// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::ReadObjFile(char const*)
int R3Mesh::
ReadObjFile(const char *filename)
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "r"))) {
    RNFail("Unable to open file %s", filename);
    return 0;
  }

  // Read body
  char buffer[1024];
  int line_count = 0;
  int material_index = -1;
  int segment_index = -1;
  RNSymbolTable<int> material_table;
  RNArray<R2Point *> texture_coords;
  RNArray<R3Vector *> normals;
  RNArray<R3MeshVertex *> verts;
  RNArray<R3MeshVertex *> degenerate_triangle_vertices;
  std::vector<int> degenerate_triangle_materials;
  std::vector<int> degenerate_triangle_segments;
  while (fgets(buffer, 1023, fp)) {
    // Increment line counter
    line_count++;

    // Skip white space
    char *bufferp = buffer;
    while (isspace(*bufferp)) bufferp++;

    // Skip blank lines and comments
    if (*bufferp == '#') continue;
    if (*bufferp == '\0') continue;

    // Get keyword
    char keyword[80];
    if (sscanf(bufferp, "%s", keyword) != 1) {
      RNFail("Syntax error on line %d in file %s", line_count, filename);
      return 0;
    }

    // Check keyword
    if (!strcmp(keyword, "v")) {
      // Read vertex coordinates
      double x, y, z;
      if (sscanf(bufferp, "%s%lf%lf%lf", keyword, &x, &y, &z) != 4) {
        RNFail("Syntax error on line %d in file %s", line_count, filename);
        return 0;
      }

      // Create vertex
      R3MeshVertex *v = CreateVertex(R3Point(x, y, z));
      verts.Insert(v);
    }
    else if (!strcmp(keyword, "vt")) {
      // Read texture coordinates
      double u, v;
      if (sscanf(bufferp, "%s%lf%lf", keyword, &u, &v) != 3) {
        RNFail("Syntax error on line %d in OBJ file", line_count);
        return 0;
      }

      // Create texture coordinates
      R2Point *vt = new R2Point(u, v);
      texture_coords.Insert(vt);
    }
    else if (!strcmp(keyword, "vn")) {
      // Read texture coordinates
      double x, y, z;
      if (sscanf(bufferp, "%s%lf%lf%lf", keyword, &x, &y, &z) != 4) {
        RNFail("Syntax error on line %d in OBJ file", line_count);
        return 0;
      }

      // Create normal
      R3Vector *vn = new R3Vector(x, y, z);
      vn->Normalize();
      normals.Insert(vn);
    }
    else if (!strcmp(keyword, "f")) {
      // Read vertex indices
      int quad = 1;
      char s[4][128] = { { '\0' }, { '\0' }, { '\0' },{ '\0' } }; 
      if (sscanf(bufferp, "%s%s%s%s%s", keyword, s[0], s[1], s[2], s[3]) != 5) {
        quad = 0;;
        if (sscanf(bufferp, "%s%s%s%s", keyword, s[0], s[1], s[2]) != 4) {
          RNFail("Syntax error on line %d in OBJ file", line_count);
          return 0;
        }
      }

      // Parse vertex indices
      int n = (quad) ? 4 : 3;
      R3MeshVertex *v[4] = { NULL, NULL, NULL, NULL };
      for (int i = 0; i < n; i++) {
        char *sv = s[i];
        char *st = strchr(sv, '/');
        if (st) *(st++) = 0;
        char *sn = (st) ? strchr(st, '/') : NULL;
        if (sn) *(sn++) = 0;
        if (sn && (strlen(sn) == 0)) sn = NULL; 
        if (st && (strlen(st) == 0)) st = NULL;
        int vi = (sv) ? atoi(sv) : 0;
        int ti = (st) ? atoi(st) : 0;
        int ni = (sn) ? atoi(sn) : 0;
        v[i] = verts.Kth(vi-1);
        R2Point texcoords(0,0);
        R3Vector normal(0, 0, 0);
        if ((ti > 0) && ((ti-1) < texture_coords.NEntries())) texcoords = *(texture_coords.Kth(ti-1));
        if ((ni > 0) && ((ni-1) < normals.NEntries())) normal = *(normals.Kth(ni-1));
        if (((ti > 0) && !R2Contains(texcoords, VertexTextureCoords(v[i]))) ||
            ((ni > 0) && !R3Contains(normal, VertexNormal(v[i])))) {
          v[i] = CreateVertex(VertexPosition(v[i]), normal, RNgray_rgb, texcoords);
        }
      }

      // Check vertices
      if ((v[0] == v[1]) || (v[1] == v[2]) || (v[0] == v[2])) continue;
      if ((quad) && ((v[3] == v[0]) || (v[3] == v[1]) || (v[3] == v[2]))) quad = 0;

      // Create first triangle
      if (RNIsPositive(R3Distance(VertexPosition(v[0]), VertexPosition(v[1]))) &&
          RNIsPositive(R3Distance(VertexPosition(v[1]), VertexPosition(v[2]))) &&
          RNIsPositive(R3Distance(VertexPosition(v[2]), VertexPosition(v[0])))) {
        R3MeshFace *face = CreateFace(v[0], v[1], v[2]);
        if (face) {
          // Set segment and face
          SetFaceSegment(face, segment_index);
          SetFaceMaterial(face, material_index);
        }
        else {
          // Must have been degeneracy (e.g., flips or three faces sharing an edge)
          // Remember for later processing (to preserve vertex indices)
          degenerate_triangle_vertices.Insert(v[0]);
          degenerate_triangle_vertices.Insert(v[1]);
          degenerate_triangle_vertices.Insert(v[2]);
          degenerate_triangle_materials.push_back(material_index);
          degenerate_triangle_segments.push_back(segment_index);
        }
      }

      // Create second triangle
      if (quad) {
        if (RNIsPositive(R3Distance(VertexPosition(v[0]), VertexPosition(v[2]))) &&
            RNIsPositive(R3Distance(VertexPosition(v[2]), VertexPosition(v[3]))) &&
            RNIsPositive(R3Distance(VertexPosition(v[0]), VertexPosition(v[3])))) {
          R3MeshFace *face = CreateFace(v[0], v[2], v[3]);
          if (face) {
            // Set segment and face
            SetFaceSegment(face, segment_index);
            SetFaceMaterial(face, material_index);
          }
          else {
            // Must have been degeneracy (e.g., flips or three faces sharing an edge)
            // Remember for later processing (to preserve vertex indices)
            degenerate_triangle_vertices.Insert(v[0]);
            degenerate_triangle_vertices.Insert(v[2]);
            degenerate_triangle_vertices.Insert(v[3]);
            degenerate_triangle_materials.push_back(material_index);
            degenerate_triangle_segments.push_back(segment_index);
          }
        }
      }
    }
    else if (!strcmp(keyword, "usemtl")) {
      // Read fields
      char mtlname[1024];
      if (sscanf(bufferp, "%s%s", keyword, mtlname) != 2) {
        RNFail("Syntax error on line %d in OBJ file", line_count);
        return 0;
      }

      // Find/insert material index
      if (!material_table.Find(mtlname, &material_index)) {
        material_table.Insert(mtlname, ++material_index);
      }
    }
    else if (!strcmp(keyword, "g") || !strcmp(keyword, "o")) {
      // Read name
      char name[1024];
      if (sscanf(bufferp, "%s%s", keyword, name) != 2) {
        RNFail("Syntax error on line %d in OBJ file", line_count);
        return 0;
      }

      // Increment the segment index
      segment_index++;
    }
  }

  // Create degenerate triangles
  for (int i = 0; i <= degenerate_triangle_vertices.NEntries()-3; i+=3) {
    // Get vertices
    R3MeshVertex *v1 = degenerate_triangle_vertices.Kth(i+0);
    R3MeshVertex *v2 = degenerate_triangle_vertices.Kth(i+1);
    R3MeshVertex *v3 = degenerate_triangle_vertices.Kth(i+2);

    // Create face
    R3MeshFace *face = CreateFace(v1, v2, v3);
    if (!face) {
      face = CreateFace(v1, v3, v2);
      if (!face) {
        // Note: these vertices are allocated separately, and so they will not be deleted (memory leak)
        R3MeshVertex *v1a = CreateVertex(VertexPosition(v1));
        R3MeshVertex *v2a = CreateVertex(VertexPosition(v2));
        R3MeshVertex *v3a = CreateVertex(VertexPosition(v3));
        face = CreateFace(v1a, v2a, v3a);
      }
    }

    // Set material and segment
    if (face) {
      if ((int) degenerate_triangle_materials.size() > i/3) 
        SetFaceMaterial(face, degenerate_triangle_materials[i/3]);
      if ((int) degenerate_triangle_segments.size() > i/3) 
        SetFaceSegment(face, degenerate_triangle_segments[i/3]);
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9a8, %rsp            # imm = 0x9A8
movq %rsi, %r15
movq %rdi, %rbp
leaq 0x8d679(%rip), %rsi     # 0xabdd3
movq %r15, %rdi
callq 0xe530
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x1f293
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc(%rsp)
movl %eax, 0x14(%rsp)
movl $0x30, %edi
callq 0xe440
leaq 0x8(%rax), %rcx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
xorl %edx, %edx
movq %rdx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rax, 0x38(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x6f80c
leaq 0xa8(%rsp), %rdi
callq 0x6f80c
leaq 0xe8(%rsp), %rdi
callq 0x6f80c
leaq 0x20(%rsp), %rdi
callq 0x6f80c
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movq %rax, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
leaq 0x5a0(%rsp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq 0x78(%rsp), %rdx
callq 0xe730
testq %rax, %rax
je 0x1f16e
movl $0x0, 0x10(%rsp)
movq %rbp, 0xd0(%rsp)
leaq 0x59f(%rsp), %r12
movsbl 0x1(%r12), %ebp
incq %r12
movl %ebp, %edi
callq 0xe080
testl %eax, %eax
jne 0x1e82f
movzbl %bpl, %eax
incl 0x10(%rsp)
testl %eax, %eax
movq 0xd0(%rsp), %rbp
je 0x1f14e
cmpl $0x23, %eax
je 0x1f14e
movq %r12, %rdi
leaq 0x89642(%rip), %rsi     # 0xa7eb0
leaq 0x150(%rsp), %rdx
xorl %eax, %eax
callq 0xe420
cmpl $0x1, %eax
jne 0x1f2ab
movzwl 0x150(%rsp), %eax
cmpl $0x76, %eax
jne 0x1e927
movq %r12, %rdi
leaq 0x83b53(%rip), %rsi     # 0xa23f4
leaq 0x150(%rsp), %rdx
leaq 0x80(%rsp), %rcx
leaq 0xf8(%rsp), %r8
leaq 0xd8(%rsp), %r9
xorl %eax, %eax
callq 0xe420
cmpl $0x4, %eax
jne 0x1f2c2
movsd 0x80(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
movsd 0xd8(%rsp), %xmm2
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x3c532
movq (%rbp), %rax
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq *0x20(%rax)
movl 0xf4(%rsp), %edx
leaq 0xe8(%rsp), %rdi
movq %rax, %rsi
callq 0x6f8a2
jmp 0x1f14e
movl 0x150(%rsp), %ecx
movl $0x7476, %edx           # imm = 0x7476
xorl %edx, %ecx
movzbl 0x152(%rsp), %edx
orw %cx, %dx
je 0x1ece9
movl 0x150(%rsp), %ecx
movl $0x6e76, %edx           # imm = 0x6E76
xorl %edx, %ecx
movzbl 0x152(%rsp), %edx
orw %cx, %dx
je 0x1ed5e
cmpl $0x66, %eax
jne 0x1edec
movl $0x200, %edx            # imm = 0x200
leaq 0x1a0(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0xe260
leaq 0x320(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq 0x83a98(%rip), %rsi     # 0xa2433
leaq 0x150(%rsp), %r13
movq %r13, %rdx
movq %rbp, %rcx
leaq 0x220(%rsp), %rbx
movq %rbx, %r8
leaq 0x2a0(%rsp), %r14
movq %r14, %r9
xorl %eax, %eax
callq 0xe420
movl $0x4, %ecx
movq %rcx, 0x18(%rsp)
movl %eax, 0x30(%rsp)
cmpl $0x5, %eax
je 0x1ea09
movq %r12, %rdi
leaq 0x83a52(%rip), %rsi     # 0xa2435
movq %r13, %rdx
movq %rbp, %rcx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0xe420
movl $0x3, %ecx
movq %rcx, 0x18(%rsp)
cmpl $0x4, %eax
jne 0x1f301
movq %r15, 0xc8(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movq %rbp, %r12
xorl %ebx, %ebx
movq %r12, %rdi
movl $0x2f, %esi
callq 0xe1a0
testq %rax, %rax
je 0x1ea8a
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
movq %r15, %rdi
movl $0x2f, %esi
callq 0xe1a0
testq %rax, %rax
je 0x1ea6a
movq %rax, %r14
movb $0x0, (%rax)
cmpb $0x0, 0x1(%rax)
je 0x1ea6a
incq %r14
jmp 0x1ea6d
xorl %r14d, %r14d
cmpb $0x0, (%r15)
je 0x1ea8d
movq %r12, %rdi
callq 0xe700
movl %eax, %ebp
movq %r15, %rdi
callq 0xe700
movl %eax, %r15d
jmp 0x1ea9a
xorl %r14d, %r14d
movq %r12, %rdi
callq 0xe700
movl %eax, %ebp
xorl %r15d, %r15d
testq %r14, %r14
je 0x1eaac
movq %r14, %rdi
callq 0xe700
movl %eax, %r13d
jmp 0x1eaaf
xorl %r13d, %r13d
movq 0xe8(%rsp), %rax
movslq %ebp, %rcx
movq -0x8(%rax,%rcx,8), %r14
movq %r14, 0x80(%rsp,%rbx,8)
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
leaq 0xd8(%rsp), %rdi
callq 0x680a6
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
leaq 0xf8(%rsp), %rdi
callq 0x3cfc6
movq 0xd0(%rsp), %rbp
testl %r15d, %r15d
jle 0x1eb26
cmpl 0xc4(%rsp), %r15d
jg 0x1eb26
movq 0xb8(%rsp), %rax
movl %r15d, %ecx
movq -0x8(%rax,%rcx,8), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x681de
testl %r13d, %r13d
jle 0x1eb52
cmpl 0xb4(%rsp), %r13d
jg 0x1eb52
movq 0xa8(%rsp), %rax
movl %r13d, %ecx
movq -0x8(%rax,%rcx,8), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x3d752
testl %r15d, %r15d
jle 0x1eb6c
leaq 0x48(%r14), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x56d15
testl %eax, %eax
je 0x1eb9d
testl %r13d, %r13d
jle 0x1ebd0
testb $0x2, 0x78(%r14)
jne 0x1eb88
movq (%rbp), %rax
movq %rbp, %rdi
movq %r14, %rsi
callq *0x2b0(%rax)
leaq 0x30(%r14), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x464c8
testl %eax, %eax
jne 0x1ebd0
addq $0x18, %r14
movq (%rbp), %rax
movq %rbp, %rdi
movq %r14, %rsi
leaq 0xf8(%rsp), %rdx
leaq 0xc6f16(%rip), %rcx     # 0xe5ad0
leaq 0xd8(%rsp), %r8
xorl %r9d, %r9d
callq *0x38(%rax)
movq %rax, 0x80(%rsp,%rbx,8)
incq %rbx
subq $-0x80, %r12
cmpq %rbx, 0x18(%rsp)
jne 0x1ea2c
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %r14
cmpq %r14, %rdi
je 0x1f146
movq 0x90(%rsp), %rsi
cmpq %rsi, %r14
sete %al
cmpq %rsi, %rdi
sete %cl
orb %al, %cl
jne 0x1f146
movb $0x1, %bl
cmpl $0x5, 0x30(%rsp)
jne 0x1ec3e
movq 0x98(%rsp), %rax
cmpq %rdi, %rax
sete %cl
cmpq %r14, %rax
sete %dl
orb %cl, %dl
cmpq %rsi, %rax
sete %bl
orb %dl, %bl
movq %rsi, 0x18(%rsp)
movq %rdi, 0x30(%rsp)
leaq 0x18(%rdi), %r12
leaq 0x18(%r14), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x49404
leaq 0xc6f36(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1f00e
movq 0x18(%rsp), %rax
leaq 0x18(%rax), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x49404
leaq 0xc6f11(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1f00e
movq %r13, %rdi
movq %r12, %rsi
callq 0x49404
leaq 0xc6ef5(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1f00e
movq (%rbp), %rax
movq %rbp, %rdi
movq 0x30(%rsp), %rsi
movq %r14, %rdx
movq 0x18(%rsp), %rcx
xorl %r8d, %r8d
callq *0x48(%rax)
testq %rax, %rax
je 0x1ef7f
movl 0x14(%rsp), %ecx
movl %ecx, 0x9c(%rax)
movl 0xc(%rsp), %ecx
movl %ecx, 0x98(%rax)
jmp 0x1f00e
movq %r12, %rdi
leaq 0x83710(%rip), %rsi     # 0xa2403
leaq 0x150(%rsp), %rdx
leaq 0x1a0(%rsp), %rcx
leaq 0x80(%rsp), %r8
xorl %eax, %eax
callq 0xe420
cmpl $0x3, %eax
jne 0x1f2d9
movl $0x10, %edi
callq 0xe440
movq %rax, %r14
movsd 0x1a0(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movq %rax, %rdi
callq 0x680a6
movl 0xc4(%rsp), %edx
leaq 0xb8(%rsp), %rdi
movq %r14, %rsi
callq 0x6f8a2
jmp 0x1f14e
movq %r12, %rdi
leaq 0x8368c(%rip), %rsi     # 0xa23f4
leaq 0x150(%rsp), %rdx
leaq 0x1a0(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0xf8(%rsp), %r9
xorl %eax, %eax
callq 0xe420
cmpl $0x4, %eax
jne 0x1f2ed
movl $0x18, %edi
callq 0xe440
movq %rax, %r14
movsd 0x1a0(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0xf8(%rsp), %xmm2
movq %rax, %rdi
callq 0x3cfc6
movq %r14, %rdi
callq 0x3d2dc
movl 0xb4(%rsp), %edx
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
callq 0x6f8a2
jmp 0x1f14e
movl 0x150(%rsp), %ecx
movl $0x6d657375, %edx       # imm = 0x6D657375
xorl %edx, %ecx
movl 0x153(%rsp), %edx
movl $0x6c746d, %esi         # imm = 0x6C746D
xorl %esi, %edx
orl %ecx, %edx
je 0x1ee4b
orl $0x8, %eax
cmpl $0x6f, %eax
jne 0x1f14e
movq %r12, %rdi
leaq 0x8385a(%rip), %rsi     # 0xa267c
leaq 0x150(%rsp), %rdx
leaq 0x1a0(%rsp), %rcx
xorl %eax, %eax
callq 0xe420
cmpl $0x2, %eax
jne 0x1f315
incl 0x14(%rsp)
jmp 0x1f14e
movq %r12, %rdi
leaq 0x83827(%rip), %rsi     # 0xa267c
leaq 0x150(%rsp), %rdx
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xe420
cmpl $0x2, %eax
jne 0x1f329
leaq 0x140(%rsp), %r12
movq %r12, 0x130(%rsp)
movq %rbx, %rdi
callq 0xe1e0
leaq (%rsp,%rax), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
leaq 0x130(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x26316
movq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x25f62
movq %rax, %r14
movq 0x38(%rsp), %rbx
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x1eed4
movl 0x40(%r14), %eax
movl %eax, 0xc(%rsp)
movq 0x130(%rsp), %rdi
cmpq %r12, %rdi
je 0x1eef1
movq 0x140(%rsp), %rsi
incq %rsi
callq 0xe450
cmpq %rbx, %r14
jne 0x1f14e
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0xe1e0
leaq (%rsp,%rax), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
leaq 0x110(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x26316
movl 0xc(%rsp), %ebx
incl %ebx
movl %ebx, 0xc(%rsp)
movq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x263ac
movl %ebx, (%rax)
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x1f14e
movq 0x120(%rsp), %rsi
incq %rsi
callq 0xe450
jmp 0x1f14e
movl 0x2c(%rsp), %edx
leaq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x6f8a2
movl 0x2c(%rsp), %edx
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x6f8a2
movl 0x2c(%rsp), %edx
leaq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x6f8a2
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0x1efd3
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0x1efe2
leaq 0x60(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x25e26
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x1efff
movl 0x14(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0x1f00e
leaq 0x40(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x25e26
testb %bl, %bl
jne 0x1f146
movq 0x18(%rsp), %rax
leaq 0x18(%rax), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x49404
leaq 0xc6b67(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1f146
movq 0x98(%rsp), %r14
leaq 0x18(%r14), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x49404
leaq 0xc6b3f(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1f146
movq %r12, %rdi
movq %r13, %rsi
callq 0x49404
leaq 0xc6b23(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm0
jbe 0x1f146
movq (%rbp), %rax
movq %rbp, %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq *0x48(%rax)
testq %rax, %rax
je 0x1f0b7
movl 0x14(%rsp), %ecx
movl %ecx, 0x9c(%rax)
movl 0xc(%rsp), %ecx
movl %ecx, 0x98(%rax)
jmp 0x1f146
movl 0x2c(%rsp), %edx
leaq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x6f8a2
movl 0x2c(%rsp), %edx
leaq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x6f8a2
movl 0x2c(%rsp), %edx
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x6f8a2
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0x1f10b
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0x1f11a
leaq 0x60(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x25e26
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x1f137
movl 0x14(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0x1f146
leaq 0x40(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x25e26
movq 0xc8(%rsp), %r15
leaq 0x5a0(%rsp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq 0x78(%rsp), %rdx
callq 0xe730
testq %rax, %rax
jne 0x1e827
cmpl $0x3, 0x2c(%rsp)
jl 0x1f27f
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
movq (%rax,%r13,8), %r12
movq 0x8(%rax,%r13,8), %r15
movq 0x10(%rax,%r13,8), %r14
movq (%rbp), %rax
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq *0x48(%rax)
testq %rax, %rax
jne 0x1f222
movq (%rbp), %rax
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq *0x48(%rax)
testq %rax, %rax
jne 0x1f222
addq $0x18, %r12
movq (%rbp), %rax
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq *0x20(%rax)
movq %rax, %r12
addq $0x18, %r15
movq (%rbp), %rax
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *0x20(%rax)
movq %rax, %r15
addq $0x18, %r14
movq (%rbp), %rax
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq *0x20(%rax)
movq (%rbp), %r9
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
callq *0x48(%r9)
testq %rax, %rax
je 0x1f266
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
movslq %edx, %rdx
cmpq %rdx, %rbx
jge 0x1f244
movl (%rcx,%rbx,4), %ecx
movl %ecx, 0x98(%rax)
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
movslq %edx, %rdx
cmpq %rdx, %rbx
jge 0x1f266
movl (%rcx,%rbx,4), %ecx
movl %ecx, 0x9c(%rax)
addq $0x3, %r13
movslq 0x2c(%rsp), %rax
addq $-0x3, %rax
incq %rbx
cmpq %rax, %r13
jle 0x1f17e
movq 0x78(%rsp), %rdi
callq 0xe430
movl $0x1, %ebx
jmp 0x1f33d
leaq 0x83120(%rip), %rdi     # 0xa23ba
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x719d2
jmp 0x1f3a6
leaq 0x8311f(%rip), %rdi     # 0xa23d1
movl 0x10(%rsp), %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x719d2
jmp 0x1f33b
leaq 0x83108(%rip), %rdi     # 0xa23d1
movl 0x10(%rsp), %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x719d2
jmp 0x1f33b
leaq 0x8312c(%rip), %rdi     # 0xa240c
movl 0x10(%rsp), %esi
xorl %eax, %eax
callq 0x719d2
jmp 0x1f33b
leaq 0x83118(%rip), %rdi     # 0xa240c
movl 0x10(%rsp), %esi
xorl %eax, %eax
callq 0x719d2
jmp 0x1f33b
leaq 0x83104(%rip), %rdi     # 0xa240c
movl 0x10(%rsp), %esi
xorl %eax, %eax
callq 0x719d2
jmp 0x1f33b
leaq 0x830f0(%rip), %rdi     # 0xa240c
movl 0x10(%rsp), %esi
xorl %eax, %eax
callq 0x719d2
jmp 0x1f33b
leaq 0x830dc(%rip), %rdi     # 0xa240c
movl 0x10(%rsp), %esi
xorl %eax, %eax
callq 0x719d2
xorl %ebx, %ebx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1f354
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0xe450
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1f36b
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0xe450
leaq 0x20(%rsp), %rdi
callq 0x6f876
leaq 0xe8(%rsp), %rdi
callq 0x6f876
leaq 0xa8(%rsp), %rdi
callq 0x6f876
leaq 0xb8(%rsp), %rdi
callq 0x6f876
leaq 0x38(%rsp), %rdi
callq 0x24712
movl %ebx, %eax
addq $0x9a8, %rsp            # imm = 0x9A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
movq %rax, %rbx
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x1f46b
movq 0x120(%rsp), %rsi
jmp 0x1f41d
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
movq %rax, %rbx
movq 0x130(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f46b
movq 0x140(%rsp), %rsi
incq %rsi
jmp 0x1f43b
jmp 0x1f468
jmp 0x1f468
movq %rax, %rbx
movl $0x18, %esi
jmp 0x1f438
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0xe450
jmp 0x1f46b
movq %rax, %rbx
jmp 0x1f4a3
movq %rax, %rbx
jmp 0x1f4b0
movq %rax, %rbx
jmp 0x1f4bd
movq %rax, %rbx
jmp 0x1f4ca
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
jmp 0x1f468
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1f482
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0xe450
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1f499
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0xe450
leaq 0x20(%rsp), %rdi
callq 0x6f876
leaq 0xe8(%rsp), %rdi
callq 0x6f876
leaq 0xa8(%rsp), %rdi
callq 0x6f876
leaq 0xb8(%rsp), %rdi
callq 0x6f876
leaq 0x38(%rsp), %rdi
callq 0x24712
movq %rbx, %rdi
callq 0xe7e0