#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 */
float BACKDET();
float BACKDIV();
int /*<<< orphan*/ compute_flow_det(float *, float *, int, int);
int /*<<< orphan*/ compute_flow_div(float *, float *, int, int);
int /*<<< orphan*/ env_interpolate_at(float *, float *, int, int, int, float,
                                      float);
float exp(float);
int /*<<< orphan*/ free(float *);
float *xmalloc(int);
void invflow(float *ou, float *flo, float *pin, int w, int h, int pd, int win,
             int hin) {
  float(*out)[w][pd] = (void *)ou;
  float(*in)[win][pd] = (void *)pin;
  float(*flow)[w][2] = (void *)flo;
  float *flowdiv = NULL;
  float *flowdet = NULL;
  if (BACKDIV() > 0) {
    flowdiv = xmalloc(w * h * sizeof *flowdiv);
    compute_flow_div(flowdiv, flo, w, h);
  }
  if (BACKDET() > 0) {
    flowdet = xmalloc(w * h * sizeof *flowdiv);
    compute_flow_det(flowdet, flo, w, h);
  }
  for (int j = 0; j < (h); j++)
    for (int i = 0; i < (w); i++) {
      float p[2] = {i + flow[j][i][0], j + flow[j][i][1]};
      float result[pd];
      env_interpolate_at(result, pin, win, hin, pd, p[0], p[1]);
      float factor = 1;
      if (flowdiv)
        factor = exp(BACKDIV() * flowdiv[j * w + i]);
      for (int l = 0; l < (pd); l++)
        out[j][i][l] = factor * result[l];
      if (flowdet) {
        float bd = BACKDET();
        float det = flowdet[j * w + i];
        if (det > bd)
          det = bd;
        for (int l = 0; l < (pd); l++)
          out[j][i][l] = det * result[l];
      }
    }
  if (flowdiv)
    free(flowdiv);
}


x86 assembly (clang, -O0):
<invflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0xa0(%rbp)
mov    -0x24(%rbp),%eax
mov    %rax,-0x98(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    $0x0,%al
call   1040 <BACKDIV@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    122c <invflow+0xac>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <xmalloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1090 <compute_flow_div@plt>
mov    $0x0,%al
call   1080 <BACKDET@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    126a <invflow+0xea>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <xmalloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1050 <compute_flow_det@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    14de <invflow+0x35e>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14cb <invflow+0x34b>
mov    -0x90(%rbp),%rdx
movslq -0x58(%rbp),%rcx
mov    %ecx,%eax
cvtsi2ss %eax,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rsi
imul   %rdx,%rsi
lea    (%rax,%rsi,8),%rax
movss  (%rax,%rcx,8),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
movslq -0x54(%rbp),%rcx
mov    %ecx,%eax
cvtsi2ss %eax,%xmm0
mov    -0x40(%rbp),%rax
imul   %rdx,%rcx
lea    (%rax,%rcx,8),%rax
movslq -0x58(%rbp),%rcx
movss  0x4(%rax,%rcx,8),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x24(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x68(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0xa8(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x70(%rbp)
mov    -0x18(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    -0x24(%rbp),%r8d
movss  -0x60(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
call   10a0 <env_interpolate_at@plt>
movss  0xcc9(%rip),%xmm0
movss  %xmm0,-0x74(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     136e <invflow+0x1ee>
mov    $0x0,%al
call   1040 <BACKDIV@plt>
mov    -0x48(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulss  (%rax,%rcx,4),%xmm0
call   1070 <exp@plt>
movss  %xmm0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13e1 <invflow+0x261>
mov    -0x98(%rbp),%rdx
mov    -0xa0(%rbp),%rsi
mov    -0xa8(%rbp),%rax
movss  -0x74(%rbp),%xmm0
movslq -0x78(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
imul   %rdx,%rsi
imul   %rsi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1375 <invflow+0x1f5>
cmpq   $0x0,-0x50(%rbp)
je     14b6 <invflow+0x336>
mov    $0x0,%al
call   1080 <BACKDET@plt>
movss  %xmm0,-0x7c(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x80(%rbp),%xmm0
ucomiss -0x7c(%rbp),%xmm0
jbe    142c <invflow+0x2ac>
movss  -0x7c(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14b1 <invflow+0x331>
mov    -0x98(%rbp),%rdx
mov    -0xa0(%rbp),%rsi
mov    -0xa8(%rbp),%rax
movss  -0x80(%rbp),%xmm0
movslq -0x84(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
imul   %rdx,%rsi
imul   %rsi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x84(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1436 <invflow+0x2b6>
jmp    14b6 <invflow+0x336>
mov    -0x68(%rbp),%rax
mov    %rax,%rsp
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1284 <invflow+0x104>
jmp    14d0 <invflow+0x350>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1271 <invflow+0xf1>
cmpq   $0x0,-0x48(%rbp)
je     14f2 <invflow+0x372>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invflow>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9d,-0x2c(%rbp)
mov    %r8d,%r14d
mov    %ecx,%ebx
mov    %rdx,-0xd8(%rbp)
mov    %rsi,%r15
mov    %rdi,-0x50(%rbp)
xor    %r12d,%r12d
xor    %eax,%eax
call   1040 <BACKDIV@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11de <invflow+0x5e>
mov    %r14d,%edi
imul   %ebx,%edi
shl    $0x2,%edi
call   1060 <xmalloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1090 <compute_flow_div@plt>
mov    %r12,-0x90(%rbp)
xor    %eax,%eax
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
call   1080 <BACKDET@plt>
ucomiss 0xe0b(%rip),%xmm0
mov    %r15,-0xb8(%rbp)
jbe    1224 <invflow+0xa4>
mov    %r14d,%edi
imul   %ebx,%edi
shl    $0x2,%edi
call   1060 <xmalloc@plt>
mov    %rax,-0x40(%rbp)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1050 <compute_flow_det@plt>
mov    -0x2c(%rbp),%r8d
test   %r14d,%r14d
jle    162a <invflow+0x4aa>
mov    %ebx,%ecx
mov    %r8d,%r15d
movslq %ebx,%rax
mov    %rax,-0xb0(%rbp)
mov    %r14d,%eax
mov    %rax,-0xc8(%rbp)
mov    %r15d,%eax
and    $0xfffffff8,%eax
mov    %rax,-0x88(%rbp)
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x80(%rbp)
mov    %rax,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
mov    %rdx,%rax
mov    %rdx,-0x78(%rbp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,-0x70(%rbp)
mov    -0x50(%rbp),%rax
lea    0x30(%rax),%rdx
mov    %rdx,-0x60(%rbp)
mov    %r15,%rdx
mov    %rcx,-0x98(%rbp)
imul   %rcx,%rdx
shl    $0x2,%rdx
mov    %rdx,-0xc0(%rbp)
lea    0x0(,%r15,4),%rcx
mov    %rcx,-0xd0(%rbp)
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
mov    %ebx,-0x44(%rbp)
jmp    12ee <invflow+0x16e>
nopl   0x0(%rax)
mov    -0x38(%rbp),%rcx
add    $0x1,%rcx
mov    -0xc0(%rbp),%rax
add    %rax,-0x60(%rbp)
add    %rax,-0x58(%rbp)
mov    %rcx,%rax
mov    %rcx,-0x38(%rbp)
cmp    -0xc8(%rbp),%rcx
mov    -0x44(%rbp),%ebx
je     162a <invflow+0x4aa>
test   %ebx,%ebx
jle    12c0 <invflow+0x140>
mov    -0x38(%rbp),%rdx
mov    %rdx,%rax
imul   -0x98(%rbp),%rax
mov    -0xb8(%rbp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,-0xe0(%rbp)
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0x48(%rbp)
imul   -0xb0(%rbp),%rdx
ff
mov    %rdx,-0xa0(%rbp)
imul   %r15,%rax
mov    -0x50(%rbp),%rcx
lea    (%rcx,%rax,4),%rax
mov    %rax,-0x68(%rbp)
mov    -0x58(%rbp),%r13
mov    -0x60(%rbp),%r12
xor    %ebx,%ebx
jmp    1375 <invflow+0x1f5>
nopw   0x0(%rax,%rax,1)
mov    -0xe8(%rbp),%rsp
add    $0x1,%rbx
mov    -0xd0(%rbp),%rax
add    %rax,%r12
add    %rax,%r13
cmp    -0x98(%rbp),%rbx
je     12c0 <invflow+0x140>
mov    %rsp,-0xe8(%rbp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mov    -0xe0(%rbp),%rax
addss  (%rax,%rbx,8),%xmm0
movss  0x4(%rax,%rbx,8),%xmm1
addss  -0x48(%rbp),%xmm1
mov    %rsp,%r14
lea    0xf(,%r15,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %r14,%rdi
mov    -0xd8(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
call   10a0 <env_interpolate_at@plt>
movss  0xc34(%rip),%xmm0
mov    %rbx,%rax
mov    -0x90(%rbp),%rbx
test   %rbx,%rbx
je     140b <invflow+0x28b>
mov    %rax,-0xa8(%rbp)
xor    %eax,%eax
call   1040 <BACKDIV@plt>
mov    -0xa0(%rbp),%rax
mov    -0xa8(%rbp),%rcx
add    %rcx,%rax
mulss  (%rbx,%rax,4),%xmm0
call   1070 <exp@plt>
mov    -0xa8(%rbp),%rax
mov    -0x2c(%rbp),%r8d
test   %r8d,%r8d
mov    %rax,%rbx
jle    14fa <invflow+0x37a>
cmp    $0x8,%r8d
jae    1430 <invflow+0x2b0>
xor    %eax,%eax
jmp    14e0 <invflow+0x360>
nopl   0x0(%rax,%rax,1)
movaps %xmm0,%xmm1
shufps $0x0,%xmm0,%xmm1
cmpq   $0x0,-0x80(%rbp)
je     160f <invflow+0x48f>
mov    -0x70(%rbp),%rcx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movaps (%r14,%rax,4),%xmm2
mulps  %xmm1,%xmm2
movaps 0x10(%r14,%rax,4),%xmm3
mulps  %xmm1,%xmm3
movups %xmm2,-0x30(%r12,%rax,4)
movups %xmm3,-0x20(%r12,%rax,4)
movaps 0x20(%r14,%rax,4),%xmm2
mulps  %xmm1,%xmm2
movaps 0x30(%r14,%rax,4),%xmm3
mulps  %xmm1,%xmm3
movups %xmm2,-0x10(%r12,%rax,4)
movups %xmm3,(%r12,%rax,4)
add    $0x10,%rax
add    $0xfffffffffffffffe,%rcx
jne    1450 <invflow+0x2d0>
testb  $0x1,-0x78(%rbp)
je     14c3 <invflow+0x343>
mov    %rbx,%rcx
imul   %r15,%rcx
mov    -0x68(%rbp),%rdx
lea    (%rdx,%rcx,4),%rcx
movaps %xmm1,%xmm2
mulps  (%r14,%rax,4),%xmm2
movaps 0x10(%r14,%rax,4),%xmm3
mulps  %xmm1,%xmm3
movups %xmm2,(%rcx,%rax,4)
movups %xmm3,0x10(%rcx,%rax,4)
mov    -0x88(%rbp),%rcx
mov    %rcx,%rax
cmp    %r15,%rcx
je     14fa <invflow+0x37a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%r14,%rax,4),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%rax,4)
add    $0x1,%rax
cmp    %rax,%r15
jne    14e0 <invflow+0x360>
cmpq   $0x0,-0x40(%rbp)
je     1350 <invflow+0x1d0>
xor    %eax,%eax
call   1080 <BACKDET@plt>
mov    -0x2c(%rbp),%r8d
test   %r8d,%r8d
jle    1350 <invflow+0x1d0>
mov    -0xa0(%rbp),%rax
add    %rbx,%rax
mov    -0x40(%rbp),%rcx
minss  (%rcx,%rax,4),%xmm0
cmp    $0x8,%r8d
jae    1539 <invflow+0x3b9>
xor    %eax,%eax
jmp    15f0 <invflow+0x470>
movaps %xmm0,%xmm1
shufps $0x0,%xmm0,%xmm1
cmpq   $0x0,-0x80(%rbp)
je     1620 <invflow+0x4a0>
mov    -0x70(%rbp),%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movaps (%r14,%rax,4),%xmm2
mulps  %xmm1,%xmm2
movaps 0x10(%r14,%rax,4),%xmm3
mulps  %xmm1,%xmm3
movups %xmm2,-0x30(%r12,%rax,4)
movups %xmm3,-0x20(%r12,%rax,4)
movaps 0x20(%r14,%rax,4),%xmm2
mulps  %xmm1,%xmm2
movaps 0x30(%r14,%rax,4),%xmm3
mulps  %xmm1,%xmm3
movups %xmm2,-0x10(%r12,%rax,4)
movups %xmm3,(%r12,%rax,4)
add    $0x10,%rax
add    $0xfffffffffffffffe,%rcx
jne    1560 <invflow+0x3e0>
testb  $0x1,-0x78(%rbp)
je     15d3 <invflow+0x453>
mov    %rbx,%rcx
imul   %r15,%rcx
mov    -0x68(%rbp),%rdx
lea    (%rdx,%rcx,4),%rcx
movaps %xmm1,%xmm2
mulps  (%r14,%rax,4),%xmm2
movaps 0x10(%r14,%rax,4),%xmm3
mulps  %xmm1,%xmm3
movups %xmm2,(%rcx,%rax,4)
movups %xmm3,0x10(%rcx,%rax,4)
mov    -0x88(%rbp),%rcx
mov    %rcx,%rax
cmp    %r15,%rcx
je     1350 <invflow+0x1d0>
cs nopw 0x0(%rax,%rax,1)
movss  (%r14,%rax,4),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%rax,4)
add    $0x1,%rax
cmp    %rax,%r15
jne    15f0 <invflow+0x470>
jmp    1350 <invflow+0x1d0>
xor    %eax,%eax
testb  $0x1,-0x78(%rbp)
jne    149a <invflow+0x31a>
jmp    14c3 <invflow+0x343>
xor    %eax,%eax
testb  $0x1,-0x78(%rbp)
jne    15aa <invflow+0x42a>
jmp    15d3 <invflow+0x453>
mov    -0x90(%rbp),%rdi
test   %rdi,%rdi
je     163b <invflow+0x4bb>
call   1030 <free@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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