half_tone(in_image, out_image, threshold, one, zero, rows, cols) long rows,
    cols;
short threshold, one, zero;
short **in_image, **out_image;
{
  float **eg, **ep;
  float c[2][3], sum_p, t;
  int i, j, m, n, xx, yy;
  c[0][0] = 0.0;
  c[0][1] = 0.2;
  c[0][2] = 0.0;
  c[1][0] = 0.6;
  c[1][1] = 0.1;
  c[1][2] = 0.1;
  eg = malloc(rows * sizeof(float *));
  for (i = 0; i < rows; i++) {
    eg[i] = malloc(cols * sizeof(float));
    if (eg[i] == '\0') {
      printf("\n\tmalloc of eg[%d] failed", i);
    }
  }
  ep = malloc(rows * sizeof(float *));
  for (i = 0; i < rows; i++) {
    ep[i] = malloc(cols * sizeof(float));
    if (ep[i] == '\0') {
      printf("\n\tmalloc of ep[%d] failed", i);
    }
  }
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      eg[i][j] = 0.0;
      ep[i][j] = 0.0;
    }
  }
  for (m = 0; m < rows; m++) {
    for (n = 0; n < cols; n++) {
      sum_p = 0.0;
      for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
          xx = m - i + 1;
          yy = n - j + 1;
          if (xx < 0)
            xx = 0;
          if (xx >= rows)
            xx = rows - 1;
          if (yy < 0)
            yy = 0;
          if (yy >= cols)
            yy = cols - 1;
          sum_p = sum_p + c[i][j] * eg[xx][yy];
        }
      }
      ep[m][n] = sum_p;
      t = in_image[m][n] + ep[m][n];
      if (t > threshold) {
        eg[m][n] = t - threshold * 2;
        out_image[m][n] = one;
      } else {
        eg[m][n] = t;
        out_image[m][n] = zero;
      }
    }
  }
  for (i = 0; i < rows; i++) {
    free(eg[i]);
    free(ep[i]);
  }
}


