// File: /workspace/github_cpp_makefile_star2_O3/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addChunk_IHDR(ucvector*, unsigned int, unsigned int, LodePNGColorType, unsigned int, unsigned int)
static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h,
                              LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method)
{
  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, interlace_method); /*interlace method*/

  error = addChunk(out, "IHDR", header.data, header.size);
  ucvector_cleanup(&header);

  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
vxorps %xmm0, %xmm0, %xmm0
movq %rsp, %r13
movl %r9d, 0x2c(%rsp)
movl %ecx, 0x20(%rsp)
movq %rdi, 0x30(%rsp)
movq %r13, %rdi
movl %r8d, %r12d
movl %edx, %r15d
movq $0x0, 0x10(%r13)
vmovaps %xmm0, (%r13)
callq 0x720d
movq %r13, %rdi
movl %r15d, %esi
callq 0x720d
movq 0x8(%r13), %r14
movq (%r13), %r15
movq 0x10(%r13), %rbp
leaq 0x1(%r14), %rcx
cmpq %rcx, %rbp
jae 0xba7f
leaq (%rcx,%rcx,2), %r13
leaq (%rbp,%rbp), %rax
movq %r15, %rdi
movq %rcx, %rbx
shrq %r13
cmpq %rcx, %rax
cmovbq %rcx, %r13
movq %r13, %rsi
callq 0x2260
testq %rax, %rax
je 0xbbf5
movq %r13, 0x10(%rsp)
movq %rax, (%rsp)
movq %rax, %r15
movq %r13, %rbp
movq %rbx, %rcx
movb %r12b, (%r15,%r14)
addq $0x2, %r14
movq %r14, %rbx
movq 0x30(%rsp), %r14
cmpq %rbx, %rbp
jae 0xbac6
leaq (%rbx,%rbx,2), %r13
leaq (%rbp,%rbp), %rax
movq %rcx, %r12
movq %r15, %rdi
shrq %r13
cmpq %rbx, %rax
cmovbq %rbx, %r13
movq %r13, %rsi
callq 0x2260
testq %rax, %rax
je 0xbae7
movq %r13, 0x10(%rsp)
movq %rax, %r15
movq %rax, (%rsp)
movl 0x20(%rsp), %eax
movq %rbx, 0x8(%rsp)
movb %al, -0x1(%r15,%rbx)
movq 0x8(%rsp), %r12
movq (%rsp), %r15
movq 0x10(%rsp), %rbp
leaq 0x1(%r12), %rbx
cmpq %rbx, %rbp
jae 0xbb27
movq %r12, 0x20(%rsp)
leaq (%rbx,%rbx,2), %r12
leaq (%rbp,%rbp), %rax
movq %r15, %rdi
shrq %r12
cmpq %rbx, %rax
cmovbq %rbx, %r12
movq %r12, %rsi
callq 0x2260
testq %rax, %rax
je 0xbbfd
movq %r12, 0x10(%rsp)
movq %rax, (%rsp)
movq %rax, %r15
movq %r12, %rbp
leaq 0x1(%rbx), %r13
movb $0x0, -0x1(%r15,%rbx)
cmpq %r13, %rbp
jae 0xbb66
leaq (%r13,%r13,2), %r12
leaq (%rbp,%rbp), %rax
movq %r15, %rdi
shrq %r12
cmpq %r13, %rax
cmovbq %r13, %r12
movq %r12, %rsi
callq 0x2260
testq %rax, %rax
je 0xbb7f
movq %rax, %r15
movq %r12, 0x10(%rsp)
movq %rax, (%rsp)
movq %r13, 0x8(%rsp)
movb $0x0, -0x1(%r15,%r13)
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %rbp
leaq 0x1(%rbx), %r13
movq (%rsp), %r15
cmpq %r13, %rbp
jae 0xbba9
leaq (%r13,%r13,2), %rsi
addq %rbp, %rbp
movq %r15, %rdi
shrq %rsi
cmpq %r13, %rbp
cmovbq %r13, %rsi
callq 0x2260
testq %rax, %rax
jne 0xbbac
jmp 0xbbbb
movq %r15, %rax
movl 0x2c(%rsp), %ecx
movq %r13, %rbx
movq %rax, %r15
movb %cl, -0x1(%rax,%r13)
leaq 0x8(%r14), %rsi
leaq 0x67a2(%rip), %rcx      # 0x12368
movq %r14, %rdi
movl %ebx, %edx
movq %r15, %r8
callq 0x74dc
testl %eax, %eax
jne 0xbbdf
movq 0x8(%r14), %rax
movq %rax, 0x10(%r14)
movq %r15, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %r14, %rcx
jmp 0xba8a
movq %rbx, %r13
movq 0x20(%rsp), %rbx
jmp 0xbb31