#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
void paw_triang_matrix_inverse(char *matrix_type, int N, double **a,
                               double **a_inv) {
  int i;
  int j;
  int k;
  double sum;
  if (strcmp(matrix_type, "u") == 0) {
    for (j = 0; j <= N - 1; j++) {
      for (i = 0; i <= N - 1; i++) {
        a_inv[i][j] = a[j][i];
      }
    }
  } else if (strcmp(matrix_type, "l") == 0) {
    for (j = 0; j <= N - 1; j++) {
      for (i = 0; i <= N - 1; i++) {
        a_inv[i][j] = a[i][j];
      }
    }
  } else {
    printf("unknown matrix type in triang_matrix_inverse\n");
    exit(1);
  }
  for (i = 0; i <= N - 1; i++) {
    a_inv[i][i] = 1.0 / a_inv[i][i];
    for (j = i + 1; j <= N - 1; j++) {
      sum = 0.0;
      for (k = i; k <= j - 1; k++) {
        sum = sum - a_inv[j][k] * a_inv[k][i];
      }
      a_inv[j][i] = sum / a_inv[j][j];
    }
  }
  if (strcmp(matrix_type, "u") == 0) {
    for (i = 0; i <= N - 1; i++) {
      for (j = i + 1; j <= N - 1; j++) {
        a_inv[i][j] = a_inv[j][i];
        a_inv[j][i] = 0.0;
      }
    }
  }
}


