// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertRGBModel(unsigned char*, unsigned char const*, unsigned int, unsigned int, LodePNGState const*, LodePNGState const*, unsigned int)
unsigned convertRGBModel(unsigned char* out, const unsigned char* in,
                         unsigned w, unsigned h,
                         const LodePNGState* state_out,
                         const LodePNGState* state_in,
                         unsigned rendering_intent) {
  if(modelsEqual(state_in, state_out)) {
    return lodepng_convert(out, in, &state_out->info_raw, &state_in->info_raw, w, h);
  } else {
    unsigned error = 0;
    size_t n, bytes;
    if(lodepng_mulofl((size_t)w, (size_t)h, &n)) return 92;
    if(lodepng_mulofl(n, 4 * sizeof(float), &bytes)) return 92;
    float* xyz = (float*)lodepng_malloc(bytes);
    float whitepoint[3];
    error = convertToXYZ(xyz, whitepoint, in, w, h, state_in);
    if (!error) error = convertFromXYZ(out, xyz, w, h, state_out, whitepoint, rendering_intent);
    lodepng_free(xyz);
    return error;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r12
movq %r8, %r14
movl %ecx, 0x10(%rsp)
movl %edx, %ebp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0x14(%rsp)
movl $0xd0, %r15d
leaq (%r9,%r15), %r13
testq %r9, %r9
cmoveq %r9, %r13
addq %r8, %r15
testq %r8, %r8
cmoveq %r8, %r15
movq %r13, %rdi
callq 0x14c9e
movl %eax, %ebx
movq %r15, %rdi
callq 0x14c9e
cmpl %eax, %ebx
jne 0x138b5
testl %ebx, %ebx
je 0x13771
movl $0xa8, %eax
addq %rax, %r14
addq %rax, %r12
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
movq %r12, %rcx
movl %ebp, %r8d
movl 0x10(%rsp), %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x642f
movl 0xfc(%r13), %eax
cmpl 0xfc(%r15), %eax
jne 0x138b5
testl %eax, %eax
je 0x137cd
movl 0x110(%r13), %eax
cmpl 0x110(%r15), %eax
jne 0x138b5
testq %rax, %rax
je 0x1373b
movq 0x108(%r13), %rcx
movq 0x108(%r15), %rdx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
cmpb (%rdx,%rsi), %dil
jne 0x138b5
incq %rsi
cmpq %rsi, %rax
jne 0x137b2
jmp 0x1373b
movl 0xf4(%r13), %eax
cmpl 0xf4(%r15), %eax
jne 0x138b5
testl %eax, %eax
jne 0x1373b
movl 0xc8(%r13), %eax
cmpl 0xc8(%r15), %eax
jne 0x138b5
testl %eax, %eax
je 0x13815
movl 0xcc(%r13), %eax
cmpl 0xcc(%r15), %eax
jne 0x138b5
movl 0xd0(%r13), %eax
cmpl 0xd0(%r15), %eax
jne 0x138b5
testl %eax, %eax
je 0x1373b
movl 0xd4(%r13), %eax
cmpl 0xd4(%r15), %eax
jne 0x138b5
movl 0xd8(%r13), %eax
cmpl 0xd8(%r15), %eax
jne 0x138b5
movl 0xdc(%r13), %eax
cmpl 0xdc(%r15), %eax
jne 0x138b5
movl 0xe0(%r13), %eax
cmpl 0xe0(%r15), %eax
jne 0x138b5
movl 0xe4(%r13), %eax
cmpl 0xe4(%r15), %eax
jne 0x138b5
movl 0xe8(%r13), %eax
cmpl 0xe8(%r15), %eax
jne 0x138b5
movl 0xec(%r13), %eax
cmpl 0xec(%r15), %eax
jne 0x138b5
movl 0xf0(%r13), %eax
cmpl 0xf0(%r15), %eax
je 0x1373b
movl %ebp, %eax
movl 0x10(%rsp), %ebx
movl %ebx, %edi
imulq %rax, %rdi
movq %rdi, %rax
shrq $0x3c, %rax
movl $0x5c, %r13d
jne 0x13928
shlq $0x4, %rdi
callq 0x22b0
movq %rax, %r15
leaq 0x2c(%rsp), %rsi
movq %rax, %rdi
movq 0x20(%rsp), %rdx
movl %ebp, %ecx
movl %ebx, %r8d
movq %r12, %r9
callq 0x1199b
movl %eax, %r13d
testl %eax, %eax
jne 0x13920
movl 0x14(%rsp), %eax
movl %eax, (%rsp)
leaq 0x2c(%rsp), %r9
movq 0x18(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %ebx, %ecx
movq %r14, %r8
callq 0x12c8c
movl %eax, %r13d
movq %r15, %rdi
callq 0x22a0
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq