#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ stage_scale2x(unsigned char *, unsigned char *,
                                 unsigned char const *, unsigned char const *,
                                 unsigned char const *, unsigned int,
                                 unsigned int);
int /*<<< orphan*/ stage_scale4x(unsigned char *, unsigned char *,
                                 unsigned char *, unsigned char *,
                                 unsigned char *, unsigned char *,
                                 unsigned char *, unsigned char *, unsigned int,
                                 unsigned int);
void scale4x_buf(void *void_dst, unsigned dst_slice, void *void_mid,
                 unsigned mid_slice, const void *void_src, unsigned src_slice,
                 unsigned pixel, unsigned width, unsigned height) {
  unsigned char *dst = (unsigned char *)void_dst;
  const unsigned char *src = (unsigned char *)void_src;
  unsigned count;
  unsigned char *mid[6];
  assert(height >= 4);
  count = height;
  mid[0] = (unsigned char *)void_mid;
  mid[1] = mid[0] + mid_slice;
  mid[2] = mid[1] + mid_slice;
  mid[3] = mid[2] + mid_slice;
  mid[4] = mid[3] + mid_slice;
  mid[5] = mid[4] + mid_slice;
  stage_scale2x((mid[(-2 + 6)]), (mid[(-1 + 6)]), (src + (0) * src_slice),
                (src + (0) * src_slice), (src + (1) * src_slice), pixel, width);
  stage_scale2x((mid[(0)]), (mid[(1)]), (src + (0) * src_slice),
                (src + (1) * src_slice), (src + (2) * src_slice), pixel, width);
  stage_scale2x((mid[(2)]), (mid[(3)]), (src + (1) * src_slice),
                (src + (2) * src_slice), (src + (3) * src_slice), pixel, width);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice),
                (dst + (2) * dst_slice), (dst + (3) * dst_slice),
                (mid[(-2 + 6)]), (mid[(-2 + 6)]), (mid[(-1 + 6)]), (mid[(0)]),
                pixel, width);
  dst = (dst + (4) * dst_slice);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice),
                (dst + (2) * dst_slice), (dst + (3) * dst_slice),
                (mid[(-1 + 6)]), (mid[(0)]), (mid[(1)]), (mid[(2)]), pixel,
                width);
  dst = (dst + (4) * dst_slice);
  count -= 4;
  while (count) {
    unsigned char *tmp;
    stage_scale2x((mid[(4)]), (mid[(5)]), (src + (2) * src_slice),
                  (src + (3) * src_slice), (src + (4) * src_slice), pixel,
                  width);
    stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice),
                  (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(1)]),
                  (mid[(2)]), (mid[(3)]), (mid[(4)]), pixel, width);
    dst = (dst + (4) * dst_slice);
    src = (src + (1) * src_slice);
    tmp = (mid[(0)]);
    (mid[(0)]) = (mid[(2)]);
    (mid[(2)]) = (mid[(4)]);
    (mid[(4)]) = tmp;
    tmp = (mid[(1)]);
    (mid[(1)]) = (mid[(3)]);
    (mid[(3)]) = (mid[(5)]);
    (mid[(5)]) = tmp;
    --count;
  }
  stage_scale2x((mid[(4)]), (mid[(5)]), (src + (2) * src_slice),
                (src + (3) * src_slice), (src + (3) * src_slice), pixel, width);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice),
                (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(1)]),
                (mid[(2)]), (mid[(3)]), (mid[(4)]), pixel, width);
  dst = (dst + (4) * dst_slice);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice),
                (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(3)]),
                (mid[(4)]), (mid[(5)]), (mid[(5)]), pixel, width);
}


