Squash all BRISK commits into one.
authorcbalint13 <cristian.balint@gmail.com>
Sat, 11 Apr 2015 09:09:13 +0000 (12:09 +0300)
committercbalint13 <cristian.balint@gmail.com>
Wed, 6 May 2015 08:21:25 +0000 (11:21 +0300)
doc/opencv.bib
modules/features2d/include/opencv2/features2d.hpp
modules/features2d/perf/perf_agast.cpp [new file with mode: 0644]
modules/features2d/src/agast.cpp [new file with mode: 0644]
modules/features2d/src/agast_score.cpp [new file with mode: 0644]
modules/features2d/src/agast_score.hpp [new file with mode: 0644]
modules/features2d/src/brisk.cpp
modules/features2d/test/test_agast.cpp [new file with mode: 0644]
modules/features2d/test/test_detectors_regression.cpp
modules/features2d/test/test_keypoints.cpp

index be53dba..b2e5002 100644 (file)
   pages = {430--443},
   publisher = {Springer}
 }
+@inproceedings{mair2010_agast,
+   title={Adaptive and Generic Corner Detection Based on the Accelerated Segment Test"},
+   author={"Elmar Mair and Gregory D. Hager and Darius Burschka and Michael Suppa and Gerhard Hirzinger"},
+   year={"2010"},
+   month={"September"},
+   booktitle={"European Conference on Computer Vision (ECCV'10)"},
+   url={"http://www6.in.tum.de/Main/ResearchAgast"
+}
 @ARTICLE{Rubner2000,
   author = {Rubner, Yossi and Tomasi, Carlo and Guibas, Leonidas J},
   title = {The earth mover's distance as a metric for image retrieval},
index 3d70172..f942c23 100644 (file)
@@ -222,7 +222,7 @@ class CV_EXPORTS_W BRISK : public Feature2D
 public:
     /** @brief The BRISK constructor
 
-    @param thresh FAST/AGAST detection threshold score.
+    @param thresh AGAST detection threshold score.
     @param octaves detection octaves. Use 0 to do single scale.
     @param patternScale apply this scale to the pattern used for sampling the neighbourhood of a
     keypoint.
@@ -408,6 +408,57 @@ public:
     CV_WRAP virtual int getType() const = 0;
 };
 
+/** @overload */
+CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,
+                      int threshold, bool nonmaxSuppression=true );
+
+/** @brief Detects corners using the AGAST algorithm
+
+@param image grayscale image where keypoints (corners) are detected.
+@param keypoints keypoints detected on the image.
+@param threshold threshold on difference between intensity of the central pixel and pixels of a
+circle around this pixel.
+@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners
+(keypoints).
+@param type one of the four neighborhoods as defined in the paper:
+AgastFeatureDetector::AGAST_5_8, AgastFeatureDetector::AGAST_7_12d,
+AgastFeatureDetector::AGAST_7_12s, AgastFeatureDetector::OAST_9_16
+
+Detects corners using the AGAST algorithm by @cite mair2010_agast .
+
+ */
+CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,
+                      int threshold, bool nonmaxSuppression, int type );
+//! @} features2d_main
+
+//! @addtogroup features2d_main
+//! @{
+
+/** @brief Wrapping class for feature detection using the AGAST method. :
+ */
+class CV_EXPORTS_W AgastFeatureDetector : public Feature2D
+{
+public:
+    enum
+    {
+        AGAST_5_8 = 0, AGAST_7_12d = 1, AGAST_7_12s = 2, OAST_9_16 = 3,
+        THRESHOLD = 10000, NONMAX_SUPPRESSION = 10001,
+    };
+
+    CV_WRAP static Ptr<AgastFeatureDetector> create( int threshold=10,
+                                                     bool nonmaxSuppression=true,
+                                                     int type=AgastFeatureDetector::OAST_9_16 );
+
+    CV_WRAP virtual void setThreshold(int threshold) = 0;
+    CV_WRAP virtual int getThreshold() const = 0;
+
+    CV_WRAP virtual void setNonmaxSuppression(bool f) = 0;
+    CV_WRAP virtual bool getNonmaxSuppression() const = 0;
+
+    CV_WRAP virtual void setType(int type) = 0;
+    CV_WRAP virtual int getType() const = 0;
+};
+
 /** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. :
  */
 class CV_EXPORTS_W GFTTDetector : public Feature2D
diff --git a/modules/features2d/perf/perf_agast.cpp b/modules/features2d/perf/perf_agast.cpp
new file mode 100644 (file)
index 0000000..8e3e82b
--- /dev/null
@@ -0,0 +1,42 @@
+#include "perf_precomp.hpp"
+
+using namespace std;
+using namespace cv;
+using namespace perf;
+using std::tr1::make_tuple;
+using std::tr1::get;
+
+enum { AGAST_5_8 = AgastFeatureDetector::AGAST_5_8, AGAST_7_12d = AgastFeatureDetector::AGAST_7_12d,
+       AGAST_7_12s = AgastFeatureDetector::AGAST_7_12s, OAST_9_16 = AgastFeatureDetector::OAST_9_16 };
+CV_ENUM(AgastType, AGAST_5_8, AGAST_7_12d,
+                   AGAST_7_12s, OAST_9_16)
+
+typedef std::tr1::tuple<string, AgastType> File_Type_t;
+typedef perf::TestBaseWithParam<File_Type_t> agast;
+
+#define AGAST_IMAGES \
+    "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
+    "stitching/a3.png"
+
+PERF_TEST_P(agast, detect, testing::Combine(
+                            testing::Values(AGAST_IMAGES),
+                            AgastType::all()
+                          ))
+{
+    string filename = getDataPath(get<0>(GetParam()));
+    int type = get<1>(GetParam());
+    Mat frame = imread(filename, IMREAD_GRAYSCALE);
+
+    if (frame.empty())
+        FAIL() << "Unable to load source image " << filename;
+
+    declare.in(frame);
+
+    Ptr<FeatureDetector> fd = AgastFeatureDetector::create(70, true, type);
+    ASSERT_FALSE( fd.empty() );
+    vector<KeyPoint> points;
+
+    TEST_CYCLE() fd->detect(frame, points);
+
+    SANITY_CHECK_KEYPOINTS(points);
+}
diff --git a/modules/features2d/src/agast.cpp b/modules/features2d/src/agast.cpp
new file mode 100644 (file)
index 0000000..01532a5
--- /dev/null
@@ -0,0 +1,7671 @@
+/* This is AGAST and OAST, an optimal and accelerated corner detector
+              based on the accelerated segment tests
+   Below is the original copyright and the references */
+
+/*
+Copyright (C) 2010  Elmar Mair
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    *Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+    *Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+    *Neither the name of the University of Cambridge nor the names of
+     its contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+The references are:
+ * Adaptive and Generic Corner Detection Based on the Accelerated Segment Test,
+   Elmar Mair and Gregory D. Hager and Darius Burschka
+   and Michael Suppa and Gerhard Hirzinger ECCV 2010
+   URL: http://www6.in.tum.de/Main/ResearchAgast
+*/
+
+#include "precomp.hpp"
+#include "agast_score.hpp"
+
+#ifdef _WIN32
+#pragma warning( disable : 4127 )
+#endif
+
+namespace cv
+{
+
+static void AGAST_5_8(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold)
+{
+
+    cv::Mat img;
+    if(!_img.getMat().isContinuous())
+      img = _img.getMat().clone();
+    else
+      img = _img.getMat();
+
+    size_t total = 0;
+    int xsize = img.cols;
+    int ysize = img.rows;
+    size_t nExpectedCorners = keypoints.capacity();
+    register int x, y;
+    register int xsizeB = xsize - 2;
+    register int ysizeB = ysize - 1;
+    register int width;
+
+    keypoints.resize(0);
+
+    int pixel_5_8_[16];
+    makeAgastOffsets(pixel_5_8_, (int)img.step, AgastFeatureDetector::AGAST_5_8);
+
+    register short offset0 = (short) pixel_5_8_[0];
+    register short offset1 = (short) pixel_5_8_[1];
+    register short offset2 = (short) pixel_5_8_[2];
+    register short offset3 = (short) pixel_5_8_[3];
+    register short offset4 = (short) pixel_5_8_[4];
+    register short offset5 = (short) pixel_5_8_[5];
+    register short offset6 = (short) pixel_5_8_[6];
+    register short offset7 = (short) pixel_5_8_[7];
+
+    width = xsize;
+
+    for(y = 1; y < ysizeB; y++)
+    {
+        x = 0;
+        while(true)
+        {
+          homogeneous:
+          {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset3] > cb)
+                      if(ptr[offset5] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset4] > cb)
+                            goto success_structured;
+                          else
+                            if(ptr[offset7] > cb)
+                              goto success_structured;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset6] > cb)
+                              goto success_structured;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset4] > cb)
+                            goto success_homogeneous;
+                          else
+                            if(ptr[offset7] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset1] > cb)
+                              goto success_structured;
+                            else
+                              if(ptr[offset4] > cb)
+                                goto success_structured;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset1] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                  else
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset1] > cb)
+                            goto success_homogeneous;
+                          else
+                            if(ptr[offset4] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto success_structured;
+                              else
+                                goto homogeneous;
+                            else
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto success_structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto success_structured;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] < c_b)
+                              goto success_structured;
+                            else
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset1] < c_b)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                goto success_structured;
+                              else
+                                if(ptr[offset4] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset1] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto success_structured;
+                              else
+                                goto homogeneous;
+                            else
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                  else
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset4] > cb)
+                              goto success_structured;
+                            else
+                              goto homogeneous;
+                          else
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset1] < c_b)
+                              goto success_homogeneous;
+                            else
+                              if(ptr[offset4] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                else
+                  if(ptr[offset3] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset4] > cb)
+                            goto success_homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset6] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset6] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      goto homogeneous;
+                  else
+                    if(ptr[offset3] < c_b)
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset2] < c_b)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      goto homogeneous;
+            }
+          }
+          structured:
+          {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset3] > cb)
+                      if(ptr[offset5] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset1] > cb)
+                            goto success_structured;
+                          else
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset4] > cb)
+                              goto success_structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                      else
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset1] > cb)
+                            goto success_structured;
+                          else
+                            goto structured;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset4] > cb)
+                              goto success_structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                    else
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset1] > cb)
+                              goto success_structured;
+                            else
+                              if(ptr[offset4] > cb)
+                                goto success_structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset1] > cb)
+                              goto success_structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto structured;
+                  else
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset1] > cb)
+                            goto success_structured;
+                          else
+                            if(ptr[offset4] > cb)
+                              goto success_structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                    else
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto structured;
+                      else
+                        goto homogeneous;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto success_structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto success_structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto homogeneous;
+                        else
+                          goto structured;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] < c_b)
+                              goto success_structured;
+                            else
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset1] < c_b)
+                              goto success_structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                goto success_structured;
+                              else
+                                if(ptr[offset4] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset1] < c_b)
+                                goto success_structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                  else
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset4] > cb)
+                              goto success_structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        goto structured;
+                    else
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset1] < c_b)
+                              goto success_structured;
+                            else
+                              if(ptr[offset4] < c_b)
+                                goto success_structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto homogeneous;
+                else
+                  if(ptr[offset3] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset4] > cb)
+                            goto success_homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset6] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset6] > cb)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      goto homogeneous;
+                  else
+                    if(ptr[offset3] < c_b)
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset2] < c_b)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto success_homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto success_homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      goto homogeneous;
+            }
+          }
+            success_homogeneous:
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+            goto homogeneous;
+            success_structured:
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+            goto structured;
+        }
+    }
+}
+
+static void AGAST_7_12d(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold)
+{
+    cv::Mat img;
+    if(!_img.getMat().isContinuous())
+      img = _img.getMat().clone();
+    else
+      img = _img.getMat();
+
+    size_t total = 0;
+    int xsize = img.cols;
+    int ysize = img.rows;
+    size_t nExpectedCorners = keypoints.capacity();
+    register int x, y;
+    register int xsizeB = xsize - 4;
+    register int ysizeB = ysize - 3;
+    register int width;
+
+    keypoints.resize(0);
+
+    int pixel_7_12d_[16];
+    makeAgastOffsets(pixel_7_12d_, (int)img.step, AgastFeatureDetector::AGAST_7_12d);
+
+    register short offset0 = (short) pixel_7_12d_[0];
+    register short offset1 = (short) pixel_7_12d_[1];
+    register short offset2 = (short) pixel_7_12d_[2];
+    register short offset3 = (short) pixel_7_12d_[3];
+    register short offset4 = (short) pixel_7_12d_[4];
+    register short offset5 = (short) pixel_7_12d_[5];
+    register short offset6 = (short) pixel_7_12d_[6];
+    register short offset7 = (short) pixel_7_12d_[7];
+    register short offset8 = (short) pixel_7_12d_[8];
+    register short offset9 = (short) pixel_7_12d_[9];
+    register short offset10 = (short) pixel_7_12d_[10];
+    register short offset11 = (short) pixel_7_12d_[11];
+
+    width = xsize;
+
+    for(y = 3; y < ysizeB; y++)
+    {
+        x = 2;
+        while(true)
+        {
+          homogeneous:
+          {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset2] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto success_homogeneous;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_homogeneous;
+                              else
+                                if(ptr[offset11] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset7] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                  else
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset2] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        if(ptr[offset8] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        if(ptr[offset1] < c_b)
+                                          goto success_structured;
+                                        else
+                                          if(ptr[offset8] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                            else
+                              if(ptr[offset2] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset1] > cb)
+                                    if(ptr[offset2] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset2] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset1] > cb)
+                                    if(ptr[offset2] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset7] > cb)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset2] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          if(ptr[offset10] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto success_structured;
+                                        else
+                                          if(ptr[offset11] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                      else
+                                        if(ptr[offset3] < c_b)
+                                          if(ptr[offset4] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                        else
+                                          goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset10] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset2] < c_b)
+                                    if(ptr[offset1] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset2] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            if(ptr[offset2] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    if(ptr[offset1] < c_b)
+                                      if(ptr[offset6] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      if(ptr[offset6] < c_b)
+                                        if(ptr[offset8] < c_b)
+                                          goto success_homogeneous;
+                                        else
+                                          goto homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                    else
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        if(ptr[offset9] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset1] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset1] > cb)
+                                goto success_homogeneous;
+                              else
+                                if(ptr[offset8] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                  else
+                    if(ptr[offset2] < c_b)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset11] > cb)
+                                        if(ptr[offset10] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset7] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset4] > cb)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset11] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset3] > cb)
+                                        if(ptr[offset4] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset5] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset4] < c_b)
+                                          if(ptr[offset7] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                        else
+                                          goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset10] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset5] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset9] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                else
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset8] > cb)
+                                goto success_homogeneous;
+                              else
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset2] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                  else
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        if(ptr[offset2] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      goto homogeneous;
+            }
+          }
+          structured:
+          {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset2] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto success_structured;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                goto success_structured;
+                              else
+                                if(ptr[offset11] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset7] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                  else
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset2] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        if(ptr[offset8] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        if(ptr[offset1] < c_b)
+                                          goto success_structured;
+                                        else
+                                          if(ptr[offset8] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                            else
+                              if(ptr[offset2] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset1] > cb)
+                                    if(ptr[offset2] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset2] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset1] > cb)
+                                    if(ptr[offset2] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset2] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          if(ptr[offset10] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto success_structured;
+                                        else
+                                          if(ptr[offset11] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                      else
+                                        if(ptr[offset3] < c_b)
+                                          if(ptr[offset4] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset10] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset2] < c_b)
+                                    if(ptr[offset1] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset2] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset2] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    if(ptr[offset1] < c_b)
+                                      if(ptr[offset6] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      if(ptr[offset6] < c_b)
+                                        if(ptr[offset8] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto homogeneous;
+                    else
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        if(ptr[offset9] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset1] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset1] > cb)
+                                goto success_structured;
+                              else
+                                if(ptr[offset8] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                  else
+                    if(ptr[offset2] < c_b)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset11] > cb)
+                                        if(ptr[offset10] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset7] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset4] > cb)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset11] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset3] > cb)
+                                        if(ptr[offset4] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset5] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset4] < c_b)
+                                          if(ptr[offset7] < c_b)
+                                            goto success_structured;
+                                          else
+                                            goto structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset10] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset5] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset9] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto homogeneous;
+                        else
+                          goto structured;
+                else
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset8] > cb)
+                                goto success_structured;
+                              else
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset2] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                    else
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                  else
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        if(ptr[offset2] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                    else
+                      goto homogeneous;
+            }
+          }
+          success_homogeneous:
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+            goto homogeneous;
+          success_structured:
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+            goto structured;
+        }
+    }
+}
+
+static void AGAST_7_12s(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold)
+{
+    cv::Mat img;
+    if(!_img.getMat().isContinuous())
+      img = _img.getMat().clone();
+    else
+      img = _img.getMat();
+
+    size_t total = 0;
+    int xsize = img.cols;
+    int ysize = img.rows;
+    size_t nExpectedCorners = keypoints.capacity();
+    register int x, y;
+    register int xsizeB=xsize - 3; //2, +1 due to faster test x>xsizeB
+    register int ysizeB=ysize - 2;
+    register int width;
+
+    keypoints.resize(0);
+
+    int pixel_7_12s_[16];
+    makeAgastOffsets(pixel_7_12s_, (int)img.step, AgastFeatureDetector::AGAST_7_12s);
+
+    register short offset0 = (short) pixel_7_12s_[0];
+    register short offset1 = (short) pixel_7_12s_[1];
+    register short offset2 = (short) pixel_7_12s_[2];
+    register short offset3 = (short) pixel_7_12s_[3];
+    register short offset4 = (short) pixel_7_12s_[4];
+    register short offset5 = (short) pixel_7_12s_[5];
+    register short offset6 = (short) pixel_7_12s_[6];
+    register short offset7 = (short) pixel_7_12s_[7];
+    register short offset8 = (short) pixel_7_12s_[8];
+    register short offset9 = (short) pixel_7_12s_[9];
+    register short offset10 = (short) pixel_7_12s_[10];
+    register short offset11 = (short) pixel_7_12s_[11];
+
+    width = xsize;
+
+    for(y = 2; y < ysizeB; y++)
+    {
+        x = 1;
+        while(true)
+        {
+          homogeneous:
+          {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset11] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset11] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        if(ptr[offset10] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset11] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset3] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset7] > cb)
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset1] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset9] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset9] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset11] > cb)
+                                        if(ptr[offset10] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset4] > cb)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset11] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset3] > cb)
+                                        if(ptr[offset4] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset5] < c_b)
+                                if(ptr[offset7] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset11] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset11] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset5] > cb)
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset1] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset9] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          if(ptr[offset9] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_homogeneous;
+                                      else
+                                        goto homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        goto homogeneous;
+                else
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset8] > cb)
+                                goto success_homogeneous;
+                              else
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset2] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                        else
+                          goto homogeneous;
+                      else
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          goto homogeneous;
+                    else
+                      goto homogeneous;
+                  else
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto success_homogeneous;
+                                else
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  goto homogeneous;
+                              else
+                                goto homogeneous;
+                          else
+                            goto homogeneous;
+                        else
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_homogeneous;
+                                  else
+                                    goto homogeneous;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_homogeneous;
+                                    else
+                                      goto homogeneous;
+                                  else
+                                    goto homogeneous;
+                              else
+                                goto homogeneous;
+                            else
+                              goto homogeneous;
+                          else
+                            goto homogeneous;
+                      else
+                        goto homogeneous;
+                    else
+                      goto homogeneous;
+            }
+          }
+          structured:
+          {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset11] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        if(ptr[offset10] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset11] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      if(ptr[offset3] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset7] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset1] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset9] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset9] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset11] < c_b)
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset9] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset5] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset8] > cb)
+                                        if(ptr[offset10] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto success_structured;
+                                      else
+                                        if(ptr[offset10] > cb)
+                                          goto success_structured;
+                                        else
+                                          goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                    else
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset9] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset5] > cb)
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset11] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto homogeneous;
+                                  else
+                                    if(ptr[offset3] > cb)
+                                      if(ptr[offset4] > cb)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset5] > cb)
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset1] > cb)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset9] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          if(ptr[offset9] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        goto structured;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto success_structured;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto success_structured;
+                                      else
+                                        goto structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    goto success_structured;
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                      else
+                        goto structured;
+                else
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset8] > cb)
+                                goto success_structured;
+                              else
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset2] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                        else
+                          goto structured;
+                      else
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto success_structured;
+                                else
+                                  goto structured;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                        else
+                          goto structured;
+                    else
+                      goto structured;
+                  else
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto success_structured;
+                                else
+                                  if(ptr[offset1] < c_b)
+                                    if(ptr[offset2] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  goto structured;
+                              else
+                                goto structured;
+                          else
+                            goto structured;
+                        else
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    goto success_structured;
+                                  else
+                                    goto structured;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto success_structured;
+                                    else
+                                      goto structured;
+                                  else
+                                    goto structured;
+                              else
+                                goto structured;
+                            else
+                              goto structured;
+                          else
+                            goto structured;
+                      else
+                        goto structured;
+                    else
+                      goto homogeneous;
+            }
+          }
+          success_homogeneous:
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+            goto homogeneous;
+          success_structured:
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+            goto structured;
+        }
+    }
+}
+
+static void OAST_9_16(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold)
+{
+    cv::Mat img;
+    if(!_img.getMat().isContinuous())
+      img = _img.getMat().clone();
+    else
+      img = _img.getMat();
+
+    size_t total = 0;
+    int xsize = img.cols;
+    int ysize = img.rows;
+    size_t nExpectedCorners = keypoints.capacity();
+    register int x, y;
+    register int xsizeB=xsize - 4;
+    register int ysizeB=ysize - 3;
+    register int width;
+
+    keypoints.resize(0);
+
+    int pixel_9_16_[16];
+    makeAgastOffsets(pixel_9_16_, (int)img.step, AgastFeatureDetector::OAST_9_16);
+
+    register short offset0 = (short) pixel_9_16_[0];
+    register short offset1 = (short) pixel_9_16_[1];
+    register short offset2 = (short) pixel_9_16_[2];
+    register short offset3 = (short) pixel_9_16_[3];
+    register short offset4 = (short) pixel_9_16_[4];
+    register short offset5 = (short) pixel_9_16_[5];
+    register short offset6 = (short) pixel_9_16_[6];
+    register short offset7 = (short) pixel_9_16_[7];
+    register short offset8 = (short) pixel_9_16_[8];
+    register short offset9 = (short) pixel_9_16_[9];
+    register short offset10 = (short) pixel_9_16_[10];
+    register short offset11 = (short) pixel_9_16_[11];
+    register short offset12 = (short) pixel_9_16_[12];
+    register short offset13 = (short) pixel_9_16_[13];
+    register short offset14 = (short) pixel_9_16_[14];
+    register short offset15 = (short) pixel_9_16_[15];
+
+    width = xsize;
+
+    for(y = 3; y < ysizeB; y++)
+    {
+        x = 2;
+        while(true)
+        {
+            x++;
+            if(x > xsizeB)
+                break;
+            else
+            {
+                register const unsigned char* const ptr = img.ptr() + y*width + x;
+                register const int cb = *ptr + threshold;
+                register const int c_b = *ptr - threshold;
+                if(ptr[offset0] > cb)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset4] > cb)
+                      if(ptr[offset5] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  {}
+                                else
+                                  if(ptr[offset15] > cb)
+                                    {}
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset13] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset9] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset6] > cb)
+                                      {}
+                                    else
+                                      if(ptr[offset11] > cb)
+                                        if(ptr[offset12] > cb)
+                                          if(ptr[offset13] > cb)
+                                            if(ptr[offset14] > cb)
+                                              if(ptr[offset15] > cb)
+                                                {}
+                                              else
+                                                continue;
+                                            else
+                                              continue;
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset9] > cb)
+                                      if(ptr[offset6] > cb)
+                                        {}
+                                      else
+                                        if(ptr[offset13] > cb)
+                                          if(ptr[offset14] > cb)
+                                            if(ptr[offset15] > cb)
+                                              {}
+                                            else
+                                              continue;
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                    else
+                                      if(ptr[offset1] > cb)
+                                        if(ptr[offset13] > cb)
+                                          if(ptr[offset14] > cb)
+                                            if(ptr[offset15] > cb)
+                                              {}
+                                            else
+                                              continue;
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                  else
+                                    if(ptr[offset1] > cb)
+                                      if(ptr[offset13] > cb)
+                                        if(ptr[offset14] > cb)
+                                          if(ptr[offset15] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else if(ptr[offset7] < c_b)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset6] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset13] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset12] > cb)
+                                        if(ptr[offset13] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset9] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        if(ptr[offset12] > cb)
+                                          if(ptr[offset13] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else if(ptr[offset14] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset12] < c_b)
+                                      if(ptr[offset13] < c_b)
+                                        if(ptr[offset6] < c_b)
+                                          {}
+                                        else
+                                          if(ptr[offset15] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset6] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset13] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset12] > cb)
+                                        if(ptr[offset13] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset9] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        if(ptr[offset12] > cb)
+                                          if(ptr[offset13] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                      else if(ptr[offset5] < c_b)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset14] > cb)
+                              if(ptr[offset15] > cb)
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset3] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset9] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset9] > cb)
+                                        if(ptr[offset10] > cb)
+                                          if(ptr[offset11] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else if(ptr[offset12] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset13] < c_b)
+                                      if(ptr[offset6] < c_b)
+                                        {}
+                                      else
+                                        if(ptr[offset14] < c_b)
+                                          if(ptr[offset15] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset14] > cb)
+                              if(ptr[offset15] > cb)
+                                if(ptr[offset1] > cb)
+                                  if(ptr[offset3] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset9] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset7] > cb)
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset9] > cb)
+                                        if(ptr[offset10] > cb)
+                                          if(ptr[offset11] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else if(ptr[offset12] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset13] < c_b)
+                                      if(ptr[offset14] < c_b)
+                                        if(ptr[offset6] < c_b)
+                                          {}
+                                        else
+                                          if(ptr[offset15] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                    else if(ptr[offset4] < c_b)
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset14] > cb)
+                                if(ptr[offset15] > cb)
+                                  if(ptr[offset1] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset9] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        if(ptr[offset9] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset5] > cb)
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        if(ptr[offset9] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else if(ptr[offset11] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      {}
+                                    else
+                                      if(ptr[offset12] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                  else
+                                    if(ptr[offset12] < c_b)
+                                      if(ptr[offset13] < c_b)
+                                        if(ptr[offset14] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset12] < c_b)
+                                    if(ptr[offset13] < c_b)
+                                      if(ptr[offset14] < c_b)
+                                        if(ptr[offset15] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset14] > cb)
+                                if(ptr[offset15] > cb)
+                                  if(ptr[offset1] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset9] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        if(ptr[offset9] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset5] > cb)
+                                  if(ptr[offset6] > cb)
+                                    if(ptr[offset7] > cb)
+                                      if(ptr[offset8] > cb)
+                                        if(ptr[offset9] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else if(ptr[offset11] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset5] < c_b)
+                                        {}
+                                      else
+                                        if(ptr[offset14] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                    else
+                                      if(ptr[offset14] < c_b)
+                                        if(ptr[offset15] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                  else if(ptr[offset2] < c_b)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset11] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset12] > cb)
+                              if(ptr[offset13] > cb)
+                                if(ptr[offset14] > cb)
+                                  if(ptr[offset15] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset12] > cb)
+                                if(ptr[offset13] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else if(ptr[offset9] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset5] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset12] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset12] < c_b)
+                                      if(ptr[offset13] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset12] < c_b)
+                                    if(ptr[offset13] < c_b)
+                                      if(ptr[offset14] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    if(ptr[offset14] < c_b)
+                                      if(ptr[offset15] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else
+                      continue;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset11] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset12] > cb)
+                              if(ptr[offset13] > cb)
+                                if(ptr[offset14] > cb)
+                                  if(ptr[offset15] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset7] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset12] > cb)
+                                if(ptr[offset13] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else if(ptr[offset9] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset5] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      {}
+                                    else
+                                      if(ptr[offset12] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                  else
+                                    if(ptr[offset12] < c_b)
+                                      if(ptr[offset13] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset12] < c_b)
+                                    if(ptr[offset13] < c_b)
+                                      if(ptr[offset14] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    if(ptr[offset14] < c_b)
+                                      if(ptr[offset15] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else
+                      continue;
+                else if(ptr[offset0] < c_b)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset5] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset1] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset12] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset12] > cb)
+                                      if(ptr[offset13] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset12] > cb)
+                                    if(ptr[offset13] > cb)
+                                      if(ptr[offset14] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    if(ptr[offset14] > cb)
+                                      if(ptr[offset15] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else if(ptr[offset9] < c_b)
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset12] < c_b)
+                              if(ptr[offset13] < c_b)
+                                if(ptr[offset14] < c_b)
+                                  if(ptr[offset15] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset12] < c_b)
+                                if(ptr[offset13] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else
+                      continue;
+                  else if(ptr[offset2] < c_b)
+                    if(ptr[offset4] > cb)
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset5] > cb)
+                                    if(ptr[offset3] > cb)
+                                      {}
+                                    else
+                                      if(ptr[offset12] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                  else
+                                    if(ptr[offset12] > cb)
+                                      if(ptr[offset13] > cb)
+                                        if(ptr[offset14] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset12] > cb)
+                                    if(ptr[offset13] > cb)
+                                      if(ptr[offset14] > cb)
+                                        if(ptr[offset15] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else if(ptr[offset11] < c_b)
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset14] < c_b)
+                                if(ptr[offset15] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset9] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        if(ptr[offset9] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset5] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        if(ptr[offset9] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else if(ptr[offset4] < c_b)
+                      if(ptr[offset5] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset13] > cb)
+                                      if(ptr[offset6] > cb)
+                                        {}
+                                      else
+                                        if(ptr[offset14] > cb)
+                                          if(ptr[offset15] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset14] < c_b)
+                              if(ptr[offset15] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset9] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset9] < c_b)
+                                        if(ptr[offset10] < c_b)
+                                          if(ptr[offset11] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else if(ptr[offset5] < c_b)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset12] > cb)
+                                      if(ptr[offset13] > cb)
+                                        if(ptr[offset6] > cb)
+                                          {}
+                                        else
+                                          if(ptr[offset15] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset13] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset12] < c_b)
+                                        if(ptr[offset13] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset9] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        if(ptr[offset12] < c_b)
+                                          if(ptr[offset13] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else if(ptr[offset7] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  {}
+                                else
+                                  if(ptr[offset15] < c_b)
+                                    {}
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset13] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset9] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      {}
+                                    else
+                                      if(ptr[offset11] < c_b)
+                                        if(ptr[offset12] < c_b)
+                                          if(ptr[offset13] < c_b)
+                                            if(ptr[offset14] < c_b)
+                                              if(ptr[offset15] < c_b)
+                                                {}
+                                              else
+                                                continue;
+                                            else
+                                              continue;
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset9] < c_b)
+                                      if(ptr[offset6] < c_b)
+                                        {}
+                                      else
+                                        if(ptr[offset13] < c_b)
+                                          if(ptr[offset14] < c_b)
+                                            if(ptr[offset15] < c_b)
+                                              {}
+                                            else
+                                              continue;
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                    else
+                                      if(ptr[offset1] < c_b)
+                                        if(ptr[offset13] < c_b)
+                                          if(ptr[offset14] < c_b)
+                                            if(ptr[offset15] < c_b)
+                                              {}
+                                            else
+                                              continue;
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                  else
+                                    if(ptr[offset1] < c_b)
+                                      if(ptr[offset13] < c_b)
+                                        if(ptr[offset14] < c_b)
+                                          if(ptr[offset15] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset13] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset12] < c_b)
+                                        if(ptr[offset13] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset9] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        if(ptr[offset12] < c_b)
+                                          if(ptr[offset13] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                      else
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset13] > cb)
+                                      if(ptr[offset14] > cb)
+                                        if(ptr[offset6] > cb)
+                                          {}
+                                        else
+                                          if(ptr[offset15] > cb)
+                                            {}
+                                          else
+                                            continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset14] < c_b)
+                              if(ptr[offset15] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset9] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset9] < c_b)
+                                        if(ptr[offset10] < c_b)
+                                          if(ptr[offset11] < c_b)
+                                            {}
+                                          else
+                                            continue;
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                    else
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    if(ptr[offset6] > cb)
+                                      if(ptr[offset5] > cb)
+                                        {}
+                                      else
+                                        if(ptr[offset14] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                    else
+                                      if(ptr[offset14] > cb)
+                                        if(ptr[offset15] > cb)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else if(ptr[offset11] < c_b)
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset14] < c_b)
+                                if(ptr[offset15] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset9] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        if(ptr[offset9] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset5] < c_b)
+                                  if(ptr[offset6] < c_b)
+                                    if(ptr[offset7] < c_b)
+                                      if(ptr[offset8] < c_b)
+                                        if(ptr[offset9] < c_b)
+                                          {}
+                                        else
+                                          continue;
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset5] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      {}
+                                    else
+                                      if(ptr[offset12] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                  else
+                                    if(ptr[offset12] > cb)
+                                      if(ptr[offset13] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset12] > cb)
+                                    if(ptr[offset13] > cb)
+                                      if(ptr[offset14] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    if(ptr[offset14] > cb)
+                                      if(ptr[offset15] > cb)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else if(ptr[offset9] < c_b)
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset12] < c_b)
+                              if(ptr[offset13] < c_b)
+                                if(ptr[offset14] < c_b)
+                                  if(ptr[offset15] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset5] < c_b)
+                                    if(ptr[offset6] < c_b)
+                                      if(ptr[offset7] < c_b)
+                                        {}
+                                      else
+                                        continue;
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset12] < c_b)
+                                if(ptr[offset13] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          continue;
+                      else
+                        continue;
+                    else
+                      continue;
+                else
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset8] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset2] > cb)
+                                  if(ptr[offset1] > cb)
+                                    {}
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset12] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset12] > cb)
+                                    if(ptr[offset13] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    if(ptr[offset14] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset12] > cb)
+                                if(ptr[offset13] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                      else
+                        continue;
+                    else
+                      continue;
+                  else if(ptr[offset7] < c_b)
+                    if(ptr[offset8] < c_b)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset2] < c_b)
+                                  if(ptr[offset1] < c_b)
+                                    {}
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset12] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset12] < c_b)
+                                    if(ptr[offset13] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    if(ptr[offset14] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                        else
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset12] < c_b)
+                                if(ptr[offset13] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      {}
+                                    else
+                                      continue;
+                                  else
+                                    continue;
+                                else
+                                  continue;
+                              else
+                                continue;
+                            else
+                              continue;
+                          else
+                            continue;
+                      else
+                        continue;
+                    else
+                      continue;
+                  else
+                    continue;
+            }
+            if(total == nExpectedCorners)
+            {
+                if(nExpectedCorners == 0)
+                {
+                    nExpectedCorners = 512;
+                    keypoints.reserve(nExpectedCorners);
+                }
+                else
+                {
+                    nExpectedCorners *= 2;
+                    keypoints.reserve(nExpectedCorners);
+                }
+            }
+            keypoints.push_back(KeyPoint(Point2f((float)x, (float)y), 1.0f));
+            total++;
+        }
+    }
+}
+
+
+void AGAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression)
+{
+    AGAST(_img, keypoints, threshold, nonmax_suppression, AgastFeatureDetector::OAST_9_16);
+}
+
+
+class AgastFeatureDetector_Impl : public AgastFeatureDetector
+{
+public:
+    AgastFeatureDetector_Impl( int _threshold, bool _nonmaxSuppression, int _type )
+    : threshold(_threshold), nonmaxSuppression(_nonmaxSuppression), type((short)_type)
+    {}
+
+    void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask )
+    {
+        Mat mask = _mask.getMat(), grayImage;
+        UMat ugrayImage;
+        _InputArray gray = _image;
+        if( _image.type() != CV_8U )
+        {
+            _OutputArray ogray = _image.isUMat() ? _OutputArray(ugrayImage) : _OutputArray(grayImage);
+            cvtColor( _image, ogray, COLOR_BGR2GRAY );
+            gray = ogray;
+        }
+        AGAST( gray, keypoints, threshold, nonmaxSuppression, type );
+        KeyPointsFilter::runByPixelsMask( keypoints, mask );
+    }
+
+    void set(int prop, double value)
+    {
+        if(prop == THRESHOLD)
+            threshold = cvRound(value);
+        else if(prop == NONMAX_SUPPRESSION)
+            nonmaxSuppression = value != 0;
+        else
+            CV_Error(Error::StsBadArg, "");
+    }
+
+    double get(int prop) const
+    {
+        if(prop == THRESHOLD)
+            return threshold;
+        if(prop == NONMAX_SUPPRESSION)
+            return nonmaxSuppression;
+        CV_Error(Error::StsBadArg, "");
+        return 0;
+    }
+
+    void setThreshold(int threshold_) { threshold = threshold_; }
+    int getThreshold() const { return threshold; }
+
+    void setNonmaxSuppression(bool f) { nonmaxSuppression = f; }
+    bool getNonmaxSuppression() const { return nonmaxSuppression; }
+
+    void setType(int type_) { type = type_; }
+    int getType() const { return type; }
+
+    int threshold;
+    bool nonmaxSuppression;
+    int type;
+};
+
+Ptr<AgastFeatureDetector> AgastFeatureDetector::create( int threshold, bool nonmaxSuppression, int type )
+{
+    return makePtr<AgastFeatureDetector_Impl>(threshold, nonmaxSuppression, type);
+}
+
+void AGAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, int type)
+{
+    // detect
+    switch(type) {
+      case AgastFeatureDetector::AGAST_5_8:
+        AGAST_5_8(_img, keypoints, threshold);
+        break;
+      case AgastFeatureDetector::AGAST_7_12d:
+        AGAST_7_12d(_img, keypoints, threshold);
+        break;
+      case AgastFeatureDetector::AGAST_7_12s:
+        AGAST_7_12s(_img, keypoints, threshold);
+        break;
+      case AgastFeatureDetector::OAST_9_16:
+        OAST_9_16(_img, keypoints, threshold);
+        break;
+    }
+
+    cv::Mat img = _img.getMat();
+
+    // score
+    int pixel_[16];
+    makeAgastOffsets(pixel_, (int)img.step, type);
+
+    std::vector<KeyPoint>::iterator kpt;
+    for(kpt = keypoints.begin(); kpt != keypoints.end(); kpt++)
+    {
+        switch(type) {
+          case AgastFeatureDetector::AGAST_5_8:
+            kpt->response = (float)agast_cornerScore<AgastFeatureDetector::AGAST_5_8>
+                (&img.at<uchar>((int)kpt->pt.y, (int)kpt->pt.x), pixel_, threshold);
+            break;
+          case AgastFeatureDetector::AGAST_7_12d:
+            kpt->response = (float)agast_cornerScore<AgastFeatureDetector::AGAST_7_12d>
+                (&img.at<uchar>((int)kpt->pt.y, (int)kpt->pt.x), pixel_, threshold);
+            break;
+          case AgastFeatureDetector::AGAST_7_12s:
+            kpt->response = (float)agast_cornerScore<AgastFeatureDetector::AGAST_7_12s>
+                (&img.at<uchar>((int)kpt->pt.y, (int)kpt->pt.x), pixel_, threshold);
+            break;
+          case AgastFeatureDetector::OAST_9_16:
+            kpt->response = (float)agast_cornerScore<AgastFeatureDetector::OAST_9_16>
+                (&img.at<uchar>((int)kpt->pt.y, (int)kpt->pt.x), pixel_, threshold);
+            break;
+        }
+    }
+    // suppression
+    if(nonmax_suppression)
+    {
+        size_t j;
+        size_t curr_idx;
+        size_t lastRow = 0, next_lastRow = 0;
+        size_t num_Corners = keypoints.size();
+        size_t lastRowCorner_ind = 0, next_lastRowCorner_ind = 0;
+
+        std::vector<int> nmsFlags;
+        std::vector<KeyPoint>::iterator currCorner_nms;
+        std::vector<KeyPoint>::const_iterator currCorner;
+
+        currCorner = keypoints.begin();
+
+        nmsFlags.resize((int)num_Corners);
+
+        // set all flags to MAXIMUM
+        for(j = 0; j < num_Corners; j++)
+            nmsFlags[j] = -1;
+
+        for(curr_idx = 0; curr_idx < num_Corners; curr_idx++)
+        {
+            int t;
+            // check above
+            if(lastRow + 1 < currCorner->pt.y)
+            {
+                lastRow = next_lastRow;
+                lastRowCorner_ind = next_lastRowCorner_ind;
+            }
+            if(next_lastRow != currCorner->pt.y)
+            {
+                next_lastRow = (size_t) currCorner->pt.y;
+                next_lastRowCorner_ind = curr_idx;
+            }
+            if(lastRow + 1 == currCorner->pt.y)
+            {
+                // find the corner above the current one
+                while( (keypoints[lastRowCorner_ind].pt.x < currCorner->pt.x)
+                    && (keypoints[lastRowCorner_ind].pt.y == lastRow) )
+                    lastRowCorner_ind++;
+
+                    if( (keypoints[lastRowCorner_ind].pt.x == currCorner->pt.x)
+                     && (lastRowCorner_ind != curr_idx) )
+                    {
+                        size_t w = lastRowCorner_ind;
+                        // find the maximum in this block
+                        while(nmsFlags[w] != -1)
+                            w = nmsFlags[w];
+
+                        if(keypoints[curr_idx].response < keypoints[w].response)
+                            nmsFlags[curr_idx] = (int)w;
+                        else
+                            nmsFlags[w] = (int)curr_idx;
+                    }
+            }
+
+            // check left
+            t = (int)curr_idx - 1;
+            if( (curr_idx != 0) && (keypoints[t].pt.y == currCorner->pt.y)
+             && (keypoints[t].pt.x + 1 == currCorner->pt.x) )
+            {
+                int currCornerMaxAbove_ind = nmsFlags[curr_idx];
+                // find the maximum in that area
+                while(nmsFlags[t] != -1)
+                    t = nmsFlags[t];
+                // no maximum above
+                if(currCornerMaxAbove_ind == -1)
+                {
+                    if((size_t)t != curr_idx)
+                    {
+                        if ( keypoints[curr_idx].response < keypoints[t].response )
+                            nmsFlags[curr_idx] = t;
+                        else
+                            nmsFlags[t] = (int)curr_idx;
+                    }
+                }
+                else // maximum above
+                {
+                    if(t != currCornerMaxAbove_ind)
+                    {
+                        if(keypoints[currCornerMaxAbove_ind].response < keypoints[t].response)
+                        {
+                            nmsFlags[currCornerMaxAbove_ind] = t;
+                            nmsFlags[curr_idx] = t;
+                        }
+                        else
+                        {
+                            nmsFlags[t] = currCornerMaxAbove_ind;
+                            nmsFlags[curr_idx] = currCornerMaxAbove_ind;
+                        }
+                    }
+                }
+            }
+            currCorner++;
+        }
+
+        // marks non-maximum corners
+        for(curr_idx = 0; curr_idx < num_Corners; curr_idx++)
+        {
+            if (nmsFlags[curr_idx] != -1)
+                keypoints[curr_idx].response = -1;
+        }
+
+        // erase non-maximum corners
+        for (j = keypoints.size(); j > 0; j--)
+        {
+            if (keypoints[j - 1].response == -1)
+                keypoints.erase(keypoints.begin() + j - 1 );
+        }
+    }
+}
+
+} // END NAMESPACE CV
diff --git a/modules/features2d/src/agast_score.cpp b/modules/features2d/src/agast_score.cpp
new file mode 100644 (file)
index 0000000..3368235
--- /dev/null
@@ -0,0 +1,9375 @@
+/* This is AGAST and OAST, an optimal and accelerated corner detector
+              based on the accelerated segment tests
+   Below is the original copyright and the references */
+
+/*
+Copyright (C) 2010  Elmar Mair
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    *Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+    *Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+    *Neither the name of the University of Cambridge nor the names of
+     its contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+The references are:
+ * Adaptive and Generic Corner Detection Based on the Accelerated Segment Test,
+   Elmar Mair and Gregory D. Hager and Darius Burschka
+   and Michael Suppa and Gerhard Hirzinger ECCV 2010
+   URL: http://www6.in.tum.de/Main/ResearchAgast
+*/
+
+#include "agast_score.hpp"
+
+#ifdef _WIN32
+#pragma warning( disable : 4127 )
+#endif
+
+namespace cv
+{
+
+void makeAgastOffsets(int pixel[16], int rowStride, int type)
+{
+    static const int offsets16[][2] =
+    {
+        {-3,  0}, {-3, -1}, {-2, -2}, {-1, -3}, {0, -3}, { 1, -3}, { 2, -2}, { 3, -1},
+        { 3,  0}, { 3,  1}, { 2,  2}, { 1,  3}, {0,  3}, {-1,  3}, {-2,  2}, {-3,  1}
+    };
+
+    static const int offsets12d[][2] =
+    {
+        {-3,  0}, {-2, -1}, {-1, -2}, {0, -3}, { 1, -2}, { 2, -1},
+        { 3,  0}, { 2,  1}, { 1,  2}, {0,  3}, {-1,  2}, {-2,  1}
+    };
+
+    static const int offsets12s[][2] =
+    {
+        {-2,  0}, {-2, -1}, {-1, -2}, {0, -2}, { 1, -2}, { 2, -1},
+        { 2,  0}, { 2,  1}, { 1,  2}, {0,  2}, {-1,  2}, {-2,  1}
+    };
+
+    static const int offsets8[][2] =
+    {
+        {-1,  0}, {-1, -1}, {0, -1}, { 1, -1},
+        { 1,  0}, { 1,  1}, {0,  1}, {-1,  1}
+    };
+
+    const int (*offsets)[2] = type == AgastFeatureDetector::OAST_9_16 ? offsets16 :
+                              type == AgastFeatureDetector::AGAST_7_12d ? offsets12d :
+                              type == AgastFeatureDetector::AGAST_7_12s ? offsets12s :
+                              type == AgastFeatureDetector::AGAST_5_8 ? offsets8  : 0;
+
+    CV_Assert(pixel && offsets);
+
+    int k = 0;
+    for( ; k < 16; k++ )
+        pixel[k] = offsets[k][0] + offsets[k][1] * rowStride;
+}
+
+// 16 pixel mask
+template<>
+int agast_cornerScore<AgastFeatureDetector::OAST_9_16>(const uchar* ptr, const int pixel[], int threshold)
+{
+    int bmin = threshold;
+    int bmax = 255;
+    int b_test = (bmax + bmin) / 2;
+
+    register short offset0 = (short) pixel[0];
+    register short offset1 = (short) pixel[1];
+    register short offset2 = (short) pixel[2];
+    register short offset3 = (short) pixel[3];
+    register short offset4 = (short) pixel[4];
+    register short offset5 = (short) pixel[5];
+    register short offset6 = (short) pixel[6];
+    register short offset7 = (short) pixel[7];
+    register short offset8 = (short) pixel[8];
+    register short offset9 = (short) pixel[9];
+    register short offset10 = (short) pixel[10];
+    register short offset11 = (short) pixel[11];
+    register short offset12 = (short) pixel[12];
+    register short offset13 = (short) pixel[13];
+    register short offset14 = (short) pixel[14];
+    register short offset15 = (short) pixel[15];
+
+    while(true)
+    {
+        register const int cb = *ptr + b_test;
+        register const int c_b = *ptr - b_test;
+        if(ptr[offset0] > cb)
+          if(ptr[offset2] > cb)
+            if(ptr[offset4] > cb)
+              if(ptr[offset5] > cb)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset3] > cb)
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset8] > cb)
+                          goto is_a_corner;
+                        else
+                          if(ptr[offset15] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset13] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset9] > cb)
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset6] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    if(ptr[offset14] > cb)
+                                      if(ptr[offset15] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] > cb)
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset6] > cb)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset13] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset1] > cb)
+                                if(ptr[offset13] > cb)
+                                  if(ptr[offset14] > cb)
+                                    if(ptr[offset15] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset13] > cb)
+                                if(ptr[offset14] > cb)
+                                  if(ptr[offset15] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else if(ptr[offset7] < c_b)
+                  if(ptr[offset14] > cb)
+                    if(ptr[offset15] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset13] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset12] > cb)
+                                if(ptr[offset13] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset9] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else if(ptr[offset14] < c_b)
+                    if(ptr[offset8] < c_b)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            if(ptr[offset12] < c_b)
+                              if(ptr[offset13] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset15] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  if(ptr[offset14] > cb)
+                    if(ptr[offset15] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset13] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset12] > cb)
+                                if(ptr[offset13] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset9] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset12] > cb)
+                                  if(ptr[offset13] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else if(ptr[offset5] < c_b)
+                if(ptr[offset12] > cb)
+                  if(ptr[offset13] > cb)
+                    if(ptr[offset14] > cb)
+                      if(ptr[offset15] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset3] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else if(ptr[offset12] < c_b)
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset8] < c_b)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            if(ptr[offset13] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset14] < c_b)
+                                  if(ptr[offset15] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset12] > cb)
+                  if(ptr[offset13] > cb)
+                    if(ptr[offset14] > cb)
+                      if(ptr[offset15] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset3] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset9] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else if(ptr[offset12] < c_b)
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset8] < c_b)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            if(ptr[offset13] < c_b)
+                              if(ptr[offset14] < c_b)
+                                if(ptr[offset6] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset15] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else if(ptr[offset4] < c_b)
+              if(ptr[offset11] > cb)
+                if(ptr[offset12] > cb)
+                  if(ptr[offset13] > cb)
+                    if(ptr[offset10] > cb)
+                      if(ptr[offset14] > cb)
+                        if(ptr[offset15] > cb)
+                          if(ptr[offset1] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset9] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset9] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else if(ptr[offset11] < c_b)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset3] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset12] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset12] < c_b)
+                              if(ptr[offset13] < c_b)
+                                if(ptr[offset14] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset12] < c_b)
+                            if(ptr[offset13] < c_b)
+                              if(ptr[offset14] < c_b)
+                                if(ptr[offset15] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              if(ptr[offset11] > cb)
+                if(ptr[offset12] > cb)
+                  if(ptr[offset13] > cb)
+                    if(ptr[offset10] > cb)
+                      if(ptr[offset14] > cb)
+                        if(ptr[offset15] > cb)
+                          if(ptr[offset1] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset9] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset9] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset9] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else if(ptr[offset11] < c_b)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset5] < c_b)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset14] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset14] < c_b)
+                                if(ptr[offset15] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+          else if(ptr[offset2] < c_b)
+            if(ptr[offset9] > cb)
+              if(ptr[offset10] > cb)
+                if(ptr[offset11] > cb)
+                  if(ptr[offset8] > cb)
+                    if(ptr[offset12] > cb)
+                      if(ptr[offset13] > cb)
+                        if(ptr[offset14] > cb)
+                          if(ptr[offset15] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset12] > cb)
+                        if(ptr[offset13] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else if(ptr[offset9] < c_b)
+              if(ptr[offset7] < c_b)
+                if(ptr[offset8] < c_b)
+                  if(ptr[offset6] < c_b)
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset12] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            if(ptr[offset12] < c_b)
+                              if(ptr[offset13] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset12] < c_b)
+                            if(ptr[offset13] < c_b)
+                              if(ptr[offset14] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset11] < c_b)
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset14] < c_b)
+                              if(ptr[offset15] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+          else
+            if(ptr[offset9] > cb)
+              if(ptr[offset10] > cb)
+                if(ptr[offset11] > cb)
+                  if(ptr[offset8] > cb)
+                    if(ptr[offset12] > cb)
+                      if(ptr[offset13] > cb)
+                        if(ptr[offset14] > cb)
+                          if(ptr[offset15] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset12] > cb)
+                        if(ptr[offset13] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else if(ptr[offset9] < c_b)
+              if(ptr[offset7] < c_b)
+                if(ptr[offset8] < c_b)
+                  if(ptr[offset10] < c_b)
+                    if(ptr[offset11] < c_b)
+                      if(ptr[offset6] < c_b)
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset3] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset12] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset12] < c_b)
+                              if(ptr[offset13] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset12] < c_b)
+                            if(ptr[offset13] < c_b)
+                              if(ptr[offset14] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset14] < c_b)
+                              if(ptr[offset15] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+        else if(ptr[offset0] < c_b)
+          if(ptr[offset2] > cb)
+            if(ptr[offset9] > cb)
+              if(ptr[offset7] > cb)
+                if(ptr[offset8] > cb)
+                  if(ptr[offset6] > cb)
+                    if(ptr[offset5] > cb)
+                      if(ptr[offset4] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset1] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset12] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset12] > cb)
+                              if(ptr[offset13] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset11] > cb)
+                          if(ptr[offset12] > cb)
+                            if(ptr[offset13] > cb)
+                              if(ptr[offset14] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] > cb)
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset14] > cb)
+                              if(ptr[offset15] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else if(ptr[offset9] < c_b)
+              if(ptr[offset10] < c_b)
+                if(ptr[offset11] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset12] < c_b)
+                      if(ptr[offset13] < c_b)
+                        if(ptr[offset14] < c_b)
+                          if(ptr[offset15] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset4] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset4] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset12] < c_b)
+                        if(ptr[offset13] < c_b)
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+          else if(ptr[offset2] < c_b)
+            if(ptr[offset4] > cb)
+              if(ptr[offset11] > cb)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset8] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset5] > cb)
+                            if(ptr[offset3] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset12] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset12] > cb)
+                              if(ptr[offset13] > cb)
+                                if(ptr[offset14] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset12] > cb)
+                            if(ptr[offset13] > cb)
+                              if(ptr[offset14] > cb)
+                                if(ptr[offset15] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else if(ptr[offset11] < c_b)
+                if(ptr[offset12] < c_b)
+                  if(ptr[offset13] < c_b)
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset14] < c_b)
+                        if(ptr[offset15] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset9] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset9] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else if(ptr[offset4] < c_b)
+              if(ptr[offset5] > cb)
+                if(ptr[offset12] > cb)
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset8] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset13] > cb)
+                              if(ptr[offset6] > cb)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset14] > cb)
+                                  if(ptr[offset15] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else if(ptr[offset12] < c_b)
+                  if(ptr[offset13] < c_b)
+                    if(ptr[offset14] < c_b)
+                      if(ptr[offset15] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset3] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else if(ptr[offset5] < c_b)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset14] > cb)
+                    if(ptr[offset8] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset12] > cb)
+                              if(ptr[offset13] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset15] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else if(ptr[offset14] < c_b)
+                    if(ptr[offset15] < c_b)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset13] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset12] < c_b)
+                                if(ptr[offset13] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset9] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else if(ptr[offset7] < c_b)
+                  if(ptr[offset3] < c_b)
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset6] < c_b)
+                        if(ptr[offset8] < c_b)
+                          goto is_a_corner;
+                        else
+                          if(ptr[offset15] < c_b)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset13] < c_b)
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset8] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    if(ptr[offset14] < c_b)
+                                      if(ptr[offset15] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset11] < c_b)
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset13] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset1] < c_b)
+                                if(ptr[offset13] < c_b)
+                                  if(ptr[offset14] < c_b)
+                                    if(ptr[offset15] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset13] < c_b)
+                                if(ptr[offset14] < c_b)
+                                  if(ptr[offset15] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset14] < c_b)
+                    if(ptr[offset15] < c_b)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset13] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset12] < c_b)
+                                if(ptr[offset13] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset9] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset12] < c_b)
+                                  if(ptr[offset13] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset12] > cb)
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset8] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset13] > cb)
+                              if(ptr[offset14] > cb)
+                                if(ptr[offset6] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset15] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else if(ptr[offset12] < c_b)
+                  if(ptr[offset13] < c_b)
+                    if(ptr[offset14] < c_b)
+                      if(ptr[offset15] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset3] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset9] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              if(ptr[offset11] > cb)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset8] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset5] > cb)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset14] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset14] > cb)
+                                if(ptr[offset15] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else if(ptr[offset11] < c_b)
+                if(ptr[offset12] < c_b)
+                  if(ptr[offset13] < c_b)
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset14] < c_b)
+                        if(ptr[offset15] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset9] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset9] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset5] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset9] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+          else
+            if(ptr[offset9] > cb)
+              if(ptr[offset7] > cb)
+                if(ptr[offset8] > cb)
+                  if(ptr[offset10] > cb)
+                    if(ptr[offset11] > cb)
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset5] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset12] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset12] > cb)
+                              if(ptr[offset13] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset12] > cb)
+                            if(ptr[offset13] > cb)
+                              if(ptr[offset14] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset14] > cb)
+                              if(ptr[offset15] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else if(ptr[offset9] < c_b)
+              if(ptr[offset10] < c_b)
+                if(ptr[offset11] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset12] < c_b)
+                      if(ptr[offset13] < c_b)
+                        if(ptr[offset14] < c_b)
+                          if(ptr[offset15] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset4] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset4] < c_b)
+                          if(ptr[offset5] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset7] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset12] < c_b)
+                        if(ptr[offset13] < c_b)
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+        else
+          if(ptr[offset7] > cb)
+            if(ptr[offset8] > cb)
+              if(ptr[offset9] > cb)
+                if(ptr[offset6] > cb)
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset4] > cb)
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset1] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            if(ptr[offset12] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset11] > cb)
+                          if(ptr[offset12] > cb)
+                            if(ptr[offset13] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] > cb)
+                      if(ptr[offset11] > cb)
+                        if(ptr[offset12] > cb)
+                          if(ptr[offset13] > cb)
+                            if(ptr[offset14] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset10] > cb)
+                    if(ptr[offset11] > cb)
+                      if(ptr[offset12] > cb)
+                        if(ptr[offset13] > cb)
+                          if(ptr[offset14] > cb)
+                            if(ptr[offset15] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+          else if(ptr[offset7] < c_b)
+            if(ptr[offset8] < c_b)
+              if(ptr[offset9] < c_b)
+                if(ptr[offset6] < c_b)
+                  if(ptr[offset5] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset2] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            if(ptr[offset12] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset12] < c_b)
+                            if(ptr[offset13] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset11] < c_b)
+                        if(ptr[offset12] < c_b)
+                          if(ptr[offset13] < c_b)
+                            if(ptr[offset14] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset10] < c_b)
+                    if(ptr[offset11] < c_b)
+                      if(ptr[offset12] < c_b)
+                        if(ptr[offset13] < c_b)
+                          if(ptr[offset14] < c_b)
+                            if(ptr[offset15] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+          else
+            goto is_not_a_corner;
+
+        is_a_corner:
+            bmin = b_test;
+            goto end;
+
+        is_not_a_corner:
+            bmax = b_test;
+            goto end;
+
+        end:
+
+        if(bmin == bmax - 1 || bmin == bmax)
+            return bmin;
+        b_test = (bmin + bmax) / 2;
+    }
+}
+
+// 12 pixel mask in diamond format
+template<>
+int agast_cornerScore<AgastFeatureDetector::AGAST_7_12d>(const uchar* ptr, const int pixel[], int threshold)
+{
+    int bmin = threshold;
+    int bmax = 255;
+    int b_test = (bmax + bmin)/2;
+
+    register short offset0 = (short) pixel[0];
+    register short offset1 = (short) pixel[1];
+    register short offset2 = (short) pixel[2];
+    register short offset3 = (short) pixel[3];
+    register short offset4 = (short) pixel[4];
+    register short offset5 = (short) pixel[5];
+    register short offset6 = (short) pixel[6];
+    register short offset7 = (short) pixel[7];
+    register short offset8 = (short) pixel[8];
+    register short offset9 = (short) pixel[9];
+    register short offset10 = (short) pixel[10];
+    register short offset11 = (short) pixel[11];
+
+    while(true)
+    {
+        register const int cb = *ptr + b_test;
+        register const int c_b = *ptr - b_test;
+        if(ptr[offset0] > cb)
+          if(ptr[offset5] > cb)
+            if(ptr[offset2] > cb)
+              if(ptr[offset9] > cb)
+                if(ptr[offset1] > cb)
+                  if(ptr[offset6] > cb)
+                    if(ptr[offset3] > cb)
+                      if(ptr[offset4] > cb)
+                        goto is_a_corner;
+                      else
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset11] > cb)
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset4] > cb)
+                          goto is_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset10] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset6] > cb)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset3] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset3] > cb)
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset6] > cb)
+                        goto is_a_corner;
+                      else
+                        if(ptr[offset11] > cb)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset8] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              if(ptr[offset9] > cb)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset8] > cb)
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset11] > cb)
+                          goto is_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset4] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset4] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset3] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+          else
+            if(ptr[offset5] < c_b)
+              if(ptr[offset9] > cb)
+                if(ptr[offset3] < c_b)
+                  if(ptr[offset4] < c_b)
+                    if(ptr[offset11] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset2] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset2] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset2] < c_b)
+                              if(ptr[offset7] < c_b)
+                                if(ptr[offset1] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset11] > cb)
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset2] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset11] > cb)
+                    if(ptr[offset10] > cb)
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset2] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset7] > cb)
+                              if(ptr[offset8] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset2] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset7] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset9] < c_b)
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset4] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset11] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset6] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset6] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset3] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset10] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset2] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset1] > cb)
+                      if(ptr[offset3] > cb)
+                        if(ptr[offset4] > cb)
+                          if(ptr[offset10] > cb)
+                            if(ptr[offset11] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    if(ptr[offset2] < c_b)
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset4] < c_b)
+                          if(ptr[offset7] < c_b)
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+            else
+              if(ptr[offset2] > cb)
+                if(ptr[offset10] > cb)
+                  if(ptr[offset11] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset3] > cb)
+                          goto is_a_corner;
+                        else
+                          if(ptr[offset8] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset3] > cb)
+                          if(ptr[offset4] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset9] > cb)
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset8] > cb)
+                      if(ptr[offset10] > cb)
+                        if(ptr[offset11] > cb)
+                          if(ptr[offset1] > cb)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+        else if(ptr[offset0] < c_b)
+          if(ptr[offset2] > cb)
+            if(ptr[offset5] > cb)
+              if(ptr[offset7] > cb)
+                if(ptr[offset6] > cb)
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset3] > cb)
+                      if(ptr[offset1] > cb)
+                        goto is_a_corner;
+                      else
+                        if(ptr[offset8] > cb)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset10] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset10] > cb)
+                          if(ptr[offset11] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset9] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset11] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              if(ptr[offset9] < c_b)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset3] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset10] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+          else
+            if(ptr[offset2] < c_b)
+              if(ptr[offset9] > cb)
+                if(ptr[offset5] > cb)
+                  if(ptr[offset1] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset11] < c_b)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset7] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset10] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset6] > cb)
+                        if(ptr[offset7] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset4] > cb)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset6] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset10] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset3] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset11] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset9] < c_b)
+                  if(ptr[offset5] < c_b)
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset6] < c_b)
+                        if(ptr[offset3] < c_b)
+                          if(ptr[offset4] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset7] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset10] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset6] < c_b)
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset8] < c_b)
+                            if(ptr[offset4] < c_b)
+                              if(ptr[offset3] < c_b)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset10] < c_b)
+                      if(ptr[offset11] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset3] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset8] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset3] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset5] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset11] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset7] < c_b)
+                              if(ptr[offset8] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset10] < c_b)
+                            if(ptr[offset11] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+            else
+              if(ptr[offset9] < c_b)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset8] < c_b)
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset10] < c_b)
+                          if(ptr[offset11] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset4] < c_b)
+                            if(ptr[offset3] < c_b)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset10] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset10] < c_b)
+                              if(ptr[offset11] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset10] < c_b)
+                        if(ptr[offset11] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset5] > cb)
+                  if(ptr[offset9] > cb)
+                    if(ptr[offset6] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset8] > cb)
+                          if(ptr[offset4] > cb)
+                            if(ptr[offset3] > cb)
+                              goto is_a_corner;
+                            else
+                              if(ptr[offset10] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+        else
+          if(ptr[offset5] > cb)
+            if(ptr[offset9] > cb)
+              if(ptr[offset6] > cb)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset3] > cb)
+                      if(ptr[offset8] > cb)
+                        goto is_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset2] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset10] > cb)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset11] > cb)
+                      if(ptr[offset8] > cb)
+                        if(ptr[offset10] > cb)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              if(ptr[offset2] > cb)
+                if(ptr[offset3] > cb)
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset8] > cb)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+          else
+            if(ptr[offset5] < c_b)
+              if(ptr[offset9] < c_b)
+                if(ptr[offset6] < c_b)
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset3] < c_b)
+                        if(ptr[offset8] < c_b)
+                          goto is_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset2] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset10] < c_b)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset11] < c_b)
+                        if(ptr[offset8] < c_b)
+                          if(ptr[offset10] < c_b)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset2] < c_b)
+                  if(ptr[offset3] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+
+        is_a_corner:
+            bmin = b_test;
+            goto end;
+
+        is_not_a_corner:
+            bmax = b_test;
+            goto end;
+
+        end:
+
+        if(bmin == bmax - 1 || bmin == bmax)
+            return bmin;
+        b_test = (bmin + bmax) / 2;
+    }
+}
+
+//12 pixel mask in square format
+template<>
+int agast_cornerScore<AgastFeatureDetector::AGAST_7_12s>(const uchar* ptr, const int pixel[], int threshold)
+{
+    int bmin = threshold;
+    int bmax = 255;
+    int b_test = (bmax + bmin)/2;
+
+    register short offset0 = (short) pixel[0];
+    register short offset1 = (short) pixel[1];
+    register short offset2 = (short) pixel[2];
+    register short offset3 = (short) pixel[3];
+    register short offset4 = (short) pixel[4];
+    register short offset5 = (short) pixel[5];
+    register short offset6 = (short) pixel[6];
+    register short offset7 = (short) pixel[7];
+    register short offset8 = (short) pixel[8];
+    register short offset9 = (short) pixel[9];
+    register short offset10 = (short) pixel[10];
+    register short offset11 = (short) pixel[11];
+
+    while(true)
+    {
+        register const int cb = *ptr + b_test;
+        register const int c_b = *ptr - b_test;
+        if(ptr[offset0] > cb)
+          if(ptr[offset5] > cb)
+            if(ptr[offset2] < c_b)
+              if(ptr[offset7] > cb)
+                if(ptr[offset9] < c_b)
+                  goto is_not_a_corner;
+                else
+                  if(ptr[offset9] > cb)
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset6] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset4] > cb)
+                              if(ptr[offset3] > cb)
+                                goto is_a_corner;
+                              else
+                                if(ptr[offset10] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset8] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                      else
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              if(ptr[offset2] > cb)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset9] < c_b)
+                    if(ptr[offset1] < c_b)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          if(ptr[offset3] > cb)
+                            if(ptr[offset4] > cb)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset11] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                else
+                  if(ptr[offset9] < c_b)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset8] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset4] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+              else
+                if(ptr[offset7] > cb)
+                  if(ptr[offset9] < c_b)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+          else
+            if(ptr[offset5] < c_b)
+              if(ptr[offset9] < c_b)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset2] < c_b)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset2] > cb)
+                      if(ptr[offset1] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset2] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset3] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        if(ptr[offset10] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      if(ptr[offset3] < c_b)
+                                        if(ptr[offset4] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                  else
+                    if(ptr[offset2] < c_b)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] > cb)
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+              else
+                if(ptr[offset9] > cb)
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset2] > cb)
+                      if(ptr[offset1] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset10] > cb)
+                              if(ptr[offset11] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset2] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset2] > cb)
+                          if(ptr[offset1] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                else
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset7] > cb)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset2] > cb)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset7] < c_b)
+                          if(ptr[offset1] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+            else
+              if(ptr[offset2] < c_b)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset9] < c_b)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset2] > cb)
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset1] < c_b)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset10] > cb)
+                                if(ptr[offset11] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                    else
+                      if(ptr[offset7] > cb)
+                        if(ptr[offset9] > cb)
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                      else
+                        if(ptr[offset9] > cb)
+                          if(ptr[offset1] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] > cb)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                else
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset9] < c_b)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+        else if(ptr[offset0] < c_b)
+          if(ptr[offset5] < c_b)
+            if(ptr[offset9] > cb)
+              if(ptr[offset2] > cb)
+                goto is_not_a_corner;
+              else
+                if(ptr[offset2] < c_b)
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset1] > cb)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset6] < c_b)
+                          if(ptr[offset3] < c_b)
+                            if(ptr[offset4] < c_b)
+                              goto is_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset7] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] > cb)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              if(ptr[offset9] < c_b)
+                if(ptr[offset7] > cb)
+                  if(ptr[offset2] > cb)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset2] < c_b)
+                      if(ptr[offset1] > cb)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset11] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset2] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset4] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                  else
+                    if(ptr[offset2] > cb)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset2] < c_b)
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset11] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+              else
+                if(ptr[offset2] > cb)
+                  goto is_not_a_corner;
+                else
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset1] > cb)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+          else
+            if(ptr[offset5] > cb)
+              if(ptr[offset2] > cb)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset9] > cb)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset2] < c_b)
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] > cb)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                  else
+                    if(ptr[offset7] > cb)
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset9] > cb)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset8] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      if(ptr[offset3] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          if(ptr[offset10] < c_b)
+                                            goto is_a_corner;
+                                          else
+                                            goto is_not_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset4] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          if(ptr[offset11] > cb)
+                                            goto is_a_corner;
+                                          else
+                                            goto is_not_a_corner;
+                                      else
+                                        if(ptr[offset3] > cb)
+                                          if(ptr[offset4] > cb)
+                                            goto is_a_corner;
+                                          else
+                                            goto is_not_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] > cb)
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset4] > cb)
+                                      if(ptr[offset3] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset10] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        if(ptr[offset11] > cb)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset1] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                else
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset9] < c_b)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+            else
+              if(ptr[offset2] > cb)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset9] > cb)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset2] < c_b)
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] > cb)
+                        goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset10] < c_b)
+                                if(ptr[offset11] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                    else
+                      if(ptr[offset7] < c_b)
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                      else
+                        if(ptr[offset9] < c_b)
+                          if(ptr[offset1] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset8] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      if(ptr[offset3] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        if(ptr[offset8] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset1] < c_b)
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset6] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  if(ptr[offset3] < c_b)
+                                    if(ptr[offset4] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        if(ptr[offset11] < c_b)
+                                          goto is_a_corner;
+                                        else
+                                          goto is_not_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                else
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset9] > cb)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+        else
+          if(ptr[offset5] < c_b)
+            if(ptr[offset7] > cb)
+              goto is_not_a_corner;
+            else
+              if(ptr[offset7] < c_b)
+                if(ptr[offset2] > cb)
+                  if(ptr[offset9] > cb)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset8] < c_b)
+                              if(ptr[offset4] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] < c_b)
+                                  if(ptr[offset11] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] < c_b)
+                        if(ptr[offset6] > cb)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            if(ptr[offset3] < c_b)
+                              if(ptr[offset4] < c_b)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset8] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] < c_b)
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] < c_b)
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset3] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset3] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset8] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] < c_b)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] > cb)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              if(ptr[offset8] < c_b)
+                                if(ptr[offset4] < c_b)
+                                  if(ptr[offset3] < c_b)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] < c_b)
+                                    if(ptr[offset11] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] < c_b)
+                                if(ptr[offset8] < c_b)
+                                  if(ptr[offset4] < c_b)
+                                    if(ptr[offset3] < c_b)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] < c_b)
+                                      if(ptr[offset11] < c_b)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+          else
+            if(ptr[offset5] > cb)
+              if(ptr[offset7] > cb)
+                if(ptr[offset2] < c_b)
+                  if(ptr[offset9] < c_b)
+                    goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] > cb)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset8] > cb)
+                              if(ptr[offset4] > cb)
+                                if(ptr[offset3] > cb)
+                                  goto is_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                if(ptr[offset10] > cb)
+                                  if(ptr[offset11] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset2] > cb)
+                    if(ptr[offset9] < c_b)
+                      if(ptr[offset1] > cb)
+                        if(ptr[offset6] < c_b)
+                          goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] > cb)
+                            if(ptr[offset3] > cb)
+                              if(ptr[offset4] > cb)
+                                goto is_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                          else
+                            goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset8] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] < c_b)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] > cb)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset8] > cb)
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset8] > cb)
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset3] > cb)
+                                if(ptr[offset4] > cb)
+                                  goto is_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset3] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset8] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                  else
+                    if(ptr[offset9] < c_b)
+                      goto is_not_a_corner;
+                    else
+                      if(ptr[offset9] > cb)
+                        if(ptr[offset1] > cb)
+                          if(ptr[offset6] < c_b)
+                            goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] > cb)
+                              if(ptr[offset8] > cb)
+                                if(ptr[offset4] > cb)
+                                  if(ptr[offset3] > cb)
+                                    goto is_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  if(ptr[offset10] > cb)
+                                    if(ptr[offset11] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                  else
+                                    goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                            else
+                              goto is_not_a_corner;
+                        else
+                          if(ptr[offset1] < c_b)
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                          else
+                            if(ptr[offset6] < c_b)
+                              goto is_not_a_corner;
+                            else
+                              if(ptr[offset6] > cb)
+                                if(ptr[offset8] > cb)
+                                  if(ptr[offset4] > cb)
+                                    if(ptr[offset3] > cb)
+                                      goto is_a_corner;
+                                    else
+                                      if(ptr[offset10] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                  else
+                                    if(ptr[offset10] > cb)
+                                      if(ptr[offset11] > cb)
+                                        goto is_a_corner;
+                                      else
+                                        goto is_not_a_corner;
+                                    else
+                                      goto is_not_a_corner;
+                                else
+                                  goto is_not_a_corner;
+                              else
+                                goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+
+        is_a_corner:
+            bmin = b_test;
+            goto end;
+
+        is_not_a_corner:
+            bmax = b_test;
+            goto end;
+
+        end:
+
+        if(bmin == bmax - 1 || bmin == bmax)
+            return bmin;
+        b_test = (bmin + bmax) / 2;
+    }
+}
+
+// 8 pixel mask
+template<>
+int agast_cornerScore<AgastFeatureDetector::AGAST_5_8>(const uchar* ptr, const int pixel[], int threshold)
+{
+    int bmin = threshold;
+    int bmax = 255;
+    int b_test = (bmax + bmin)/2;
+
+    register short offset0 = (short) pixel[0];
+    register short offset1 = (short) pixel[1];
+    register short offset2 = (short) pixel[2];
+    register short offset3 = (short) pixel[3];
+    register short offset4 = (short) pixel[4];
+    register short offset5 = (short) pixel[5];
+    register short offset6 = (short) pixel[6];
+    register short offset7 = (short) pixel[7];
+
+    while(true)
+    {
+        register const int cb = *ptr + b_test;
+        register const int c_b = *ptr - b_test;
+        if(ptr[offset0] > cb)
+          if(ptr[offset2] > cb)
+            if(ptr[offset3] > cb)
+              if(ptr[offset5] > cb)
+                if(ptr[offset1] > cb)
+                  if(ptr[offset4] > cb)
+                    goto is_a_corner;
+                  else
+                    if(ptr[offset7] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset6] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset1] > cb)
+                  if(ptr[offset4] > cb)
+                    goto is_a_corner;
+                  else
+                    if(ptr[offset7] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              if(ptr[offset7] > cb)
+                if(ptr[offset6] > cb)
+                  if(ptr[offset5] > cb)
+                    if(ptr[offset1] > cb)
+                      goto is_a_corner;
+                    else
+                      if(ptr[offset4] > cb)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                if(ptr[offset5] < c_b)
+                  if(ptr[offset3] < c_b)
+                    if(ptr[offset7] < c_b)
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+          else
+            if(ptr[offset5] > cb)
+              if(ptr[offset7] > cb)
+                if(ptr[offset6] > cb)
+                  if(ptr[offset1] > cb)
+                    goto is_a_corner;
+                  else
+                    if(ptr[offset4] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              if(ptr[offset5] < c_b)
+                if(ptr[offset3] < c_b)
+                  if(ptr[offset2] < c_b)
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset4] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset7] < c_b)
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+        else if(ptr[offset0] < c_b)
+          if(ptr[offset2] < c_b)
+            if(ptr[offset7] > cb)
+              if(ptr[offset3] < c_b)
+                if(ptr[offset5] < c_b)
+                  if(ptr[offset1] < c_b)
+                    if(ptr[offset4] < c_b)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset6] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset1] < c_b)
+                    if(ptr[offset4] < c_b)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset5] > cb)
+                  if(ptr[offset3] > cb)
+                    if(ptr[offset4] > cb)
+                      if(ptr[offset6] > cb)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              if(ptr[offset7] < c_b)
+                if(ptr[offset3] < c_b)
+                  if(ptr[offset5] < c_b)
+                    if(ptr[offset1] < c_b)
+                      goto is_a_corner;
+                    else
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] < c_b)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset6] < c_b)
+                    if(ptr[offset5] < c_b)
+                      if(ptr[offset1] < c_b)
+                        goto is_a_corner;
+                      else
+                        if(ptr[offset4] < c_b)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                    else
+                      if(ptr[offset1] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset3] < c_b)
+                  if(ptr[offset5] < c_b)
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset4] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      if(ptr[offset4] < c_b)
+                        if(ptr[offset6] < c_b)
+                          goto is_a_corner;
+                        else
+                          goto is_not_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    if(ptr[offset1] < c_b)
+                      if(ptr[offset4] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+          else
+            if(ptr[offset5] > cb)
+              if(ptr[offset3] > cb)
+                if(ptr[offset2] > cb)
+                  if(ptr[offset1] > cb)
+                    if(ptr[offset4] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    if(ptr[offset4] > cb)
+                      if(ptr[offset6] > cb)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset7] > cb)
+                    if(ptr[offset4] > cb)
+                      if(ptr[offset6] > cb)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              if(ptr[offset5] < c_b)
+                if(ptr[offset7] < c_b)
+                  if(ptr[offset6] < c_b)
+                    if(ptr[offset1] < c_b)
+                      goto is_a_corner;
+                    else
+                      if(ptr[offset4] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+        else
+          if(ptr[offset3] > cb)
+            if(ptr[offset5] > cb)
+              if(ptr[offset2] > cb)
+                if(ptr[offset1] > cb)
+                  if(ptr[offset4] > cb)
+                    goto is_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset6] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                if(ptr[offset7] > cb)
+                  if(ptr[offset4] > cb)
+                    if(ptr[offset6] > cb)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+                else
+                  goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+          else
+            if(ptr[offset3] < c_b)
+              if(ptr[offset5] < c_b)
+                if(ptr[offset2] < c_b)
+                  if(ptr[offset1] < c_b)
+                    if(ptr[offset4] < c_b)
+                      goto is_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset6] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                else
+                  if(ptr[offset7] < c_b)
+                    if(ptr[offset4] < c_b)
+                      if(ptr[offset6] < c_b)
+                        goto is_a_corner;
+                      else
+                        goto is_not_a_corner;
+                    else
+                      goto is_not_a_corner;
+                  else
+                    goto is_not_a_corner;
+              else
+                goto is_not_a_corner;
+            else
+              goto is_not_a_corner;
+
+        is_a_corner:
+            bmin=b_test;
+            goto end;
+
+        is_not_a_corner:
+            bmax=b_test;
+            goto end;
+
+        end:
+
+        if(bmin == bmax - 1 || bmin == bmax)
+            return bmin;
+        b_test = (bmin + bmax) / 2;
+    }
+}
+
+} // namespace cv
diff --git a/modules/features2d/src/agast_score.hpp b/modules/features2d/src/agast_score.hpp
new file mode 100644 (file)
index 0000000..bd5ddb3
--- /dev/null
@@ -0,0 +1,62 @@
+/* This is AGAST and OAST, an optimal and accelerated corner detector
+              based on the accelerated segment tests
+   Below is the original copyright and the references */
+
+/*
+Copyright (C) 2010  Elmar Mair
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    *Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+    *Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+    *Neither the name of the University of Cambridge nor the names of
+     its contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+The references are:
+ * Adaptive and Generic Corner Detection Based on the Accelerated Segment Test,
+   Elmar Mair and Gregory D. Hager and Darius Burschka
+   and Michael Suppa and Gerhard Hirzinger ECCV 2010
+   URL: http://www6.in.tum.de/Main/ResearchAgast
+*/
+
+
+#ifndef __OPENCV_FEATURES_2D_AGAST_HPP__
+#define __OPENCV_FEATURES_2D_AGAST_HPP__
+
+#ifdef __cplusplus
+
+#include "precomp.hpp"
+namespace cv
+{
+
+void makeAgastOffsets(int pixel[16], int row_stride, int type);
+
+template<int type>
+int agast_cornerScore(const uchar* ptr, const int pixel[], int threshold);
+
+}
+#endif
+#endif
index c24d727..3e80c5d 100644 (file)
@@ -46,7 +46,7 @@
 #include <fstream>
 #include <stdlib.h>
 
