// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::ReadIfsFile(char const*)
int R3Mesh::
ReadIfsFile(const char *filename)
{
  char buffer[1024];

  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "rb"))) {
    RNFail("Unable to open file %s\n", filename);
    return 0;
  }

  // Read magic string
  if (ReadIfsString(fp, buffer, 1024) < 0) {
    RNFail("Unable to read header of %s", filename);
    return 0;
  }
  if (strcmp(buffer, "IFS")) {
    RNFail("Bad magic string in IFS file header of %s", filename);
    return 0;
  }

  // Read version number
  float version;
  if (fread(&version, sizeof(float), 1, fp) != 1) {
    RNFail("Unable to read version of %s", filename);
    return 0;
  }
  if (version != 1.0) {
    RNFail("Bad version number in file header of %s", filename);
    return 0;
  }

  // Read model name
  if (ReadIfsString(fp, buffer, 1024) < 0) {
    RNFail("Unable to read model name of %s", filename);
    return 0;
  }

  // Read vertex header
  if (ReadIfsString(fp, buffer, 1024) < 0) {
    RNFail("Unable to read vertex header of %s", filename);
    return 0;
  }
  if (strcmp(buffer, "VERTICES")) {
    RNFail("Bad vertex header in %s", filename);
    return 0;
  }

  // Read number of vertices
  unsigned int nverts;
  if (fread(&nverts, sizeof(unsigned int), 1, fp) != 1) {
    RNFail("Unable to read number of vertices in %s", filename);
    return 0;
  }

  // Allocate block of vertices
  vertex_block = new R3MeshVertex [nverts];
  
  // Resize array of vertices
  vertices.Resize(nverts);

  // Read vertices
  for (unsigned int i = 0; i < nverts; i++) {
    float p[3];
    if (fread(p, sizeof(float), 3, fp) != 3) {
      RNFail("Unable to read vertex %d in %s", i, filename);
      return 0;
    }

    // Create mesh vertex
    if (!CreateVertex(R3Point(p[0], p[1], p[2]), &vertex_block[i])) {
      RNFail("Unable to create vertex %d in %s", i, filename);
      return 0;
    }
  }

  // Read triangle header
  if (ReadIfsString(fp, buffer, 1024) < 0) {
    RNFail("Unable to read vertex header of %s", filename);
    return 0;
  }
  if (strcmp(buffer, "TRIANGLES")) {
    RNFail("Bad triangle header in %s", filename);
    return 0;
  }

  // Read number of faces
  unsigned int nfaces;
  if (fread(&nfaces, sizeof(unsigned int), 1, fp) != 1) {
    RNFail("Unable to read number of faces in %s", filename);
    return 0;
  }

  // Allocate block of faces
  face_block = new R3MeshFace [nfaces];

  // Resize array of faces
  faces.Resize(nfaces);

  // Allocate array for degenerate triangles
  RNArray<R3MeshVertex *> degenerate_triangle_vertices;

  // Read triangles
  for (unsigned int i = 0; i < nfaces; i++) {
    int v[3];
    if (fread(v, sizeof(unsigned int), 3, fp) != 3) {
      RNFail("Unable to read vertex index in triangle %d of %s", i, filename);
      return 0;
    }

    // Get vertices
    R3MeshVertex *v0 = vertices[v[0]];
    R3MeshVertex *v1 = vertices[v[1]];
    R3MeshVertex *v2 = vertices[v[2]];

    // Check vertices
    if ((v0 == v1) || (v1 == v2) || (v0 == v2)) continue;

    // Create mesh face
    if (!CreateFace(v0, v1, v2, &face_block[i])) {
      // 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(v0);
      degenerate_triangle_vertices.Insert(v1);
      degenerate_triangle_vertices.Insert(v2);
    }
  }

  // Create degenerate triangles
  for (int i = 0; i <= degenerate_triangle_vertices.NEntries()-3; i+=3) {
    R3MeshVertex *v1 = degenerate_triangle_vertices.Kth(i+0);
    R3MeshVertex *v2 = degenerate_triangle_vertices.Kth(i+1);
    R3MeshVertex *v3 = degenerate_triangle_vertices.Kth(i+2);
    if (!CreateFace(v1, v2, v3)) {
      if (!CreateFace(v1, v3, v2)) {
        // 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));
        CreateFace(v1a, v2a, v3a);
      }
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x608, %rsp            # imm = 0x608
movq %rdi, 0x5f8(%rsp)
movq %rsi, 0x5f0(%rsp)
movq 0x5f8(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x5f0(%rsp), %rdi
leaq 0x1019a3(%rip), %rsi    # 0x1335d9
callq 0xf5e0
movq %rax, 0x1e8(%rsp)
cmpq $0x0, %rax
jne 0x31c6f
movq 0x5f0(%rsp), %rsi
leaq 0x101813(%rip), %rdi    # 0x13346b
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x1e8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x32880
cmpl $0x0, %eax
jge 0x31cb4
movq 0x5f0(%rsp), %rsi
leaq 0x101ac1(%rip), %rdi    # 0x13375e
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
leaq 0x1f0(%rsp), %rdi
leaq 0x101ab7(%rip), %rsi    # 0x13377a
callq 0xf700
cmpl $0x0, %eax
je 0x31cf3
movq 0x5f0(%rsp), %rsi
leaq 0x101aa2(%rip), %rdi    # 0x13377e
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x1e8(%rsp), %rcx
leaq 0x1e4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xf780
cmpq $0x1, %rax
je 0x31d3e
movq 0x5f0(%rsp), %rsi
leaq 0x101a81(%rip), %rdi    # 0x1337a8
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movss 0x1e4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1012b5(%rip), %xmm1   # 0x133008
ucomisd %xmm1, %xmm0
jne 0x31d5d
jp 0x31d5d
jmp 0x31d83
movq 0x5f0(%rsp), %rsi
leaq 0x101a59(%rip), %rdi    # 0x1337c5
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x1e8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x32880
cmpl $0x0, %eax
jge 0x31dc8
movq 0x5f0(%rsp), %rsi
leaq 0x101a3c(%rip), %rdi    # 0x1337ed
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x1e8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x32880
cmpl $0x0, %eax
jge 0x31e0d
movq 0x5f0(%rsp), %rsi
leaq 0x101a17(%rip), %rdi    # 0x13380d
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
leaq 0x1f0(%rsp), %rdi
leaq 0x101a14(%rip), %rsi    # 0x133830
callq 0xf700
cmpl $0x0, %eax
je 0x31e4c
movq 0x5f0(%rsp), %rsi
leaq 0x101a04(%rip), %rdi    # 0x133839
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x1e8(%rsp), %rcx
leaq 0x1e0(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xf780
cmpq $0x1, %rax
je 0x31e97
movq 0x5f0(%rsp), %rsi
leaq 0x1019d1(%rip), %rdi    # 0x133851
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movl 0x1e0(%rsp), %eax
movq %rax, 0x108(%rsp)
movl $0x98, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0x100(%rsp)
callq 0xf030
movq %rax, %rcx
movq 0x108(%rsp), %rax
movq %rcx, 0x110(%rsp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x118(%rsp)
cmpq $0x0, %rax
je 0x31f67
movq 0x118(%rsp), %rax
movq 0x108(%rsp), %rcx
imulq $0x98, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x36460
jmp 0x31f44
movq 0xf0(%rsp), %rcx
movq 0xe8(%rsp), %rax
addq $0x98, %rax
cmpq %rcx, %rax
movq %rax, 0xf8(%rsp)
jne 0x31f2d
movq 0x120(%rsp), %rdi
movq 0x118(%rsp), %rax
movq %rax, 0x38(%rdi)
addq $0x8, %rdi
movl 0x1e0(%rsp), %esi
callq 0xd1a80
movl $0x0, 0x1d0(%rsp)
movl 0x1d0(%rsp), %eax
cmpl 0x1e0(%rsp), %eax
jae 0x32135
leaq 0x1c4(%rsp), %rdi
movq 0x1e8(%rsp), %rcx
movl $0x4, %esi
movl $0x3, %edx
callq 0xf780
cmpq $0x3, %rax
je 0x32082
movl 0x1d0(%rsp), %esi
movq 0x5f0(%rsp), %rdx
leaq 0x101890(%rip), %rdi    # 0x133879
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x118(%rsp), %rcx
movq %rax, %rsi
movq 0xe8(%rsp), %rax
movq %rsi, 0x1d8(%rsp)
movl %edx, 0x1d4(%rsp)
cmpq %rax, %rcx
movq %rax, 0xe0(%rsp)
je 0x32068
movq 0xe0(%rsp), %rdi
addq $-0x98, %rdi
movq %rdi, 0xd8(%rsp)
callq 0x36560
movq 0x118(%rsp), %rcx
movq 0xd8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xe0(%rsp)
jne 0x3202f
movq 0x100(%rsp), %rsi
movq 0x110(%rsp), %rdi
callq 0xf990
jmp 0x32865
movss 0x1c4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x1c8(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x1cc(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x1a8(%rsp), %rdi
callq 0x6eb50
movq 0x120(%rsp), %rdi
movq 0x38(%rdi), %rdx
movl 0x1d0(%rsp), %eax
imulq $0x98, %rax, %rax
addq %rax, %rdx
movq (%rdi), %rax
leaq 0x1a8(%rsp), %rsi
callq *0x20(%rax)
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x320f0
jmp 0x3211d
movl 0x1d0(%rsp), %esi
movq 0x5f0(%rsp), %rdx
leaq 0x101792(%rip), %rdi    # 0x133898
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
jmp 0x3211f
movl 0x1d0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d0(%rsp)
jmp 0x31f96
movq 0x1e8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x32880
cmpl $0x0, %eax
jge 0x3217a
movq 0x5f0(%rsp), %rsi
leaq 0x1016aa(%rip), %rdi    # 0x13380d
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
leaq 0x1f0(%rsp), %rdi
leaq 0x101730(%rip), %rsi    # 0x1338b9
callq 0xf700
cmpl $0x0, %eax
je 0x321b9
movq 0x5f0(%rsp), %rsi
leaq 0x101721(%rip), %rdi    # 0x1338c3
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movq 0x1e8(%rsp), %rcx
leaq 0x1a4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xf780
cmpq $0x1, %rax
je 0x32204
movq 0x5f0(%rsp), %rsi
leaq 0x1016f0(%rip), %rdi    # 0x1338dd
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x604(%rsp)
jmp 0x32856
movl 0x1a4(%rsp), %eax
movq %rax, 0xc0(%rsp)
movl $0xc8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0xb8(%rsp)
callq 0xf030
movq %rax, %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0xc8(%rsp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0xd0(%rsp)
cmpq $0x0, %rax
je 0x322d4
movq 0xd0(%rsp), %rax
movq 0xc0(%rsp), %rcx
imulq $0xc8, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x36680
jmp 0x322b1
movq 0xa8(%rsp), %rcx
movq 0xa0(%rsp), %rax
addq $0xc8, %rax
cmpq %rcx, %rax
movq %rax, 0xb0(%rsp)
jne 0x3229a
movq 0x120(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq %rax, 0x48(%rdi)
addq $0x28, %rdi
movl 0x1a4(%rsp), %esi
callq 0xd1a80
leaq 0x190(%rsp), %rdi
callq 0x36800
movl $0x0, 0x18c(%rsp)
movl 0x18c(%rsp), %eax
cmpl 0x1a4(%rsp), %eax
jae 0x325bf
movq 0x1e8(%rsp), %rcx
leaq 0x180(%rsp), %rdi
movl $0x4, %esi
movl $0x3, %edx
callq 0xf780
movq %rax, 0x98(%rsp)
jmp 0x3234d
movq 0x98(%rsp), %rax
cmpq $0x3, %rax
je 0x32441
movl 0x18c(%rsp), %esi
movq 0x5f0(%rsp), %rdx
leaq 0x10158d(%rip), %rdi    # 0x133902
xorl %eax, %eax
callq 0xd4f30
jmp 0x3237e
movl $0x0, 0x604(%rsp)
movl $0x1, 0x17c(%rsp)
jmp 0x32849
movq 0xd0(%rsp), %rcx
movq %rax, %rsi
movq 0xa0(%rsp), %rax
movq %rsi, 0x1d8(%rsp)
movl %edx, 0x1d4(%rsp)
cmpq %rax, %rcx
movq %rax, 0x90(%rsp)
je 0x32401
movq 0x90(%rsp), %rdi
addq $-0xc8, %rdi
movq %rdi, 0x88(%rsp)
callq 0x367a0
movq 0xd0(%rsp), %rcx
movq 0x88(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x90(%rsp)
jne 0x323c8
movq 0xb8(%rsp), %rsi
movq 0xc8(%rsp), %rdi
callq 0xf990
jmp 0x32865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x36850
jmp 0x32865
movq 0x120(%rsp), %rdi
addq $0x8, %rdi
movl 0x180(%rsp), %esi
callq 0x37800
movq %rax, 0x80(%rsp)
jmp 0x32463
movq 0x120(%rsp), %rdi
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x170(%rsp)
addq $0x8, %rdi
movl 0x184(%rsp), %esi
callq 0x37800
movq %rax, 0x78(%rsp)
jmp 0x32495
movq 0x120(%rsp), %rdi
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x168(%rsp)
addq $0x8, %rdi
movl 0x188(%rsp), %esi
callq 0x37800
movq %rax, 0x70(%rsp)
jmp 0x324c4
movq 0x70(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x160(%rsp)
movq 0x170(%rsp), %rax
cmpq 0x168(%rsp), %rax
je 0x3250a
movq 0x168(%rsp), %rax
cmpq 0x160(%rsp), %rax
je 0x3250a
movq 0x170(%rsp), %rax
cmpq 0x160(%rsp), %rax
jne 0x3250f
jmp 0x325a9
movq 0x120(%rsp), %rdi
movq 0x170(%rsp), %rsi
movq 0x168(%rsp), %rdx
movq 0x160(%rsp), %rcx
movq (%rdi), %rax
movq 0x48(%rdi), %r8
movl 0x18c(%rsp), %r9d
imulq $0xc8, %r9, %r9
addq %r9, %r8
movq 0x48(%rax), %rax
callq *%rax
movq %rax, 0x68(%rsp)
jmp 0x32555
movq 0x68(%rsp), %rax
cmpq $0x0, %rax
jne 0x325a7
movq 0x170(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0x37410
jmp 0x32577
movq 0x168(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0x37410
jmp 0x3258e
movq 0x160(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0x37410
jmp 0x325a5
jmp 0x325a7
jmp 0x325a9
movl 0x18c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18c(%rsp)
jmp 0x32310
movl $0x0, 0x15c(%rsp)
movl 0x15c(%rsp), %eax
movl %eax, 0x60(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x13600
movl %eax, 0x64(%rsp)
jmp 0x325e8
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x32824
movl 0x15c(%rsp), %esi
leaq 0x190(%rsp), %rdi
callq 0x377e0
movq %rax, 0x58(%rsp)
jmp 0x32616
movq 0x58(%rsp), %rax
movq %rax, 0x150(%rsp)
movl 0x15c(%rsp), %esi
incl %esi
leaq 0x190(%rsp), %rdi
callq 0x377e0
movq %rax, 0x50(%rsp)
jmp 0x32640
movq 0x50(%rsp), %rax
movq %rax, 0x148(%rsp)
movl 0x15c(%rsp), %esi
addl $0x2, %esi
leaq 0x190(%rsp), %rdi
callq 0x377e0
movq %rax, 0x48(%rsp)
jmp 0x3266b
movq 0x120(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x150(%rsp), %rsi
movq 0x148(%rsp), %rdx
movq 0x140(%rsp), %rcx
movq (%rdi), %rax
movq 0x48(%rax), %rax
xorl %r8d, %r8d
callq *%rax
movq %rax, 0x40(%rsp)
jmp 0x326ab
movq 0x40(%rsp), %rax
cmpq $0x0, %rax
jne 0x3280c
movq 0x120(%rsp), %rdi
movq 0x150(%rsp), %rsi
movq 0x140(%rsp), %rdx
movq 0x148(%rsp), %rcx
movq (%rdi), %rax
movq 0x48(%rax), %rax
xorl %r8d, %r8d
callq *%rax
movq %rax, 0x38(%rsp)
jmp 0x326ed
movq 0x38(%rsp), %rax
cmpq $0x0, %rax
jne 0x3280a
movq 0x120(%rsp), %rdi
movq 0x150(%rsp), %rsi
callq 0x13660
movq %rax, 0x30(%rsp)
jmp 0x32718
movq 0x30(%rsp), %rsi
movq 0x120(%rsp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movq %rax, 0x28(%rsp)
jmp 0x32739
movq 0x120(%rsp), %rdi
movq 0x28(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x148(%rsp), %rsi
callq 0x13660
movq %rax, 0x20(%rsp)
jmp 0x32762
movq 0x20(%rsp), %rsi
movq 0x120(%rsp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movq %rax, 0x18(%rsp)
jmp 0x32783
movq 0x120(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x140(%rsp), %rsi
callq 0x13660
movq %rax, 0x10(%rsp)
jmp 0x327ac
movq 0x10(%rsp), %rsi
movq 0x120(%rsp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movq %rax, 0x8(%rsp)
jmp 0x327cd
movq 0x120(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x138(%rsp), %rsi
movq 0x130(%rsp), %rdx
movq 0x128(%rsp), %rcx
movq (%rdi), %rax
movq 0x48(%rax), %rax
xorl %r8d, %r8d
callq *%rax
jmp 0x32808
jmp 0x3280a
jmp 0x3280c
jmp 0x3280e
movl 0x15c(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x15c(%rsp)
jmp 0x325ca
movq 0x1e8(%rsp), %rdi
callq 0xf4b0
jmp 0x32833
movl $0x1, 0x604(%rsp)
movl $0x1, 0x17c(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x36850
movl 0x604(%rsp), %eax
addq $0x608, %rsp            # imm = 0x608
retq
movq 0x1d8(%rsp), %rdi
callq 0xf890
nopw %cs:(%rax,%rax)