// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::ReadPFMFile(char const*)
int R2Image::
ReadPFMFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open image: %s\n", filename);
    return 0;
  }

  // Read magic header
  int c;
  c = fgetc(fp); if (c != 'P') { RNFail("Bad magic keyword in %s\n", filename); return 0; }
  c = fgetc(fp); if (c != 'f') { RNFail("Bad magic keyword in %s\n", filename); return 0; }
  c = fgetc(fp); if (c != '\n') { RNFail("Bad magic keyword in %s\n", filename); return 0; }

  // Read width
  int width_count = 0;
  char width_string[256];
  for (int i = 0; i < 256; i++) { 
    c = fgetc(fp); 
    if ((c == ' ') && (width_count == 0)) { continue; }
    else if ((c == ' ') || (c == '\n')) { width_string[width_count] = '\0'; break; }
    else if (!isdigit(c)) { RNFail("Bad width character %c in %s\n", c, filename); return 0; }
    else width_string[width_count++] = c;
  }

  // Check width
  if ((width_count == 0) || (width_count > 128)) {
    RNFail("Error reading width in %s\n", filename); 
    return 0; 
  }

  // Read height
  int height_count = 0;
  char height_string[256];
  for (int i = 0; i < 256; i++) { 
    c = fgetc(fp); 
    if ((c == ' ') && (height_count == 0)) { continue; }
    else if ((c == ' ') || (c == '\n')) { height_string[height_count] = '\0'; break; }
    else if (!isdigit(c)) { RNFail("Bad height character %c in %s\n", c, filename); return 0; }
    else height_string[height_count++] = c;
  }

  // Check height
  if ((height_count == 0) || (height_count > 128)) {
    RNFail("Error reading height in %s\n", filename); 
    return 0; 
  }

  // Read endian
  int endian_count = 0;
  char endian_string[256];
  for (int i = 0; i < 256; i++) { 
    c = fgetc(fp); 
    if ((c == ' ') && (endian_count == 0)) { continue; }
    else if ((c == ' ') || (c == '\n')) { endian_string[endian_count] = '\0'; break; }
    if (!isdigit(c) && (c != '.') && (c != '-')) { RNFail("Bad endian character %c in %s\n", c, filename); return 0; }
    endian_string[endian_count++] = c;
  }

  // Check endian
  if ((endian_count == 0) || (endian_count > 128)) {
    RNFail("Error reading endian in %s\n", filename); 
    return 0; 
  }

  // Parse values
  width = atoi(width_string);
  height = atoi(height_string);
  float endian = atof(endian_string);
  if (endian == -999.0F) RNFail("Just trying to avoid compiler warning for unused variable\n");

  // Allocate values
  int npixels = width * height;
  float *values = new float [ npixels ];
  if (!values) {
    RNFail("Unable to allocate values for %s\n", filename);
    return 0;
  }

  // Read values
  int count = npixels;
  while (count > 0) {
    int n = (int) fread(&values[npixels-count], sizeof(float), count, fp);
    if (n <= 0) { RNFail("read error\n"); abort(); }
    count -= n;
  }

  // Close image
  fclose(fp);

  // Determine offset and scale
  float offset = 0;
  float scale = 1;
  if (npixels > 0) {
    float sum = 0;
    float min_value = FLT_MAX;
    float max_value = -FLT_MAX;
    for (int i = 0; i < npixels; i++) {
      if (values[i] == R2_GRID_UNKNOWN_VALUE) continue;
      if (values[i] > max_value) max_value = values[i];
      if (values[i] < min_value) min_value = values[i];
      sum += values[i];
    }
    float mean = sum / npixels;
    float ssd = 0;
    for (int i = 0; i < npixels; i++) {
      if (values[i] == R2_GRID_UNKNOWN_VALUE) continue;
      float delta = values[i] - mean;
      ssd += delta * delta;
    }
    float stddev = sqrt(ssd);
    float min_clamped = mean - 3 * stddev;
    if (min_clamped < min_value) min_clamped = min_value;
    float max_clamped = mean + 3 * stddev;
    if (max_clamped > max_value) max_clamped = max_value;
    float range = max_clamped - min_clamped;
    if (range > 0) {
      offset = min_clamped;
      scale = 1.0F / range;
    }
  }

  // Allocate pixels
  ncomponents = 3;
  rowsize = ncomponents * width;
  if ((rowsize % 4) != 0) rowsize = (rowsize / 4 + 1) * 4;
  int nbytes = rowsize * height;
  pixels = new unsigned char [nbytes];
  assert(pixels);

  // Fill in pixels
  float *valuesp = values;
  for (int j = 0; j < height; j++) {
    unsigned char *pixelsp = &pixels[j*rowsize];
    for (int i = 0; i < width; i++) {
      if (*valuesp == R2_GRID_UNKNOWN_VALUE) {
        *(pixelsp++) = 64;
        *(pixelsp++) = 32;
        *(pixelsp++) = 0;
      }
      else {
        int value = (int) ((*valuesp - offset) * 255 * scale);
        if (value < 0) value = 0;
        if (value > 255) value = 255;
        unsigned char p = (unsigned char) value;
        *(pixelsp++) = p;
        *(pixelsp++) = p;
        *(pixelsp++) = p;
      }
      valuesp++;
    }
  }

  // Return success
  return nbytes;
}

