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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(double *);
double *malloc(int);
int /*<<< orphan*/ stderr;
int svd(double *, double *, double *, int, double *, int);
int svd_float(float *d, float *a, float *u, int m, float *v, int n) {
  assert(m >= n);
  double *dd = malloc(n * sizeof(double));
  double *da = malloc(n * m * sizeof(double));
  double *du = malloc(m * m * sizeof(double));
  double *dv = malloc(n * n * sizeof(double));
  if (!(dd && da && du && dv))
    exit(fprintf(stderr, "out of mem"));
  for (int i = 0; i < n * m; i++)
    da[i] = a[i];
  int r = svd(dd, da, du, m, dv, n);
  if (d)
    for (int i = 0; i < n; i++)
      d[i] = dd[i];
  if (u)
    for (int i = 0; i < m * m; i++)
      u[i] = du[i];
  if (v)
    for (int i = 0; i < n * n; i++)
      v[i] = dv[i];
  free(du);
  free(dv);
  free(da);
  free(dd);
  return r;
}


x86 assembly (clang, -O0):
<svd_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1219 <svd_float+0xb9>
cmpq   $0x0,-0x40(%rbp)
je     1219 <svd_float+0xb9>
cmpq   $0x0,-0x48(%rbp)
je     1219 <svd_float+0xb9>
cmpq   $0x0,-0x50(%rbp)
jne    1235 <svd_float+0xd5>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
lea    0xdd7(%rip),%rsi
call   1060 <fprintf@plt>
mov    %eax,%edi
call   1080 <exit@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    127a <svd_float+0x11a>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    123c <svd_float+0xdc>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x50(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1040 <svd@plt>
mov    %eax,-0x58(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     12e8 <svd_float+0x188>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12e3 <svd_float+0x183>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    12ab <svd_float+0x14b>
jmp    12e8 <svd_float+0x188>
cmpq   $0x0,-0x18(%rbp)
je     133d <svd_float+0x1dd>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    1338 <svd_float+0x1d8>
mov    -0x48(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    12fa <svd_float+0x19a>
jmp    133d <svd_float+0x1dd>
cmpq   $0x0,-0x28(%rbp)
je     1392 <svd_float+0x232>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jge    138d <svd_float+0x22d>
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    134f <svd_float+0x1ef>
jmp    1392 <svd_float+0x232>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%r13d
mov    %r8,0x28(%rsp)
mov    %ecx,%ebx
mov    %rdx,0x20(%rsp)
mov    %rsi,%rbp
mov    %rdi,%r14
xor    %edi,%edi
cmp    %r9d,%ecx
setge  %dil
call   1050 <assert@plt>
lea    0x0(,%r13,8),%edi
call   1070 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r13d,%r15d
imul   %ebx,%r15d
lea    0x0(,%r15,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    %ebx,0x4(%rsp)
mov    %ebx,%eax
imul   %eax,%eax
mov    %rax,0x10(%rsp)
lea    0x0(,%rax,8),%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %r13,0x8(%rsp)
mov    %r13d,%eax
imul   %eax,%eax
mov    %rax,0x18(%rsp)
lea    0x0(,%rax,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r13
mov    0x30(%rsp),%rax
test   %rax,%rax
je     1640 <svd_float+0x4e0>
test   %r12,%r12
je     1640 <svd_float+0x4e0>
mov    %rbx,%rdx
test   %rbx,%rbx
je     1640 <svd_float+0x4e0>
test   %r13,%r13
je     1640 <svd_float+0x4e0>
mov    %rax,%r8
test   %r15d,%r15d
jle    12e9 <svd_float+0x189>
mov    %r15d,%eax
cmp    $0x4,%r15d
jae    123e <svd_float+0xde>
xor    %ecx,%ecx
jmp    12d0 <svd_float+0x170>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%rbx
shr    $0x2,%rbx
add    $0x1,%rbx
test   %rsi,%rsi
je     15fd <svd_float+0x49d>
mov    %rbx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cvtps2pd 0x0(%rbp,%rsi,4),%xmm0
cvtps2pd 0x8(%rbp,%rsi,4),%xmm1
movups %xmm0,(%r12,%rsi,8)
movups %xmm1,0x10(%r12,%rsi,8)
cvtps2pd 0x10(%rbp,%rsi,4),%xmm0
cvtps2pd 0x18(%rbp,%rsi,4),%xmm1
movups %xmm0,0x20(%r12,%rsi,8)
movupd %xmm1,0x30(%r12,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1270 <svd_float+0x110>
test   $0x1,%bl
je     12c1 <svd_float+0x161>
cvtps2pd 0x0(%rbp,%rsi,4),%xmm0
cvtps2pd 0x8(%rbp,%rsi,4),%xmm1
movups %xmm0,(%r12,%rsi,8)
movupd %xmm1,0x10(%r12,%rsi,8)
cmp    %rax,%rcx
je     12e9 <svd_float+0x189>
cs nopw 0x0(%rax,%rax,1)
movss  0x0(%rbp,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%r12,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    12d0 <svd_float+0x170>
mov    %r8,%rbp
mov    %r8,%rdi
mov    %r12,%rsi
mov    %rdx,%r15
mov    0x4(%rsp),%ecx
mov    %r13,%r8
mov    0x8(%rsp),%rbx
mov    %ebx,%r9d
call   1040 <svd@plt>
mov    %eax,0x4(%rsp)
test   %r14,%r14
mov    0x28(%rsp),%r9
mov    0x20(%rsp),%rdx
je     13e9 <svd_float+0x289>
test   %ebx,%ebx
jle    13e9 <svd_float+0x289>
mov    %ebx,%eax
cmp    $0x4,%ebx
jae    1336 <svd_float+0x1d6>
xor    %ecx,%ecx
jmp    13d0 <svd_float+0x270>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     160d <svd_float+0x4ad>
mov    %r8,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
nopl   0x0(%rax)
movupd 0x0(%rbp,%rsi,8),%xmm0
movupd 0x10(%rbp,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%r14,%rsi,4)
movupd 0x20(%rbp,%rsi,8),%xmm0
movupd 0x30(%rbp,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0x10(%r14,%rsi,4)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1360 <svd_float+0x200>
test   $0x1,%r8b
je     13cb <svd_float+0x26b>
movupd 0x0(%rbp,%rsi,8),%xmm0
movupd 0x10(%rbp,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%r14,%rsi,4)
cmp    %rax,%rcx
je     13e9 <svd_float+0x289>
movsd  0x0(%rbp,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    13d0 <svd_float+0x270>
test   %rdx,%rdx
mov    0x10(%rsp),%rcx
je     14d8 <svd_float+0x378>
test   %ecx,%ecx
je     14d8 <svd_float+0x378>
mov    %ecx,%eax
cmp    $0x4,%ecx
jae    140d <svd_float+0x2ad>
xor    %ecx,%ecx
jmp    14c0 <svd_float+0x360>
mov    %eax,%ecx
and    $0x7ffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     161e <svd_float+0x4be>
mov    %r8,%rbx
and    $0xfffffffffffffffe,%rbx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
movupd (%r15,%rsi,8),%xmm0
movupd 0x10(%r15,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%rdx,%rsi,4)
movupd 0x20(%r15,%rsi,8),%xmm0
movupd 0x30(%r15,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0x10(%rdx,%rsi,4)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rbx
jne    1440 <svd_float+0x2e0>
test   $0x1,%r8b
je     14ac <svd_float+0x34c>
movupd (%r15,%rsi,8),%xmm0
movupd 0x10(%r15,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%rdx,%rsi,4)
cmp    %rax,%rcx
je     14d8 <svd_float+0x378>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rdx,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    14c0 <svd_float+0x360>
test   %r9,%r9
mov    0x18(%rsp),%rcx
je     15ca <svd_float+0x46a>
test   %ecx,%ecx
je     15ca <svd_float+0x46a>
mov    %ecx,%eax
cmp    $0x4,%ecx
jae    14fc <svd_float+0x39c>
xor    %ecx,%ecx
jmp    15b0 <svd_float+0x450>
mov    %eax,%ecx
and    $0x7ffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     162f <svd_float+0x4cf>
mov    %r8,%rdx
and    $0xfffffffffffffffe,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nop
movupd 0x0(%r13,%rsi,8),%xmm0
movupd 0x10(%r13,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%r9,%rsi,4)
movupd 0x20(%r13,%rsi,8),%xmm0
movupd 0x30(%r13,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0x10(%r9,%rsi,4)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdx
jne    1530 <svd_float+0x3d0>
test   $0x1,%r8b
je     15a1 <svd_float+0x441>
movupd 0x0(%r13,%rsi,8),%xmm0
movupd 0x10(%r13,%rsi,8),%xmm1
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%r9,%rsi,4)
cmp    %rax,%rcx
je     15ca <svd_float+0x46a>
cs nopw 0x0(%rax,%rax,1)
movsd  0x0(%r13,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r9,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    15b0 <svd_float+0x450>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x4(%rsp),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%bl
jne    12ab <svd_float+0x14b>
jmp    12c1 <svd_float+0x161>
xor    %esi,%esi
test   $0x1,%r8b
jne    13ad <svd_float+0x24d>
jmp    13cb <svd_float+0x26b>
xor    %esi,%esi
test   $0x1,%r8b
jne    148e <svd_float+0x32e>
jmp    14ac <svd_float+0x34c>
xor    %esi,%esi
test   $0x1,%r8b
jne    1581 <svd_float+0x421>
jmp    15a1 <svd_float+0x441>
mov    0x2999(%rip),%rax
mov    (%rax),%edi
lea    0x9b0(%rip),%rsi
call   1060 <fprintf@plt>
mov    %eax,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"out of mem\00"
define i32 @svd_float(float* %0, float* %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store i32 %3, i32* %10
store float* %4, float** %11
store i32 %5, i32* %12
%22 = load i32, i32* %10
%23 = load i32, i32* %12
%24 = icmp sge i32 %22, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i32, i32* %12
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 8
%30 = trunc i64 %29 to i32
%31 = call double* @malloc(i32 %30)
store double* %31, double** %13
%32 = load i32, i32* %12
%33 = load i32, i32* %10
%34 = mul nsw i32 %32, %33
%35 = sext i32 %34 to i64
%36 = mul i64 %35, 8
%37 = trunc i64 %36 to i32
%38 = call double* @malloc(i32 %37)
store double* %38, double** %14
%39 = load i32, i32* %10
%40 = load i32, i32* %10
%41 = mul nsw i32 %39, %40
%42 = sext i32 %41 to i64
%43 = mul i64 %42, 8
%44 = trunc i64 %43 to i32
%45 = call double* @malloc(i32 %44)
store double* %45, double** %15
%46 = load i32, i32* %12
%47 = load i32, i32* %12
%48 = mul nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = mul i64 %49, 8
%51 = trunc i64 %50 to i32
%52 = call double* @malloc(i32 %51)
store double* %52, double** %16
%53 = load double*, double** %13
%54 = icmp ne double* %53, null
br i1 %54, label %55, label %64
55: ; preds = %6
%56 = load double*, double** %14
%57 = icmp ne double* %56, null
br i1 %57, label %58, label %64
58: ; preds = %55
%59 = load double*, double** %15
%60 = icmp ne double* %59, null
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load double*, double** %16
%63 = icmp ne double* %62, null
br i1 %63, label %68, label %64
64: ; preds = %61, %58, %55, %6
%65 = load i32, i32* @stderr
%66 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%67 = call i32 @exit(i32 %66)
unreachable
68: ; preds = %61
store i32 0, i32* %17
br label %69
69: ; preds = %86, %68
%70 = load i32, i32* %17
%71 = load i32, i32* %12
%72 = load i32, i32* %10
%73 = mul nsw i32 %71, %72
%74 = icmp slt i32 %70, %73
br i1 %74, label %75, label %89
75: ; preds = %69
%76 = load float*, float** %8
%77 = load i32, i32* %17
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds float, float* %76, i64 %78
%80 = load float, float* %79
%81 = fpext float %80 to double
%82 = load double*, double** %14
%83 = load i32, i32* %17
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
store double %81, double* %85
br label %86
86: ; preds = %75
%87 = load i32, i32* %17
%88 = add nsw i32 %87, 1
store i32 %88, i32* %17
br label %69
89: ; preds = %69
%90 = load double*, double** %13
%91 = load double*, double** %14
%92 = load double*, double** %15
%93 = load i32, i32* %10
%94 = load double*, double** %16
%95 = load i32, i32* %12
%96 = call i32 @svd(double* %90, double* %91, double* %92, i32 %93, double* %94, i32 %95)
store i32 %96, i32* %18
%97 = load float*, float** %7
%98 = icmp ne float* %97, null
br i1 %98, label %99, label %119
99: ; preds = %89
store i32 0, i32* %19
br label %100
100: ; preds = %115, %99
%101 = load i32, i32* %19
%102 = load i32, i32* %12
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %118
104: ; preds = %100
%105 = load double*, double** %13
%106 = load i32, i32* %19
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %105, i64 %107
%109 = load double, double* %108
%110 = fptrunc double %109 to float
%111 = load float*, float** %7
%112 = load i32, i32* %19
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds float, float* %111, i64 %113
store float %110, float* %114
br label %115
115: ; preds = %104
%116 = load i32, i32* %19
%117 = add nsw i32 %116, 1
store i32 %117, i32* %19
br label %100
118: ; preds = %100
br label %119
119: ; preds = %118, %89
%120 = load float*, float** %9
%121 = icmp ne float* %120, null
br i1 %121, label %122, label %144
122: ; preds = %119
store i32 0, i32* %20
br label %123
123: ; preds = %140, %122
%124 = load i32, i32* %20
%125 = load i32, i32* %10
%126 = load i32, i32* %10
%127 = mul nsw i32 %125, %126
%128 = icmp slt i32 %124, %127
br i1 %128, label %129, label %143
129: ; preds = %123
%130 = load double*, double** %15
%131 = load i32, i32* %20
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %130, i64 %132
%134 = load double, double* %133
%135 = fptrunc double %134 to float
%136 = load float*, float** %9
%137 = load i32, i32* %20
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds float, float* %136, i64 %138
store float %135, float* %139
br label %140
140: ; preds = %129
%141 = load i32, i32* %20
%142 = add nsw i32 %141, 1
store i32 %142, i32* %20
br label %123
143: ; preds = %123
br label %144
144: ; preds = %143, %119
%145 = load float*, float** %11
%146 = icmp ne float* %145, null
br i1 %146, label %147, label %169
147: ; preds = %144
store i32 0, i32* %21
br label %148
148: ; preds = %165, %147
%149 = load i32, i32* %21
%150 = load i32, i32* %12
%151 = load i32, i32* %12
%152 = mul nsw i32 %150, %151
%153 = icmp slt i32 %149, %152
br i1 %153, label %154, label %168
154: ; preds = %148
%155 = load double*, double** %16
%156 = load i32, i32* %21
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = fptrunc double %159 to float
%161 = load float*, float** %11
%162 = load i32, i32* %21
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds float, float* %161, i64 %163
store float %160, float* %164
br label %165
165: ; preds = %154
%166 = load i32, i32* %21
%167 = add nsw i32 %166, 1
store i32 %167, i32* %21
br label %148
168: ; preds = %148
br label %169
169: ; preds = %168, %144
%170 = load double*, double** %15
%171 = call i32 @free(double* %170)
%172 = load double*, double** %16
%173 = call i32 @free(double* %172)
%174 = load double*, double** %14
%175 = call i32 @free(double* %174)
%176 = load double*, double** %13
%177 = call i32 @free(double* %176)
%178 = load i32, i32* %18
ret i32 %178
}

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