// File: /workspace/github_cpp_makefile_star2_O2/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 0x120cf
movl %eax, %ebx
movq %r15, %rdi
callq 0x120cf
cmpl %eax, %ebx
jne 0x10f82
testl %ebx, %ebx
je 0x10e45
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 0x5390
movl 0xfc(%r13), %eax
cmpl 0xfc(%r15), %eax
jne 0x10f82
testl %eax, %eax
je 0x10e9a
movl 0x110(%r13), %eax
cmpl 0x110(%r15), %eax
jne 0x10f82
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x10e0f
movq 0x108(%r13), %rdx
movb (%rdx,%rcx), %dl
movq 0x108(%r15), %rsi
leaq 0x1(%rcx), %rdi
cmpb (%rsi,%rcx), %dl
movq %rdi, %rcx
je 0x10e73
jmp 0x10f82
movl 0xf4(%r13), %eax
cmpl 0xf4(%r15), %eax
jne 0x10f82
testl %eax, %eax
jne 0x10e0f
movl 0xc8(%r13), %eax
cmpl 0xc8(%r15), %eax
jne 0x10f82
testl %eax, %eax
je 0x10ee2
movl 0xcc(%r13), %eax
cmpl 0xcc(%r15), %eax
jne 0x10f82
movl 0xd0(%r13), %eax
cmpl 0xd0(%r15), %eax
jne 0x10f82
testl %eax, %eax
je 0x10e0f
movl 0xd4(%r13), %eax
cmpl 0xd4(%r15), %eax
jne 0x10f82
movl 0xd8(%r13), %eax
cmpl 0xd8(%r15), %eax
jne 0x10f82
movl 0xdc(%r13), %eax
cmpl 0xdc(%r15), %eax
jne 0x10f82
movl 0xe0(%r13), %eax
cmpl 0xe0(%r15), %eax
jne 0x10f82
movl 0xe4(%r13), %eax
cmpl 0xe4(%r15), %eax
jne 0x10f82
movl 0xe8(%r13), %eax
cmpl 0xe8(%r15), %eax
jne 0x10f82
movl 0xec(%r13), %eax
cmpl 0xec(%r15), %eax
jne 0x10f82
movl 0xf0(%r13), %eax
cmpl 0xf0(%r15), %eax
je 0x10e0f
movl %ebp, %eax
movl 0x10(%rsp), %ebx
movl %ebx, %edi
imulq %rax, %rdi
movq %rdi, %rax
shrq $0x3c, %rax
jne 0x10ff1
shlq $0x4, %rdi
callq 0x2280
movq %rax, %r15
leaq 0x2c(%rsp), %rsi
movq %rax, %rdi
movq 0x20(%rsp), %rdx
movl %ebp, %ecx
movl %ebx, %r8d
movq %r12, %r9
callq 0xf697
movl %eax, %r12d
testl %eax, %eax
jne 0x10fe7
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 0x1051a
movl %eax, %r12d
movq %r15, %rdi
callq 0x2260
jmp 0x10ff5
pushq $0x5c
popq %r12
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq