#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 Det(float **);
float Glosbe(float **, unsigned char, unsigned char);
char Inv(float Jp[3][3], float (*iJp)[3][3]) {
  float CJp[3][3];
  unsigned char i, j;
  float det = Det(Jp);
  if (det <= 0.00001 && det >= -0.00001)
    return 0x02;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) {
      CJp[i][j] = Glosbe(Jp, i, j);
    }
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) {
      (*iJp)[i][j] = CJp[j][i] / det;
    }
  return 0x01;
}


x86 assembly (clang, -O0):
<Inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Det@plt>
movss  %xmm0,-0x48(%rbp)
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     117d <Inv+0x5d>
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     117d <Inv+0x5d>
movb   $0x2,-0x1(%rbp)
jmp    1267 <Inv+0x147>
movb   $0x0,-0x41(%rbp)
movzbl -0x41(%rbp),%eax
cmp    $0x3,%eax
jge    11eb <Inv+0xcb>
movb   $0x0,-0x42(%rbp)
movzbl -0x42(%rbp),%eax
cmp    $0x3,%eax
jge    11d9 <Inv+0xb9>
mov    -0x10(%rbp),%rdi
mov    -0x41(%rbp),%al
movzbl %al,%esi
movzbl -0x42(%rbp),%edx
call   1030 <Glosbe@plt>
movzbl -0x41(%rbp),%eax
mov    %eax,%ecx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movzbl -0x42(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x42(%rbp),%al
add    $0x1,%al
mov    %al,-0x42(%rbp)
jmp    1192 <Inv+0x72>
jmp    11de <Inv+0xbe>
mov    -0x41(%rbp),%al
add    $0x1,%al
mov    %al,-0x41(%rbp)
jmp    1181 <Inv+0x61>
movb   $0x0,-0x41(%rbp)
movzbl -0x41(%rbp),%eax
cmp    $0x3,%eax
jge    1263 <Inv+0x143>
movb   $0x0,-0x42(%rbp)
movzbl -0x42(%rbp),%eax
cmp    $0x3,%eax
jge    1251 <Inv+0x131>
movzbl -0x42(%rbp),%eax
mov    %eax,%ecx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movzbl -0x41(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
divss  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movzbl -0x41(%rbp),%ecx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movzbl -0x42(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x42(%rbp),%al
add    $0x1,%al
mov    %al,-0x42(%rbp)
jmp    1200 <Inv+0xe0>
jmp    1256 <Inv+0x136>
mov    -0x41(%rbp),%al
add    $0x1,%al
mov    %al,-0x41(%rbp)
jmp    11ef <Inv+0xcf>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inv>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <Det@plt>
cvtss2sd %xmm0,%xmm2
movsd  0xebf(%rip),%xmm1
ucomisd %xmm2,%xmm1
jb     1157 <Inv+0x37>
mov    $0x2,%al
ucomisd 0xeb7(%rip),%xmm2
jae    126d <Inv+0x14d>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
movaps %xmm0,0x80(%rsp)
call   1030 <Glosbe@plt>
movaps %xmm0,0x70(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,0x50(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,0x60(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,0x20(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <Glosbe@plt>
movaps %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <Glosbe@plt>
movaps (%rsp),%xmm1
unpcklps 0x50(%rsp),%xmm1
movaps 0x70(%rsp),%xmm3
unpcklps 0x30(%rsp),%xmm3
movlhps %xmm1,%xmm3
movaps 0x80(%rsp),%xmm2
movaps %xmm2,%xmm1
shufps $0x0,%xmm2,%xmm1
divps  %xmm1,%xmm3
movups %xmm3,(%r14)
movaps 0x60(%rsp),%xmm3
unpcklps 0x20(%rsp),%xmm3
movaps 0x40(%rsp),%xmm4
unpcklps 0x10(%rsp),%xmm4
movlhps %xmm3,%xmm4
divps  %xmm1,%xmm4
movups %xmm4,0x10(%r14)
divss  %xmm2,%xmm0
movss  %xmm0,0x20(%r14)
mov    $0x1,%al
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @Inv([3 x float]* %0, [3 x [3 x float]]* %1) {
%3 = alloca i8
%4 = alloca [3 x float]*
%5 = alloca [3 x [3 x float]]*
%6 = alloca [3 x [3 x float]]
%7 = alloca i8
%8 = alloca i8
%9 = alloca float
store [3 x float]* %0, [3 x float]** %4
store [3 x [3 x float]]* %1, [3 x [3 x float]]** %5
%10 = load [3 x float]*, [3 x float]** %4
%11 = bitcast [3 x float]* %10 to float**
%12 = call float @Det(float** %11)
store float %12, float* %9
%13 = load float, float* %9
%14 = fpext float %13 to double
%15 = fcmp ole double %14, 1.000000e-05
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load float, float* %9
%18 = fpext float %17 to double
%19 = fcmp oge double %18, -1.000000e-05
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 2, i8* %3
br label %85
21: ; preds = %16, %2
store i8 0, i8* %7
br label %22
22: ; preds = %47, %21
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %50
26: ; preds = %22
store i8 0, i8* %8
br label %27
27: ; preds = %43, %26
%28 = load i8, i8* %8
%29 = zext i8 %28 to i32
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %46
31: ; preds = %27
%32 = load [3 x float]*, [3 x float]** %4
%33 = bitcast [3 x float]* %32 to float**
%34 = load i8, i8* %7
%35 = load i8, i8* %8
%36 = call float @Glosbe(float** %33, i8 zeroext %34, i8 zeroext %35)
%37 = load i8, i8* %7
%38 = zext i8 %37 to i64
%39 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 %38
%40 = load i8, i8* %8
%41 = zext i8 %40 to i64
%42 = getelementptr inbounds [3 x float], [3 x float]* %39, i64 0, i64 %41
store float %36, float* %42
br label %43
43: ; preds = %31
%44 = load i8, i8* %8
%45 = add i8 %44, 1
store i8 %45, i8* %8
br label %27
46: ; preds = %27
br label %47
47: ; preds = %46
%48 = load i8, i8* %7
%49 = add i8 %48, 1
store i8 %49, i8* %7
br label %22
50: ; preds = %22
store i8 0, i8* %7
br label %51
51: ; preds = %81, %50
%52 = load i8, i8* %7
%53 = zext i8 %52 to i32
%54 = icmp slt i32 %53, 3
br i1 %54, label %55, label %84
55: ; preds = %51
store i8 0, i8* %8
br label %56
56: ; preds = %77, %55
%57 = load i8, i8* %8
%58 = zext i8 %57 to i32
%59 = icmp slt i32 %58, 3
br i1 %59, label %60, label %80
60: ; preds = %56
%61 = load i8, i8* %8
%62 = zext i8 %61 to i64
%63 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %6, i64 0, i64 %62
%64 = load i8, i8* %7
%65 = zext i8 %64 to i64
%66 = getelementptr inbounds [3 x float], [3 x float]* %63, i64 0, i64 %65
%67 = load float, float* %66
%68 = load float, float* %9
%69 = fdiv float %67, %68
%70 = load [3 x [3 x float]]*, [3 x [3 x float]]** %5
%71 = load i8, i8* %7
%72 = zext i8 %71 to i64
%73 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %70, i64 0, i64 %72
%74 = load i8, i8* %8
%75 = zext i8 %74 to i64
%76 = getelementptr inbounds [3 x float], [3 x float]* %73, i64 0, i64 %75
store float %69, float* %76
br label %77
77: ; preds = %60
%78 = load i8, i8* %8
%79 = add i8 %78, 1
store i8 %79, i8* %8
br label %56
80: ; preds = %56
br label %81
81: ; preds = %80
%82 = load i8, i8* %7
%83 = add i8 %82, 1
store i8 %83, i8* %7
br label %51
84: ; preds = %51
store i8 1, i8* %3
br label %85
85: ; preds = %84, %20
%86 = load i8, i8* %3
ret i8 %86
}

LLVM IR (-O2):
define signext i8 @Inv([3 x float]* %0, [3 x [3 x float]]* nocapture writeonly %1) {
%3 = bitcast [3 x float]* %0 to float**
%4 = tail call float @Det(float** %3)
%5 = fpext float %4 to double
%6 = fcmp ugt double %5, 1.000000e-05
%7 = fcmp ult double %5, -1.000000e-05
%8 = or i1 %6, %7
br i1 %8, label %9, label %36
9: ; preds = %2
%10 = tail call float @Glosbe(float** %3, i8 zeroext 0, i8 zeroext 0)
%11 = tail call float @Glosbe(float** %3, i8 zeroext 0, i8 zeroext 1)
%12 = tail call float @Glosbe(float** %3, i8 zeroext 0, i8 zeroext 2)
%13 = tail call float @Glosbe(float** %3, i8 zeroext 1, i8 zeroext 0)
%14 = tail call float @Glosbe(float** %3, i8 zeroext 1, i8 zeroext 1)
%15 = tail call float @Glosbe(float** %3, i8 zeroext 1, i8 zeroext 2)
%16 = tail call float @Glosbe(float** %3, i8 zeroext 2, i8 zeroext 0)
%17 = tail call float @Glosbe(float** %3, i8 zeroext 2, i8 zeroext 1)
%18 = tail call float @Glosbe(float** %3, i8 zeroext 2, i8 zeroext 2)
%19 = insertelement <4 x float> poison, float %10, i64 0
%20 = insertelement <4 x float> %19, float %13, i64 1
%21 = insertelement <4 x float> %20, float %16, i64 2
%22 = insertelement <4 x float> %21, float %11, i64 3
%23 = insertelement <4 x float> poison, float %4, i64 0
%24 = shufflevector <4 x float> %23, <4 x float> poison, <4 x i32> zeroinitializer
%25 = fdiv <4 x float> %22, %24
%26 = bitcast [3 x [3 x float]]* %1 to <4 x float>*
store <4 x float> %25, <4 x float>* %26
%27 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 1, i64 1
%28 = insertelement <4 x float> poison, float %14, i64 0
%29 = insertelement <4 x float> %28, float %17, i64 1
%30 = insertelement <4 x float> %29, float %12, i64 2
%31 = insertelement <4 x float> %30, float %15, i64 3
%32 = fdiv <4 x float> %31, %24
%33 = bitcast float* %27 to <4 x float>*
store <4 x float> %32, <4 x float>* %33
%34 = fdiv float %18, %4
%35 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 2, i64 2
store float %34, float* %35
br label %36
36: ; preds = %9, %2
%37 = phi i8 [ 2, %2 ], [ 1, %9 ]
ret i8 %37
}