-#include "fast_score.hpp"
+#include "agast_score.hpp"
 
 namespace cv
 {
@@ -157,7 +157,7 @@ public:
   // derive a layer
   BriskLayer(const BriskLayer& layer, int mode);
 
-  // Fast/Agast without non-max suppression
+  // Agast without non-max suppression
   void
   getAgastPoints(int threshold, std::vector<cv::KeyPoint>& keypoints);
 
@@ -204,13 +204,13 @@ private:
   value(const cv::Mat& mat, float xf, float yf, float scale) const;
   // the image
   cv::Mat img_;
-  // its Fast scores
+  // its Agast scores
   cv::Mat_<uchar> scores_;
   // coordinate transformation
   float scale_;
   float offset_;
   // agast
-  cv::Ptr<cv::FastFeatureDetector> fast_9_16_;
+  cv::Ptr<cv::AgastFeatureDetector> oast_9_16_;
   int pixel_5_8_[25];
   int pixel_9_16_[25];
 };
@@ -618,8 +618,6 @@ BRISK_Impl::detectAndCompute( InputArray _image, InputArray _mask, std::vector<K
                               OutputArray _descriptors, bool useProvidedKeypoints)
 {
   bool doOrientation=true;
-  if (useProvidedKeypoints)
-    doOrientation = false;
 
   // If the user specified cv::noArray(), this will yield false. Otherwise it will return true.
   bool doDescriptors = _descriptors.needed();
@@ -733,8 +731,12 @@ BRISK_Impl::computeDescriptorsAndOrOrientation(InputArray _image, InputArray _ma
           direction1 += tmp1;
         }
         kp.angle = (float)(atan2((float) direction1, (float) direction0) / CV_PI * 180.0);
-        if (kp.angle < 0)
-          kp.angle += 360.f;
+
+        if (!doDescriptors)
+        {
+          if (kp.angle < 0)
+            kp.angle += 360.f;
+        }
     }
 
     if (!doDescriptors)
