// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: addChunk_IHDR
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
xorps %xmm0, %xmm0
movq %rsp, %r13
movaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movq %r13, %rdi
callq 0x408c
movq %r13, %rdi
movl %r12d, %esi
callq 0x408c
movq 0x8(%r13), %rbp
movq 0x10(%r13), %rax
incq %rbp
cmpq %rbp, %rax
jae 0x897b
addq %rax, %rax
leaq (,%rbp,2), %r12
addq %rbp, %r12
shrq %r12
cmpq %rbp, %rax
cmovbq %rbp, %r12
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x1120
testq %rax, %rax
je 0x8989
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 0x89c6
addq %rax, %rax
leaq (%r12,%r12,2), %r15
shrq %r15
cmpq %r12, %rax
cmovbq %r12, %r15
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x1120
testq %rax, %rax
je 0x89d4
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 0x8a11
addq %rax, %rax
leaq (%r15,%r15,2), %r14
shrq %r14
cmpq %r15, %rax
cmovbq %r15, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x1120
testq %rax, %rax
je 0x8a20
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 0x8a5d
addq %rax, %rax
leaq (%r15,%r15,2), %r14
shrq %r14
cmpq %r15, %rax
cmovbq %r15, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x1120
testq %rax, %rax
je 0x8a6c
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 0x8aa9
addq %rax, %rax
leaq (%r15,%r15,2), %r14
shrq %r14
cmpq %r15, %rax
cmovbq %r15, %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x1120
testq %rax, %rax
je 0x8abb
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 0x5fa2(%rip), %rcx      # 0xea74
movq %rbx, %rdi
movq %r14, %r8
callq 0x4357
testl %eax, %eax
jne 0x8ae9
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %r14, %rdi
callq 0x1030
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq