int geometry(the_image, out_image, x_angle, x_stretch, y_stretch, x_displace,
             y_displace, x_cross, y_cross, bilinear, rows, cols)
float x_angle, x_stretch, y_stretch, x_cross, y_cross;
int bilinear;
long cols, rows;
short **the_image, **out_image, x_displace, y_displace;
{
  double cosa, sina, radian_angle, tmpx, tmpy;
  float fi, fj, x_div, y_div, x_num, y_num;
  int i, j, new_i, new_j;
  radian_angle = x_angle / 57.29577951;
  cosa = cos(radian_angle);
  sina = sin(radian_angle);
  if (x_stretch < 0.00001) {
    x_div = 1.0;
    x_num = 0.0;
  } else {
    x_div = x_stretch;
    x_num = 1.0;
  }
  if (y_stretch < 0.00001) {
    y_div = 1.0;
    y_num = 0.0;
  } else {
    y_div = y_stretch;
    y_num = 1.0;
  }
  printf("\n");
  for (i = 0; i < rows; i++) {
    if ((i % 10) == 0)
      printf("%d ", i);
    for (j = 0; j < cols; j++) {
      fi = i;
      fj = j;
      tmpx = (double)(j)*cosa + (double)(i)*sina + (double)(x_displace) +
             (double)(x_num * fj / x_div) + (double)(x_cross * i * j);
      tmpy = (double)(i)*cosa - (double)(j)*sina + (double)(y_displace) +
             (double)(y_num * fi / y_div) + (double)(y_cross * i * j);
      if (x_stretch != 0.0)
        tmpx = tmpx - (double)(fj * cosa + fi * sina);
      if (y_stretch != 0.0)
        tmpy = tmpy - (double)(fi * cosa - fj * sina);
      new_j = tmpx;
      new_i = tmpy;
      if (bilinear == 0) {
        if (new_j < 0 || new_j >= cols || new_i < 0 || new_i >= rows)
          out_image[i][j] = 150;
        else
          out_image[i][j] = the_image[new_i][new_j];
      } else {
        out_image[i][j] =
            bilinear_interpolate(the_image, tmpx, tmpy, rows, cols);
      }
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<geometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm4,-0x90(%rbp)
ff
movsd  %xmm3,-0x98(%rbp)
ff
mov    %ecx,%eax
movaps %xmm1,%xmm3
movsd  -0x98(%rbp),%xmm1
ff
movaps %xmm0,%xmm4
movsd  -0x90(%rbp),%xmm0
ff
mov    0x10(%rbp),%rcx
cvtsd2ss %xmm4,%xmm4
cvtsd2ss %xmm3,%xmm3
cvtsd2ss %xmm2,%xmm2
mov    %dx,%cx
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
mov    %cx,-0x1e(%rbp)
mov    %ax,-0x20(%rbp)
movss  %xmm1,-0x24(%rbp)
movss  %xmm0,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe38(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdf8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    122c <geometry+0xec>
movss  0xdf6(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
jmp    1243 <geometry+0x103>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  0xdd2(%rip),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdac(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1278 <geometry+0x138>
movss  0xdaa(%rip),%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
jmp    128f <geometry+0x14f>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  0xd86(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x7c(%rbp)
movslq -0x7c(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    1599 <geometry+0x459>
mov    -0x7c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12d7 <geometry+0x197>
mov    -0x7c(%rbp),%esi
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x80(%rbp)
movslq -0x80(%rbp),%rax
cmp    0x10(%rbp),%rax
jge    1586 <geometry+0x446>
cvtsi2ssl -0x7c(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
cvtsi2ssl -0x80(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
mov    -0x80(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x7c(%rbp),%ecx
cvtsi2sd %ecx,%xmm1
movsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movswl -0x1e(%rbp),%edx
cvtsi2sd %edx,%xmm1
addsd  %xmm1,%xmm0
movss  -0x74(%rbp),%xmm1
movss  -0x68(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  -0x6c(%rbp),%xmm2
divss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm1
cvtsi2ss %ecx,%xmm2
mulss  %xmm2,%xmm1
cvtsi2ss %eax,%xmm2
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
cvtsi2sdl -0x80(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
movswl -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movss  -0x78(%rbp),%xmm1
mulss  -0x64(%rbp),%xmm1
divss  -0x70(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movss  -0x28(%rbp),%xmm1
cvtsi2ssl -0x7c(%rbp),%xmm2
mulss  %xmm2,%xmm1
cvtsi2ssl -0x80(%rbp),%xmm2
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13f9 <geometry+0x2b9>
jp     13f9 <geometry+0x2b9>
jmp    142b <geometry+0x2eb>
movsd  -0x58(%rbp),%xmm0
movss  -0x68(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  -0x40(%rbp),%xmm3
movss  -0x64(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  -0x48(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    144c <geometry+0x30c>
jp     144c <geometry+0x30c>
jmp    1495 <geometry+0x355>
movsd  -0x60(%rbp),%xmm0
movss  -0x64(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  -0x40(%rbp),%xmm3
movss  -0x68(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  -0x48(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
cvttsd2si -0x58(%rbp),%eax
mov    %eax,-0x88(%rbp)
cvttsd2si -0x60(%rbp),%eax
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    153f <geometry+0x3ff>
cmpl   $0x0,-0x88(%rbp)
jl     14f1 <geometry+0x3b1>
movslq -0x88(%rbp),%rax
cmp    0x10(%rbp),%rax
jge    14f1 <geometry+0x3b1>
cmpl   $0x0,-0x84(%rbp)
jl     14f1 <geometry+0x3b1>
movslq -0x84(%rbp),%rax
cmp    -0x38(%rbp),%rax
jl     150c <geometry+0x3cc>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x80(%rbp),%rcx
movw   $0x96,(%rax,%rcx,2)
jmp    153a <geometry+0x3fa>
mov    -0x8(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x80(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    1573 <geometry+0x433>
mov    -0x8(%rbp),%rdi
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mov    -0x38(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    $0x2,%al
call   1030 <bilinear_interpolate@plt>
mov    %ax,%dx
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x80(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    1578 <geometry+0x438>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    12de <geometry+0x19e>
jmp    158b <geometry+0x44b>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12a4 <geometry+0x164>
mov    $0x1,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geometry>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
mov    %r9,%r14
mov    %r8d,%r12d
movsd  %xmm4,0x28(%rsp)
movsd  %xmm3,0x20(%rsp)
mov    %ecx,%r15d
mov    %edx,%r13d
movsd  %xmm2,0x30(%rsp)
mov    %rsi,%rbx
mov    %rdi,0x48(%rsp)
cvtss2sd %xmm0,%xmm0
divsd  0xe5f(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
call   1070 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x50(%rsp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,0x80(%rsp)
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe2e(%rip),%xmm0
ucomisd %xmm1,%xmm0
movss  0xe2a(%rip),%xmm1
movss  %xmm1,0xc(%rsp)
movss  %xmm1,0x14(%rsp)
ja     1200 <geometry+0xb0>
movss  0x4(%rsp),%xmm1
movss  %xmm1,0x14(%rsp)
movsd  0x30(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm2
xorps  %xmm1,%xmm1
movss  %xmm1,0x10(%rsp)
ja     1226 <geometry+0xd6>
movss  0xdf0(%rip),%xmm1
movss  %xmm1,0x10(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
ucomisd %xmm1,%xmm0
movss  %xmm2,(%rsp)
ja     1240 <geometry+0xf0>
movss  %xmm2,0x8(%rsp)
jmp    1258 <geometry+0x108>
movss  0xdc8(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14,%r14
movsd  0x18(%rsp),%xmm6
movss  (%rsp),%xmm8
jle    1554 <geometry+0x404>
movsd  0x20(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x40(%rsp)
movsd  0x28(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x3c(%rsp)
mov    0xf0(%rsp),%rbp
movswl %r13w,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x70(%rsp)
movapd 0xd67(%rip),%xmm9
movswl %r15w,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x68(%rsp)
xorpd  0x80(%rsp),%xmm9
xorps  %xmm7,%xmm7
xor    %r13d,%r13d
movapd %xmm9,0x90(%rsp)
jmp    12fd <geometry+0x1ad>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    %r14,%r13
je     1554 <geometry+0x404>
imul   $0xcccccccd,%r13d,%eax
ror    %eax
cmp    $0x19999999,%eax
jbe    1320 <geometry+0x1d0>
test   %rbp,%rbp
jg     134f <geometry+0x1ff>
jmp    12f0 <geometry+0x1a0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xd09(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xorps  %xmm7,%xmm7
movapd 0x90(%rsp),%xmm9
movss  (%rsp),%xmm8
movsd  0x18(%rsp),%xmm6
test   %rbp,%rbp
jle    12f0 <geometry+0x1a0>
xorps  %xmm0,%xmm0
cvtsi2ss %r13d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movapd 0x80(%rsp),%xmm2
movapd %xmm2,%xmm3
movsd  %xmm1,0x30(%rsp)
mulsd  %xmm1,%xmm3
movapd %xmm3,0x50(%rsp)
movss  0x40(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x28(%rsp)
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
divss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  %xmm1,0x20(%rsp)
movss  0x3c(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x44(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x78(%rsp)
mulsd  %xmm0,%xmm2
movapd %xmm2,0xa0(%rsp)
xor    %r15d,%r15d
jmp    14a5 <geometry+0x355>
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movapd %xmm9,%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm6,%xmm0
addsd  0x50(%rsp),%xmm0
addsd  0x70(%rsp),%xmm0
movss  0x10(%rsp),%xmm5
mulss  %xmm1,%xmm5
divss  0x14(%rsp),%xmm5
cvtss2sd %xmm5,%xmm5
addsd  %xmm0,%xmm5
movss  0x28(%rsp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm5,%xmm0
subsd  %xmm2,%xmm0
movsd  0x30(%rsp),%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm4,%xmm2
addsd  0x68(%rsp),%xmm2
addsd  0x20(%rsp),%xmm2
mulss  0x44(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm3,%xmm1
test   %r12d,%r12d
je     1510 <geometry+0x3c0>
mov    0x48(%rsp),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    $0x2,%al
call   1040 <bilinear_interpolate@plt>
xorps  %xmm7,%xmm7
movapd 0x90(%rsp),%xmm9
movss  (%rsp),%xmm8
movsd  0x18(%rsp),%xmm6
mov    (%rbx,%r13,8),%rcx
mov    %ax,(%rcx,%r15,2)
add    $0x1,%r15
cmp    %r15,%rbp
je     12f0 <geometry+0x1a0>
movss  0x4(%rsp),%xmm0
ucomiss %xmm7,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %r15d,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movaps %xmm0,%xmm2
mulsd  %xmm6,%xmm2
addsd  0xa0(%rsp),%xmm2
jne    14d5 <geometry+0x385>
jp     14d5 <geometry+0x385>
xorpd  %xmm2,%xmm2
ucomiss %xmm7,%xmm8
mulsd  %xmm9,%xmm0
movsd  0x78(%rsp),%xmm3
mulsd  %xmm6,%xmm3
addsd  %xmm0,%xmm3
jne    13e0 <geometry+0x290>
jp     13e0 <geometry+0x290>
xorpd  %xmm3,%xmm3
jmp    13e0 <geometry+0x290>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cvttsd2si %xmm0,%ecx
mov    $0x96,%ax
test   %ecx,%ecx
js     148f <geometry+0x33f>
mov    %ecx,%ecx
cmp    %rbp,%rcx
jge    148f <geometry+0x33f>
cvttsd2si %xmm1,%edx
test   %edx,%edx
js     148f <geometry+0x33f>
mov    %edx,%edx
cmp    %r14,%rdx
jge    148f <geometry+0x33f>
mov    0x48(%rsp),%rax
mov    (%rax,%rdx,8),%rax
movzwl (%rax,%rcx,2),%eax
jmp    148f <geometry+0x33f>
mov    $0x1,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
define i32 @geometry(i16** %0, i16** nocapture %1, double %2, double %3, double %4, i32 %5, i32 %6, double %7, double %8, i32 %9, i64 %10, i64 %11) {
%13 = fptrunc double %2 to float
%14 = fptrunc double %3 to float
%15 = fptrunc double %4 to float
%16 = fptrunc double %7 to float
%17 = fptrunc double %8 to float
%18 = fpext float %13 to double
%19 = fdiv double %18, 0x404CA5DC1A5D2372
%20 = tail call double @cos(double %19)
%21 = tail call double @sin(double %19)
%22 = fpext float %14 to double
%23 = fcmp olt double %22, 1.000000e-05
%24 = select i1 %23, float 1.000000e+00, float %14
%25 = select i1 %23, float 0.000000e+00, float 1.000000e+00
%26 = fpext float %15 to double
%27 = fcmp olt double %26, 1.000000e-05
%28 = select i1 %27, float 1.000000e+00, float %15
%29 = select i1 %27, float 0.000000e+00, float 1.000000e+00
%30 = tail call i32 @putchar(i32 10)
%31 = icmp sgt i64 %10, 0
br i1 %31, label %32, label %120
32: ; preds = %12
%33 = trunc i32 %6 to i16
%34 = trunc i32 %5 to i16
%35 = icmp sgt i64 %11, 0
%36 = sitofp i16 %34 to double
%37 = fneg double %21
%38 = sitofp i16 %33 to double
%39 = fcmp une float %14, 0.000000e+00
%40 = fcmp une float %15, 0.000000e+00
%41 = icmp eq i32 %9, 0
br label %42
42: ; preds = %32, %117
%43 = phi i64 [ 0, %32 ], [ %118, %117 ]
%44 = trunc i64 %43 to i32
%45 = urem i32 %44, 10
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
br label %49
49: ; preds = %47, %42
br i1 %35, label %50, label %117
50: ; preds = %49
%51 = sitofp i32 %44 to float
%52 = sitofp i32 %44 to double
%53 = fmul double %21, %52
%54 = fmul float %16, %51
%55 = fmul float %29, %51
%56 = fdiv float %55, %28
%57 = fpext float %56 to double
%58 = fmul float %17, %51
%59 = fpext float %51 to double
%60 = fmul double %21, %59
%61 = getelementptr inbounds i16*, i16** %1, i64 %43
br label %62
62: ; preds = %50, %111
%63 = phi i64 [ 0, %50 ], [ %115, %111 ]
%64 = trunc i64 %63 to i32
%65 = sitofp i32 %64 to float
%66 = sitofp i32 %64 to double
%67 = tail call double @llvm.fmuladd.f64(double %66, double %20, double %53)
%68 = fadd double %67, %36
%69 = fmul float %25, %65
%70 = fdiv float %69, %24
%71 = fpext float %70 to double
%72 = fadd double %68, %71
%73 = fmul float %54, %65
%74 = fpext float %73 to double
%75 = fadd double %72, %74
%76 = fmul double %37, %66
%77 = tail call double @llvm.fmuladd.f64(double %52, double %20, double %76)
%78 = fadd double %77, %38
%79 = fadd double %78, %57
%80 = fmul float %58, %65
%81 = fpext float %80 to double
%82 = fadd double %79, %81
%83 = fpext float %65 to double
%84 = tail call double @llvm.fmuladd.f64(double %83, double %20, double %60)
%85 = select i1 %39, double %84, double 0.000000e+00
%86 = fsub double %75, %85
%87 = fmul double %37, %83
%88 = tail call double @llvm.fmuladd.f64(double %59, double %20, double %87)
%89 = select i1 %40, double %88, double 0.000000e+00
%90 = fsub double %82, %89
%91 = fptosi double %86 to i32
%92 = fptosi double %90 to i32
br i1 %41, label %93, label %108
93: ; preds = %62
%94 = icmp slt i32 %91, 0
br i1 %94, label %111, label %95
95: ; preds = %93
%96 = zext i32 %91 to i64
%97 = icmp sge i64 %96, %11
%98 = icmp slt i32 %92, 0
%99 = select i1 %97, i1 true, i1 %98
br i1 %99, label %111, label %100
100: ; preds = %95
%101 = zext i32 %92 to i64
%102 = icmp slt i64 %101, %10
br i1 %102, label %103, label %111
103: ; preds = %100
%104 = getelementptr inbounds i16*, i16** %0, i64 %101
%105 = load i16*, i16** %104
%106 = getelementptr inbounds i16, i16* %105, i64 %96
%107 = load i16, i16* %106
br label %111
108: ; preds = %62
%109 = tail call i32 (i16**, double, double, i64, i64, ...) bitcast (i32 (...)* @bilinear_interpolate to i32 (i16**, double, double, i64, i64, ...)*)(i16** %0, double %86, double %90, i64 %10, i64 %11)
%110 = trunc i32 %109 to i16
br label %111
111: ; preds = %93, %95, %100, %108, %103
%112 = phi i16 [ %110, %108 ], [ %107, %103 ], [ 150, %100 ], [ 150, %95 ], [ 150, %93 ]
%113 = load i16*, i16** %61
%114 = getelementptr inbounds i16, i16* %113, i64 %63
store i16 %112, i16* %114
%115 = add nuw nsw i64 %63, 1
%116 = icmp eq i64 %115, %11
br i1 %116, label %117, label %62
117: ; preds = %111, %49
%118 = add nuw nsw i64 %43, 1
%119 = icmp eq i64 %118, %10
br i1 %119, label %120, label %42
120: ; preds = %117, %12
ret i32 1
}