x86 assembly (clang, -O0):
<scale4x_buf>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xa8,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x4,0x20(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x20(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x48(%rbp),%rdx
imul   $0x0,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
imul   $0x0,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x48(%rbp),%r8
mov    -0x34(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%r8
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <stage_scale2x@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x48(%rbp),%rdx
imul   $0x0,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
mov    -0x34(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x48(%rbp),%r8
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%r8
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <stage_scale2x@plt>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x34(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x48(%rbp),%r8
imul   $0x3,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%r8
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <stage_scale2x@plt>
mov    -0x40(%rbp),%rdi
imul   $0x0,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rsi
mov    -0x40(%rbp),%rdx
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x40(%rbp),%rcx
imul   $0x3,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x60(%rbp),%r8
mov    -0x60(%rbp),%r9
mov    -0x58(%rbp),%rbx
mov    -0x80(%rbp),%r11
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1050 <stage_scale4x@plt>
mov    -0x40(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
imul   $0x0,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rsi
mov    -0x40(%rbp),%rdx
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x40(%rbp),%rcx
imul   $0x3,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x58(%rbp),%r8
mov    -0x80(%rbp),%r9
mov    -0x78(%rbp),%rbx
mov    -0x70(%rbp),%r11
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1050 <stage_scale4x@plt>
mov    -0x40(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x4c(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     14c1 <scale4x_buf+0x391>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x48(%rbp),%r8
mov    -0x34(%rbp),%eax
shl    $0x2,%eax
mov    %eax,%eax
add    %rax,%r8
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <stage_scale2x@plt>
mov    -0x40(%rbp),%rdi
imul   $0x0,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rsi
mov    -0x40(%rbp),%rdx
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x40(%rbp),%rcx
imul   $0x3,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x78(%rbp),%r8
mov    -0x70(%rbp),%r9
mov    -0x68(%rbp),%rbx
mov    -0x60(%rbp),%r11
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1050 <stage_scale4x@plt>
mov    -0x40(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x0,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x4c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    138f <scale4x_buf+0x25f>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x48(%rbp),%r8
imul   $0x3,-0x34(%rbp),%eax
mov    %eax,%eax
add    %rax,%r8
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <stage_scale2x@plt>
mov    -0x40(%rbp),%rdi
imul   $0x0,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rsi
mov    -0x40(%rbp),%rdx
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x40(%rbp),%rcx
imul   $0x3,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x78(%rbp),%r8
mov    -0x70(%rbp),%r9
mov    -0x68(%rbp),%rbx
mov    -0x60(%rbp),%r11
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1050 <stage_scale4x@plt>
mov    -0x40(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
imul   $0x0,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
mov    %eax,%eax
add    %rax,%rsi
mov    -0x40(%rbp),%rdx
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
add    %rax,%rdx
mov    -0x40(%rbp),%rcx
imul   $0x3,-0x14(%rbp),%eax
mov    %eax,%eax
add    %rax,%rcx
mov    -0x68(%rbp),%r8
mov    -0x60(%rbp),%r9
mov    -0x58(%rbp),%rbx
mov    -0x58(%rbp),%r11
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1050 <stage_scale4x@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale4x_buf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9d,%r15d
mov    %r8,%rbp
mov    %ecx,%r14d
mov    %rdx,%r13
mov    %rdx,(%rsp)
mov    %rsi,0x28(%rsp)
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x4,0xc0(%rsp)
04
setae  %dil
call   1040 <assert@plt>
mov    %r14d,%r12d
lea    (%r12,%r13,1),%rax
mov    %rax,0x10(%rsp)
add    %r12,%rax
mov    %rax,0x48(%rsp)
lea    (%rax,%r12,1),%r13
lea    (%r12,%r13,1),%rdi
mov    %rdi,0x18(%rsp)
add    %rdi,%r12
mov    %r15,0x20(%rsp)
mov    %r15d,%eax
mov    %rax,0x70(%rsp)
lea    (%rax,%rbp,1),%r14
sub    $0x8,%rsp
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    0xb8(%rsp),%r9d
mov    0xc0(%rsp),%eax
push   %rax
call   1030 <stage_scale2x@plt>
add    $0x10,%rsp
lea    (%r15,%r15,1),%eax
mov    %rax,0x58(%rsp)
lea    (%rax,%rbp,1),%r15
sub    $0x8,%rsp
mov    0x8(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %r15,%r8
mov    0xb8(%rsp),%r9d
mov    0xc0(%rsp),%eax
push   %rax
call   1030 <stage_scale2x@plt>
add    $0x10,%rsp
mov    0x20(%rsp),%rax
lea    (%rax,%rax,2),%eax
mov    %rax,0x50(%rsp)
lea    (%rax,%rbp,1),%r8
sub    $0x8,%rsp
mov    0x50(%rsp),%rdi
mov    %r13,0x48(%rsp)
mov    %r13,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    0xb8(%rsp),%r9d
mov    0xc0(%rsp),%eax
push   %rax
call   1030 <stage_scale2x@plt>
add    $0x10,%rsp
mov    0x28(%rsp),%r14
mov    %r14d,%eax
mov    %rax,0x30(%rsp)
lea    (%rbx,%rax,1),%rsi
lea    (%r14,%r14,1),%r15d
lea    (%rbx,%r15,1),%rdx
lea    (%r14,%r14,2),%r13d
lea    (%rbx,%r13,1),%rcx
mov    %rbx,%rdi
mov    0x18(%rsp),%r8
mov    %r8,%r9
mov    0xb8(%rsp),%eax
push   %rax
mov    0xb8(%rsp),%eax
push   %rax
push   0x10(%rsp)
push   %r12
call   1050 <stage_scale4x@plt>
add    $0x20,%rsp
shl    $0x2,%r14d
add    %r14,%rbx
mov    0x30(%rsp),%rax
lea    (%rbx,%rax,1),%rsi
mov    %r15,0x68(%rsp)
lea    (%rbx,%r15,1),%rdx
mov    0x48(%rsp),%r15
mov    %r13,0x60(%rsp)
lea    (%rbx,%r13,1),%rcx
mov    0x10(%rsp),%r13
mov    %rbx,%rdi
mov    %r12,0x8(%rsp)
mov    %r12,%r8
mov    (%rsp),%r9
mov    %r9,%r12
mov    0xb8(%rsp),%eax
push   %rax
mov    0xb8(%rsp),%eax
push   %rax
push   %r15
push   %r13
call   1050 <stage_scale4x@plt>
mov    0xe0(%rsp),%edx
mov    %r14,%rcx
add    $0x20,%rsp
add    %r14,%rbx
mov    %rbx,0x38(%rsp)
add    $0xfffffffc,%edx
mov    %r14,0x28(%rsp)
je     13ff <scale4x_buf+0x2cf>
mov    0x20(%rsp),%rax
shl    $0x2,%eax
mov    %rax,0x20(%rsp)
mov    0x8(%rsp),%rsi
mov    0x18(%rsp),%rdi
mov    %r12,%rax
mov    0x40(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %edx,0x8(%rsp)
mov    %rsi,(%rsp)
mov    %rdi,%r12
mov    %rbx,%r14
mov    %rax,0x18(%rsp)
mov    0x58(%rsp),%rax
lea    0x0(%rbp,%rax,1),%rdx
mov    0x50(%rsp),%rax
lea    (%rax,%rbp,1),%rcx
mov    0x20(%rsp),%rax
lea    (%rax,%rbp,1),%r8
sub    $0x8,%rsp
mov    0xb8(%rsp),%eax
mov    %rax,%r9
mov    0xc0(%rsp),%eax
mov    0x40(%rsp),%rbx
push   %rax
call   1030 <stage_scale2x@plt>
add    $0x10,%rsp
mov    0x30(%rsp),%rax
lea    (%rbx,%rax,1),%rsi
mov    0x68(%rsp),%rax
lea    (%rbx,%rax,1),%rdx
mov    0x60(%rsp),%rax
lea    (%rbx,%rax,1),%rcx
mov    %rbx,%rdi
mov    %r13,%r8
mov    %r15,%r9
mov    0xb8(%rsp),%eax
push   %rax
mov    0xb8(%rsp),%eax
push   %rax
push   %r12
push   %r14
call   1050 <stage_scale4x@plt>
mov    0x38(%rsp),%rdi
mov    %r13,%rsi
mov    0x28(%rsp),%edx
add    $0x20,%rsp
add    0x70(%rsp),%rbp
add    0x28(%rsp),%rbx
mov    %rbx,0x38(%rsp)
mov    %r15,%rax
mov    %r14,0x10(%rsp)
mov    %r14,%r13
mov    %r12,%r14
mov    %r12,%r15
mov    (%rsp),%rbx
add    $0xffffffff,%edx
jne    1330 <scale4x_buf+0x200>
jmp    141a <scale4x_buf+0x2ea>
mov    0x40(%rsp),%rax
mov    %rax,(%rsp)
mov    %r15,%r14
mov    %r13,0x10(%rsp)
mov    0x8(%rsp),%rsi
mov    0x18(%rsp),%rdi
mov    %rsi,0x8(%rsp)
mov    0x58(%rsp),%rdx
add    %rbp,%rdx
mov    0x50(%rsp),%rcx
add    %rbp,%rcx
sub    $0x8,%rsp
mov    %rcx,%r8
mov    0xb8(%rsp),%ebp
mov    %rbp,%r9
mov    %rdi,%r12
mov    0xc0(%rsp),%ebp
push   %rbp
call   1030 <stage_scale2x@plt>
add    $0x10,%rsp
mov    0x38(%rsp),%rbx
mov    0x30(%rsp),%rbp
lea    (%rbx,%rbp,1),%rsi
mov    0x68(%rsp),%r15
lea    (%rbx,%r15,1),%rdx
mov    0x60(%rsp),%r13
lea    (%rbx,%r13,1),%rcx
mov    %rbx,%rdi
mov    0x10(%rsp),%r8
mov    %r14,%r9
mov    0xb8(%rsp),%eax
push   %rax
mov    0xb8(%rsp),%eax
push   %rax
push   %r12
mov    0x18(%rsp),%r14
push   %r14
call   1050 <stage_scale4x@plt>
add    $0x20,%rsp
mov    0x28(%rsp),%rdi
add    %rbx,%rdi
add    %rdi,%rbp
add    %rdi,%r15
add    %rdi,%r13
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
mov    %r14,%r8
mov    %r12,%r9
mov    0xb8(%rsp),%eax
push   %rax
mov    0xb8(%rsp),%eax
push   %rax
mov    0x18(%rsp),%rax
push   %rax
push   %rax
call   1050 <stage_scale4x@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @scale4x_buf(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca [6 x i8*]
%23 = alloca i8*
store i8* %0, i8** %10
store i32 %1, i32* %11
store i8* %2, i8** %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%24 = load i8*, i8** %10
store i8* %24, i8** %19
%25 = load i8*, i8** %14
store i8* %25, i8** %20
%26 = load i32, i32* %18
%27 = icmp uge i32 %26, 4
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i32, i32* %18
store i32 %30, i32* %21
%31 = load i8*, i8** %12
%32 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
store i8* %31, i8** %32
%33 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
%34 = load i8*, i8** %33
%35 = load i32, i32* %13
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
store i8* %37, i8** %38
%39 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
%40 = load i8*, i8** %39
%41 = load i32, i32* %13
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %40, i64 %42
%44 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
store i8* %43, i8** %44
%45 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
%46 = load i8*, i8** %45
%47 = load i32, i32* %13
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
%50 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
store i8* %49, i8** %50
%51 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
%52 = load i8*, i8** %51
%53 = load i32, i32* %13
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
store i8* %55, i8** %56
%57 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%58 = load i8*, i8** %57
%59 = load i32, i32* %13
%60 = zext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %58, i64 %60
%62 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
store i8* %61, i8** %62
%63 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%64 = load i8*, i8** %63
%65 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%66 = load i8*, i8** %65
%67 = load i8*, i8** %20
%68 = load i32, i32* %15
%69 = mul i32 0, %68
%70 = zext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %67, i64 %70
%72 = load i8*, i8** %20
%73 = load i32, i32* %15
%74 = mul i32 0, %73
%75 = zext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %72, i64 %75
%77 = load i8*, i8** %20
%78 = load i32, i32* %15
%79 = mul i32 1, %78
%80 = zext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %77, i64 %80
%82 = load i32, i32* %16
%83 = load i32, i32* %17
%84 = call i32 @stage_scale2x(i8* %64, i8* %66, i8* %71, i8* %76, i8* %81, i32 %82, i32 %83)
%85 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
%86 = load i8*, i8** %85
%87 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
%88 = load i8*, i8** %87
%89 = load i8*, i8** %20
%90 = load i32, i32* %15
%91 = mul i32 0, %90
%92 = zext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %89, i64 %92
%94 = load i8*, i8** %20
%95 = load i32, i32* %15
%96 = mul i32 1, %95
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %94, i64 %97
%99 = load i8*, i8** %20
%100 = load i32, i32* %15
%101 = mul i32 2, %100
%102 = zext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %99, i64 %102
%104 = load i32, i32* %16
%105 = load i32, i32* %17
%106 = call i32 @stage_scale2x(i8* %86, i8* %88, i8* %93, i8* %98, i8* %103, i32 %104, i32 %105)
%107 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
%108 = load i8*, i8** %107
%109 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
%110 = load i8*, i8** %109
%111 = load i8*, i8** %20
%112 = load i32, i32* %15
%113 = mul i32 1, %112
%114 = zext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %111, i64 %114
%116 = load i8*, i8** %20
%117 = load i32, i32* %15
%118 = mul i32 2, %117
%119 = zext i32 %118 to i64
%120 = getelementptr inbounds i8, i8* %116, i64 %119
%121 = load i8*, i8** %20
%122 = load i32, i32* %15
%123 = mul i32 3, %122
%124 = zext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %121, i64 %124
%126 = load i32, i32* %16
%127 = load i32, i32* %17
%128 = call i32 @stage_scale2x(i8* %108, i8* %110, i8* %115, i8* %120, i8* %125, i32 %126, i32 %127)
%129 = load i8*, i8** %19
%130 = load i32, i32* %11
%131 = mul i32 0, %130
%132 = zext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %129, i64 %132
%134 = load i8*, i8** %19
%135 = load i32, i32* %11
%136 = mul i32 1, %135
%137 = zext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %134, i64 %137
%139 = load i8*, i8** %19
%140 = load i32, i32* %11
%141 = mul i32 2, %140
%142 = zext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %139, i64 %142
%144 = load i8*, i8** %19
%145 = load i32, i32* %11
%146 = mul i32 3, %145
%147 = zext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %144, i64 %147
%149 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%150 = load i8*, i8** %149
%151 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%152 = load i8*, i8** %151
%153 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%154 = load i8*, i8** %153
%155 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
%156 = load i8*, i8** %155
%157 = load i32, i32* %16
%158 = load i32, i32* %17
%159 = call i32 @stage_scale4x(i8* %133, i8* %138, i8* %143, i8* %148, i8* %150, i8* %152, i8* %154, i8* %156, i32 %157, i32 %158)
%160 = load i8*, i8** %19
%161 = load i32, i32* %11
%162 = mul i32 4, %161
%163 = zext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %160, i64 %163
store i8* %164, i8** %19
%165 = load i8*, i8** %19
%166 = load i32, i32* %11
%167 = mul i32 0, %166
%168 = zext i32 %167 to i64
%169 = getelementptr inbounds i8, i8* %165, i64 %168
%170 = load i8*, i8** %19
%171 = load i32, i32* %11
%172 = mul i32 1, %171
%173 = zext i32 %172 to i64
%174 = getelementptr inbounds i8, i8* %170, i64 %173
%175 = load i8*, i8** %19
%176 = load i32, i32* %11
%177 = mul i32 2, %176
%178 = zext i32 %177 to i64
%179 = getelementptr inbounds i8, i8* %175, i64 %178
%180 = load i8*, i8** %19
%181 = load i32, i32* %11
%182 = mul i32 3, %181
%183 = zext i32 %182 to i64
%184 = getelementptr inbounds i8, i8* %180, i64 %183
%185 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%186 = load i8*, i8** %185
%187 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
%188 = load i8*, i8** %187
%189 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
%190 = load i8*, i8** %189
%191 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
%192 = load i8*, i8** %191
%193 = load i32, i32* %16
%194 = load i32, i32* %17
%195 = call i32 @stage_scale4x(i8* %169, i8* %174, i8* %179, i8* %184, i8* %186, i8* %188, i8* %190, i8* %192, i32 %193, i32 %194)
%196 = load i8*, i8** %19
%197 = load i32, i32* %11
%198 = mul i32 4, %197
%199 = zext i32 %198 to i64
%200 = getelementptr inbounds i8, i8* %196, i64 %199
store i8* %200, i8** %19
%201 = load i32, i32* %21
%202 = sub i32 %201, 4
store i32 %202, i32* %21
br label %203
203: ; preds = %206, %9
%204 = load i32, i32* %21
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %292
206: ; preds = %203
%207 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%208 = load i8*, i8** %207
%209 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%210 = load i8*, i8** %209
%211 = load i8*, i8** %20
%212 = load i32, i32* %15
%213 = mul i32 2, %212
%214 = zext i32 %213 to i64
%215 = getelementptr inbounds i8, i8* %211, i64 %214
%216 = load i8*, i8** %20
%217 = load i32, i32* %15
%218 = mul i32 3, %217
%219 = zext i32 %218 to i64
%220 = getelementptr inbounds i8, i8* %216, i64 %219
%221 = load i8*, i8** %20
%222 = load i32, i32* %15
%223 = mul i32 4, %222
%224 = zext i32 %223 to i64
%225 = getelementptr inbounds i8, i8* %221, i64 %224
%226 = load i32, i32* %16
%227 = load i32, i32* %17
%228 = call i32 @stage_scale2x(i8* %208, i8* %210, i8* %215, i8* %220, i8* %225, i32 %226, i32 %227)
%229 = load i8*, i8** %19
%230 = load i32, i32* %11
%231 = mul i32 0, %230
%232 = zext i32 %231 to i64
%233 = getelementptr inbounds i8, i8* %229, i64 %232
%234 = load i8*, i8** %19
%235 = load i32, i32* %11
%236 = mul i32 1, %235
%237 = zext i32 %236 to i64
%238 = getelementptr inbounds i8, i8* %234, i64 %237
%239 = load i8*, i8** %19
%240 = load i32, i32* %11
%241 = mul i32 2, %240
%242 = zext i32 %241 to i64
%243 = getelementptr inbounds i8, i8* %239, i64 %242
%244 = load i8*, i8** %19
%245 = load i32, i32* %11
%246 = mul i32 3, %245
%247 = zext i32 %246 to i64
%248 = getelementptr inbounds i8, i8* %244, i64 %247
%249 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
%250 = load i8*, i8** %249
%251 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
%252 = load i8*, i8** %251
%253 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
%254 = load i8*, i8** %253
%255 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%256 = load i8*, i8** %255
%257 = load i32, i32* %16
%258 = load i32, i32* %17
%259 = call i32 @stage_scale4x(i8* %233, i8* %238, i8* %243, i8* %248, i8* %250, i8* %252, i8* %254, i8* %256, i32 %257, i32 %258)
%260 = load i8*, i8** %19
%261 = load i32, i32* %11
%262 = mul i32 4, %261
%263 = zext i32 %262 to i64
%264 = getelementptr inbounds i8, i8* %260, i64 %263
store i8* %264, i8** %19
%265 = load i8*, i8** %20
%266 = load i32, i32* %15
%267 = mul i32 1, %266
%268 = zext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %265, i64 %268
store i8* %269, i8** %20
%270 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
%271 = load i8*, i8** %270
store i8* %271, i8** %23
%272 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
%273 = load i8*, i8** %272
%274 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 0
store i8* %273, i8** %274
%275 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%276 = load i8*, i8** %275
%277 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
store i8* %276, i8** %277
%278 = load i8*, i8** %23
%279 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
store i8* %278, i8** %279
%280 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
%281 = load i8*, i8** %280
store i8* %281, i8** %23
%282 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
%283 = load i8*, i8** %282
%284 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
store i8* %283, i8** %284
%285 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%286 = load i8*, i8** %285
%287 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
store i8* %286, i8** %287
%288 = load i8*, i8** %23
%289 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
store i8* %288, i8** %289
%290 = load i32, i32* %21
%291 = add i32 %290, -1
store i32 %291, i32* %21
br label %203
292: ; preds = %203
%293 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%294 = load i8*, i8** %293
%295 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%296 = load i8*, i8** %295
%297 = load i8*, i8** %20
%298 = load i32, i32* %15
%299 = mul i32 2, %298
%300 = zext i32 %299 to i64
%301 = getelementptr inbounds i8, i8* %297, i64 %300
%302 = load i8*, i8** %20
%303 = load i32, i32* %15
%304 = mul i32 3, %303
%305 = zext i32 %304 to i64
%306 = getelementptr inbounds i8, i8* %302, i64 %305
%307 = load i8*, i8** %20
%308 = load i32, i32* %15
%309 = mul i32 3, %308
%310 = zext i32 %309 to i64
%311 = getelementptr inbounds i8, i8* %307, i64 %310
%312 = load i32, i32* %16
%313 = load i32, i32* %17
%314 = call i32 @stage_scale2x(i8* %294, i8* %296, i8* %301, i8* %306, i8* %311, i32 %312, i32 %313)
%315 = load i8*, i8** %19
%316 = load i32, i32* %11
%317 = mul i32 0, %316
%318 = zext i32 %317 to i64
%319 = getelementptr inbounds i8, i8* %315, i64 %318
%320 = load i8*, i8** %19
%321 = load i32, i32* %11
%322 = mul i32 1, %321
%323 = zext i32 %322 to i64
%324 = getelementptr inbounds i8, i8* %320, i64 %323
%325 = load i8*, i8** %19
%326 = load i32, i32* %11
%327 = mul i32 2, %326
%328 = zext i32 %327 to i64
%329 = getelementptr inbounds i8, i8* %325, i64 %328
%330 = load i8*, i8** %19
%331 = load i32, i32* %11
%332 = mul i32 3, %331
%333 = zext i32 %332 to i64
%334 = getelementptr inbounds i8, i8* %330, i64 %333
%335 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 1
%336 = load i8*, i8** %335
%337 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 2
%338 = load i8*, i8** %337
%339 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
%340 = load i8*, i8** %339
%341 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%342 = load i8*, i8** %341
%343 = load i32, i32* %16
%344 = load i32, i32* %17
%345 = call i32 @stage_scale4x(i8* %319, i8* %324, i8* %329, i8* %334, i8* %336, i8* %338, i8* %340, i8* %342, i32 %343, i32 %344)
%346 = load i8*, i8** %19
%347 = load i32, i32* %11
%348 = mul i32 4, %347
%349 = zext i32 %348 to i64
%350 = getelementptr inbounds i8, i8* %346, i64 %349
store i8* %350, i8** %19
%351 = load i8*, i8** %19
%352 = load i32, i32* %11
%353 = mul i32 0, %352
%354 = zext i32 %353 to i64
%355 = getelementptr inbounds i8, i8* %351, i64 %354
%356 = load i8*, i8** %19
%357 = load i32, i32* %11
%358 = mul i32 1, %357
%359 = zext i32 %358 to i64
%360 = getelementptr inbounds i8, i8* %356, i64 %359
%361 = load i8*, i8** %19
%362 = load i32, i32* %11
%363 = mul i32 2, %362
%364 = zext i32 %363 to i64
%365 = getelementptr inbounds i8, i8* %361, i64 %364
%366 = load i8*, i8** %19
%367 = load i32, i32* %11
%368 = mul i32 3, %367
%369 = zext i32 %368 to i64
%370 = getelementptr inbounds i8, i8* %366, i64 %369
%371 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 3
%372 = load i8*, i8** %371
%373 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 4
%374 = load i8*, i8** %373
%375 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%376 = load i8*, i8** %375
%377 = getelementptr inbounds [6 x i8*], [6 x i8*]* %22, i64 0, i64 5
%378 = load i8*, i8** %377
%379 = load i32, i32* %16
%380 = load i32, i32* %17
%381 = call i32 @stage_scale4x(i8* %355, i8* %360, i8* %365, i8* %370, i8* %372, i8* %374, i8* %376, i8* %378, i32 %379, i32 %380)
ret void
}

LLVM IR (-O2):
define void @scale4x_buf(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = icmp ugt i32 %8, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = zext i32 %3 to i64
%14 = getelementptr inbounds i8, i8* %2, i64 %13
%15 = getelementptr inbounds i8, i8* %14, i64 %13
%16 = getelementptr inbounds i8, i8* %15, i64 %13
%17 = getelementptr inbounds i8, i8* %16, i64 %13
%18 = getelementptr inbounds i8, i8* %17, i64 %13
%19 = zext i32 %5 to i64
%20 = getelementptr inbounds i8, i8* %4, i64 %19
%21 = tail call i32 @stage_scale2x(i8* %17, i8* %18, i8* %4, i8* %4, i8* %20, i32 %6, i32 %7)
%22 = shl i32 %5, 1
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %4, i64 %23
%25 = tail call i32 @stage_scale2x(i8* %2, i8* %14, i8* %4, i8* %20, i8* %24, i32 %6, i32 %7)
%26 = mul i32 %5, 3
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %4, i64 %27
%29 = tail call i32 @stage_scale2x(i8* %15, i8* %16, i8* %20, i8* %24, i8* %28, i32 %6, i32 %7)
%30 = zext i32 %1 to i64
%31 = getelementptr inbounds i8, i8* %0, i64 %30
%32 = shl i32 %1, 1
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %0, i64 %33
%35 = mul i32 %1, 3
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %0, i64 %36
%38 = tail call i32 @stage_scale4x(i8* %0, i8* %31, i8* %34, i8* %37, i8* %17, i8* %17, i8* %18, i8* %2, i32 %6, i32 %7)
%39 = shl i32 %1, 2
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %0, i64 %40
%42 = getelementptr inbounds i8, i8* %41, i64 %30
%43 = getelementptr inbounds i8, i8* %41, i64 %33
%44 = getelementptr inbounds i8, i8* %41, i64 %36
%45 = tail call i32 @stage_scale4x(i8* %41, i8* %42, i8* %43, i8* %44, i8* %18, i8* %2, i8* %14, i8* %15, i32 %6, i32 %7)
%46 = add i32 %8, -4
%47 = getelementptr inbounds i8, i8* %41, i64 %40
%48 = icmp eq i32 %46, 0
br i1 %48, label %74, label %49
49: ; preds = %9
%50 = shl i32 %5, 2
%51 = zext i32 %50 to i64
br label %52
52: ; preds = %49, %52
%53 = phi i8* [ %47, %49 ], [ %72, %52 ]
%54 = phi i8* [ %2, %49 ], [ %56, %52 ]
%55 = phi i8* [ %14, %49 ], [ %57, %52 ]
%56 = phi i8* [ %15, %49 ], [ %58, %52 ]
%57 = phi i8* [ %16, %49 ], [ %59, %52 ]
%58 = phi i8* [ %17, %49 ], [ %54, %52 ]
%59 = phi i8* [ %18, %49 ], [ %55, %52 ]
%60 = phi i32 [ %46, %49 ], [ %71, %52 ]
%61 = phi i8* [ %4, %49 ], [ %70, %52 ]
%62 = getelementptr inbounds i8, i8* %61, i64 %23
%63 = getelementptr inbounds i8, i8* %61, i64 %27
%64 = getelementptr inbounds i8, i8* %61, i64 %51
%65 = tail call i32 @stage_scale2x(i8* %58, i8* %59, i8* %62, i8* %63, i8* %64, i32 %6, i32 %7)
%66 = getelementptr inbounds i8, i8* %53, i64 %30
%67 = getelementptr inbounds i8, i8* %53, i64 %33
%68 = getelementptr inbounds i8, i8* %53, i64 %36
%69 = tail call i32 @stage_scale4x(i8* %53, i8* %66, i8* %67, i8* %68, i8* %55, i8* %56, i8* %57, i8* %58, i32 %6, i32 %7)
%70 = getelementptr inbounds i8, i8* %61, i64 %19
%71 = add i32 %60, -1
%72 = getelementptr inbounds i8, i8* %53, i64 %40
%73 = icmp eq i32 %71, 0
br i1 %73, label %74, label %52
74: ; preds = %52, %9
%75 = phi i8* [ %4, %9 ], [ %70, %52 ]
%76 = phi i8* [ %18, %9 ], [ %55, %52 ]
%77 = phi i8* [ %17, %9 ], [ %54, %52 ]
%78 = phi i8* [ %16, %9 ], [ %59, %52 ]
%79 = phi i8* [ %15, %9 ], [ %58, %52 ]
%80 = phi i8* [ %14, %9 ], [ %57, %52 ]
%81 = phi i8* [ %47, %9 ], [ %72, %52 ]
%82 = getelementptr inbounds i8, i8* %75, i64 %23
%83 = getelementptr inbounds i8, i8* %75, i64 %27
%84 = tail call i32 @stage_scale2x(i8* %77, i8* %76, i8* %82, i8* %83, i8* %83, i32 %6, i32 %7)
%85 = getelementptr inbounds i8, i8* %81, i64 %30
%86 = getelementptr inbounds i8, i8* %81, i64 %33
%87 = getelementptr inbounds i8, i8* %81, i64 %36
%88 = tail call i32 @stage_scale4x(i8* %81, i8* %85, i8* %86, i8* %87, i8* %80, i8* %79, i8* %78, i8* %77, i32 %6, i32 %7)
%89 = getelementptr inbounds i8, i8* %81, i64 %40
%90 = getelementptr inbounds i8, i8* %89, i64 %30
%91 = getelementptr inbounds i8, i8* %89, i64 %33
%92 = getelementptr inbounds i8, i8* %89, i64 %36
%93 = tail call i32 @stage_scale4x(i8* %89, i8* %90, i8* %91, i8* %92, i8* %78, i8* %77, i8* %76, i8* %76, i32 %6, i32 %7)
ret void
}