x86 assembly (clang, -O0):
<half_tone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %r8w,%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %dx,-0x1a(%rbp)
mov    %cx,-0x1c(%rbp)
mov    %ax,-0x1e(%rbp)
mov    %r9,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  0xe87(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  0xe76(%rip),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  0xe69(%rip),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1215 <half_tone+0xe5>
mov    0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    1202 <half_tone+0xd2>
mov    -0x5c(%rbp),%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1207 <half_tone+0xd7>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11b4 <half_tone+0x84>
mov    -0x28(%rbp),%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    128e <half_tone+0x15e>
mov    0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    127b <half_tone+0x14b>
mov    -0x5c(%rbp),%esi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1280 <half_tone+0x150>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    122d <half_tone+0xfd>
movl   $0x0,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1309 <half_tone+0x1d9>
movl   $0x0,-0x60(%rbp)
movslq -0x60(%rbp),%rax
cmp    0x10(%rbp),%rax
jge    12f6 <half_tone+0x1c6>
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x60(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    12aa <half_tone+0x17a>
jmp    12fb <half_tone+0x1cb>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1295 <half_tone+0x165>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1529 <half_tone+0x3f9>
movl   $0x0,-0x68(%rbp)
movslq -0x68(%rbp),%rax
cmp    0x10(%rbp),%rax
jge    1516 <half_tone+0x3e6>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x2,-0x5c(%rbp)
jge    1429 <half_tone+0x2f9>
movl   $0x0,-0x60(%rbp)
cmpl   $0x3,-0x60(%rbp)
jge    1416 <half_tone+0x2e6>
mov    -0x64(%rbp),%eax
sub    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%eax
sub    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jge    1386 <half_tone+0x256>
movl   $0x0,-0x6c(%rbp)
movslq -0x6c(%rbp),%rax
cmp    -0x28(%rbp),%rax
jl     139f <half_tone+0x26f>
mov    -0x28(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x70(%rbp)
jge    13b0 <half_tone+0x280>
movl   $0x0,-0x70(%rbp)
movslq -0x70(%rbp),%rax
cmp    0x10(%rbp),%rax
jl     13c9 <half_tone+0x299>
mov    0x10(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x70(%rbp)
movss  -0x54(%rbp),%xmm1
movslq -0x5c(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x60(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x70(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1353 <half_tone+0x223>
jmp    141b <half_tone+0x2eb>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1342 <half_tone+0x212>
movss  -0x54(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cvtsi2ss %eax,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x58(%rbp),%xmm0
movswl -0x1a(%rbp),%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jbe    14d1 <half_tone+0x3a1>
movss  -0x58(%rbp),%xmm0
movswl -0x1a(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%dx
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    1503 <half_tone+0x3d3>
movss  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1e(%rbp),%dx
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x68(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    1508 <half_tone+0x3d8>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1325 <half_tone+0x1f5>
jmp    151b <half_tone+0x3eb>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1310 <half_tone+0x1e0>
movl   $0x0,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    156e <half_tone+0x43e>
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1530 <half_tone+0x400>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_tone>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%rbp
mov    %r8d,0x2c(%rsp)
mov    %ecx,%r15d
mov    %edx,0x10(%rsp)
mov    %rsi,0x40(%rsp)
mov    %rdi,0x38(%rsp)
lea    0x0(,%r9,8),%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rbp,%rbp
jle    15cb <half_tone+0x49b>
mov    %rbx,0x8(%rsp)
mov    0x80(%rsp),%r14
lea    0x0(,%r14,4),%r13
xor    %r12d,%r12d
mov    %rax,%rbx
jmp    1199 <half_tone+0x69>
nopl   (%rax)
add    $0x1,%r12
cmp    %r12,%rbp
je     11bd <half_tone+0x8d>
mov    %r13,%rdi
call   1050 <malloc@plt>
mov    %rax,(%rbx,%r12,8)
test   %rax,%rax
jne    1190 <half_tone+0x60>
lea    0xe5b(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <half_tone+0x60>
mov    0x8(%rsp),%rdi
call   1050 <malloc@plt>
test   %rbp,%rbp
jle    15cb <half_tone+0x49b>
mov    %rbx,0x20(%rsp)
xor    %r12d,%r12d
mov    %rax,%rbx
jmp    11e9 <half_tone+0xb9>
nopl   (%rax)
add    $0x1,%r12
cmp    %r12,%rbp
je     120d <half_tone+0xdd>
mov    %r13,%rdi
call   1050 <malloc@plt>
mov    %rax,(%rbx,%r12,8)
test   %rax,%rax
jne    11e0 <half_tone+0xb0>
lea    0xe25(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e0 <half_tone+0xb0>
test   %rbp,%rbp
jle    15cb <half_tone+0x49b>
mov    %rbx,0x18(%rsp)
lea    -0x8(%r14),%r8
mov    %r8,%r10
shr    $0x3,%r10
add    $0x1,%r10
mov    %r14,%r11
and    $0xfffffffffffffff8,%r11
mov    %r10d,%r9d
and    $0x3,%r9d
and    $0xfffffffffffffffc,%r10
mov    %r14d,%r12d
and    $0x3,%r12d
mov    %r9,%rsi
shl    $0x5,%rsi
xor    %eax,%eax
xorps  %xmm0,%xmm0
mov    %rbp,0x8(%rsp)
jmp    126d <half_tone+0x13d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rbp,%rax
je     13f2 <half_tone+0x2c2>
test   %r14,%r14
jle    1260 <half_tone+0x130>
mov    0x20(%rsp),%rcx
mov    (%rcx,%rax,8),%rcx
mov    0x18(%rsp),%rdx
mov    (%rdx,%rax,8),%rdx
cmp    $0x8,%r14
jb     12a4 <half_tone+0x174>
lea    (%rdx,%r14,4),%rdi
cmp    %rdi,%rcx
jae    133c <half_tone+0x20c>
lea    (%rcx,%r14,4),%rdi
cmp    %rdi,%rdx
jae    133c <half_tone+0x20c>
xor    %ebx,%ebx
mov    %rbx,%rbp
not    %rbp
add    %r14,%rbp
test   %r12,%r12
je     12d8 <half_tone+0x1a8>
mov    %r12,%rdi
nopw   0x0(%rax,%rax,1)
movl   $0x0,(%rcx,%rbx,4)
movl   $0x0,(%rdx,%rbx,4)
add    $0x1,%rbx
add    $0xffffffffffffffff,%rdi
jne    12c0 <half_tone+0x190>
cmp    $0x3,%rbp
mov    0x8(%rsp),%rbp
jb     1260 <half_tone+0x130>
nopw   0x0(%rax,%rax,1)
movl   $0x0,(%rcx,%rbx,4)
movl   $0x0,(%rdx,%rbx,4)
movl   $0x0,0x4(%rcx,%rbx,4)
movl   $0x0,0x4(%rdx,%rbx,4)
movl   $0x0,0x8(%rcx,%rbx,4)
movl   $0x0,0x8(%rdx,%rbx,4)
movl   $0x0,0xc(%rcx,%rbx,4)
movl   $0x0,0xc(%rdx,%rbx,4)
add    $0x4,%rbx
cmp    %rbx,%r14
jne    12f0 <half_tone+0x1c0>
jmp    1260 <half_tone+0x130>
cmp    $0x18,%r8
jae    1346 <half_tone+0x216>
xor    %ebx,%ebx
jmp    13a8 <half_tone+0x278>
mov    %r10,%rbp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rcx,%rbx,4)
movups %xmm0,0x10(%rcx,%rbx,4)
movups %xmm0,(%rdx,%rbx,4)
movups %xmm0,0x10(%rdx,%rbx,4)
movups %xmm0,0x20(%rcx,%rbx,4)
movups %xmm0,0x30(%rcx,%rbx,4)
movups %xmm0,0x20(%rdx,%rbx,4)
movups %xmm0,0x30(%rdx,%rbx,4)
movups %xmm0,0x40(%rcx,%rbx,4)
movups %xmm0,0x50(%rcx,%rbx,4)
movups %xmm0,0x40(%rdx,%rbx,4)
movups %xmm0,0x50(%rdx,%rbx,4)
movups %xmm0,0x60(%rcx,%rbx,4)
movups %xmm0,0x70(%rcx,%rbx,4)
movups %xmm0,0x60(%rdx,%rbx,4)
movups %xmm0,0x70(%rdx,%rbx,4)
add    $0x20,%rbx
add    $0xfffffffffffffffc,%rbp
jne    1350 <half_tone+0x220>
test   %r9,%r9
je     13dc <half_tone+0x2ac>
lea    (%rdx,%rbx,4),%rbp
add    $0x10,%rbp
lea    (%rcx,%rbx,4),%rdi
add    $0x10,%rdi
xor    %ebx,%ebx
nop
movups %xmm0,-0x10(%rdi,%rbx,1)
movups %xmm0,(%rdi,%rbx,1)
movups %xmm0,-0x10(%rbp,%rbx,1)
movups %xmm0,0x0(%rbp,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%rsi
jne    13c0 <half_tone+0x290>
mov    %r11,%rbx
cmp    %r14,%r11
mov    0x8(%rsp),%rbp
je     1260 <half_tone+0x130>
jmp    12a6 <half_tone+0x176>
test   %rbp,%rbp
jle    15cb <half_tone+0x49b>
mov    $0xffffffff,%ecx
movswl 0x10(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    %eax,%eax
cvtsi2ss %eax,%xmm1
add    %rbp,%rcx
mov    %rcx,0x30(%rsp)
lea    -0x1(%r14),%ebx
xor    %r10d,%r10d
xorps  %xmm2,%xmm2
movss  0xbd3(%rip),%xmm8
movss  0xbce(%rip),%xmm9
movss  0xbca(%rip),%xmm5
xor    %eax,%eax
mov    0x2c(%rsp),%r9d
jmp    1460 <half_tone+0x330>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %rax,%rcx
cmp    %rbp,%rcx
je     1590 <half_tone+0x460>
test   %r14,%r14
jle    1450 <half_tone+0x320>
mov    0x18(%rsp),%rcx
mov    (%rcx,%rax,8),%r11
mov    0x38(%rsp),%rcx
mov    (%rcx,%rax,8),%r12
movslq %eax,%rdx
mov    0x20(%rsp),%rcx
mov    (%rcx,%rdx,8),%rsi
lea    0x1(%rax),%rdi
cmp    %rbp,%rdi
mov    0x30(%rsp),%rdx
mov    %rdi,0x10(%rsp)
cmovl  %rdi,%rdx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rbp
mov    (%rcx,%rax,8),%r13
mov    0x40(%rsp),%rcx
mov    (%rcx,%rax,8),%rdx
xor    %edi,%edi
xchg   %ax,%ax
lea    0x1(%rdi),%rax
cmp    %r14,%rax
mov    %ebx,%ecx
cmovl  %eax,%ecx
mov    %edi,%r8d
cmp    %r14,%r8
movslq %ecx,%rcx
movss  0x0(%rbp,%rcx,4),%xmm6
mulss  %xmm2,%xmm6
addss  %xmm2,%xmm6
movss  (%rsi,%rcx,4),%xmm7
mov    %ebx,%ecx
cmovl  %edi,%ecx
movslq %ecx,%rcx
movss  0x0(%rbp,%rcx,4),%xmm3
mulss  %xmm8,%xmm3
movss  (%rsi,%rcx,4),%xmm4
lea    -0x1(%rdi),%ecx
cmp    $0x2,%rdi
cmovb  %r10d,%ecx
addss  %xmm6,%xmm3
cmp    %r14,%rcx
cmovge %ebx,%ecx
movslq %ecx,%rcx
movss  0x0(%rbp,%rcx,4),%xmm6
mulss  %xmm2,%xmm6
addss  %xmm3,%xmm6
mulss  %xmm9,%xmm7
addss  %xmm6,%xmm7
mulss  %xmm5,%xmm4
addss  %xmm7,%xmm4
movss  (%rsi,%rcx,4),%xmm3
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
movss  %xmm3,(%r11,%rdi,4)
movswl (%r12,%rdi,2),%ecx
xorps  %xmm4,%xmm4
cvtsi2ss %ecx,%xmm4
addss  %xmm3,%xmm4
ucomiss %xmm0,%xmm4
movaps %xmm0,%xmm3
cmpltss %xmm4,%xmm3
andps  %xmm1,%xmm3
mov    %r9d,%ecx
cmova  %r15d,%ecx
subss  %xmm3,%xmm4
movss  %xmm4,0x0(%r13,%rdi,4)
mov    %cx,(%rdx,%rdi,2)
mov    %rax,%rdi
cmp    %rax,%r14
jne    14b0 <half_tone+0x380>
mov    0x10(%rsp),%rcx
mov    %rcx,%rax
mov    0x8(%rsp),%rbp
cmp    %rbp,%rcx
jne    1460 <half_tone+0x330>
test   %rbp,%rbp
mov    0x20(%rsp),%r14
mov    0x18(%rsp),%r15
jle    15cb <half_tone+0x49b>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    15b0 <half_tone+0x480>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A\09malloc of eg[%d] failed\00"
@.str.1 = [26 x i8] c"\0A\09malloc of ep[%d] failed\00"
define i32 @half_tone(i16** %0, i16** %1, i32 %2, i32 %3, i32 %4, i64 %5, i64 %6) {
%8 = alloca i32
%9 = alloca i16**
%10 = alloca i16**
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i64
%15 = alloca i64
%16 = alloca float**
%17 = alloca float**
%18 = alloca [2 x [3 x float]]
%19 = alloca float
%20 = alloca float
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = trunc i32 %2 to i16
%28 = trunc i32 %3 to i16
%29 = trunc i32 %4 to i16
store i16** %0, i16*** %9
store i16** %1, i16*** %10
store i16 %27, i16* %11
store i16 %28, i16* %12
store i16 %29, i16* %13
store i64 %5, i64* %14
store i64 %6, i64* %15
%30 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 0
%31 = getelementptr inbounds [3 x float], [3 x float]* %30, i64 0, i64 0
store float 0.000000e+00, float* %31
%32 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 0
%33 = getelementptr inbounds [3 x float], [3 x float]* %32, i64 0, i64 1
store float 0x3FC99999A0000000, float* %33
%34 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 0
%35 = getelementptr inbounds [3 x float], [3 x float]* %34, i64 0, i64 2
store float 0.000000e+00, float* %35
%36 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 1
%37 = getelementptr inbounds [3 x float], [3 x float]* %36, i64 0, i64 0
store float 0x3FE3333340000000, float* %37
%38 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 1
%39 = getelementptr inbounds [3 x float], [3 x float]* %38, i64 0, i64 1
store float 0x3FB99999A0000000, float* %39
%40 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 1
%41 = getelementptr inbounds [3 x float], [3 x float]* %40, i64 0, i64 2
store float 0x3FB99999A0000000, float* %41
%42 = load i64, i64* %14
%43 = mul i64 %42, 8
%44 = call i8* @malloc(i64 %43)
%45 = bitcast i8* %44 to float**
store float** %45, float*** %16
store i32 0, i32* %21
br label %46
46: ; preds = %70, %7
%47 = load i32, i32* %21
%48 = sext i32 %47 to i64
%49 = load i64, i64* %14
%50 = icmp slt i64 %48, %49
br i1 %50, label %51, label %73
51: ; preds = %46
%52 = load i64, i64* %15
%53 = mul i64 %52, 4
%54 = call i8* @malloc(i64 %53)
%55 = bitcast i8* %54 to float*
%56 = load float**, float*** %16
%57 = load i32, i32* %21
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float*, float** %56, i64 %58
store float* %55, float** %59
%60 = load float**, float*** %16
%61 = load i32, i32* %21
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds float*, float** %60, i64 %62
%64 = load float*, float** %63
%65 = icmp eq float* %64, null
br i1 %65, label %66, label %69
66: ; preds = %51
%67 = load i32, i32* %21
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %66, %51
br label %70
70: ; preds = %69
%71 = load i32, i32* %21
%72 = add nsw i32 %71, 1
store i32 %72, i32* %21
br label %46
73: ; preds = %46
%74 = load i64, i64* %14
%75 = mul i64 %74, 8
%76 = call i8* @malloc(i64 %75)
%77 = bitcast i8* %76 to float**
store float** %77, float*** %17
store i32 0, i32* %21
br label %78
78: ; preds = %102, %73
%79 = load i32, i32* %21
%80 = sext i32 %79 to i64
%81 = load i64, i64* %14
%82 = icmp slt i64 %80, %81
br i1 %82, label %83, label %105
83: ; preds = %78
%84 = load i64, i64* %15
%85 = mul i64 %84, 4
%86 = call i8* @malloc(i64 %85)
%87 = bitcast i8* %86 to float*
%88 = load float**, float*** %17
%89 = load i32, i32* %21
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds float*, float** %88, i64 %90
store float* %87, float** %91
%92 = load float**, float*** %17
%93 = load i32, i32* %21
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds float*, float** %92, i64 %94
%96 = load float*, float** %95
%97 = icmp eq float* %96, null
br i1 %97, label %98, label %101
98: ; preds = %83
%99 = load i32, i32* %21
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %98, %83
br label %102
102: ; preds = %101
%103 = load i32, i32* %21
%104 = add nsw i32 %103, 1
store i32 %104, i32* %21
br label %78
105: ; preds = %78
store i32 0, i32* %21
br label %106
106: ; preds = %138, %105
%107 = load i32, i32* %21
%108 = sext i32 %107 to i64
%109 = load i64, i64* %14
%110 = icmp slt i64 %108, %109
br i1 %110, label %111, label %141
111: ; preds = %106
store i32 0, i32* %22
br label %112
112: ; preds = %134, %111
%113 = load i32, i32* %22
%114 = sext i32 %113 to i64
%115 = load i64, i64* %15
%116 = icmp slt i64 %114, %115
br i1 %116, label %117, label %137
117: ; preds = %112
%118 = load float**, float*** %16
%119 = load i32, i32* %21
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds float*, float** %118, i64 %120
%122 = load float*, float** %121
%123 = load i32, i32* %22
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds float, float* %122, i64 %124
store float 0.000000e+00, float* %125
%126 = load float**, float*** %17
%127 = load i32, i32* %21
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds float*, float** %126, i64 %128
%130 = load float*, float** %129
%131 = load i32, i32* %22
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds float, float* %130, i64 %132
store float 0.000000e+00, float* %133
br label %134
134: ; preds = %117
%135 = load i32, i32* %22
%136 = add nsw i32 %135, 1
store i32 %136, i32* %22
br label %112
137: ; preds = %112
br label %138
138: ; preds = %137
%139 = load i32, i32* %21
%140 = add nsw i32 %139, 1
store i32 %140, i32* %21
br label %106
141: ; preds = %106
store i32 0, i32* %23
br label %142
142: ; preds = %305, %141
%143 = load i32, i32* %23
%144 = sext i32 %143 to i64
%145 = load i64, i64* %14
%146 = icmp slt i64 %144, %145
br i1 %146, label %147, label %308
147: ; preds = %142
store i32 0, i32* %24
br label %148
148: ; preds = %301, %147
%149 = load i32, i32* %24
%150 = sext i32 %149 to i64
%151 = load i64, i64* %15
%152 = icmp slt i64 %150, %151
br i1 %152, label %153, label %304
153: ; preds = %148
store float 0.000000e+00, float* %19
store i32 0, i32* %21
br label %154
154: ; preds = %218, %153
%155 = load i32, i32* %21
%156 = icmp slt i32 %155, 2
br i1 %156, label %157, label %221
157: ; preds = %154
store i32 0, i32* %22
br label %158
158: ; preds = %214, %157
%159 = load i32, i32* %22
%160 = icmp slt i32 %159, 3
br i1 %160, label %161, label %217
161: ; preds = %158
%162 = load i32, i32* %23
%163 = load i32, i32* %21
%164 = sub nsw i32 %162, %163
%165 = add nsw i32 %164, 1
store i32 %165, i32* %25
%166 = load i32, i32* %24
%167 = load i32, i32* %22
%168 = sub nsw i32 %166, %167
%169 = add nsw i32 %168, 1
store i32 %169, i32* %26
%170 = load i32, i32* %25
%171 = icmp slt i32 %170, 0
br i1 %171, label %172, label %173
172: ; preds = %161
store i32 0, i32* %25
br label %173
173: ; preds = %172, %161
%174 = load i32, i32* %25
%175 = sext i32 %174 to i64
%176 = load i64, i64* %14
%177 = icmp sge i64 %175, %176
br i1 %177, label %178, label %182
178: ; preds = %173
%179 = load i64, i64* %14
%180 = sub nsw i64 %179, 1
%181 = trunc i64 %180 to i32
store i32 %181, i32* %25
br label %182
182: ; preds = %178, %173
%183 = load i32, i32* %26
%184 = icmp slt i32 %183, 0
br i1 %184, label %185, label %186
185: ; preds = %182
store i32 0, i32* %26
br label %186
186: ; preds = %185, %182
%187 = load i32, i32* %26
%188 = sext i32 %187 to i64
%189 = load i64, i64* %15
%190 = icmp sge i64 %188, %189
br i1 %190, label %191, label %195
191: ; preds = %186
%192 = load i64, i64* %15
%193 = sub nsw i64 %192, 1
%194 = trunc i64 %193 to i32
store i32 %194, i32* %26
br label %195
195: ; preds = %191, %186
%196 = load float, float* %19
%197 = load i32, i32* %21
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [2 x [3 x float]], [2 x [3 x float]]* %18, i64 0, i64 %198
%200 = load i32, i32* %22
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [3 x float], [3 x float]* %199, i64 0, i64 %201
%203 = load float, float* %202
%204 = load float**, float*** %16
%205 = load i32, i32* %25
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds float*, float** %204, i64 %206
%208 = load float*, float** %207
%209 = load i32, i32* %26
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds float, float* %208, i64 %210
%212 = load float, float* %211
%213 = call float @llvm.fmuladd.f32(float %203, float %212, float %196)
store float %213, float* %19
br label %214
214: ; preds = %195
%215 = load i32, i32* %22
%216 = add nsw i32 %215, 1
store i32 %216, i32* %22
br label %158
217: ; preds = %158
br label %218
218: ; preds = %217
%219 = load i32, i32* %21
%220 = add nsw i32 %219, 1
store i32 %220, i32* %21
br label %154
221: ; preds = %154
%222 = load float, float* %19
%223 = load float**, float*** %17
%224 = load i32, i32* %23
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds float*, float** %223, i64 %225
%227 = load float*, float** %226
%228 = load i32, i32* %24
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds float, float* %227, i64 %229
store float %222, float* %230
%231 = load i16**, i16*** %9
%232 = load i32, i32* %23
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i16*, i16** %231, i64 %233
%235 = load i16*, i16** %234
%236 = load i32, i32* %24
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds i16, i16* %235, i64 %237
%239 = load i16, i16* %238
%240 = sext i16 %239 to i32
%241 = sitofp i32 %240 to float
%242 = load float**, float*** %17
%243 = load i32, i32* %23
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds float*, float** %242, i64 %244
%246 = load float*, float** %245
%247 = load i32, i32* %24
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds float, float* %246, i64 %248
%250 = load float, float* %249
%251 = fadd float %241, %250
store float %251, float* %20
%252 = load float, float* %20
%253 = load i16, i16* %11
%254 = sext i16 %253 to i32
%255 = sitofp i32 %254 to float
%256 = fcmp ogt float %252, %255
br i1 %256, label %257, label %281
257: ; preds = %221
%258 = load float, float* %20
%259 = load i16, i16* %11
%260 = sext i16 %259 to i32
%261 = mul nsw i32 %260, 2
%262 = sitofp i32 %261 to float
%263 = fsub float %258, %262
%264 = load float**, float*** %16
%265 = load i32, i32* %23
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds float*, float** %264, i64 %266
%268 = load float*, float** %267
%269 = load i32, i32* %24
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds float, float* %268, i64 %270
store float %263, float* %271
%272 = load i16, i16* %12
%273 = load i16**, i16*** %10
%274 = load i32, i32* %23
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds i16*, i16** %273, i64 %275
%277 = load i16*, i16** %276
%278 = load i32, i32* %24
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds i16, i16* %277, i64 %279
store i16 %272, i16* %280
br label %300
281: ; preds = %221
%282 = load float, float* %20
%283 = load float**, float*** %16
%284 = load i32, i32* %23
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds float*, float** %283, i64 %285
%287 = load float*, float** %286
%288 = load i32, i32* %24
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds float, float* %287, i64 %289
store float %282, float* %290
%291 = load i16, i16* %13
%292 = load i16**, i16*** %10
%293 = load i32, i32* %23
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i16*, i16** %292, i64 %294
%296 = load i16*, i16** %295
%297 = load i32, i32* %24
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds i16, i16* %296, i64 %298
store i16 %291, i16* %299
br label %300
300: ; preds = %281, %257
br label %301
301: ; preds = %300
%302 = load i32, i32* %24
%303 = add nsw i32 %302, 1
store i32 %303, i32* %24
br label %148
304: ; preds = %148
br label %305
305: ; preds = %304
%306 = load i32, i32* %23
%307 = add nsw i32 %306, 1
store i32 %307, i32* %23
br label %142
308: ; preds = %142
store i32 0, i32* %21
br label %309
309: ; preds = %327, %308
%310 = load i32, i32* %21
%311 = sext i32 %310 to i64
%312 = load i64, i64* %14
%313 = icmp slt i64 %311, %312
br i1 %313, label %314, label %330
314: ; preds = %309
%315 = load float**, float*** %16
%316 = load i32, i32* %21
%317 = sext i32 %316 to i64
%318 = getelementptr inbounds float*, float** %315, i64 %317
%319 = load float*, float** %318
%320 = bitcast float* %319 to i8*
%321 = load float**, float*** %17
%322 = load i32, i32* %21
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds float*, float** %321, i64 %323
%325 = load float*, float** %324
%326 = bitcast float* %325 to i8*
br label %327
327: ; preds = %314
%328 = load i32, i32* %21
%329 = add nsw i32 %328, 1
store i32 %329, i32* %21
br label %309
330: ; preds = %309
%331 = load i32, i32* %8
ret i32 %331
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0A\09malloc of eg[%d] failed\00"
@.str.1 = [26 x i8] c"\0A\09malloc of ep[%d] failed\00"
define i32 @half_tone(i16** nocapture %0, i16** nocapture %1, i32 %2, i32 %3, i32 %4, i64 %5, i64 %6) {
%8 = shl i64 %5, 3
%9 = tail call i8* @malloc(i64 %8)
%10 = bitcast i8* %9 to float**
%11 = icmp sgt i64 %5, 0
br i1 %11, label %12, label %263
12: ; preds = %7
%13 = shl i64 %6, 2
br label %14
14: ; preds = %12, %23
%15 = phi i64 [ 0, %12 ], [ %24, %23 ]
%16 = tail call i8* @malloc(i64 %13)
%17 = getelementptr inbounds float*, float** %10, i64 %15
%18 = bitcast float** %17 to i8**
store i8* %16, i8** %18
%19 = icmp eq i8* %16, null
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = trunc i64 %15 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %14, %20
%24 = add nuw nsw i64 %15, 1
%25 = icmp eq i64 %24, %5
br i1 %25, label %26, label %14
26: ; preds = %23
%27 = tail call i8* @malloc(i64 %8)
%28 = bitcast i8* %27 to float**
br i1 %11, label %29, label %263
29: ; preds = %26
%30 = shl i64 %6, 2
br label %46
31: ; preds = %55
br i1 %11, label %32, label %263
32: ; preds = %31
%33 = icmp sgt i64 %6, 0
%34 = add i64 %6, -8
%35 = lshr i64 %34, 3
%36 = add nuw nsw i64 %35, 1
%37 = icmp ult i64 %6, 8
%38 = and i64 %6, -8
%39 = and i64 %36, 3
%40 = icmp ult i64 %34, 24
%41 = and i64 %36, 4611686018427387900
%42 = icmp eq i64 %39, 0
%43 = icmp eq i64 %38, %6
%44 = and i64 %6, 3
%45 = icmp eq i64 %44, 0
br label %58
46: ; preds = %29, %55
%47 = phi i64 [ 0, %29 ], [ %56, %55 ]
%48 = tail call i8* @malloc(i64 %30)
%49 = getelementptr inbounds float*, float** %28, i64 %47
%50 = bitcast float** %49 to i8**
store i8* %48, i8** %50
%51 = icmp eq i8* %48, null
br i1 %51, label %52, label %55
52: ; preds = %46
%53 = trunc i64 %47 to i32
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %46, %52
%56 = add nuw nsw i64 %47, 1
%57 = icmp eq i64 %56, %5
br i1 %57, label %31, label %46
58: ; preds = %32, %171
%59 = phi i64 [ 0, %32 ], [ %172, %171 ]
br i1 %33, label %60, label %171
60: ; preds = %58
%61 = getelementptr inbounds float*, float** %10, i64 %59
%62 = load float*, float** %61
%63 = getelementptr inbounds float*, float** %28, i64 %59
%64 = load float*, float** %63
br i1 %37, label %130, label %65
65: ; preds = %60
%66 = getelementptr float, float* %62, i64 %6
%67 = getelementptr float, float* %64, i64 %6
%68 = icmp ult float* %62, %67
%69 = icmp ult float* %64, %66
%70 = and i1 %68, %69
br i1 %70, label %130, label %71
71: ; preds = %65
br i1 %40, label %113, label %72
72: ; preds = %71, %72
%73 = phi i64 [ %110, %72 ], [ 0, %71 ]
%74 = phi i64 [ %111, %72 ], [ 0, %71 ]
%75 = getelementptr inbounds float, float* %62, i64 %73
%76 = bitcast float* %75 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %76
%77 = getelementptr inbounds float, float* %75, i64 4
%78 = bitcast float* %77 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %78
%79 = getelementptr inbounds float, float* %64, i64 %73
%80 = bitcast float* %79 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %80
%81 = getelementptr inbounds float, float* %79, i64 4
%82 = bitcast float* %81 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %82
%83 = or i64 %73, 8
%84 = getelementptr inbounds float, float* %62, i64 %83
%85 = bitcast float* %84 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %85
%86 = getelementptr inbounds float, float* %84, i64 4
%87 = bitcast float* %86 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %87
%88 = getelementptr inbounds float, float* %64, i64 %83
%89 = bitcast float* %88 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %89
%90 = getelementptr inbounds float, float* %88, i64 4
%91 = bitcast float* %90 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %91
%92 = or i64 %73, 16
%93 = getelementptr inbounds float, float* %62, i64 %92
%94 = bitcast float* %93 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %94
%95 = getelementptr inbounds float, float* %93, i64 4
%96 = bitcast float* %95 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %96
%97 = getelementptr inbounds float, float* %64, i64 %92
%98 = bitcast float* %97 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %98
%99 = getelementptr inbounds float, float* %97, i64 4
%100 = bitcast float* %99 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %100
%101 = or i64 %73, 24
%102 = getelementptr inbounds float, float* %62, i64 %101
%103 = bitcast float* %102 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %103
%104 = getelementptr inbounds float, float* %102, i64 4
%105 = bitcast float* %104 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %105
%106 = getelementptr inbounds float, float* %64, i64 %101
%107 = bitcast float* %106 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %107
%108 = getelementptr inbounds float, float* %106, i64 4
%109 = bitcast float* %108 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %109
%110 = add nuw i64 %73, 32
%111 = add i64 %74, 4
%112 = icmp eq i64 %111, %41
br i1 %112, label %113, label %72
113: ; preds = %72, %71
%114 = phi i64 [ 0, %71 ], [ %110, %72 ]
br i1 %42, label %129, label %115
115: ; preds = %113, %115
%116 = phi i64 [ %126, %115 ], [ %114, %113 ]
%117 = phi i64 [ %127, %115 ], [ 0, %113 ]
%118 = getelementptr inbounds float, float* %62, i64 %116
%119 = bitcast float* %118 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %119
%120 = getelementptr inbounds float, float* %118, i64 4
%121 = bitcast float* %120 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %121
%122 = getelementptr inbounds float, float* %64, i64 %116
%123 = bitcast float* %122 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %123
%124 = getelementptr inbounds float, float* %122, i64 4
%125 = bitcast float* %124 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %125
%126 = add nuw i64 %116, 8
%127 = add i64 %117, 1
%128 = icmp eq i64 %127, %39
br i1 %128, label %129, label %115
129: ; preds = %115, %113
br i1 %43, label %171, label %130
130: ; preds = %65, %60, %129
%131 = phi i64 [ 0, %65 ], [ 0, %60 ], [ %38, %129 ]
%132 = xor i64 %131, -1
%133 = add i64 %132, %6
br i1 %45, label %142, label %134
134: ; preds = %130, %134
%135 = phi i64 [ %139, %134 ], [ %131, %130 ]
%136 = phi i64 [ %140, %134 ], [ 0, %130 ]
%137 = getelementptr inbounds float, float* %62, i64 %135
store float 0.000000e+00, float* %137
%138 = getelementptr inbounds float, float* %64, i64 %135
store float 0.000000e+00, float* %138
%139 = add nuw nsw i64 %135, 1
%140 = add i64 %136, 1
%141 = icmp eq i64 %140, %44
br i1 %141, label %142, label %134
142: ; preds = %134, %130
%143 = phi i64 [ %131, %130 ], [ %139, %134 ]
%144 = icmp ult i64 %133, 3
br i1 %144, label %171, label %156
145: ; preds = %171
br i1 %11, label %146, label %263
146: ; preds = %145
%147 = icmp sgt i64 %6, 0
%148 = add nuw i64 %5, 4294967295
%149 = trunc i64 %6 to i32
%150 = add i32 %149, -1
%151 = shl i32 %2, 16
%152 = ashr exact i32 %151, 16
%153 = sitofp i32 %152 to float
%154 = ashr exact i32 %151, 15
%155 = sitofp i32 %154 to float
br label %174
156: ; preds = %142, %156
%157 = phi i64 [ %169, %156 ], [ %143, %142 ]
%158 = getelementptr inbounds float, float* %62, i64 %157
store float 0.000000e+00, float* %158
%159 = getelementptr inbounds float, float* %64, i64 %157
store float 0.000000e+00, float* %159
%160 = add nuw nsw i64 %157, 1
%161 = getelementptr inbounds float, float* %62, i64 %160
store float 0.000000e+00, float* %161
%162 = getelementptr inbounds float, float* %64, i64 %160
store float 0.000000e+00, float* %162
%163 = add nuw nsw i64 %157, 2
%164 = getelementptr inbounds float, float* %62, i64 %163
store float 0.000000e+00, float* %164
%165 = getelementptr inbounds float, float* %64, i64 %163
store float 0.000000e+00, float* %165
%166 = add nuw nsw i64 %157, 3
%167 = getelementptr inbounds float, float* %62, i64 %166
store float 0.000000e+00, float* %167
%168 = getelementptr inbounds float, float* %64, i64 %166
store float 0.000000e+00, float* %168
%169 = add nuw nsw i64 %157, 4
%170 = icmp eq i64 %169, %6
br i1 %170, label %171, label %156
171: ; preds = %142, %156, %129, %58
%172 = add nuw nsw i64 %59, 1
%173 = icmp eq i64 %172, %5
br i1 %173, label %145, label %58
174: ; preds = %146, %250
%175 = phi i64 [ 0, %146 ], [ %251, %250 ]
br i1 %147, label %178, label %176
176: ; preds = %174
%177 = add nuw nsw i64 %175, 1
br label %250
178: ; preds = %174
%179 = getelementptr inbounds float*, float** %28, i64 %175
%180 = load float*, float** %179
%181 = getelementptr inbounds i16*, i16** %0, i64 %175
%182 = load i16*, i16** %181
%183 = getelementptr inbounds float*, float** %10, i64 %175
%184 = getelementptr inbounds i16*, i16** %1, i64 %175
%185 = shl i64 %175, 32
%186 = ashr exact i64 %185, 32
%187 = getelementptr inbounds float*, float** %10, i64 %186
%188 = load float*, float** %187
%189 = add nuw nsw i64 %175, 1
%190 = icmp slt i64 %189, %5
%191 = select i1 %190, i64 %189, i64 %148
%192 = shl i64 %191, 32
%193 = ashr exact i64 %192, 32
%194 = getelementptr inbounds float*, float** %10, i64 %193
%195 = load float*, float** %194
%196 = load float*, float** %183
%197 = load i16*, i16** %184
br label %199
198: ; preds = %250
br i1 %11, label %253, label %263
199: ; preds = %178, %199
%200 = phi i64 [ 0, %178 ], [ %201, %199 ]
%201 = add nuw nsw i64 %200, 1
%202 = icmp slt i64 %201, %6
%203 = trunc i64 %201 to i32
%204 = select i1 %202, i32 %203, i32 %150
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds float, float* %195, i64 %205
%207 = load float, float* %206
%208 = tail call float @llvm.fmuladd.f32(float %207, float 0.000000e+00, float 0.000000e+00)
%209 = trunc i64 %200 to i32
%210 = and i64 %200, 4294967295
%211 = icmp slt i64 %210, %6
%212 = select i1 %211, i32 %209, i32 %150
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds float, float* %195, i64 %213
%215 = load float, float* %214
%216 = tail call float @llvm.fmuladd.f32(float %215, float 0x3FC99999A0000000, float %208)
%217 = icmp ugt i64 %200, 1
%218 = trunc i64 %200 to i32
%219 = add i32 %218, -1
%220 = select i1 %217, i32 %219, i32 0
%221 = zext i32 %220 to i64
%222 = icmp slt i64 %221, %6
%223 = select i1 %222, i32 %220, i32 %150
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds float, float* %195, i64 %224
%226 = load float, float* %225
%227 = tail call float @llvm.fmuladd.f32(float %226, float 0.000000e+00, float %216)
%228 = getelementptr inbounds float, float* %188, i64 %205
%229 = load float, float* %228
%230 = tail call float @llvm.fmuladd.f32(float %229, float 0x3FE3333340000000, float %227)
%231 = getelementptr inbounds float, float* %188, i64 %213
%232 = load float, float* %231
%233 = tail call float @llvm.fmuladd.f32(float %232, float 0x3FB99999A0000000, float %230)
%234 = getelementptr inbounds float, float* %188, i64 %224
%235 = load float, float* %234
%236 = tail call float @llvm.fmuladd.f32(float %235, float 0x3FB99999A0000000, float %233)
%237 = getelementptr inbounds float, float* %180, i64 %200
store float %236, float* %237
%238 = getelementptr inbounds i16, i16* %182, i64 %200
%239 = load i16, i16* %238
%240 = sitofp i16 %239 to float
%241 = fadd float %236, %240
%242 = fcmp ogt float %241, %153
%243 = select i1 %242, float %155, float 0.000000e+00
%244 = fsub float %241, %243
%245 = select i1 %242, i32 %3, i32 %4
%246 = trunc i32 %245 to i16
%247 = getelementptr inbounds float, float* %196, i64 %200
store float %244, float* %247
%248 = getelementptr inbounds i16, i16* %197, i64 %200
store i16 %246, i16* %248
%249 = icmp eq i64 %201, %6
br i1 %249, label %250, label %199
250: ; preds = %199, %176
%251 = phi i64 [ %177, %176 ], [ %189, %199 ]
%252 = icmp eq i64 %251, %5
br i1 %252, label %198, label %174
253: ; preds = %198, %253
%254 = phi i64 [ %261, %253 ], [ 0, %198 ]
%255 = getelementptr inbounds float*, float** %10, i64 %254
%256 = bitcast float** %255 to i8**
%257 = load i8*, i8** %256
tail call void @free(i8* %257)
%258 = getelementptr inbounds float*, float** %28, i64 %254
%259 = bitcast float** %258 to i8**
%260 = load i8*, i8** %259
tail call void @free(i8* %260)
%261 = add nuw nsw i64 %254, 1
%262 = icmp eq i64 %261, %5
br i1 %262, label %263, label %253
263: ; preds = %253, %7, %26, %31, %145, %198
ret i32 undef
}