@@ -755,6 +757,9 @@ BRISK_Impl::computeDescriptorsAndOrOrientation(InputArray _image, InputArray _ma
           theta -= n_rot_;
     }
 
+    if (kp.angle < 0)
+      kp.angle += 360.f;
+
     // now also extract the stuff for the actual direction:
     // let us compute the smoothed values
     int shifter = 0;
@@ -867,7 +872,7 @@ BriskScaleSpace::getKeypoints(const int threshold_, std::vector<cv::KeyPoint>& k
   std::vector<std::vector<cv::KeyPoint> > agastPoints;
   agastPoints.resize(layers_);
 
-  // go through the octaves and intra layers and calculate fast corner scores:
+  // go through the octaves and intra layers and calculate agast corner scores:
   for (int i = 0; i < layers_; i++)
   {
     // call OAST16_9 without nms
@@ -2067,9 +2072,9 @@ BriskLayer::BriskLayer(const cv::Mat& img_in, float scale_in, float offset_in)
   scale_ = scale_in;
   offset_ = offset_in;
   // create an agast detector
-  fast_9_16_ = FastFeatureDetector::create(1, true, FastFeatureDetector::TYPE_9_16);
-  makeOffsets(pixel_5_8_, (int)img_.step, 8);
-  makeOffsets(pixel_9_16_, (int)img_.step, 16);
+  oast_9_16_ = AgastFeatureDetector::create(1, false, AgastFeatureDetector::OAST_9_16);
+  makeAgastOffsets(pixel_5_8_, (int)img_.step, AgastFeatureDetector::AGAST_5_8);
+  makeAgastOffsets(pixel_9_16_, (int)img_.step, AgastFeatureDetector::OAST_9_16);
 }
 // derive a layer
 BriskLayer::BriskLayer(const BriskLayer& layer, int mode)
@@ -2089,18 +2094,18 @@ BriskLayer::BriskLayer(const BriskLayer& layer, int mode)
     offset_ = 0.5f * scale_ - 0.5f;
   }
   scores_ = cv::Mat::zeros(img_.rows, img_.cols, CV_8U);