// Assembly:
subq $0x3d8, %rsp            # imm = 0x3D8
movq %rdi, 0x3c8(%rsp)
movq %rsi, 0x3c0(%rsp)
movq 0x3c8(%rsp), %rax
movq %rax, (%rsp)
movq 0x3c0(%rsp), %rdi
leaq 0x6baa7(%rip), %rsi     # 0x1335d9
callq 0xf5e0
movq %rax, 0x3b8(%rsp)
cmpq $0x0, 0x3b8(%rsp)
jne 0xc7b70
movq 0x3c0(%rsp), %rsi
leaq 0x6e2c0(%rip), %rdi     # 0x135e19
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movq 0x3b8(%rsp), %rdi
callq 0xf7d0
movl %eax, 0x3b4(%rsp)
cmpl $0x50, 0x3b4(%rsp)
je 0xc7bb4
movq 0x3c0(%rsp), %rsi
leaq 0x6e296(%rip), %rdi     # 0x135e33
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movq 0x3b8(%rsp), %rdi
callq 0xf7d0
movl %eax, 0x3b4(%rsp)
cmpl $0x66, 0x3b4(%rsp)
je 0xc7bf8
movq 0x3c0(%rsp), %rsi
leaq 0x6e252(%rip), %rdi     # 0x135e33
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movq 0x3b8(%rsp), %rdi
callq 0xf7d0
movl %eax, 0x3b4(%rsp)
cmpl $0xa, 0x3b4(%rsp)
je 0xc7c3c
movq 0x3c0(%rsp), %rsi
leaq 0x6e20e(%rip), %rdi     # 0x135e33
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl $0x0, 0x3b0(%rsp)
movl $0x0, 0x2ac(%rsp)
cmpl $0x100, 0x2ac(%rsp) # imm = 0x100
jge 0xc7d35
movq 0x3b8(%rsp), %rdi
callq 0xf7d0
movl %eax, 0x3b4(%rsp)
cmpl $0x20, 0x3b4(%rsp)
jne 0xc7c90
cmpl $0x0, 0x3b0(%rsp)
jne 0xc7c90
jmp 0xc7d1f
cmpl $0x20, 0x3b4(%rsp)
je 0xc7ca4
cmpl $0xa, 0x3b4(%rsp)
jne 0xc7cb6
movslq 0x3b0(%rsp), %rax
movb $0x0, 0x2b0(%rsp,%rax)
jmp 0xc7d35
movl 0x3b4(%rsp), %edi
callq 0xf430
cmpl $0x0, %eax
jne 0xc7cf4
movl 0x3b4(%rsp), %esi
movq 0x3c0(%rsp), %rdx
leaq 0x6e16f(%rip), %rdi     # 0x135e4c
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl 0x3b4(%rsp), %eax
movb %al, %cl
movl 0x3b0(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x3b0(%rsp)
cltq
movb %cl, 0x2b0(%rsp,%rax)
jmp 0xc7d1b
jmp 0xc7d1d
jmp 0xc7d1f
movl 0x2ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ac(%rsp)
jmp 0xc7c52
cmpl $0x0, 0x3b0(%rsp)
je 0xc7d4c
cmpl $0x80, 0x3b0(%rsp)
jle 0xc7d72
movq 0x3c0(%rsp), %rsi
leaq 0x6e10f(%rip), %rdi     # 0x135e6a
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl $0x0, 0x2a8(%rsp)
movl $0x0, 0x19c(%rsp)
cmpl $0x100, 0x19c(%rsp) # imm = 0x100
jge 0xc7e6b
movq 0x3b8(%rsp), %rdi
callq 0xf7d0
movl %eax, 0x3b4(%rsp)
cmpl $0x20, 0x3b4(%rsp)
jne 0xc7dc6
cmpl $0x0, 0x2a8(%rsp)
jne 0xc7dc6
jmp 0xc7e55
cmpl $0x20, 0x3b4(%rsp)
je 0xc7dda
cmpl $0xa, 0x3b4(%rsp)
jne 0xc7dec
movslq 0x2a8(%rsp), %rax
movb $0x0, 0x1a0(%rsp,%rax)
jmp 0xc7e6b
movl 0x3b4(%rsp), %edi
callq 0xf430
cmpl $0x0, %eax
jne 0xc7e2a
movl 0x3b4(%rsp), %esi
movq 0x3c0(%rsp), %rdx
leaq 0x6e072(%rip), %rdi     # 0x135e85
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl 0x3b4(%rsp), %eax
movb %al, %cl
movl 0x2a8(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x2a8(%rsp)
cltq
movb %cl, 0x1a0(%rsp,%rax)
jmp 0xc7e51
jmp 0xc7e53
jmp 0xc7e55
movl 0x19c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x19c(%rsp)
jmp 0xc7d88
cmpl $0x0, 0x2a8(%rsp)
je 0xc7e82
cmpl $0x80, 0x2a8(%rsp)
jle 0xc7ea8
movq 0x3c0(%rsp), %rsi
leaq 0x6e013(%rip), %rdi     # 0x135ea4
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl $0x0, 0x198(%rsp)
movl $0x0, 0x8c(%rsp)
cmpl $0x100, 0x8c(%rsp) # imm = 0x100
jge 0xc7fb4
movq 0x3b8(%rsp), %rdi
callq 0xf7d0
movl %eax, 0x3b4(%rsp)
cmpl $0x20, 0x3b4(%rsp)
jne 0xc7efc
cmpl $0x0, 0x198(%rsp)
jne 0xc7efc
jmp 0xc7f9e
cmpl $0x20, 0x3b4(%rsp)
je 0xc7f10
cmpl $0xa, 0x3b4(%rsp)
jne 0xc7f25
movslq 0x198(%rsp), %rax
movb $0x0, 0x90(%rsp,%rax)
jmp 0xc7fb4
jmp 0xc7f27
movl 0x3b4(%rsp), %edi
callq 0xf430
cmpl $0x0, %eax
jne 0xc7f79
cmpl $0x2e, 0x3b4(%rsp)
je 0xc7f79
cmpl $0x2d, 0x3b4(%rsp)
je 0xc7f79
movl 0x3b4(%rsp), %esi
movq 0x3c0(%rsp), %rdx
leaq 0x6dff3(%rip), %rdi     # 0x135f55
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl 0x3b4(%rsp), %eax
movb %al, %cl
movl 0x198(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x198(%rsp)
cltq
movb %cl, 0x90(%rsp,%rax)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0xc7ebe
cmpl $0x0, 0x198(%rsp)
je 0xc7fcb
cmpl $0x80, 0x198(%rsp)
jle 0xc7ff1
movq 0x3c0(%rsp), %rsi
leaq 0x6df9a(%rip), %rdi     # 0x135f74
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
leaq 0x2b0(%rsp), %rdi
callq 0xf7b0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, (%rax)
leaq 0x1a0(%rsp), %rdi
callq 0xf7b0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x4(%rax)
leaq 0x90(%rsp), %rdi
callq 0xf640
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x88(%rsp)
movss 0x88(%rsp), %xmm0
movss 0x6dc39(%rip), %xmm1    # 0x135c80
ucomiss %xmm1, %xmm0
jne 0xc805c
jp 0xc805c
leaq 0x6df3b(%rip), %rdi     # 0x135f90
movb $0x0, %al
callq 0xd4f30
movq (%rsp), %rcx
movl (%rcx), %eax
imull 0x4(%rcx), %eax
movl %eax, 0x84(%rsp)
movslq 0x84(%rsp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xf030
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0xc80c9
movq 0x3c0(%rsp), %rsi
leaq 0x6e5a3(%rip), %rdi     # 0x136655
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x3d4(%rsp)
jmp 0xc85a1
movl 0x84(%rsp), %eax
movl %eax, 0x74(%rsp)
cmpl $0x0, 0x74(%rsp)
jle 0xc8139
movq 0x78(%rsp), %rdi
movl 0x84(%rsp), %eax
subl 0x74(%rsp), %eax
cltq
shlq $0x2, %rax
addq %rax, %rdi
movslq 0x74(%rsp), %rdx
movq 0x3b8(%rsp), %rcx
movl $0x4, %esi
callq 0xf780
movl %eax, 0x70(%rsp)
cmpl $0x0, 0x70(%rsp)
jg 0xc8129
leaq 0x6e55a(%rip), %rdi     # 0x136677
movb $0x0, %al
callq 0xd4f30
callq 0xf290
movl 0x70(%rsp), %ecx
movl 0x74(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x74(%rsp)
jmp 0xc80d4
movq 0x3b8(%rsp), %rdi
callq 0xf4b0
xorps %xmm0, %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x6b111(%rip), %xmm0    # 0x133268
movss %xmm0, 0x68(%rsp)
cmpl $0x0, 0x84(%rsp)
jle 0xc83ba
xorps %xmm0, %xmm0
movss %xmm0, 0x64(%rsp)
movss 0x6e230(%rip), %xmm0    # 0x1363ac
movss %xmm0, 0x60(%rsp)
movss 0x6e21e(%rip), %xmm0    # 0x1363a8
movss %xmm0, 0x5c(%rsp)
movl $0x0, 0x58(%rsp)
movl 0x58(%rsp), %eax
cmpl 0x84(%rsp), %eax
jge 0xc824e
movq 0x78(%rsp), %rax
movslq 0x58(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss 0x6e1f8(%rip), %xmm1    # 0x1363b8
ucomiss %xmm1, %xmm0
jne 0xc81c9
jp 0xc81c9
jmp 0xc823e
movq 0x78(%rsp), %rax
movslq 0x58(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss 0x5c(%rsp), %xmm0
jbe 0xc81f4
movq 0x78(%rsp), %rax
movslq 0x58(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x5c(%rsp)
movq 0x78(%rsp), %rax
movslq 0x58(%rsp), %rcx
movss (%rax,%rcx,4), %xmm1
movss 0x60(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xc8223
movq 0x78(%rsp), %rax
movslq 0x58(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x60(%rsp)
movq 0x78(%rsp), %rax
movslq 0x58(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
addss 0x64(%rsp), %xmm0
movss %xmm0, 0x64(%rsp)
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0xc8198
movss 0x64(%rsp), %xmm0
cvtsi2ssl 0x84(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x54(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
cmpl 0x84(%rsp), %eax
jge 0xc82ed
movq 0x78(%rsp), %rax
movslq 0x4c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss 0x6e11c(%rip), %xmm1    # 0x1363b8
ucomiss %xmm1, %xmm0
jne 0xc82a5
jp 0xc82a5
jmp 0xc82e0
movq 0x78(%rsp), %rax
movslq 0x4c(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
subss 0x54(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
movss 0x48(%rsp), %xmm0
movss 0x48(%rsp), %xmm2
movss 0x50(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x50(%rsp)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0xc8278
movss 0x50(%rsp), %xmm0
callq 0xca8a0
movss %xmm0, 0x44(%rsp)
movss 0x54(%rsp), %xmm1
movss 0x44(%rsp), %xmm0
movss 0x6e09e(%rip), %xmm2    # 0x1363b0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x40(%rsp), %xmm1
movss 0x60(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xc833d
movss 0x60(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x54(%rsp), %xmm1
movss 0x44(%rsp), %xmm0
movss 0x6e063(%rip), %xmm2    # 0x1363b4
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm0
ucomiss 0x5c(%rsp), %xmm0
jbe 0xc8378
movss 0x5c(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm0
subss 0x40(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
movss 0x38(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xc83b8
movss 0x40(%rsp), %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x6aebc(%rip), %xmm0    # 0x133268
divss 0x38(%rsp), %xmm0
movss %xmm0, 0x68(%rsp)
jmp 0xc83ba
movq (%rsp), %rax
movl $0x3, 0x8(%rax)
movl 0x8(%rax), %ecx
imull (%rax), %ecx
movl %ecx, 0xc(%rax)
movl 0xc(%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xc83fc
movq (%rsp), %rax
movl 0xc(%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq (%rsp), %rax
addl $0x1, %ecx
shll $0x2, %ecx
movl %ecx, 0xc(%rax)
movq (%rsp), %rcx
movl 0xc(%rcx), %eax
imull 0x4(%rcx), %eax
movl %eax, 0x34(%rsp)
movslq 0x34(%rsp), %rdi
callq 0xf030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
movq (%rsp), %rcx
movl 0x24(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0xc8596
movq (%rsp), %rdx
movq 0x10(%rdx), %rax
movl 0x24(%rsp), %ecx
imull 0xc(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq (%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl (%rcx), %eax
jge 0xc8584
movq 0x28(%rsp), %rax
movss (%rax), %xmm0
movss 0x6df31(%rip), %xmm1    # 0x1363b8
ucomiss %xmm1, %xmm0
jne 0xc84cf
jp 0xc84cf
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movb $0x40, (%rax)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movb $0x20, (%rax)
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rsp)
movb $0x0, (%rax)
jmp 0xc8566
movq 0x28(%rsp), %rax
movss (%rax), %xmm0
subss 0x6c(%rsp), %xmm0
movss 0x6debe(%rip), %xmm1    # 0x1363a4
mulss %xmm1, %xmm0
mulss 0x68(%rsp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jge 0xc8507
movl $0x0, 0x10(%rsp)
cmpl $0xff, 0x10(%rsp)
jle 0xc8519
movl $0xff, 0x10(%rsp)
movl 0x10(%rsp), %eax
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movb 0xf(%rsp), %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movb 0xf(%rsp), %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movq 0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x28(%rsp)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xc8466
jmp 0xc8586
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xc8432
movl 0x34(%rsp), %eax
movl %eax, 0x3d4(%rsp)
movl 0x3d4(%rsp), %eax
addq $0x3d8, %rsp            # imm = 0x3D8
retq