// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: Adam7_getpassvalues
static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8],
                                size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp)
{
  /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/
  unsigned i;

  /*calculate width and height in pixels of each pass*/
  for(i = 0; i != 7; ++i)
  {
    passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i];
    passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i];
    if(passw[i] == 0) passh[i] = 0;
    if(passh[i] == 0) passw[i] = 0;
  }

  filter_passstart[0] = padded_passstart[0] = passstart[0] = 0;
  for(i = 0; i != 7; ++i)
  {
    /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/
    filter_passstart[i + 1] = filter_passstart[i]
                            + ((passw[i] && passh[i]) ? passh[i] * (1 + (passw[i] * bpp + 7) / 8) : 0);
    /*bits padded if needed to fill full byte at end of each scanline*/
    padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7) / 8);
    /*only padded at end of reduced image*/
    passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7) / 8;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
cmpl $0x7, -0x30(%rbp)
je 0xf61b
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
movl %ecx, %edx
leaq 0x4f2e(%rip), %rcx      # 0x14490
addl (%rcx,%rdx,4), %eax
movl -0x30(%rbp), %ecx
movl %ecx, %edx
leaq 0x4f3f(%rip), %rcx      # 0x144b0
subl (%rcx,%rdx,4), %eax
subl $0x1, %eax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
leaq 0x4f0d(%rip), %rcx      # 0x14490
xorl %edx, %edx
divl (%rcx,%rsi,4)
movl %eax, %edx
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl 0x10(%rbp), %eax
movl -0x30(%rbp), %ecx
movl %ecx, %edx
leaq 0x4f2d(%rip), %rcx      # 0x144d0
addl (%rcx,%rdx,4), %eax
movl -0x30(%rbp), %ecx
movl %ecx, %edx
leaq 0x4f3e(%rip), %rcx      # 0x144f0
subl (%rcx,%rdx,4), %eax
subl $0x1, %eax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
leaq 0x4f0c(%rip), %rcx      # 0x144d0
xorl %edx, %edx
divl (%rcx,%rsi,4)
movl %eax, %edx
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0xf5f0
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl $0x0, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0xf60b
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
movl $0x0, (%rax,%rcx,4)
jmp 0xf60d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xf549
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x30(%rbp)
cmpl $0x7, -0x30(%rbp)
je 0xf750
movq -0x18(%rbp), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
je 0xf69f
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
je 0xf69f
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movl -0x30(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
imull 0x18(%rbp), %ecx
addl $0x7, %ecx
shrl $0x3, %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl %eax, -0x3c(%rbp)
jmp 0xf6a6
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0xf6a6
movq -0x38(%rbp), %rdx
movl -0x3c(%rbp), %eax
movl %eax, %eax
addq %rax, %rdx
movq -0x18(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movl -0x30(%rbp), %esi
movl (%rcx,%rsi,4), %ecx
imull 0x18(%rbp), %ecx
addl $0x7, %ecx
shrl $0x3, %ecx
imull %ecx, %eax
movl %eax, %eax
addq %rax, %rdx
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movl -0x30(%rbp), %esi
imull (%rcx,%rsi,4), %eax
imull 0x18(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
addq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xf643
popq %rbp
retq
nopw %cs:(%rax,%rax)