x86 assembly (clang, -O0):
<paw_triang_matrix_inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e1 <paw_triang_matrix_inverse+0xb1>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11dc <paw_triang_matrix_inverse+0xac>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11c9 <paw_triang_matrix_inverse+0x99>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1180 <paw_triang_matrix_inverse+0x50>
jmp    11ce <paw_triang_matrix_inverse+0x9e>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1168 <paw_triang_matrix_inverse+0x38>
jmp    1296 <paw_triang_matrix_inverse+0x166>
mov    -0x8(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    127b <paw_triang_matrix_inverse+0x14b>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1276 <paw_triang_matrix_inverse+0x146>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1263 <paw_triang_matrix_inverse+0x133>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    121a <paw_triang_matrix_inverse+0xea>
jmp    1268 <paw_triang_matrix_inverse+0x138>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1202 <paw_triang_matrix_inverse+0xd2>
jmp    1291 <paw_triang_matrix_inverse+0x161>
lea    0xd8a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1296 <paw_triang_matrix_inverse+0x166>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     13ca <paw_triang_matrix_inverse+0x29a>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  0xd3a(%rip),%xmm0
divsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     13b7 <paw_triang_matrix_inverse+0x287>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     137a <paw_triang_matrix_inverse+0x24a>
movsd  -0x38(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1308 <paw_triang_matrix_inverse+0x1d8>
movsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12e9 <paw_triang_matrix_inverse+0x1b9>
jmp    13bc <paw_triang_matrix_inverse+0x28c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    129d <paw_triang_matrix_inverse+0x16d>
mov    -0x8(%rbp),%rdi
lea    0xc33(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    147e <paw_triang_matrix_inverse+0x34e>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1479 <paw_triang_matrix_inverse+0x349>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1466 <paw_triang_matrix_inverse+0x336>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1405 <paw_triang_matrix_inverse+0x2d5>
jmp    146b <paw_triang_matrix_inverse+0x33b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13eb <paw_triang_matrix_inverse+0x2bb>
jmp    147e <paw_triang_matrix_inverse+0x34e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paw_triang_matrix_inverse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %esi,%r15d
mov    %rdi,%r14
lea    0xeba(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1250 <paw_triang_matrix_inverse+0x120>
lea    0xea7(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    14bf <paw_triang_matrix_inverse+0x38f>
test   %r15d,%r15d
jle    1405 <paw_triang_matrix_inverse+0x2d5>
mov    %r15d,%r9d
lea    -0x1(%r9),%r8
mov    %r9d,%r11d
and    $0x3,%r11d
mov    %r9d,%r10d
and    $0xfffffffc,%r10d
xor    %edi,%edi
jmp    11ad <paw_triang_matrix_inverse+0x7d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rdi
cmp    %r9,%rdi
je     131c <paw_triang_matrix_inverse+0x1ec>
xor    %ecx,%ecx
cmp    $0x3,%r8
jb     1218 <paw_triang_matrix_inverse+0xe8>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp,%rcx,8),%rax
movsd  (%rax,%rdi,8),%xmm0
mov    (%rbx,%rcx,8),%rax
movsd  %xmm0,(%rax,%rdi,8)
mov    0x8(%rbp,%rcx,8),%rax
movsd  (%rax,%rdi,8),%xmm0
mov    0x8(%rbx,%rcx,8),%rax
movsd  %xmm0,(%rax,%rdi,8)
mov    0x10(%rbp,%rcx,8),%rax
movsd  (%rax,%rdi,8),%xmm0
mov    0x10(%rbx,%rcx,8),%rax
movsd  %xmm0,(%rax,%rdi,8)
mov    0x18(%rbp,%rcx,8),%rax
movsd  (%rax,%rdi,8),%xmm0
mov    0x18(%rbx,%rcx,8),%rax
movsd  %xmm0,(%rax,%rdi,8)
add    $0x4,%rcx
cmp    %rcx,%r10
jne    11c0 <paw_triang_matrix_inverse+0x90>
test   %r11,%r11
je     11a0 <paw_triang_matrix_inverse+0x70>
lea    (%rbx,%rcx,8),%rax
lea    0x0(,%rcx,8),%rcx
add    %rbp,%rcx
xor    %esi,%esi
xchg   %ax,%ax
mov    (%rcx,%rsi,8),%rdx
movsd  (%rdx,%rdi,8),%xmm0
mov    (%rax,%rsi,8),%rdx
movsd  %xmm0,(%rdx,%rdi,8)
add    $0x1,%rsi
cmp    %rsi,%r11
jne    1230 <paw_triang_matrix_inverse+0x100>
jmp    11a0 <paw_triang_matrix_inverse+0x70>
test   %r15d,%r15d
jle    1405 <paw_triang_matrix_inverse+0x2d5>
mov    %r15d,%r9d
lea    -0x1(%r9),%r8
mov    %r9d,%r11d
and    $0x3,%r11d
mov    %r9d,%r10d
and    $0xfffffffc,%r10d
xor    %edi,%edi
jmp    128d <paw_triang_matrix_inverse+0x15d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
cmp    %r9,%rdi
je     131c <paw_triang_matrix_inverse+0x1ec>
mov    0x0(%rbp,%rdi,8),%rcx
xor    %eax,%eax
cmp    $0x3,%r8
jb     12e7 <paw_triang_matrix_inverse+0x1b7>
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rax,8),%xmm0
mov    (%rbx,%rax,8),%rsi
movsd  %xmm0,(%rsi,%rdi,8)
movsd  0x8(%rcx,%rax,8),%xmm0
mov    0x8(%rbx,%rax,8),%rsi
movsd  %xmm0,(%rsi,%rdi,8)
movsd  0x10(%rcx,%rax,8),%xmm0
mov    0x10(%rbx,%rax,8),%rsi
movsd  %xmm0,(%rsi,%rdi,8)
movsd  0x18(%rcx,%rax,8),%xmm0
mov    0x18(%rbx,%rax,8),%rsi
movsd  %xmm0,(%rsi,%rdi,8)
add    $0x4,%rax
cmp    %rax,%r10
jne    12a0 <paw_triang_matrix_inverse+0x170>
test   %r11,%r11
je     1280 <paw_triang_matrix_inverse+0x150>
lea    (%rbx,%rax,8),%rsi
lea    (%rcx,%rax,8),%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
movsd  (%rax,%rcx,8),%xmm0
mov    (%rsi,%rcx,8),%rdx
movsd  %xmm0,(%rdx,%rdi,8)
add    $0x1,%rcx
cmp    %rcx,%r11
jne    1300 <paw_triang_matrix_inverse+0x1d0>
jmp    1280 <paw_triang_matrix_inverse+0x150>
test   %r15d,%r15d
setg   %r12b
jle    14a2 <paw_triang_matrix_inverse+0x372>
mov    %r15d,%r11d
mov    $0x1,%r10d
xor    %r8d,%r8d
movsd  0xcc3(%rip),%xmm0
jmp    134d <paw_triang_matrix_inverse+0x21d>
nop
add    $0x1,%r10
cmp    %r11,%r8
je     1408 <paw_triang_matrix_inverse+0x2d8>
mov    %r8,%rdx
mov    (%rbx,%r8,8),%rcx
movapd %xmm0,%xmm1
divsd  (%rcx,%r8,8),%xmm1
movsd  %xmm1,(%rcx,%r8,8)
add    $0x1,%r8
cmp    %r11,%r8
jae    1340 <paw_triang_matrix_inverse+0x210>
lea    0x1(%rdx),%r9
xor    %r13d,%r13d
mov    %r10,%rcx
jmp    1397 <paw_triang_matrix_inverse+0x267>
nopl   0x0(%rax)
divsd  (%rdi,%rcx,8),%xmm1
movsd  %xmm1,(%rdi,%rdx,8)
add    $0x1,%rcx
add    $0x1,%r13
cmp    %r11,%rcx
je     1340 <paw_triang_matrix_inverse+0x210>
mov    (%rbx,%rcx,8),%rdi
xorpd  %xmm1,%xmm1
cmp    %rcx,%rdx
jae    1380 <paw_triang_matrix_inverse+0x250>
xorpd  %xmm1,%xmm1
mov    %rdx,%rsi
test   $0x1,%r13b
jne    13ca <paw_triang_matrix_inverse+0x29a>
movsd  (%rdi,%rdx,8),%xmm2
mov    (%rbx,%rdx,8),%rsi
mulsd  (%rsi,%rdx,8),%xmm2
xorpd  %xmm1,%xmm1
subsd  %xmm2,%xmm1
mov    %r9,%rsi
test   %r13,%r13
je     1380 <paw_triang_matrix_inverse+0x250>
nop
movsd  (%rdi,%rsi,8),%xmm2
movsd  0x8(%rdi,%rsi,8),%xmm3
mov    (%rbx,%rsi,8),%rax
mov    0x8(%rbx,%rsi,8),%rbp
mulsd  (%rax,%rdx,8),%xmm2
mulsd  0x0(%rbp,%rdx,8),%xmm3
subsd  %xmm2,%xmm1
subsd  %xmm3,%xmm1
add    $0x2,%rsi
cmp    %rsi,%rcx
jne    13d0 <paw_triang_matrix_inverse+0x2a0>
jmp    1380 <paw_triang_matrix_inverse+0x250>
xor    %r12d,%r12d
lea    0xbf9(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1493 <paw_triang_matrix_inverse+0x363>
test   %r12b,%r12b
je     1493 <paw_triang_matrix_inverse+0x363>
movslq %r15d,%r8
mov    %r15d,%r9d
xor    %r10d,%r10d
mov    %r9,%rdx
mov    %rbx,%rsi
jmp    144d <paw_triang_matrix_inverse+0x31d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x8,%rsi
add    $0xffffffffffffffff,%rdx
cmp    %r9,%r10
je     1493 <paw_triang_matrix_inverse+0x363>
mov    %r10,%rdi
add    $0x1,%r10
cmp    %r8,%r10
jge    1440 <paw_triang_matrix_inverse+0x310>
lea    0x0(,%rdi,8),%rax
add    (%rbx,%rdi,8),%rax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    (%rsi,%rcx,8),%rbp
movsd  0x0(%rbp,%rdi,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movq   $0x0,0x0(%rbp,%rdi,8)
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1470 <paw_triang_matrix_inverse+0x340>
jmp    1440 <paw_triang_matrix_inverse+0x310>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb5f(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <strcmp@plt>
lea    0xb46(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

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