-  fast_9_16_ = FastFeatureDetector::create(1, false, FastFeatureDetector::TYPE_9_16);
-  makeOffsets(pixel_5_8_, (int)img_.step, 8);
-  makeOffsets(pixel_9_16_, (int)img_.step, 16);
+  oast_9_16_ = AgastFeatureDetector::create(1, false, AgastFeatureDetector::OAST_9_16);
+  makeAgastOffsets(pixel_5_8_, (int)img_.step, AgastFeatureDetector::AGAST_5_8);
+  makeAgastOffsets(pixel_9_16_, (int)img_.step, AgastFeatureDetector::OAST_9_16);
 }
 
-// Fast/Agast
+// Agast
 // wraps the agast class
 void
 BriskLayer::getAgastPoints(int threshold, std::vector<KeyPoint>& keypoints)
 {
-  fast_9_16_->setThreshold(threshold);
-  fast_9_16_->detect(img_, keypoints);
+  oast_9_16_->setThreshold(threshold);
+  oast_9_16_->detect(img_, keypoints);
 
   // also write scores
   const size_t num = keypoints.size();
@@ -2121,7 +2126,7 @@ BriskLayer::getAgastScore(int x, int y, int threshold) const
   {
     return score;
   }
-  score = (uchar)cornerScore<16>(&img_.at<uchar>(y, x), pixel_9_16_, threshold - 1);
+  score = (uchar)agast_cornerScore<AgastFeatureDetector::OAST_9_16>(&img_.at<uchar>(y, x), pixel_9_16_, threshold - 1);
   if (score < threshold)
     score = 0;
   return score;
@@ -2134,7 +2139,7 @@ BriskLayer::getAgastScore_5_8(int x, int y, int threshold) const
     return 0;
   if (x >= img_.cols - 2 || y >= img_.rows - 2)
     return 0;
-  int score = cornerScore<8>(&img_.at<uchar>(y, x), pixel_5_8_, threshold - 1);
+  int score = agast_cornerScore<AgastFeatureDetector::AGAST_5_8>(&img_.at<uchar>(y, x), pixel_5_8_, threshold - 1);
   if (score < threshold)
     score = 0;
   return score;
diff --git a/modules/features2d/test/test_agast.cpp b/modules/features2d/test/test_agast.cpp
new file mode 100644 (file)
index 0000000..36f34df
--- /dev/null
@@ -0,0 +1,137 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
+//                           License Agreement
+//                For Open Source Computer Vision Library
+//
+// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
+// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
+// Third party copyrights are property of their respective owners.
+//
+// Redistribution and use in source and binary forms, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+//   * Redistribution's of source code must retain the above copyright notice,
+//     this list of conditions and the following disclaimer.
+//
+//   * Redistribution's in binary form must reproduce the above copyright notice,
+//     this list of conditions and the following disclaimer in the documentation
+//     and/or other materials provided with the distribution.
+//
+//   * The name of the copyright holders may not be used to endorse or promote products
+//     derived from this software without specific prior written permission.
+//
+// This software is provided by the copyright holders and contributors "as is" and
+// any express or implied warranties, including, but not limited to, the implied
+// warranties of merchantability and fitness for a particular purpose are disclaimed.
+// In no event shall the Intel Corporation or contributors be liable for any direct,
+// indirect, incidental, special, exemplary, or consequential damages
+// (including, but not limited to, procurement of substitute goods or services;
+// loss of use, data, or profits; or business interruption) however caused
+// and on any theory of liability, whether in contract, strict liability,
+// or tort (including negligence or otherwise) arising in any way out of
+// the use of this software, even if advised of the possibility of such damage.
+//
+//M*/
+
+#include "test_precomp.hpp"
+
+using namespace std;
+using namespace cv;
+
+class CV_AgastTest : public cvtest::BaseTest
+{
+public:
+    CV_AgastTest();
+    ~CV_AgastTest();
+protected:
+    void run(int);
+};
+
+CV_AgastTest::CV_AgastTest() {}
+CV_AgastTest::~CV_AgastTest() {}
+
+void CV_AgastTest::run( int )
+{
+  for(int type=0; type <= 2; ++type) {
+    Mat image1 = imread(string(ts->get_data_path()) + "inpaint/orig.png");
+    Mat image2 = imread(string(ts->get_data_path()) + "cameracalibration/chess9.png");
+    string xml = string(ts->get_data_path()) + format("agast/result%d.xml", type);
+
+    if (image1.empty() || image2.empty())
+    {
+        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
+        return;
+    }
+
+    Mat gray1, gray2;
+    cvtColor(image1, gray1, COLOR_BGR2GRAY);
+    cvtColor(image2, gray2, COLOR_BGR2GRAY);
+
+    vector<KeyPoint> keypoints1;
+    vector<KeyPoint> keypoints2;
+    AGAST(gray1, keypoints1, 30, true, type);
+    AGAST(gray2, keypoints2, (type > 0 ? 30 : 20), true, type);
+
+    for(size_t i = 0; i < keypoints1.size(); ++i)
+    {
+        const KeyPoint& kp = keypoints1[i];
+        cv::circle(image1, kp.pt, cvRound(kp.size/2), Scalar(255, 0, 0));
+    }
+
+    for(size_t i = 0; i < keypoints2.size(); ++i)
+    {
+        const KeyPoint& kp = keypoints2[i];
+        cv::circle(image2, kp.pt, cvRound(kp.size/2), Scalar(255, 0, 0));
+    }
+
+    Mat kps1(1, (int)(keypoints1.size() * sizeof(KeyPoint)), CV_8U, &keypoints1[0]);
+    Mat kps2(1, (int)(keypoints2.size() * sizeof(KeyPoint)), CV_8U, &keypoints2[0]);
+
+    FileStorage fs(xml, FileStorage::READ);
+    if (!fs.isOpened())
+    {
+        fs.open(xml, FileStorage::WRITE);
+        if (!fs.isOpened())
+        {
+            ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
+            return;
+        }
+        fs << "exp_kps1" << kps1;
+        fs << "exp_kps2" << kps2;
+        fs.release();
+        fs.open(xml, FileStorage::READ);
+        if (!fs.isOpened())
+        {
+            ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
+            return;
+        }
+    }
+
+    Mat exp_kps1, exp_kps2;
+    read( fs["exp_kps1"], exp_kps1, Mat() );
+    read( fs["exp_kps2"], exp_kps2, Mat() );
+    fs.release();
+
+     if ( exp_kps1.size != kps1.size || 0 != cvtest::norm(exp_kps1, kps1, NORM_L2) ||
+          exp_kps2.size != kps2.size || 0 != cvtest::norm(exp_kps2, kps2, NORM_L2))
+    {
+        ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
+        return;
+    }
+
+    /*cv::namedWindow("Img1"); cv::imshow("Img1", image1);
+    cv::namedWindow("Img2"); cv::imshow("Img2", image2);
+    cv::waitKey(0);*/
+  }
+
+  ts->set_failed_test_info(cvtest::TS::OK);
+}
+
+TEST(Features2d_AGAST, regression) { CV_AgastTest test; test.safe_run(); }
index e2d9f47..58c0b6d 100644 (file)
@@ -259,6 +259,12 @@ TEST( Features2d_Detector_FAST, regression )
     test.safe_run();
 }
 
+TEST( Features2d_Detector_AGAST, regression )
+{
+    CV_FeatureDetectorTest test( "detector-agast", AgastFeatureDetector::create() );
+    test.safe_run();
+}
+
 TEST( Features2d_Detector_GFTT, regression )
 {
     CV_FeatureDetectorTest test( "detector-gftt", GFTTDetector::create() );
index e9dafe3..4f5f8a0 100644 (file)
@@ -131,6 +131,12 @@ TEST(Features2d_Detector_Keypoints_FAST, validation)
     test.safe_run();
 }
 
+TEST(Features2d_Detector_Keypoints_AGAST, validation)
+{
+    CV_FeatureDetectorKeypointsTest test(AgastFeatureDetector::create());
+    test.safe_run();
+}
+
 TEST(Features2d_Detector_Keypoints_HARRIS, validation)
 {