// File: Ciaxur[P]yagb-emu/include/imgui/imstb_truetype.h
// Function: stbtt__GetGlyphShapeTT(stbtt_fontinfo const*, int, stbtt_vertex**)
static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices)
{
   stbtt_int16 numberOfContours;
   stbtt_uint8 *endPtsOfContours;
   stbtt_uint8 *data = info->data;
   stbtt_vertex *vertices=0;
   int num_vertices=0;
   int g = stbtt__GetGlyfOffset(info, glyph_index);

   *pvertices = NULL;

   if (g < 0) return 0;

   numberOfContours = ttSHORT(data + g);

   if (numberOfContours > 0) {
      stbtt_uint8 flags=0,flagcount;
      stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0;
      stbtt_int32 x,y,cx,cy,sx,sy, scx,scy;
      stbtt_uint8 *points;
      endPtsOfContours = (data + g + 10);
      ins = ttUSHORT(data + g + 10 + numberOfContours * 2);
      points = data + g + 10 + numberOfContours * 2 + 2 + ins;

      n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2);

      m = n + 2*numberOfContours;  // a loose bound on how many vertices we might need
      vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata);
      if (vertices == 0)
         return 0;

      next_move = 0;
      flagcount=0;

      // in first pass, we load uninterpreted data into the allocated array
      // above, shifted to the end of the array so we won't overwrite it when
      // we create our final data starting from the front

      off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated

      // first load flags

      for (i=0; i < n; ++i) {
         if (flagcount == 0) {
            flags = *points++;
            if (flags & 8)
               flagcount = *points++;
         } else
            --flagcount;
         vertices[off+i].type = flags;
      }

      // now load x coordinates
      x=0;
      for (i=0; i < n; ++i) {
         flags = vertices[off+i].type;
         if (flags & 2) {
            stbtt_int16 dx = *points++;
            x += (flags & 16) ? dx : -dx; // ???
         } else {
            if (!(flags & 16)) {
               x = x + (stbtt_int16) (points[0]*256 + points[1]);
               points += 2;
            }
         }
         vertices[off+i].x = (stbtt_int16) x;
      }

      // now load y coordinates
      y=0;
      for (i=0; i < n; ++i) {
         flags = vertices[off+i].type;
         if (flags & 4) {
            stbtt_int16 dy = *points++;
            y += (flags & 32) ? dy : -dy; // ???
         } else {
            if (!(flags & 32)) {
               y = y + (stbtt_int16) (points[0]*256 + points[1]);
               points += 2;
            }
         }
         vertices[off+i].y = (stbtt_int16) y;
      }

      // now convert them to our format
      num_vertices=0;
      sx = sy = cx = cy = scx = scy = 0;
      for (i=0; i < n; ++i) {
         flags = vertices[off+i].type;
         x     = (stbtt_int16) vertices[off+i].x;
         y     = (stbtt_int16) vertices[off+i].y;

         if (next_move == i) {
            if (i != 0)
               num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);

            // now start the new one               
            start_off = !(flags & 1);
            if (start_off) {
               // if we start off with an off-curve point, then when we need to find a point on the curve
               // where we can start, and we need to save some state for when we wraparound.
               scx = x;
               scy = y;
               if (!(vertices[off+i+1].type & 1)) {
                  // next point is also a curve point, so interpolate an on-point curve
                  sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1;
                  sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1;
               } else {
                  // otherwise just use the next point as our start point
                  sx = (stbtt_int32) vertices[off+i+1].x;
                  sy = (stbtt_int32) vertices[off+i+1].y;
                  ++i; // we're using point i+1 as the starting point, so skip it
               }
            } else {
               sx = x;
               sy = y;
            }
            stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0);
            was_off = 0;
            next_move = 1 + ttUSHORT(endPtsOfContours+j*2);
            ++j;
         } else {
            if (!(flags & 1)) { // if it's a curve
               if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint
                  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy);
               cx = x;
               cy = y;
               was_off = 1;
            } else {
               if (was_off)
                  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy);
               else
                  stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0);
               was_off = 0;
            }
         }
      }
      num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
   } else if (numberOfContours == -1) {
      // Compound shapes.
      int more = 1;
      stbtt_uint8 *comp = data + g + 10;
      num_vertices = 0;
      vertices = 0;
      while (more) {
         stbtt_uint16 flags, gidx;
         int comp_num_verts = 0, i;
         stbtt_vertex *comp_verts = 0, *tmp = 0;
         float mtx[6] = {1,0,0,1,0,0}, m, n;
         
         flags = ttSHORT(comp); comp+=2;
         gidx = ttSHORT(comp); comp+=2;

         if (flags & 2) { // XY values
            if (flags & 1) { // shorts
               mtx[4] = ttSHORT(comp); comp+=2;
               mtx[5] = ttSHORT(comp); comp+=2;
            } else {
               mtx[4] = ttCHAR(comp); comp+=1;
               mtx[5] = ttCHAR(comp); comp+=1;
            }
         }
         else {
            // @TODO handle matching point
            STBTT_assert(0);
         }
         if (flags & (1<<3)) { // WE_HAVE_A_SCALE
            mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
            mtx[1] = mtx[2] = 0;
         } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE
            mtx[0] = ttSHORT(comp)/16384.0f; comp+=2;
            mtx[1] = mtx[2] = 0;
            mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
         } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO
            mtx[0] = ttSHORT(comp)/16384.0f; comp+=2;
            mtx[1] = ttSHORT(comp)/16384.0f; comp+=2;
            mtx[2] = ttSHORT(comp)/16384.0f; comp+=2;
            mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
         }
         
         // Find transformation scales.
         m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]);
         n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]);

         // Get indexed glyph.
         comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts);
         if (comp_num_verts > 0) {
            // Transform vertices.
            for (i = 0; i < comp_num_verts; ++i) {
               stbtt_vertex* v = &comp_verts[i];
               stbtt_vertex_type x,y;
               x=v->x; y=v->y;
               v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
               v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
               x=v->cx; y=v->cy;
               v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
               v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
            }
            // Append vertices.
            tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata);
            if (!tmp) {
               if (vertices) STBTT_free(vertices, info->userdata);
               if (comp_verts) STBTT_free(comp_verts, info->userdata);
               return 0;
            }
            if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); //-V595
            STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex));
            if (vertices) STBTT_free(vertices, info->userdata);
            vertices = tmp;
            STBTT_free(comp_verts, info->userdata);
            num_vertices += comp_num_verts;
         }
         // More components ?
         more = flags & (1<<5);
      }
   } else if (numberOfContours < 0) {
      // @TODO other compound variations?
      STBTT_assert(0);
   } else {
      // numberOfCounters == 0, do nothing
   }

   *pvertices = vertices;
   return num_vertices;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x11fbb0
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
cmpl $0x0, -0x50(%rbp)
jge 0x122a3e
movl $0x0, -0xc(%rbp)
jmp 0x123923
movq -0x40(%rbp), %rdi
movslq -0x50(%rbp), %rax
addq %rax, %rdi
callq 0x11f960
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jle 0x123198
movb $0x0, -0x51(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x78(%rbp)
movq -0x40(%rbp), %rax
movslq -0x50(%rbp), %rcx
addq %rcx, %rax
addq $0xa, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rdi
movslq -0x50(%rbp), %rax
addq %rax, %rdi
addq $0xa, %rdi
movswl -0x2a(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x11f5b0
movzwl %ax, %eax
movl %eax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movslq -0x50(%rbp), %rcx
addq %rcx, %rax
addq $0xa, %rax
movswl -0x2a(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
addq $0x2, %rax
movslq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rdi
movswl -0x2a(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
addq $-0x2, %rdi
callq 0x11f5b0
movzwl %ax, %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movswl -0x2a(%rbp), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x64(%rbp)
movslq -0x64(%rbp), %rax
imulq $0xe, %rax, %rdi
callq 0xc4820
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x122b30
movl $0x0, -0xc(%rbp)
jmp 0x123923
movl $0x0, -0x6c(%rbp)
movb $0x0, -0x52(%rbp)
movl -0x64(%rbp), %eax
subl -0x68(%rbp), %eax
movl %eax, -0x74(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x122bcb
movzbl -0x52(%rbp), %eax
cmpl $0x0, %eax
jne 0x122b9e
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0xa0(%rbp)
movb (%rax), %al
movb %al, -0x51(%rbp)
movzbl -0x51(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x122b9c
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0xa0(%rbp)
movb (%rax), %al
movb %al, -0x52(%rbp)
jmp 0x122ba6
movb -0x52(%rbp), %al
addb $-0x1, %al
movb %al, -0x52(%rbp)
movb -0x51(%rbp), %cl
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %edx
addl -0x5c(%rbp), %edx
movslq %edx, %rdx
imulq $0xe, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0xc(%rax)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x122b4b
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x122cd4
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movb 0xc(%rax), %al
movb %al, -0x51(%rbp)
movzbl -0x51(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x122c64
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0xa0(%rbp)
movzbl (%rax), %eax
movw %ax, -0xa2(%rbp)
movzbl -0x51(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x122c45
movswl -0xa2(%rbp), %eax
movl %eax, -0x108(%rbp)
jmp 0x122c56
movswl -0xa2(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x108(%rbp)
movl -0x108(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x122ca9
movzbl -0x51(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x122ca7
movl -0x7c(%rbp), %eax
movq -0xa0(%rbp), %rcx
movzbl (%rcx), %ecx
shll $0x8, %ecx
movq -0xa0(%rbp), %rdx
movzbl 0x1(%rdx), %edx
addl %edx, %ecx
movswl %cx, %ecx
addl %ecx, %eax
movl %eax, -0x7c(%rbp)
movq -0xa0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xa0(%rbp)
jmp 0x122ca9
movl -0x7c(%rbp), %eax
movw %ax, %cx
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %edx
addl -0x5c(%rbp), %edx
movslq %edx, %rdx
imulq $0xe, %rdx, %rdx
addq %rdx, %rax
movw %cx, (%rax)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x122bd9
movl $0x0, -0x80(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x122dde
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movb 0xc(%rax), %al
movb %al, -0x51(%rbp)
movzbl -0x51(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x122d6d
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0xa0(%rbp)
movzbl (%rax), %eax
movw %ax, -0xa4(%rbp)
movzbl -0x51(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x122d4e
movswl -0xa4(%rbp), %eax
movl %eax, -0x10c(%rbp)
jmp 0x122d5f
movswl -0xa4(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
addl -0x80(%rbp), %eax
movl %eax, -0x80(%rbp)
jmp 0x122db2
movzbl -0x51(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x122db0
movl -0x80(%rbp), %eax
movq -0xa0(%rbp), %rcx
movzbl (%rcx), %ecx
shll $0x8, %ecx
movq -0xa0(%rbp), %rdx
movzbl 0x1(%rdx), %edx
addl %edx, %ecx
movswl %cx, %ecx
addl %ecx, %eax
movl %eax, -0x80(%rbp)
movq -0xa0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xa0(%rbp)
jmp 0x122db2
movl -0x80(%rbp), %eax
movw %ax, %cx
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %edx
addl -0x5c(%rbp), %edx
movslq %edx, %rdx
imulq $0xe, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x2(%rax)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x122ce2
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x98(%rbp)
movl $0x0, -0x94(%rbp)
movl $0x0, -0x88(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0x90(%rbp)
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x123145
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movb 0xc(%rax), %al
movb %al, -0x51(%rbp)
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movswl (%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movswl 0x2(%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jne 0x12304d
cmpl $0x0, -0x5c(%rbp)
je 0x122ee3
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x70(%rbp), %edx
movl -0x78(%rbp), %ecx
movl -0x8c(%rbp), %r8d
movl -0x90(%rbp), %r9d
movl -0x94(%rbp), %ebx
movl -0x98(%rbp), %r11d
movl -0x84(%rbp), %r10d
movl -0x88(%rbp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x123a20
movl %eax, -0x4c(%rbp)
movzbl -0x51(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x78(%rbp)
je 0x122fd6
movl -0x7c(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x98(%rbp)
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x122f8a
movl -0x7c(%rbp), %eax
movq -0x48(%rbp), %rcx
movl -0x74(%rbp), %edx
addl -0x5c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
imulq $0xe, %rdx, %rdx
addq %rdx, %rcx
movswl (%rcx), %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x8c(%rbp)
movl -0x80(%rbp), %eax
movq -0x48(%rbp), %rcx
movl -0x74(%rbp), %edx
addl -0x5c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
imulq $0xe, %rdx, %rdx
addq %rdx, %rcx
movswl 0x2(%rcx), %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x90(%rbp)
jmp 0x122fd4
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movswl (%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x48(%rbp), %rax
movl -0x74(%rbp), %ecx
addl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0xe, %rcx, %rcx
addq %rcx, %rax
movswl 0x2(%rax), %eax
movl %eax, -0x90(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x122fe8
movl -0x7c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x90(%rbp)
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x4c(%rbp)
cltq
imulq $0xe, %rax, %rax
addq %rax, %rdi
movl -0x8c(%rbp), %edx
movl -0x90(%rbp), %ecx
movl $0x1, %esi
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x121490
movl $0x0, -0x70(%rbp)
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x11f5b0
movzwl %ax, %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x123135
movzbl -0x51(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1230c0
cmpl $0x0, -0x70(%rbp)
je 0x1230a5
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x4c(%rbp)
cltq
imulq $0xe, %rax, %rax
addq %rax, %rdi
movl -0x84(%rbp), %edx
addl -0x7c(%rbp), %edx
sarl %edx
movl -0x88(%rbp), %ecx
addl -0x80(%rbp), %ecx
sarl %ecx
movl -0x84(%rbp), %r8d
movl -0x88(%rbp), %r9d
movl $0x3, %esi
callq 0x121490
movl -0x7c(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x88(%rbp)
movl $0x1, -0x70(%rbp)
jmp 0x123133
cmpl $0x0, -0x70(%rbp)
je 0x1230fe
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x4c(%rbp)
cltq
imulq $0xe, %rax, %rax
addq %rax, %rdi
movl -0x7c(%rbp), %edx
movl -0x80(%rbp), %ecx
movl -0x84(%rbp), %r8d
movl -0x88(%rbp), %r9d
movl $0x3, %esi
callq 0x121490
jmp 0x12312c
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x4c(%rbp)
cltq
imulq $0xe, %rax, %rax
addq %rax, %rdi
movl -0x7c(%rbp), %edx
movl -0x80(%rbp), %ecx
movl $0x2, %esi
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x121490
movl $0x0, -0x70(%rbp)
jmp 0x123135
jmp 0x123137
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x122e28
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x70(%rbp), %edx
movl -0x78(%rbp), %ecx
movl -0x8c(%rbp), %r8d
movl -0x90(%rbp), %r9d
movl -0x94(%rbp), %ebx
movl -0x98(%rbp), %r11d
movl -0x84(%rbp), %r10d
movl -0x88(%rbp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x123a20
movl %eax, -0x4c(%rbp)
jmp 0x123912
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x1238e2
movl $0x1, -0xa8(%rbp)
movq -0x40(%rbp), %rax
movslq -0x50(%rbp), %rcx
addq %rcx, %rax
addq $0xa, %rax
movq %rax, -0xb0(%rbp)
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x48(%rbp)
cmpl $0x0, -0xa8(%rbp)
je 0x1238e0
movl $0x0, -0xb8(%rbp)
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xd0(%rbp)
movq 0x634b8(%rip), %rax     # 0x1866c0
movq %rax, -0xf0(%rbp)
movq 0x634b2(%rip), %rax     # 0x1866c8
movq %rax, -0xe8(%rbp)
movq 0x634ac(%rip), %rax     # 0x1866d0
movq %rax, -0xe0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
movw %ax, -0xb2(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
movw %ax, -0xb4(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
movzwl -0xb2(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x123340
movzwl -0xb2(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1232ef
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xe0(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xdc(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
jmp 0x12333e
movq -0xb0(%rbp), %rax
movsbl (%rax), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xe0(%rbp)
movq -0xb0(%rbp), %rax
incq %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movsbl (%rax), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xdc(%rbp)
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
jmp 0x123361
jmp 0x123342
leaq 0x51dc1(%rip), %rdi     # 0x17510a
leaq 0x67c9a(%rip), %rsi     # 0x18afea
movl $0x70b, %edx            # imm = 0x70B
leaq 0x680fe(%rip), %rcx     # 0x18b45a
callq 0xd180
movzwl -0xb2(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x1233ca
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x606c3(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xe4(%rbp)
movss %xmm0, -0xf0(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0xe8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0xec(%rbp)
jmp 0x12355b
movzwl -0xb2(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x123466
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x60656(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xf0(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0xe8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0xec(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x60609(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xe4(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
jmp 0x123559
movzwl -0xb2(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x123557
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x605b8(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xf0(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x60581(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xec(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x6054a(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xe8(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x11f960
cwtl
cvtsi2ss %eax, %xmm0
movss 0x60513(%rip), %xmm1    # 0x183a4c
divss %xmm1, %xmm0
movss %xmm0, -0xe4(%rbp)
movq -0xb0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xb0(%rbp)
jmp 0x123559
jmp 0x12355b
movss -0xf0(%rbp), %xmm0
movss -0xf0(%rbp), %xmm2
movss -0xec(%rbp), %xmm1
mulss -0xec(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0xd960
movss %xmm0, -0xf4(%rbp)
movss -0xe8(%rbp), %xmm0
movss -0xe8(%rbp), %xmm2
movss -0xe4(%rbp), %xmm1
mulss -0xe4(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0xd960
movss %xmm0, -0xf8(%rbp)
movq -0x18(%rbp), %rdi
movzwl -0xb4(%rbp), %esi
leaq -0xc8(%rbp), %rdx
callq 0x122890
movl %eax, -0xb8(%rbp)
cmpl $0x0, -0xb8(%rbp)
jle 0x1238cb
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
cmpl -0xb8(%rbp), %eax
jge 0x1237fa
movq -0xc8(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movq %rcx, %rdx
addq %rdx, %rdx
shlq $0x4, %rcx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x102(%rbp)
movq -0x100(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x104(%rbp)
movss -0xf4(%rbp), %xmm0
movswl -0x102(%rbp), %eax
cvtsi2ss %eax, %xmm3
movss -0xf0(%rbp), %xmm1
movss -0xe8(%rbp), %xmm2
movswl -0x104(%rbp), %eax
cvtsi2ss %eax, %xmm4
mulss %xmm4, %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
movss -0xe0(%rbp), %xmm2
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x100(%rbp), %rax
movw %cx, (%rax)
movss -0xf8(%rbp), %xmm0
movswl -0x102(%rbp), %eax
cvtsi2ss %eax, %xmm3
movss -0xec(%rbp), %xmm1
movss -0xe4(%rbp), %xmm2
movswl -0x104(%rbp), %eax
cvtsi2ss %eax, %xmm4
mulss %xmm4, %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
movss -0xdc(%rbp), %xmm2
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x100(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x100(%rbp), %rax
movw 0x4(%rax), %ax
movw %ax, -0x102(%rbp)
movq -0x100(%rbp), %rax
movw 0x6(%rax), %ax
movw %ax, -0x104(%rbp)
movss -0xf4(%rbp), %xmm0
movswl -0x102(%rbp), %eax
cvtsi2ss %eax, %xmm3
movss -0xf0(%rbp), %xmm1
movss -0xe8(%rbp), %xmm2
movswl -0x104(%rbp), %eax
cvtsi2ss %eax, %xmm4
mulss %xmm4, %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
movss -0xe0(%rbp), %xmm2
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x100(%rbp), %rax
movw %cx, 0x4(%rax)
movss -0xf8(%rbp), %xmm0
movswl -0x102(%rbp), %eax
cvtsi2ss %eax, %xmm3
movss -0xec(%rbp), %xmm1
movss -0xe4(%rbp), %xmm2
movswl -0x104(%rbp), %eax
cvtsi2ss %eax, %xmm4
mulss %xmm4, %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
movss -0xdc(%rbp), %xmm2
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0x100(%rbp), %rax
movw %cx, 0x6(%rax)
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x1235f9
movl -0x4c(%rbp), %eax
addl -0xb8(%rbp), %eax
cltq
imulq $0xe, %rax, %rdi
callq 0xc4820
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x123851
cmpq $0x0, -0x48(%rbp)
je 0x12382f
movq -0x48(%rbp), %rdi
callq 0xc4920
cmpq $0x0, -0xc8(%rbp)
je 0x123845
movq -0xc8(%rbp), %rdi
callq 0xc4920
movl $0x0, -0xc(%rbp)
jmp 0x123923
cmpl $0x0, -0x4c(%rbp)
jle 0x12386f
movq -0xd0(%rbp), %rdi
movq -0x48(%rbp), %rsi
movslq -0x4c(%rbp), %rax
imulq $0xe, %rax, %rdx
callq 0xd0a0
movq -0xd0(%rbp), %rdi
movslq -0x4c(%rbp), %rax
imulq $0xe, %rax, %rax
addq %rax, %rdi
movq -0xc8(%rbp), %rsi
movslq -0xb8(%rbp), %rax
imulq $0xe, %rax, %rdx
callq 0xd0a0
cmpq $0x0, -0x48(%rbp)
je 0x1238a8
movq -0x48(%rbp), %rdi
callq 0xc4920
movq -0xd0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0xc8(%rbp), %rdi
callq 0xc4920
movl -0xb8(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movzwl -0xb2(%rbp), %eax
andl $0x20, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1231d4
jmp 0x123910
movswl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jge 0x12390c
jmp 0x1238ed
leaq 0x51816(%rip), %rdi     # 0x17510a
leaq 0x676ef(%rip), %rsi     # 0x18afea
movl $0x740, %edx            # imm = 0x740
leaq 0x67b53(%rip), %rcx     # 0x18b45a
callq 0xd180
jmp 0x12390e
jmp 0x123910
jmp 0x123912
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl -0x4c(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %rbp
retq