// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movl %r9d, 0x24(%rsp)
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %r12d
movq %rdi, %rbx
vxorps %xmm0, %xmm0, %xmm0
movq %rsp, %r13
vmovaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movq %r13, %rdi
callq 0x7201
movq %r13, %rdi
movl %r12d, %esi
callq 0x7201
movq 0x8(%r13), %rbp
movq 0x10(%r13), %rax
incq %rbp
cmpq %rbp, %rax
jae 0xbacf
addq %rax, %rax
leaq (%rbp,%rbp,2), %r12
shrq %r12
cmpq %rbp, %rax
cmovbq %rbp, %r12
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x2260
testq %rax, %rax
je 0xbadd
movq %r12, 0x10(%rsp)
movq %rax, (%rsp)
movq %rbp, 0x8(%rsp)
movq (%rsp), %rax
movb %r15b, -0x1(%rax,%rbp)
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %rax
incq %r12
cmpq %r12, %rax
jae 0xbb1a
addq %rax, %rax
leaq (%r12,%r12,2), %r15
shrq %r15
cmpq %r12, %rax
cmovbq %r12, %r15
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x2260
testq %rax, %rax
je 0xbb28
movq %r15, 0x10(%rsp)
movq %rax, (%rsp)
movq %r12, 0x8(%rsp)
movq (%rsp), %rax
movb %r14b, -0x1(%rax,%r12)
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rax
incq %r15
cmpq %r15, %rax
jae 0xbb65
addq %rax, %rax
leaq (%r15,%r15,2), %r14
shrq %r14
cmpq %r15, %rax
cmovbq %r15, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x2260
testq %rax, %rax
je 0xbb74
movq %r14, 0x10(%rsp)
movq %rax, (%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, -0x1(%rax,%r15)
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rax
incq %r15
cmpq %r15, %rax
jae 0xbbb1
addq %rax, %rax
leaq (%r15,%r15,2), %r14
shrq %r14
cmpq %r15, %rax
cmovbq %r15, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x2260
testq %rax, %rax
je 0xbbc0
movq %r14, 0x10(%rsp)
movq %rax, (%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, -0x1(%rax,%r15)
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rax
incq %r15
cmpq %r15, %rax
jae 0xbbfd
addq %rax, %rax
leaq (%r15,%r15,2), %r14
shrq %r14
cmpq %r15, %rax
cmovbq %r15, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x2260
testq %rax, %rax
je 0xbc0f
movq %r14, 0x10(%rsp)
movq %rax, (%rsp)
movq %r15, 0x8(%rsp)
movq (%rsp), %rax
movl 0x24(%rsp), %ecx
movb %cl, -0x1(%rax,%r15)
leaq 0x8(%rsp), %r15
movq -0x8(%r15), %r14
movl (%r15), %edx
leaq 0x8(%rbx), %rsi
leaq 0x66e2(%rip), %rcx      # 0x12308
movq %rbx, %rdi
movq %r14, %r8
callq 0x74cd
testl %eax, %eax
jne 0xbc3d
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, (%r15)
movq %r14, %rdi
callq 0x21b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq