// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movl %r9d, 0x2c(%rsp)
movl %r8d, %r12d
movl %ecx, 0x20(%rsp)
movl %edx, %r15d
movq %rdi, 0x30(%rsp)
xorps %xmm0, %xmm0
movq %rsp, %r13
movaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movq %r13, %rdi
callq 0x4746
movq %r13, %rdi
movl %r15d, %esi
callq 0x4746
movq (%r13), %r15
movq 0x8(%r13), %r14
leaq 0x1(%r14), %rcx
movq 0x10(%r13), %rbp
cmpq %rcx, %rbp
jae 0x904b
leaq (,%rbp,2), %rax
leaq (%rcx,%rcx,2), %r13
shrq %r13
cmpq %rcx, %rax
cmovbq %rcx, %r13
movq %r15, %rdi
movq %r13, %rsi
movq %rcx, %rbx
callq 0x1130
testq %rax, %rax
je 0x91d6
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
cmpq %rbx, %rbp
movq 0x30(%rsp), %r14
jae 0x9095
movq %rcx, %r12
leaq (,%rbp,2), %rax
leaq (%rbx,%rbx,2), %r13
shrq %r13
cmpq %rbx, %rax
cmovbq %rbx, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x1130
testq %rax, %rax
je 0x90b6
movq %r13, 0x10(%rsp)
movq %rax, (%rsp)
movq %rax, %r15
movq %rbx, 0x8(%rsp)
movl 0x20(%rsp), %eax
movb %al, -0x1(%r15,%rbx)
movq (%rsp), %r15
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %rbp
leaq 0x1(%r12), %rbx
cmpq %rbx, %rbp
jae 0x90f9
movq %r12, 0x20(%rsp)
leaq (,%rbp,2), %rax
leaq (%rbx,%rbx,2), %r12
shrq %r12
cmpq %rbx, %rax
cmovbq %rbx, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1130
testq %rax, %rax
je 0x91de
movq %r12, 0x10(%rsp)
movq %rax, (%rsp)
movq %rax, %r15
movq %r12, %rbp
movb $0x0, -0x1(%r15,%rbx)
leaq 0x1(%rbx), %r13
cmpq %r13, %rbp
jae 0x9141
leaq (,%rbp,2), %rax
leaq (,%r13,2), %r12
addq %r13, %r12
shrq %r12
cmpq %r13, %rax
cmovbq %r13, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1130
testq %rax, %rax
je 0x915a
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 0x918a
addq %rbp, %rbp
leaq (,%r13,2), %rsi
addq %r13, %rsi
shrq %rsi
cmpq %r13, %rbp
cmovbq %r13, %rsi
movq %r15, %rdi
callq 0x1130
testq %rax, %rax
jne 0x918d
jmp 0x919c
movq %r15, %rax
movl 0x2c(%rsp), %ecx
movb %cl, -0x1(%rax,%r13)
movq %r13, %rbx
movq %rax, %r15
leaq 0x8(%r14), %rsi
leaq 0x59ad(%rip), %rcx      # 0xeb54
movq %r14, %rdi
movl %ebx, %edx
movq %r15, %r8
callq 0x4a14
testl %eax, %eax
jne 0x91c0
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 0x1030
movq %r14, %rcx
jmp 0x9056
movq %rbx, %r13
movq 0x20(%rsp), %rbx
jmp 0x9103