LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Frustum.cpp
// Function: gaps::R3Frustum::BSphere() const
const R3Sphere R3Frustum::
BSphere(void) const
{
  // Return bounding sphere
  R3Point centroid = Centroid();
  R3Point corner = Corner(RN_HI, RN_HI, RN_HI);
  RNLength radius = R3Distance(centroid, corner);
  return R3Sphere(centroid, radius);
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x58(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rsi), %rax
leaq 0x40(%rsp), %rdi
callq *0x68(%rax)
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movl $0x1, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0xc6160
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x8e7e0
movq 0x10(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
leaq 0x40(%rsp), %rsi
callq 0xc71a0
movq 0x18(%rsp), %rax
addq $0x68, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Frustum.cpp
// Function: gaps::R3Frustum::Empty()
void R3Frustum::
Empty(void)
{
  // Reset coordinate system
  cs = R3xyz_coordinate_system;

  // Reset fovs
  xfov = 0;
  yfov = 0;

  // Reset near and far dists
  neardist = 0;
  fardist = 0;
  
  // Reset halfspaces
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      halfspaces[dir][dim] = R3null_halfspace;
    }
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
addq $0x8, %rdi
leaq 0x136e33(%rip), %rsi    # 0x1fd580
callq 0x457f0
movq (%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x128(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x130(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x138(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x140(%rax)
movl $0x0, 0xc(%rsp)
cmpl $0x2, 0xc(%rsp)
jge 0xc67e8
movl $0x0, 0x8(%rsp)
cmpl $0x3, 0x8(%rsp)
jge 0xc67d9
movq (%rsp), %rdi
addq $0x68, %rdi
movslq 0xc(%rsp), %rax
imulq $0x60, %rax, %rax
addq %rax, %rdi
movslq 0x8(%rsp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq 0x537439(%rip), %rsi    # 0x5fdc00
callq 0xc6f50
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xc6799
jmp 0xc67db
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xc678a
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Frustum.cpp
// Function: gaps::R3Frustum::Transform(gaps::R3Transformation const&)
void R3Frustum::
Transform(const R3Transformation& transformation)
{
  // Assumes rigid transformation
  // xfov, yfov stay same

  // Transform coordinate system
  cs.Transform(transformation);

  // Transform halfspaces
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      halfspaces[dir][dim].Transform(transformation);
    }
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x8, %rdi
movq 0x18(%rsp), %rsi
callq 0xd58b0
movl $0x0, 0x14(%rsp)
cmpl $0x2, 0x14(%rsp)
jge 0xc687b
movl $0x0, 0x10(%rsp)
cmpl $0x3, 0x10(%rsp)
jge 0xc686c
movq 0x8(%rsp), %rdi
addq $0x68, %rdi
movslq 0x14(%rsp), %rax
imulq $0x60, %rax, %rax
addq %rax, %rdi
movslq 0x10(%rsp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0xf5900
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xc682d
jmp 0xc686e
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xc681e
addq $0x28, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PlanarGrid.cpp
// Function: gaps::R3PlanarGrid::ReadFile(char const*)
int R3PlanarGrid::
ReadFile(const char *filename)
{
  // Parse input filename extension
  const char *input_extension;
  if (!(input_extension = strrchr(filename, '.'))) {
    RNFail("Input file has no extension (e.g., .pfm).\n");
    return 0;
  }
  
  // Read file of appropriate type
  if (!strncmp(input_extension, ".grd", 4)) return ReadGridFile(filename);
  
  // Should never get here
  RNFail("Unrecognized image file extension");
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x2e, %esi
callq 0x13630
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0xddeb9
leaq 0xc8ae8(%rip), %rdi     # 0x1a6990
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0xddefe
movq 0x8(%rsp), %rdi
leaq 0xc8af6(%rip), %rsi     # 0x1a69bb
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0xddee8
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xddf10
movl %eax, 0x24(%rsp)
jmp 0xddefe
leaq 0xc8ad1(%rip), %rdi     # 0x1a69c0
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PlanarGrid.cpp
// Function: gaps::R3PlanarGrid::ReadGridFile(char const*)
int R3PlanarGrid::
ReadGridFile(const char *filename)
{
  // Open file
  FILE *fp = stdin;
  if (filename) {
    fp = fopen(filename, "rb");
    if (!fp) {
      RNFail("Unable to open file %s", filename);
      return 0;
    }
  }

  // Read file
  int status = ReadGrid(fp);
  if (!status) return 0;

  // Close file
  fclose(fp);

  // Return number of grid values read
  return status;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x115089(%rip), %rax    # 0x1f2fb8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0xddf7c
movq 0x20(%rsp), %rdi
leaq 0xc62aa(%rip), %rsi     # 0x1a41f5
callq 0x13690
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0xddf7a
movq 0x20(%rsp), %rsi
leaq 0xc7ef8(%rip), %rdi     # 0x1a5e61
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x34(%rsp)
jmp 0xddfb2
jmp 0xddf7c
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xde110
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jne 0xddfa0
movl $0x0, 0x34(%rsp)
jmp 0xddfb2
movq 0x18(%rsp), %rdi
callq 0x13560
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PlanarGrid.cpp
// Function: gaps::R3PlanarGrid::WriteFile(char const*) const
int R3PlanarGrid::
WriteFile(const char *filename) const
{
  // Parse input filename extension
  const char *input_extension;
  if (!(input_extension = strrchr(filename, '.'))) {
    RNFail("Output file has no extension (e.g., .pfm).\n");
    return 0;
  }
  
  // Write file of appropriate type
  if (!strncmp(input_extension, ".grd", 4)) return WriteGridFile(filename);

  // Should never get here
  RNFail("Unrecognized image file extension");
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x2e, %esi
callq 0x13630
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0xde009
leaq 0xc89ea(%rip), %rdi     # 0x1a69e2
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0xde04e
movq 0x8(%rsp), %rdi
leaq 0xc89a6(%rip), %rsi     # 0x1a69bb
movl $0x4, %edx
callq 0x13260
cmpl $0x0, %eax
jne 0xde038
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xde060
movl %eax, 0x24(%rsp)
jmp 0xde04e
leaq 0xc8981(%rip), %rdi     # 0x1a69c0
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PlanarGrid.cpp
// Function: gaps::R3PlanarGrid::WriteGridFile(char const*) const
int R3PlanarGrid::
WriteGridFile(const char *filename) const
{
  // Open file
  FILE *fp = stdout;
  if (filename) {
    fp = fopen(filename, "wb");
    if (!fp) {
      RNFail("Unable to open file %s", filename);
      return 0;
    }
  }

  // Write file
  int status = WriteGrid(fp);
  if (!status) return 0;

  // Close file
  fclose(fp);

  // Return number of grid values written
  return status;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x114f11(%rip), %rax    # 0x1f2f90
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0xde0cc
movq 0x20(%rsp), %rdi
leaq 0xc707c(%rip), %rsi     # 0x1a5117
callq 0x13690
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0xde0ca
movq 0x20(%rsp), %rsi
leaq 0xc7da8(%rip), %rdi     # 0x1a5e61
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x34(%rsp)
jmp 0xde102
jmp 0xde0cc
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xde300
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jne 0xde0f0
movl $0x0, 0x34(%rsp)
jmp 0xde102
movq 0x18(%rsp), %rdi
callq 0x13560
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PlanarGrid.cpp
// Function: gaps::R3PlanarGrid::ReadGrid(_IO_FILE*)
int R3PlanarGrid::
ReadGrid(FILE *fp)
{
  // Read grid 
  if (!grid.ReadGrid(fp)) return 0;

  // Read plane from file
  RNScalar p[4];
  if (fread(p, sizeof(RNScalar), 4, fp) != 4) {
    RNFail("Unable to read plane from file");
    return 0;
  }

  // Read bounding box from file
  RNScalar b[6];
  if (fread(b, sizeof(RNScalar), 6, fp) != 6) {
    RNFail("Unable to read bounding box from file");
    return 0;
  }

  // Read transformation from file
  RNScalar m[16];
  if (fread(m, sizeof(RNScalar), 16, fp) != 16) {
    RNFail("Unable to read transformation matrix from file");
    return 0;
  }

  // Update variables
  transformation.Reset(R4Matrix(m));
  plane = R3Plane(p);
  bbox.Reset(R3Point(b[0], b[1], b[2]), R3Point(b[3], b[4], b[5]));

  // Return success
  return 1;
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1c8(%rsp)
movq %rsi, 0x1c0(%rsp)
movq 0x1c8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
addq $0x130, %rdi            # imm = 0x130
movq 0x1c0(%rsp), %rsi
callq 0xdec30
cmpl $0x0, %eax
jne 0xde15d
movl $0x0, 0x1d4(%rsp)
jmp 0xde2f1
leaq 0x1a0(%rsp), %rdi
movq 0x1c0(%rsp), %rcx
movl $0x8, %esi
movl $0x4, %edx
callq 0x13860
cmpq $0x4, %rax
je 0xde1a0
leaq 0xc8885(%rip), %rdi     # 0x1a6a0e
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x1d4(%rsp)
jmp 0xde2f1
leaq 0x170(%rsp), %rdi
movq 0x1c0(%rsp), %rcx
movl $0x8, %esi
movl $0x6, %edx
callq 0x13860
cmpq $0x6, %rax
je 0xde1e3
leaq 0xc8861(%rip), %rdi     # 0x1a6a2d
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x1d4(%rsp)
jmp 0xde2f1
leaq 0xf0(%rsp), %rdi
movq 0x1c0(%rsp), %rcx
movl $0x8, %esi
movl $0x10, %edx
callq 0x13860
cmpq $0x10, %rax
je 0xde226
leaq 0xc8844(%rip), %rdi     # 0x1a6a53
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x1d4(%rsp)
jmp 0xde2f1
movq 0x18(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x8(%rsp)
leaq 0xf0(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0xd8d70
movq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
xorl %edx, %edx
callq 0xd52b0
leaq 0x1a0(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0xf5a30
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x44240
movq 0x18(%rsp), %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, 0x10(%rsp)
movsd 0x170(%rsp), %xmm0
movsd 0x178(%rsp), %xmm1
movsd 0x180(%rsp), %xmm2
leaq 0x38(%rsp), %rdi
callq 0xf8350
movsd 0x188(%rsp), %xmm0
movsd 0x190(%rsp), %xmm1
movsd 0x198(%rsp), %xmm2
leaq 0x20(%rsp), %rdi
callq 0xf8350
movq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0xcc250
movl $0x1, 0x1d4(%rsp)
movl 0x1d4(%rsp), %eax
addq $0x1d8, %rsp            # imm = 0x1D8
retq
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::~R2PixelDatabase()
R2PixelDatabase::
~R2PixelDatabase(void)
{
  // Delete name
  if (name) free(name);

  // Delete filename
  if (filename) free(filename);

  // Delete rwaccess
  if (rwaccess) free(rwaccess);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xcd896(%rip), %rcx     # 0x1f2270
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x10(%rax)
je 0x1249f6
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x136a0
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x124a10
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x136a0
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x124a2a
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x136a0
movq 0x8(%rsp), %rdi
addq $0x48, %rdi
callq 0x126b80
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x126be0
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::FindImage(char const*, gaps::R2Image*) const
int R2PixelDatabase::
FindImage(const char *key, R2Image *image) const
{
  // Find entry
  R2PixelDatabaseEntry entry;
  if (!map.Find(key, &entry)) return FALSE;

  // Read image
  if (image) {
    // Seek to start of entry
    RNFileSeek(fp, entry.seek, RN_FILE_SEEK_SET);
  
    // Read entry
    if (!image->ReadPNGStream(fp)) {
      RNFail("Error reading %s from pixel database\n", key);
      return FALSE;
    }
  }

  // Return success
  return TRUE;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x118(%rsp)
movq %rsi, 0x110(%rsp)
movq %rdx, 0x108(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x60(%rsp), %rdi
xorps %xmm0, %xmm0
movsd 0x7f647(%rip), %xmm2    # 0x1a4168
movq %r8, %rsi
movl %ecx, %edx
movaps %xmm2, %xmm1
callq 0x126bf0
movq 0x8(%rsp), %rax
addq $0x40, %rax
movq %rax, 0x10(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x13980
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0xbd8c0
jmp 0x124b6e
movq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x126ca0
movl %eax, 0x4(%rsp)
jmp 0x124b88
movl 0x4(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, 0x3(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x13340
leaq 0x3f(%rsp), %rdi
callq 0x135f0
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x124bb6
jmp 0x124bfa
movl $0x0, 0x124(%rsp)
jmp 0x124c68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x124bee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x13340
leaq 0x3f(%rsp), %rdi
callq 0x135f0
jmp 0x124c77
cmpq $0x0, 0x108(%rsp)
je 0x124c5d
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0xe8(%rsp), %rsi
xorl %edx, %edx
callq 0x145360
movq 0x8(%rsp), %rax
movq 0x108(%rsp), %rdi
movq 0x8(%rax), %rsi
callq 0x13aa60
cmpl $0x0, %eax
jne 0x124c5b
movq 0x110(%rsp), %rsi
leaq 0x83f81(%rip), %rdi     # 0x1a8bc8
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x124(%rsp)
jmp 0x124c68
jmp 0x124c5d
movl $0x1, 0x124(%rsp)
movl 0x124(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
retq
movq 0x30(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::GetFormat(char const*) const
int R2PixelDatabase::
GetFormat(const char *key) const
{
  // Find entry
  R2PixelDatabaseEntry entry;
  if (!map.Find(key, &entry)) return -1;
  return entry.format;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x118(%rsp)
movq %rsi, 0x110(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x10(%rsp)
xorl %ecx, %ecx
movl %ecx, %r8d
leaq 0x68(%rsp), %rdi
xorps %xmm0, %xmm0
movsd 0x7f20f(%rip), %xmm2    # 0x1a4168
movq %r8, %rsi
movl %ecx, %edx
movaps %xmm2, %xmm1
callq 0x126bf0
movq 0x10(%rsp), %rax
addq $0x40, %rax
movq %rax, 0x18(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x47(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x13980
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0xbd8c0
jmp 0x124fa6
movq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x126ca0
movl %eax, 0xc(%rsp)
jmp 0x124fc0
movl 0xc(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, 0xb(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x13340
leaq 0x47(%rsp), %rdi
callq 0x135f0
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x124fee
jmp 0x12502f
movl $0xffffffff, 0x124(%rsp) # imm = 0xFFFFFFFF
jmp 0x12503d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
jmp 0x125023
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x13340
leaq 0x47(%rsp), %rdi
callq 0x135f0
jmp 0x12504c
movl 0xe8(%rsp), %eax
movl %eax, 0x124(%rsp)
movl 0x124(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
retq
movq 0x38(%rsp), %rdi
callq 0x13970
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::Remove(char const*)
int R2PixelDatabase::
Remove(const char *key)
{
  // Remove entry from map
  map.Remove(key);

  // Remove key
  std::vector<std::string>::iterator it = std::find(keys.begin(), keys.end(), key);
  if (it != keys.end()) keys.erase(it);
  
  // Leaves hole in file where pixels were :(

  // Decrement number of entries
  entries_count--;

  // Return success
  return 1;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x40, %rax
movq %rax, 0x18(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x77(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x13980
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0xbd8c0
jmp 0x12588f
movq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x126db0
jmp 0x1258a0
leaq 0x78(%rsp), %rdi
callq 0x13340
leaq 0x77(%rsp), %rdi
callq 0x135f0
movq 0x10(%rsp), %rdi
addq $0x48, %rdi
callq 0x126e90
movq 0x10(%rsp), %rdi
movq %rax, 0x50(%rsp)
addq $0x48, %rdi
callq 0x126ec0
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x126e30
movq 0x10(%rsp), %rdi
movq %rax, 0x58(%rsp)
addq $0x48, %rdi
callq 0x126ec0
movq %rax, 0x40(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x126ef0
testb $0x1, %al
jne 0x12591e
jmp 0x125985
movq 0x10(%rsp), %rax
addq $0x48, %rax
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x126fa0
movq 0x8(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x126f30
movq %rax, 0x30(%rsp)
jmp 0x125985
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x125979
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x13340
leaq 0x77(%rsp), %rdi
callq 0x135f0
jmp 0x1259a0
movq 0x10(%rsp), %rax
movl 0x34(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x34(%rax)
movl $0x1, %eax
addq $0xa8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x13970
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::CloseFile()
int R2PixelDatabase::
CloseFile(void)
{
  // Check if writing file
  if (strcmp(rwaccess, "rb")) {
    // Write entries
    if (!WriteEntries(fp, swap_endian)) return 0;

    // Write header again (now that the seek values have been filled in)
    if (!WriteHeader(fp, swap_endian)) return 0;
  }

  // Close file
  fclose(fp);
  fp = NULL;
  
  // Reset filename
  if (filename) free(filename);
  filename = NULL;

  // Reset rwaccess
  if (rwaccess) free(rwaccess);
  rwaccess = NULL;

  // Return success
  return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rax), %rdi
leaq 0x7e648(%rip), %rsi     # 0x1a41f5
callq 0x137e0
cmpl $0x0, %eax
je 0x125bff
movq (%rsp), %rdi
movq 0x8(%rdi), %rsi
movl 0x30(%rdi), %edx
movq (%rdi), %rax
callq *0x80(%rax)
cmpl $0x0, %eax
jne 0x125bdd
movl $0x0, 0x14(%rsp)
jmp 0x125c60
movq (%rsp), %rdi
movq 0x8(%rdi), %rsi
movl 0x30(%rdi), %edx
movq (%rdi), %rax
callq *0x70(%rax)
cmpl $0x0, %eax
jne 0x125bfd
movl $0x0, 0x14(%rsp)
jmp 0x125c60
jmp 0x125bff
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x13560
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0x18(%rax)
je 0x125c2c
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x136a0
movq (%rsp), %rax
movq $0x0, 0x18(%rax)
cmpq $0x0, 0x20(%rax)
je 0x125c4c
movq (%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x136a0
movq (%rsp), %rax
movq $0x0, 0x20(%rax)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::OpenStream(_IO_FILE*, char const*)
int R2PixelDatabase::
OpenStream(FILE *fp, const char *rwaccess)
{
  // Set dummy file name
  if (this->filename) free(this->filename);
  this->filename = RNStrdup("stream");

  // Parse rwaccess
  if (this->rwaccess) free(this->rwaccess);
  if (!rwaccess) this->rwaccess = RNStrdup("w+b");
  else if (strstr(rwaccess, "w")) this->rwaccess = RNStrdup("w+b");
  else if (strstr(rwaccess, "+")) this->rwaccess = RNStrdup("r+b");
  else this->rwaccess = RNStrdup("rb"); 

  // Check if file is new
  if (!strcmp(this->rwaccess, "w+b")) {
    // Just checking ...
    assert(entries_count == 0);

    // File is new -- write header
    if (!WriteHeader(fp, 0)) return 0;

    // Update entries info
    entries_seek = RNFileTell(fp);
  }
  else {
    // Read header
    if (!ReadHeader(fp)) return 0;

    // Read entries
    if (!ReadEntries(fp, swap_endian)) return 0;
  }

  // Remember file
  this->fp = fp;

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x18(%rax)
je 0x125ca0
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x136a0
leaq 0x85d1e(%rip), %rdi     # 0x1ab9c5
callq 0x1461b0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x20(%rax)
je 0x125ccb
movq (%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x136a0
cmpq $0x0, 0x8(%rsp)
jne 0x125cec
leaq 0x7ff92(%rip), %rdi     # 0x1a5c6c
callq 0x1461b0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x125d67
movq 0x8(%rsp), %rdi
leaq 0x81206(%rip), %rsi     # 0x1a6efe
callq 0x13120
cmpq $0x0, %rax
je 0x125d1c
leaq 0x7ff62(%rip), %rdi     # 0x1a5c6c
callq 0x1461b0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x125d65
movq 0x8(%rsp), %rdi
leaq 0x7e6d1(%rip), %rsi     # 0x1a43f9
callq 0x13120
cmpq $0x0, %rax
je 0x125d4c
leaq 0x7ff36(%rip), %rdi     # 0x1a5c70
callq 0x1461b0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x125d63
leaq 0x7e4a2(%rip), %rdi     # 0x1a41f5
callq 0x1461b0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x125d65
jmp 0x125d67
movq (%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x7fef6(%rip), %rsi     # 0x1a5c6c
callq 0x137e0
cmpl $0x0, %eax
jne 0x125db7
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
xorl %edx, %edx
callq *0x70(%rax)
cmpl $0x0, %eax
jne 0x125da0
movl $0x0, 0x24(%rsp)
jmp 0x125e0d
movq 0x10(%rsp), %rdi
callq 0x1453b0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x38(%rax)
jmp 0x125df8
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x68(%rax)
cmpl $0x0, %eax
jne 0x125dd5
movl $0x0, 0x24(%rsp)
jmp 0x125e0d
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x30(%rdi), %edx
movq (%rdi), %rax
callq *0x78(%rax)
cmpl $0x0, %eax
jne 0x125df6
movl $0x0, 0x24(%rsp)
jmp 0x125e0d
jmp 0x125df8
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::CloseStream()
int R2PixelDatabase::
CloseStream(void)
{
  // Check if writing file
  if (strcmp(rwaccess, "rb")) {
    // Write entries
    if (!WriteEntries(fp, swap_endian)) return 0;

    // Get position at end of stream
    unsigned long long end_of_stream = RNFileTell(fp);
    
    // Write header again (now that the seek values have been filled in)
    if (!WriteHeader(fp, swap_endian)) return 0;

    // Seek back to end of stream
    RNFileSeek(fp, end_of_stream, RN_FILE_SEEK_SET);
  }

  // Reset filename
  if (filename) free(filename);
  filename = NULL;

  // Reset rwaccess
  if (rwaccess) free(rwaccess);
  rwaccess = NULL;

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rax), %rdi
leaq 0x7e3b7(%rip), %rsi     # 0x1a41f5
callq 0x137e0
cmpl $0x0, %eax
je 0x125eb8
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rsi
movl 0x30(%rdi), %edx
movq (%rdi), %rax
callq *0x80(%rax)
cmpl $0x0, %eax
jne 0x125e6f
movl $0x0, 0x24(%rsp)
jmp 0x125f09
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1453b0
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x8(%rdi), %rsi
movl 0x30(%rdi), %edx
movq (%rdi), %rax
callq *0x70(%rax)
cmpl $0x0, %eax
jne 0x125ea3
movl $0x0, 0x24(%rsp)
jmp 0x125f09
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x145360
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x125ed2
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x136a0
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
cmpq $0x0, 0x20(%rax)
je 0x125ef4
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x136a0
movq 0x8(%rsp), %rax
movq $0x0, 0x20(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::WriteHeader(_IO_FILE*, int)
int R2PixelDatabase::
WriteHeader(FILE *fp, int swap_endian)
{
  // Seek to beginning of file
  RNFileSeek(fp, 0, RN_FILE_SEEK_SET);

  // Get convenient variables
  unsigned int endian_test = 1;
  char magic[32] = { '\0' };
  strncpy(magic, "R2PixelDatabase", 32);
  char buffer[1024] = { '\0' };

  // Write header
  if (!RNWriteChar(fp, magic, 32, swap_endian)) return 0;
  if (!RNWriteUnsignedInt(fp, &endian_test, 1, swap_endian)) return 0;
  if (!RNWriteUnsignedInt(fp, &endian_test, 1, swap_endian)) return 0;
  if (!RNWriteUnsignedInt(fp, &major_version, 1, swap_endian)) return 0;
  if (!RNWriteUnsignedInt(fp, &minor_version, 1, swap_endian)) return 0;
  if (!RNWriteUnsignedLongLong(fp, &entries_seek, 1, swap_endian)) return 0;
  if (!RNWriteUnsignedInt(fp, &entries_count, 1, swap_endian)) return 0;
  if (!RNWriteChar(fp, buffer, 1024, swap_endian)) return 0;
  
  // Return success
  return 1;
}

// Assembly:
subq $0x458, %rsp            # imm = 0x458
movq %rdi, 0x448(%rsp)
movq %rsi, 0x440(%rsp)
movl %edx, 0x43c(%rsp)
movq 0x448(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x440(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x145360
movl $0x1, 0x438(%rsp)
leaq 0x410(%rsp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x132c0
leaq 0x410(%rsp), %rdi
leaq 0x829f2(%rip), %rsi     # 0x1a8bee
movl $0x20, %edx
callq 0x132a0
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x132c0
movq 0x440(%rsp), %rdi
leaq 0x410(%rsp), %rsi
movl 0x43c(%rsp), %ecx
movl $0x20, %edx
callq 0x145a90
cmpl $0x0, %eax
jne 0x12624d
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x440(%rsp), %rdi
movl 0x43c(%rsp), %ecx
leaq 0x438(%rsp), %rsi
movl $0x1, %edx
callq 0x145d20
cmpl $0x0, %eax
jne 0x126283
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x440(%rsp), %rdi
movl 0x43c(%rsp), %ecx
leaq 0x438(%rsp), %rsi
movl $0x1, %edx
callq 0x145d20
cmpl $0x0, %eax
jne 0x1262b9
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x8(%rsp), %rsi
movq 0x440(%rsp), %rdi
addq $0x28, %rsi
movl 0x43c(%rsp), %ecx
movl $0x1, %edx
callq 0x145d20
cmpl $0x0, %eax
jne 0x1262f0
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x8(%rsp), %rsi
movq 0x440(%rsp), %rdi
addq $0x2c, %rsi
movl 0x43c(%rsp), %ecx
movl $0x1, %edx
callq 0x145d20
cmpl $0x0, %eax
jne 0x126327
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x8(%rsp), %rsi
movq 0x440(%rsp), %rdi
addq $0x38, %rsi
movl 0x43c(%rsp), %ecx
movl $0x1, %edx
callq 0x145f60
cmpl $0x0, %eax
jne 0x12635b
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x8(%rsp), %rsi
movq 0x440(%rsp), %rdi
addq $0x34, %rsi
movl 0x43c(%rsp), %ecx
movl $0x1, %edx
callq 0x145d20
cmpl $0x0, %eax
jne 0x12638f
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movq 0x440(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl 0x43c(%rsp), %ecx
movl $0x400, %edx            # imm = 0x400
callq 0x145a90
cmpl $0x0, %eax
jne 0x1263bf
movl $0x0, 0x454(%rsp)
jmp 0x1263ca
movl $0x1, 0x454(%rsp)
movl 0x454(%rsp), %eax
addq $0x458, %rsp            # imm = 0x458
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNFileExists(char const*)
RNBoolean
RNFileExists(const char *filename)
{
    // Return whether or not file exists (and is readable)
    FILE *fp = fopen(filename, "rb");
    if (!fp) return FALSE;
    fclose(fp); 
    return TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x5ef50(%rip), %rsi     # 0x1a41f5
callq 0x13690
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x1452bf
movl $0x0, 0x14(%rsp)
jmp 0x1452d0
movq (%rsp), %rdi
callq 0x13560
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNFileSize(char const*)
unsigned long long
RNFileSize(const char *filename)
{
#if 1
    // Return size of file in bytes
    FILE *fp = fopen(filename, "r");
    if (!fp) return 0;
    RNFileSeek(fp, 0, RN_FILE_SEEK_END);
    unsigned long long file_size = RNFileTell(fp);
    fclose(fp);
    return file_size;
#else
    // Requires "unistd.h"
    struct stat stat_buf;
    int rc = fstat(filename, &stat_buf);
    if (rc == 0) return 0;
    else return stat_buf.st_size;
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x6605e(%rip), %rsi     # 0x1ab353
callq 0x13690
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x145312
movq $0x0, 0x20(%rsp)
jmp 0x145348
movq 0x10(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x145360
movq 0x10(%rsp), %rdi
callq 0x1453b0
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x13560
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadChar(_IO_FILE*, char*, int, int)
int 
RNReadChar(FILE *fp, char *ptr, int count, int /* swap_endian */)
{
  // Read the values
  if (fread(ptr, sizeof(char), count, fp) != (size_t) count) {
    RNFail("Unable to read char from file\n");
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x1, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145411
leaq 0x63f40(%rip), %rdi     # 0x1a9340
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x145419
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadUnsignedChar(_IO_FILE*, unsigned char*, int, int)
int 
RNReadUnsignedChar(FILE *fp, unsigned char *ptr, int count, int /* swap_endian */)
{
  // Read the values
  if (fread(ptr, sizeof(unsigned char), count, fp) != (size_t) count) {
    RNFail("Unable to read unsigned char from file\n");
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x1, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145481
leaq 0x63eef(%rip), %rdi     # 0x1a935f
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x145489
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadShort(_IO_FILE*, short*, int, int)
int 
RNReadShort(FILE *fp, short *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(short), count, fp) != (size_t) count) {
    RNFail("Unable to read short from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap2(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x2, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x1454f1
leaq 0x63ea7(%rip), %rdi     # 0x1a9387
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x14550e
cmpl $0x0, 0x8(%rsp)
je 0x145506
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145520
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNSwap2(void*, int)
void
RNSwap2(void *values, int count)
{
  // Swap endian of 2-byte data type
  unsigned short *y = (unsigned short *) values;
  for (int i = 0; i < count; i++) {
    unsigned short x = y[i];
    y[i] = (x<<8) | (x>>8);
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0x145588
movq -0x18(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movw (%rax,%rcx,2), %ax
movw %ax, -0x1e(%rsp)
movzwl -0x1e(%rsp), %eax
shll $0x8, %eax
movzwl -0x1e(%rsp), %ecx
sarl $0x8, %ecx
orl %ecx, %eax
movw %ax, %dx
movq -0x18(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x14553b
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadUnsignedShort(_IO_FILE*, unsigned short*, int, int)
int 
RNReadUnsignedShort(FILE *fp, unsigned short *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(unsigned short), count, fp) != (size_t) count) {
    RNFail("Unable to read unsigned short from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap2(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x2, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x1455e1
leaq 0x63dd7(%rip), %rdi     # 0x1a93a7
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x1455fe
cmpl $0x0, 0x8(%rsp)
je 0x1455f6
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145520
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadInt(_IO_FILE*, int*, int, int)
int 
RNReadInt(FILE *fp, int *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(int), count, fp) != (size_t) count) {
    RNFail("Unable to read integer from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap4(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x4, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145661
leaq 0x63d80(%rip), %rdi     # 0x1a93d0
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x14567e
cmpl $0x0, 0x8(%rsp)
je 0x145676
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145690
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNSwap4(void*, int)
void
RNSwap4(void *values, int count)
{
  // Swap endian of 4-byte data type
  unsigned int *y = (unsigned int *) values;
  for (int i = 0; i < count; i++) {
    unsigned int x = y[i];
    y[i] = 
       (x<<24) | 
      ((x<<8) & 0x00FF0000) | 
      ((x>>8) & 0x0000FF00) | 
       (x>>24);
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0x14570c
movq -0x18(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %edx
shll $0x18, %edx
movl -0x20(%rsp), %eax
shll $0x8, %eax
andl $0xff0000, %eax         # imm = 0xFF0000
orl %eax, %edx
movl -0x20(%rsp), %eax
shrl $0x8, %eax
andl $0xff00, %eax           # imm = 0xFF00
orl %eax, %edx
movl -0x20(%rsp), %eax
shrl $0x18, %eax
orl %eax, %edx
movq -0x18(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x1456ab
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadUnsignedInt(_IO_FILE*, unsigned int*, int, int)
int 
RNReadUnsignedInt(FILE *fp, unsigned int *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(unsigned int), count, fp) != (size_t) count) {
    RNFail("Unable to read unsigned integer from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap4(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x4, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145761
leaq 0x63ca2(%rip), %rdi     # 0x1a93f2
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x14577e
cmpl $0x0, 0x8(%rsp)
je 0x145776
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145690
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadFloat(_IO_FILE*, float*, int, int)
int
RNReadFloat(FILE *fp, float *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(float), count, fp) != (size_t) count) {
    RNFail("Unable to read float from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap4(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x4, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x1457e1
leaq 0x63c4d(%rip), %rdi     # 0x1a941d
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x1457fe
cmpl $0x0, 0x8(%rsp)
je 0x1457f6
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145690
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadDouble(_IO_FILE*, double*, int, int)
int
RNReadDouble(FILE *fp, double *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(double), count, fp) != (size_t) count) {
    RNFail("Unable to read double from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap8(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x8, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145861
leaq 0x63bed(%rip), %rdi     # 0x1a943d
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x14587e
cmpl $0x0, 0x8(%rsp)
je 0x145876
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145890
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNSwap8(void*, int)
void
RNSwap8(void *values, int count)
{
  // Swap endian
  unsigned long long *y = (unsigned long long *) values;
  for (int i = 0; i < count; i++) {
    unsigned long long x = y[i];
    y[i] = 
       (x<<56) | 
      ((x<<40) & 0x00FF000000000000ULL) |
      ((x<<24) & 0x0000FF0000000000ULL) |
      ((x<<8)  & 0x000000FF00000000ULL) |
      ((x>>8)  & 0x00000000FF000000ULL) |
      ((x>>24) & 0x0000000000FF0000ULL) |
      ((x>>40) & 0x000000000000FF00ULL) |
       (x>>56);
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0x145987
movq -0x18(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rdx
shlq $0x38, %rdx
movq -0x28(%rsp), %rax
shlq $0x28, %rax
movabsq $0xff000000000000, %rcx # imm = 0xFF000000000000
andq %rcx, %rax
orq %rax, %rdx
movq -0x28(%rsp), %rax
shlq $0x18, %rax
movabsq $0xff0000000000, %rcx   # imm = 0xFF0000000000
andq %rcx, %rax
orq %rax, %rdx
movq -0x28(%rsp), %rax
shlq $0x8, %rax
movabsq $0xff00000000, %rcx     # imm = 0xFF00000000
andq %rcx, %rax
orq %rax, %rdx
movq -0x28(%rsp), %rax
shrq $0x8, %rax
movabsq $0xff000000, %rcx       # imm = 0xFF000000
andq %rcx, %rax
orq %rax, %rdx
movq -0x28(%rsp), %rax
shrq $0x18, %rax
andq $0xff0000, %rax         # imm = 0xFF0000
orq %rax, %rdx
movq -0x28(%rsp), %rax
shrq $0x28, %rax
andq $0xff00, %rax           # imm = 0xFF00
orq %rax, %rdx
movq -0x28(%rsp), %rax
shrq $0x38, %rax
orq %rax, %rdx
movq -0x18(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x1458ab
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadLongLong(_IO_FILE*, long long*, int, int)
int
RNReadLongLong(FILE *fp, long long *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(long long), count, fp) != (size_t) count) {
    RNFail("Unable to read long long from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap8(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x8, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x1459e1
leaq 0x63a8e(%rip), %rdi     # 0x1a945e
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x1459fe
cmpl $0x0, 0x8(%rsp)
je 0x1459f6
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145890
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNReadUnsignedLongLong(_IO_FILE*, unsigned long long*, int, int)
int
RNReadUnsignedLongLong(FILE *fp, unsigned long long *ptr, int count, int swap_endian)
{
  // Read the values
  if (fread(ptr, sizeof(unsigned long long), count, fp) != (size_t) count) {
    RNFail("Unable to read unsigned long long from file\n");
    return 0;
  }

  // Swap endian
  if (swap_endian) RNSwap8(ptr, count);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x8, %esi
callq 0x13860
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145a61
leaq 0x63a32(%rip), %rdi     # 0x1a9482
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x145a7e
cmpl $0x0, 0x8(%rsp)
je 0x145a76
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x145890
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNWriteChar(_IO_FILE*, char const*, int, int)
int
RNWriteChar(FILE *fp, const char *ptr, int count, int /* swap_endian */)
{
  // Write the values
  if (fwrite(ptr, sizeof(char), count, fp) != (size_t) count) {
    RNFail("Unable to write integer to file\n");
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x1, %esi
callq 0x13a80
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145ae1
leaq 0x639df(%rip), %rdi     # 0x1a94af
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x145ae9
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNWriteUnsignedChar(_IO_FILE*, unsigned char const*, int, int)
int
RNWriteUnsignedChar(FILE *fp, const unsigned char *ptr, int count, int /* swap_endian */)
{
  // Write the values
  if (fwrite(ptr, sizeof(unsigned char), count, fp) != (size_t) count) {
    RNFail("Unable to write unsigned char to file\n");
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x1, %esi
callq 0x13a80
movslq 0xc(%rsp), %rcx
cmpq %rcx, %rax
je 0x145b51
leaq 0x63990(%rip), %rdi     # 0x1a94d0
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0x24(%rsp)
jmp 0x145b59
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNWriteShort(_IO_FILE*, short const*, int, int)
int
RNWriteShort(FILE *fp, const short *ptr, int count, int swap_endian)
{
  // Swap endian
  if (swap_endian) RNSwap2((void *) ptr, count);

  // Write the values
  int status = 1;
  if (fwrite(ptr, sizeof(short), count, fp) != (size_t) count) {
    RNFail("Unable to write short to file\n");
    status = 0;
  }

  // Swap endian back
  if (swap_endian) RNSwap2((void *) ptr, count);

  // Return status
  return status;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x145b9b
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x145520
movl $0x1, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rdx
movq 0x20(%rsp), %rcx
movl $0x2, %esi
callq 0x13a80
movslq 0x14(%rsp), %rcx
cmpq %rcx, %rax
je 0x145bdc
leaq 0x6392a(%rip), %rdi     # 0x1a94f7
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x145bf1
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x145520
movl 0xc(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNWriteUnsignedShort(_IO_FILE*, unsigned short const*, int, int)
int
RNWriteUnsignedShort(FILE *fp, const unsigned short *ptr, int count, int swap_endian)
{
  // Swap endian
  if (swap_endian) RNSwap2((void *) ptr, count);

  // Write the values
  int status = 1;
  if (fwrite(ptr, sizeof(unsigned short), count, fp) != (size_t) count) {
    RNFail("Unable to write unsigned short to file\n");
    status = 0;
  }

  // Swap endian back
  if (swap_endian) RNSwap2((void *) ptr, count);

  // Return status
  return status;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x145c2b
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x145520
movl $0x1, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rdx
movq 0x20(%rsp), %rcx
movl $0x2, %esi
callq 0x13a80
movslq 0x14(%rsp), %rcx
cmpq %rcx, %rax
je 0x145c6c
leaq 0x638b9(%rip), %rdi     # 0x1a9516
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x145c81
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x145520
movl 0xc(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/RNBasics/RNFile.cpp
// Function: gaps::RNWriteInt(_IO_FILE*, int const*, int, int)
int
RNWriteInt(FILE *fp, const int *ptr, int count, int swap_endian)
{
  // Swap endian
  if (swap_endian) RNSwap4((void *) ptr, count);

  // Write the values
  int status = 1;
  if (fwrite(ptr, sizeof(int), count, fp) != (size_t) count) {
    RNFail("Unable to write integer to file\n");
    status = 0;
  }

  // Swap endian back
  if (swap_endian) RNSwap4((void *) ptr, count);

  // Return status
  return status;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x145cbb
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x145690
movl $0x1, 0xc(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rdx
movq 0x20(%rsp), %rcx
movl $0x4, %esi
callq 0x13a80
movslq 0x14(%rsp), %rcx
cmpq %rcx, %rax
je 0x145cfc
leaq 0x637c2(%rip), %rdi     # 0x1a94af
movb $0x0, %al
callq 0x1464b0
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x145d11
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x145690
movl 0xc(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)