// File: /workspace/github_cpp_makefile_star2_O1/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, -0x34(%rbp)
movl %r8d, -0x30(%rbp)
movl %ecx, -0x2c(%rbp)
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, -0x40(%rbp)
movl $0x20, %edi
callq 0x5420
movq %rax, %r15
xorl %ebx, %ebx
testq %rax, %rax
setne %bl
leal (,%rbx,4), %r13d
shll $0x5, %ebx
bswapl %r12d
movl %r12d, -0x4(%rax,%r13)
leaq 0x4(%r13), %r12
leal (,%r12,4), %eax
cmpl %ebx, %eax
jbe 0x210f4
leal (,%r12,8), %esi
movq %r15, %rdi
movq %rsi, -0x48(%rbp)
callq 0x5500
testq %rax, %rax
je 0x210f7
movq %rax, %r15
movq %r12, %r13
movq -0x48(%rbp), %rbx
jmp 0x210f7
movq %r12, %r13
bswapl %r14d
movl %r14d, -0x4(%r15,%r13)
leaq 0x1(%r13), %r12
leal (,%r12,4), %eax
cmpl %ebx, %eax
jbe 0x21131
leal (,%r12,8), %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x5500
testq %rax, %rax
je 0x21135
xorl %ecx, %ecx
movq %rax, %r15
movq %r14, %rbx
jmp 0x2113a
xorl %ecx, %ecx
jmp 0x2113a
movb $0x1, %cl
movq %r13, %r12
testb %cl, %cl
jne 0x21146
movl -0x2c(%rbp), %eax
movb %al, -0x1(%r15,%r12)
leaq 0x1(%r12), %r13
leal (,%r13,4), %eax
cmpl %ebx, %eax
jbe 0x21179
leal (,%r13,8), %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x5500
testq %rax, %rax
je 0x2117d
xorl %ecx, %ecx
movq %rax, %r15
movq %r14, %rbx
jmp 0x21182
xorl %ecx, %ecx
jmp 0x21182
movb $0x1, %cl
movq %r12, %r13
testb %cl, %cl
jne 0x2118e
movl -0x30(%rbp), %eax
movb %al, -0x1(%r15,%r13)
leaq 0x1(%r13), %r12
leal (,%r12,4), %eax
cmpl %ebx, %eax
jbe 0x211c0
leal (,%r12,8), %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x5500
testq %rax, %rax
je 0x211c4
xorl %ecx, %ecx
movq %rax, %r15
movq %r14, %rbx
jmp 0x211c9
xorl %ecx, %ecx
jmp 0x211c9
movb $0x1, %cl
movq %r13, %r12
testb %cl, %cl
jne 0x211d3
movb $0x0, -0x1(%r15,%r12)
leaq 0x1(%r12), %r13
leal (,%r13,4), %eax
cmpl %ebx, %eax
jbe 0x21206
leal (,%r13,8), %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x5500
testq %rax, %rax
je 0x2120a
xorl %ecx, %ecx
movq %rax, %r15
movq %r14, %rbx
jmp 0x2120f
xorl %ecx, %ecx
jmp 0x2120f
movb $0x1, %cl
movq %r12, %r13
testb %cl, %cl
jne 0x21219
movb $0x0, -0x1(%r15,%r13)
leaq 0x1(%r13), %r14
leal (,%r14,4), %eax
cmpl %ebx, %eax
jbe 0x21249
leal (,%r14,8), %esi
movq %r15, %rdi
callq 0x5500
testq %rax, %rax
movq -0x40(%rbp), %rbx
je 0x21251
xorl %ecx, %ecx
movq %rax, %r15
jmp 0x21256
xorl %ecx, %ecx
movq -0x40(%rbp), %rbx
jmp 0x21256
movb $0x1, %cl
movq %r13, %r14
testb %cl, %cl
jne 0x21262
movl -0x34(%rbp), %eax
movb %al, -0x1(%r15,%r14)
leaq 0x8(%rbx), %rsi
leaq 0x10974(%rip), %rcx     # 0x31be1
movq %rbx, %rdi
movl %r14d, %edx
movq %r15, %r8
callq 0x1d440
testl %eax, %eax
jne 0x21287
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 0x5390