// File: /workspace/github_cpp_makefile_star2_O3/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: addChunk_IHDR(ucvector*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h, unsigned bitDepth, unsigned colorType, unsigned interlaceMethod)
{
  unsigned error = 0;
  ucvector header;
  ucvector_init(&header);
  
  LodePNG_add32bitInt(&header, w); /*width*/
  LodePNG_add32bitInt(&header, h); /*height*/
  ucvector_push_back(&header, (unsigned char)bitDepth); /*bit depth*/
  ucvector_push_back(&header, (unsigned char)colorType); /*color type*/
  ucvector_push_back(&header, 0); /*compression method*/
  ucvector_push_back(&header, 0); /*filter method*/
  ucvector_push_back(&header, interlaceMethod); /*interlace method*/
  
  error = addChunk(out, "IHDR", header.data, header.size);
  ucvector_cleanup(&header);
  
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, -0x40(%rbp)
movl %r8d, -0x30(%rbp)
movl %ecx, -0x3c(%rbp)
movl %edx, %r13d
movl %esi, %ebx
movq %rdi, -0x48(%rbp)
movl $0x20, %r12d
movl $0x20, %edi
callq 0x4410
movq %rax, %r15
xorl %r14d, %r14d
testq %rax, %rax
setne %r14b
shll $0x2, %r14d
leaq 0x4(%r14), %rax
bswapl %ebx
movl %ebx, -0x4(%r15,%r14)
testq %r15, %r15
je 0x1fe3e
movq %rax, %r14
jmp 0x1fe64
movq %rax, %rbx
leal (,%rax,8), %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0x44f0
testq %rax, %rax
je 0x1fe61
movq %rax, %r15
movq %rbx, %r14
jmp 0x1fe64
xorl %r12d, %r12d
bswapl %r13d
movl %r13d, -0x4(%r15,%r14)
leaq 0x1(%r14), %rax
leal (,%rax,4), %ebx
cmpq %r12, %rbx
movq %rax, -0x38(%rbp)
jbe 0x1fea2
leal (,%rax,8), %r13d
movq %r15, %rdi
movq %r13, %rsi
callq 0x44f0
testq %rax, %rax
jne 0x1fea8
movq -0x38(%rbp), %rdx
movq %r14, -0x38(%rbp)
jmp 0x1fec4
movq %r15, %rax
movq %r12, %r13
movl -0x3c(%rbp), %ecx
movb %cl, (%rax,%r14)
addq $0x2, %r14
leal (,%r14,4), %ebx
movq %r14, %rdx
movq %r13, %r12
movq %rax, %r15
cmpl %r12d, %ebx
jbe 0x1fef0
leal (,%rdx,8), %r14d
movq %r15, %rdi
movq %r14, %rsi
movq %rdx, %r13
callq 0x44f0
movq %r13, %rdx
testq %rax, %rax
jne 0x1fef6
movq %rdx, %rcx
movq -0x38(%rbp), %rdx
jmp 0x1ff0e
movq %r15, %rax
movq %r12, %r14
movl -0x30(%rbp), %ecx
movb %cl, -0x1(%rax,%rdx)
leaq 0x1(%rdx), %rcx
leal (,%rcx,4), %ebx
movq %r14, %r12
movq %rax, %r15
cmpl %r12d, %ebx
jbe 0x1ff3e
movq %rdx, -0x30(%rbp)
leal (,%rcx,8), %r13d
movq %r15, %rdi
movq %r13, %rsi
movq %rcx, %r14
callq 0x44f0
movq %r14, %rcx
testq %rax, %rax
jne 0x1ff44
movq %rcx, %r14
movq -0x30(%rbp), %rcx
jmp 0x1ff5b
movq %r15, %rax
movq %r12, %r13
movb $0x0, -0x1(%rax,%rcx)
leaq 0x1(%rcx), %r14
leal (,%r14,4), %ebx
movq %r13, %r12
movq %rax, %r15
cmpl %r12d, %ebx
jbe 0x1ff88
movq %rcx, -0x30(%rbp)
leal (,%r14,8), %r13d
movq %r15, %rdi
movq %r13, %rsi
callq 0x44f0
movq %r13, %rcx
testq %rax, %rax
jne 0x1ff8e
movq %r14, %r13
movq -0x30(%rbp), %r14
jmp 0x1ffa6
movq %r15, %rax
movq %r12, %rcx
movb $0x0, -0x1(%rax,%r14)
leaq 0x1(%r14), %r13
leal (,%r13,4), %ebx
movq %rcx, %r12
movq %rax, %r15
cmpl %r12d, %ebx
jbe 0x1ffc6
leal (,%r13,8), %esi
movq %r15, %rdi
callq 0x44f0
testq %rax, %rax
movq -0x48(%rbp), %rbx
jne 0x1ffcd
jmp 0x1ffdb
movq %r15, %rax
movq -0x48(%rbp), %rbx
movl -0x40(%rbp), %ecx
movb %cl, -0x1(%rax,%r13)
movq %r13, %r14
movq %rax, %r15
leaq 0x8(%rbx), %rsi
leaq 0x10c0b(%rip), %rcx     # 0x30bf1
movq %rbx, %rdi
movl %r14d, %edx
movq %r15, %r8
callq 0x1c3c3
testl %eax, %eax
jne 0x20000
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4380