// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: testXYZ()
void testXYZ() {
  std::cout << "testXYZ" << std::endl;
  unsigned w = 512, h = 512;
  std::vector<unsigned char> v(w * h * 4 * 2);
  for(size_t i = 0; i < v.size(); i++) {
    v[i] = getRandom() & 255;
  }

  // Test sRGB -> XYZ -> sRGB roundtrip

  unsigned rendering_intent = 3; // test with absolute for now

  // 8-bit
  {
    // Default state, the conversions use 8-bit sRGB
    lodepng::State state;
    std::vector<float> f(w * h * 4);
    float whitepoint[3];
    assertNoError(lodepng::convertToXYZ(f.data(), whitepoint, v.data(), w, h, &state));

    std::vector<unsigned char> v2(w * h * 4);
    assertNoError(lodepng::convertFromXYZ(v2.data(), f.data(), w, h, &state, whitepoint, rendering_intent));

    for(size_t i = 0; i < v2.size(); i++) {
      ASSERT_EQUALS(v[i], v2[i]);
    }
  }

  // 16-bit
  {
    // Default state but with 16-bit, the conversions use 16-bit sRGB
    lodepng::State state;
    state.info_raw.bitdepth = 16;
    std::vector<float> f(w * h * 4);
    float whitepoint[3];
    assertNoError(lodepng::convertToXYZ(f.data(), whitepoint, v.data(), w, h, &state));

    std::vector<unsigned char> v2(w * h * 8);
    assertNoError(lodepng::convertFromXYZ(v2.data(), f.data(), w, h, &state, whitepoint, rendering_intent));

    for(size_t i = 0; i < v2.size(); i++) {
      ASSERT_EQUALS(v[i], v2[i]);
    }
  }

  // Test custom RGB+gamma -> XYZ -> custom RGB+gamma roundtrip

  LodePNGInfo info_custom;
  lodepng_info_init(&info_custom);
  info_custom.gama_defined = 1;
  info_custom.gama_gamma =   30000; // default 45455
  info_custom.chrm_defined = 1;
  info_custom.chrm_white_x = 10000; // default 31270
  info_custom.chrm_white_y = 20000; // default 32900
  info_custom.chrm_red_x =   30000; // default 64000
  info_custom.chrm_red_y =   50000; // default 33000
  info_custom.chrm_green_x = 70000; // default 30000
  info_custom.chrm_green_y = 11000; // default 60000
  info_custom.chrm_blue_x =  13000; // default 15000
  info_custom.chrm_blue_y =  17000; // default 6000

  // 8-bit
  {
    lodepng::State state;
    lodepng_info_copy(&state.info_png, &info_custom);
    std::vector<float> f(w * h * 4);
    float whitepoint[3];
    assertNoError(lodepng::convertToXYZ(f.data(), whitepoint, v.data(), w, h, &state));

    std::vector<unsigned char> v2(w * h * 4);
    assertNoError(lodepng::convertFromXYZ(v2.data(), f.data(), w, h, &state, whitepoint, rendering_intent));

    for(size_t i = 0; i < v2.size(); i++) {
      // Allow near instead of exact due to numerical issues with low values,
      // see description at the 16-bit test below.
      unsigned maxdist = 0;
      if(v[i] <= 2) maxdist = 3;
      else if(v[i] <= 4) maxdist = 2;
      else maxdist = 0;
      ASSERT_NEAR(v[i], v2[i], maxdist);
    }
  }

  // 16-bit
  {
    lodepng::State state;
    lodepng_info_copy(&state.info_png, &info_custom);
    state.info_raw.bitdepth = 16;
    std::vector<float> f(w * h * 4);
    float whitepoint[3];
    assertNoError(lodepng::convertToXYZ(f.data(), whitepoint, v.data(), w, h, &state));

    std::vector<unsigned char> v2(w * h * 8);
    assertNoError(lodepng::convertFromXYZ(v2.data(), f.data(), w, h, &state, whitepoint, rendering_intent));

    for(size_t i = 0; i < v2.size(); i += 2) {
      unsigned a = v[i + 0] * 256u + v[i + 1];
      unsigned a2 = v2[i + 0] * 256u + v2[i + 1];
      // There are numerical issues with low values due to the precision of float,
      // so allow some distance for low values (low compared to 65535).
      // The issue seems to be: the combination of how the gamma correction affects
      // low values and the color conversion matrix operating on single precision
      // floating point. With the sRGB's gamma the problem seems not to happen, maybe
      // because that linear part near 0 behaves better than power.
      // TODO: check if it can be fixed without using double for the image and without slow double precision pow.
      unsigned maxdist = 0;
      if(a < 2048) maxdist = 768;
      else if(a < 4096) maxdist = 24;
      else if(a < 16384) maxdist = 4;
      else maxdist = 2;
      ASSERT_NEAR(a, a2, maxdist);
    }
  }

  lodepng_info_cleanup(&info_custom);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x540, %rsp            # imm = 0x540
movq 0x5b2d9(%rip), %rdi     # 0xa2fd8
leaq 0x1bb36(%rip), %rsi     # 0x6383c
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x2c0(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xd0(%rsp), %rdi
leaq 0x118(%rsp), %rcx
movl $0x200000, %esi         # imm = 0x200000
callq 0x5ab3a
xorl %ebx, %ebx
movq 0xd8(%rsp), %rax
subq 0xd0(%rsp), %rax
cmpq %rax, %rbx
jae 0x47d64
callq 0x134fe
movq 0xd0(%rsp), %rcx
movb %al, (%rcx,%rbx)
incq %rbx
jmp 0x47d3a
leaq 0x2c0(%rsp), %rdi
callq 0xb84c
leaq 0x118(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0xe8(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movl $0x100000, %esi         # imm = 0x100000
callq 0x5b062
movq 0xe8(%rsp), %rdi
movq 0xd0(%rsp), %rdx
leaq 0x78(%rsp), %rsi
leaq 0x2c0(%rsp), %r9
movl $0x200, %ecx            # imm = 0x200
movl $0x200, %r8d            # imm = 0x200
callq 0xf697
movl %eax, %edi
callq 0x13456
leaq 0x118(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movl $0x100000, %esi         # imm = 0x100000
callq 0x5ab3a
movq 0x38(%rsp), %rdi
movq 0xe8(%rsp), %rsi
movl $0x3, (%rsp)
leaq 0x2c0(%rsp), %r8
leaq 0x78(%rsp), %r9
movl $0x200, %edx            # imm = 0x200
movl $0x200, %ecx            # imm = 0x200
callq 0x1051a
movl %eax, %edi
callq 0x13456
movq 0x38(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq %rax, %rdx
subq 0x40(%rsp), %rdx
xorl %r14d, %r14d
xorl %esi, %esi
cmpq %r14, %rdx
je 0x47e52
movb (%rcx,%rsi), %dil
cmpb (%rax,%rsi), %dil
jne 0x4831d
incq %rsi
decq %r14
jmp 0x47e37
leaq 0x38(%rsp), %rdi
callq 0xea7c
leaq 0xe8(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
leaq 0x2c0(%rsp), %rdi
callq 0xb84c
movl $0x10, 0x36c(%rsp)
leaq 0x118(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0xe8(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movl $0x100000, %esi         # imm = 0x100000
callq 0x5b062
movq 0xe8(%rsp), %rdi
movq 0xd0(%rsp), %rdx
leaq 0x78(%rsp), %rsi
leaq 0x2c0(%rsp), %r9
movl $0x200, %ecx            # imm = 0x200
movl $0x200, %r8d            # imm = 0x200
callq 0xf697
movl %eax, %edi
callq 0x13456
leaq 0x118(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movl $0x200000, %esi         # imm = 0x200000
callq 0x5ab3a
movq 0x38(%rsp), %rdi
movq 0xe8(%rsp), %rsi
movl $0x3, (%rsp)
leaq 0x2c0(%rsp), %r8
leaq 0x78(%rsp), %r9
movl $0x200, %edx            # imm = 0x200
movl $0x200, %ecx            # imm = 0x200
callq 0x1051a
movl %eax, %edi
callq 0x13456
movq 0x38(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq %rax, %rdx
subq 0x40(%rsp), %rdx
xorl %r14d, %r14d
xorl %esi, %esi
cmpq %r14, %rdx
je 0x47f6f
movb (%rcx,%rsi), %dil
cmpb (%rax,%rsi), %dil
jne 0x4848e
incq %rsi
decq %r14
jmp 0x47f54
leaq 0x38(%rsp), %rdi
callq 0xea7c
leaq 0xe8(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
leaq 0x118(%rsp), %rdi
callq 0x5095
movaps 0x18139(%rip), %xmm0    # 0x600e0
movups %xmm0, 0x1e0(%rsp)
movaps 0x1813a(%rip), %xmm0    # 0x600f0
movups %xmm0, 0x1f0(%rsp)
movabsq $0x32c800002af8, %rax   # imm = 0x32C800002AF8
movq %rax, 0x200(%rsp)
movl $0x4268, 0x208(%rsp) # imm = 0x4268
leaq 0x2c0(%rsp), %rdi
callq 0xb84c
leaq 0x390(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x51b8
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rcx
movl $0x100000, %esi         # imm = 0x100000
callq 0x5b062
movq 0x38(%rsp), %rdi
movq 0xd0(%rsp), %rdx
leaq 0x10c(%rsp), %rsi
leaq 0x2c0(%rsp), %r9
movl $0x200, %ecx            # imm = 0x200
movl $0x200, %r8d            # imm = 0x200
callq 0xf697
movl %eax, %edi
callq 0x13456
leaq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rcx
movl $0x100000, %esi         # imm = 0x100000
callq 0x5ab3a
movq 0x78(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x3, (%rsp)
leaq 0x2c0(%rsp), %r8
leaq 0x10c(%rsp), %r9
movl $0x200, %edx            # imm = 0x200
movl $0x200, %ecx            # imm = 0x200
callq 0x1051a
movl %eax, %edi
callq 0x13456
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
subq %rax, %rcx
movq 0xd0(%rsp), %rdx
xorl %r14d, %r14d
pushq $0x3
popq %rsi
pushq $0x2
popq %rdi
cmpq %r14, %rcx
je 0x48128
andl $0x0, 0xc(%rsp)
movb (%rdx,%r14), %r9b
cmpb $0x2, %r9b
ja 0x480e2
movl $0x3, 0xc(%rsp)
movl %esi, %r8d
jmp 0x480f6
xorl %r8d, %r8d
cmpb $0x4, %r9b
ja 0x480f6
movl $0x2, 0xc(%rsp)
movl %edi, %r8d
movb (%rax,%r14), %r9b
movb (%rdx,%r14), %r10b
movl %r9d, %r11d
subb %r10b, %r11b
negb %r11b
subb %r10b, %r9b
movzbl %r9b, %r9d
movzbl %r11b, %r10d
cmovael %r9d, %r10d
movzbl %r10b, %r9d
cmpl %r9d, %r8d
jb 0x485ff
incq %r14
jmp 0x480c1
leaq 0x78(%rsp), %rdi
callq 0xea7c
leaq 0x38(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
leaq 0x2c0(%rsp), %rdi
callq 0xb84c
leaq 0x390(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x51b8
movl $0x10, 0x36c(%rsp)
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rcx
movl $0x100000, %esi         # imm = 0x100000
callq 0x5b062
movq 0x38(%rsp), %rdi
movq 0xd0(%rsp), %rdx
leaq 0x10c(%rsp), %rsi
leaq 0x2c0(%rsp), %r9
movl $0x200, %ecx            # imm = 0x200
movl $0x200, %r8d            # imm = 0x200
callq 0xf697
movl %eax, %edi
callq 0x13456
leaq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rcx
movl $0x200000, %esi         # imm = 0x200000
callq 0x5ab3a
movq 0x78(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x3, (%rsp)
leaq 0x2c0(%rsp), %r8
leaq 0x10c(%rsp), %r9
movl $0x200, %edx            # imm = 0x200
movl $0x200, %ecx            # imm = 0x200
callq 0x1051a
movl %eax, %edi
callq 0x13456
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
subq %rax, %rcx
movq 0xd0(%rsp), %rdx
xorl %esi, %esi
pushq $0x18
popq %rdi
pushq $0x4
popq %r8
pushq $0x2
popq %r9
cmpq %rcx, %rsi
jae 0x482d6
movzbl (%rdx,%rsi), %ebx
movl %ebx, %r11d
shll $0x8, %r11d
movzbl 0x1(%rdx,%rsi), %r10d
orl %r11d, %r10d
movl %r10d, 0xc(%rsp)
movzwl (%rax,%rsi), %r11d
rolw $0x8, %r11w
movzwl %r11w, %r11d
movl %r11d, 0x50(%rsp)
cmpl $0x7, %ebx
ja 0x48287
movl $0x300, 0x34(%rsp)      # imm = 0x300
movl $0x300, %ebx            # imm = 0x300
jmp 0x482b5
cmpb $0xf, %bl
ja 0x48298
movl $0x18, 0x34(%rsp)
movl %edi, %ebx
jmp 0x482b5
cmpb $0x3f, %bl
ja 0x482aa
movl $0x4, 0x34(%rsp)
movl %r8d, %ebx
jmp 0x482b5
movl $0x2, 0x34(%rsp)
movl %r9d, %ebx
movl %r11d, %ebp
subl %r10d, %ebp
negl %ebp
subl %r10d, %r11d
cmovbl %ebp, %r11d
cmpl %ebx, %r11d
ja 0x48811
addq $0x2, %rsi
jmp 0x4823e
leaq 0x78(%rsp), %rdi
callq 0xea7c
leaq 0x38(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
leaq 0x118(%rsp), %rdi
callq 0x515b
leaq 0xd0(%rsp), %rdi
callq 0xea7c
addq $0x540, %rsp            # imm = 0x540
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x17eb9(%rip), %rsi     # 0x601dd
leaq 0x90(%rsp), %rdi
leaq 0x10c(%rsp), %rdx
callq 0x20c0
leaq 0x1b504(%rip), %rdx     # 0x63844
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5a5df
leaq 0x1b449(%rip), %rdx     # 0x637a5
leaq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5a5df
leaq 0x1b4d4(%rip), %rdx     # 0x63849
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x5a5df
leaq 0x17e9a(%rip), %rdx     # 0x60225
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5a5df
movq 0x5ac34(%rip), %rdi     # 0xa2fd8
leaq 0x118(%rsp), %rsi
callq 0x21d0
leaq 0x118(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x58(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
movq 0x5abe5(%rip), %rdi     # 0xa2fd8
leaq 0x40b13(%rip), %rsi     # 0x88f0d
callq 0x21f0
movq %rax, %rbx
movq 0xd0(%rsp), %rsi
subq %r14, %rsi
leaq 0x118(%rsp), %rdi
callq 0x132a0
leaq 0x118(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17e0c(%rip), %rsi     # 0x6023d
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
movq 0x38(%rsp), %rsi
subq %r14, %rsi
leaq 0x10(%rsp), %rdi
callq 0x132a0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17cc2(%rip), %rsi     # 0x60124
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x118(%rsp), %rdi
callq 0x2270
callq 0x13280
leaq 0x17d48(%rip), %rsi     # 0x601dd
leaq 0x90(%rsp), %rdi
leaq 0x10c(%rsp), %rdx
callq 0x20c0
leaq 0x1b39e(%rip), %rdx     # 0x6384f
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5a5df
leaq 0x1b2d8(%rip), %rdx     # 0x637a5
leaq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5a5df
leaq 0x1b363(%rip), %rdx     # 0x63849
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x5a5df
leaq 0x17d29(%rip), %rdx     # 0x60225
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5a5df
movq 0x5aac3(%rip), %rdi     # 0xa2fd8
leaq 0x118(%rsp), %rsi
callq 0x21d0
leaq 0x118(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x58(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
movq 0x5aa74(%rip), %rdi     # 0xa2fd8
leaq 0x409a2(%rip), %rsi     # 0x88f0d
callq 0x21f0
movq %rax, %rbx
movq 0xd0(%rsp), %rsi
subq %r14, %rsi
leaq 0x118(%rsp), %rdi
callq 0x132a0
leaq 0x118(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17c9b(%rip), %rsi     # 0x6023d
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
movq 0x38(%rsp), %rsi
subq %r14, %rsi
leaq 0x10(%rsp), %rdi
callq 0x132a0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17b51(%rip), %rsi     # 0x60124
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x118(%rsp), %rdi
callq 0x2270
callq 0x13280
leaq 0x17bd7(%rip), %rsi     # 0x601dd
leaq 0xe8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x20c0
leaq 0x1b235(%rip), %rdx     # 0x63854
leaq 0x90(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x5a5df
leaq 0x1b16a(%rip), %rdx     # 0x637a5
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5a5df
leaq 0x1b1f2(%rip), %rdx     # 0x63849
leaq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5a5df
leaq 0x1b122(%rip), %rdx     # 0x63792
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x5a5df
movq 0x5a952(%rip), %rdi     # 0xa2fd8
leaq 0x10(%rsp), %rsi
callq 0x21d0
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x58(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0xe8(%rsp), %rdi
callq 0x2270
movq 0x5a906(%rip), %rdi     # 0xa2fd8
leaq 0x1b0cf(%rip), %rsi     # 0x637a8
callq 0x21f0
movq %rax, %rbx
movq 0xd0(%rsp), %rsi
addq %r14, %rsi
leaq 0x10(%rsp), %rdi
callq 0x132a0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17b33(%rip), %rsi     # 0x6023d
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
movq 0x78(%rsp), %rsi
addq %r14, %rsi
leaq 0x58(%rsp), %rdi
callq 0x132a0
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x1b08c(%rip), %rsi     # 0x637c7
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x5a957
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x1b069(%rip), %rsi     # 0x637d8
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
movq 0xd0(%rsp), %rax
movb (%rax,%r14), %al
movq 0x78(%rsp), %rcx
movb (%rcx,%r14), %cl
movl %eax, %edx
subb %cl, %dl
negb %dl
subb %cl, %al
movzbl %al, %eax
movzbl %dl, %ecx
cmovael %eax, %ecx
leaq 0xe8(%rsp), %rsi
movb %cl, (%rsi)
leaq 0x90(%rsp), %rdi
callq 0x132a0
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17956(%rip), %rsi     # 0x60124
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x58(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %rdi
callq 0x2270
callq 0x13280
leaq 0x179c5(%rip), %rsi     # 0x601dd
leaq 0xe8(%rsp), %rdi
leaq 0x57(%rsp), %rdx
callq 0x20c0
leaq 0x1b028(%rip), %rdx     # 0x63859
leaq 0x90(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x5a5df
leaq 0x1af58(%rip), %rdx     # 0x637a5
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5a5df
leaq 0x1aff5(%rip), %rdx     # 0x6385e
leaq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5a5df
leaq 0x1af10(%rip), %rdx     # 0x63792
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x5a5df
movq 0x5a740(%rip), %rdi     # 0xa2fd8
leaq 0x10(%rsp), %rsi
callq 0x21d0
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x58(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0xe8(%rsp), %rdi
callq 0x2270
movq 0x5a6f4(%rip), %rdi     # 0xa2fd8
leaq 0x1aebd(%rip), %rsi     # 0x637a8
callq 0x21f0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x5a957
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17927(%rip), %rsi     # 0x6023d
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x5a957
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x1ae83(%rip), %rsi     # 0x637c7
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x5a957
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x1ae60(%rip), %rsi     # 0x637d8
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
movl 0xc(%rsp), %eax
movl 0x50(%rsp), %ecx
movl %eax, %edx
subl %ecx, %edx
negl %edx
subl %ecx, %eax
cmovbl %edx, %eax
leaq 0xe8(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x90(%rsp), %rdi
callq 0x5a957
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x17760(%rip), %rsi     # 0x60124
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x58(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %rdi
callq 0x2270
callq 0x13280
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x48a32
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x48a44
jmp 0x48a2f
jmp 0x48a41
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x48a5a
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x48a69
jmp 0x48a57
jmp 0x48a66
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x48a9e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x48ab0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48ac2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48ad7
jmp 0x48a9b
jmp 0x48aad
jmp 0x48abf
jmp 0x48ad4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48d05
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48d2b
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x2270
jmp 0x48d51
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x2270
jmp 0x48d7a
jmp 0x48d02
jmp 0x48d28
jmp 0x48d4e
jmp 0x48d77
jmp 0x48d02
jmp 0x48d28
jmp 0x48d4e
jmp 0x48d77
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48bb3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48bc2
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x2270
jmp 0x48bd1
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x2270
jmp 0x48be0
jmp 0x48b6d
jmp 0x48bf3
jmp 0x48bf3
jmp 0x48b6d
movq %rax, %rbx
jmp 0x48d19
jmp 0x48b83
jmp 0x48c04
jmp 0x48c04
jmp 0x48b83
movq %rax, %rbx
jmp 0x48d3f
jmp 0x48b94
jmp 0x48c13
jmp 0x48c13
movq %rax, %rbx
jmp 0x48d68
jmp 0x48ba8
jmp 0x48c28
jmp 0x48c28
movq %rax, %rbx
jmp 0x48d91
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x48c33
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x48c45
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48c57
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x48c66
jmp 0x48c1b
jmp 0x48d02
movq %rax, %rbx
jmp 0x48d0f
jmp 0x48c1b
jmp 0x48c1b
jmp 0x48d28
movq %rax, %rbx
jmp 0x48d35
jmp 0x48c1b
jmp 0x48d4e
movq %rax, %rbx
jmp 0x48d5b
movq %rax, %rbx
jmp 0x48d9e
jmp 0x48d77
movq %rax, %rbx
jmp 0x48d84
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x48c75
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x48c87
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x48c99
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2270
jmp 0x48cab
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x48cbd
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x48ccf
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x48ce1
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x48cf3
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2270
jmp 0x48d05
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2270
jmp 0x48d2b
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x48d51
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x48d7a
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xea7c
leaq 0x38(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
jmp 0x48d9e
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xea7c
leaq 0x38(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
jmp 0x48d9e
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xea7c
leaq 0xe8(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
jmp 0x48d9e
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xea7c
leaq 0xe8(%rsp), %rdi
callq 0x5b666
leaq 0x2c0(%rsp), %rdi
callq 0xb874
leaq 0xd0(%rsp), %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x2380
movq %rax, %rdi
callq 0xe6cc