#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 */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void save_matrix(char filename[], float **A, int ml, int mh, int nl, int nh,
                 int transpose, const char *mode) {
  FILE *fp_m;
  int i, j, rows, cols;
  void exit();
  time_t now;
  if (transpose)
    rows = nh - nl + 1;
  else
    rows = mh - ml + 1;
  if (transpose)
    cols = mh - ml + 1;
  else
    cols = nh - nl + 1;
  if ((fp_m = fopen(filename, mode)) == NULL) {
    printf(" error: cannot open file: %s \n", filename);
    exit(1013);
  }
  (void)time(&now);
  fprintf(fp_m, "%% filename: %s - %s", filename, ctime(&now));
  fprintf(fp_m, "%% type: matrix \n");
  fprintf(fp_m, "%% rows: %d\n", rows);
  fprintf(fp_m, "%% columns: %d\n", cols);
  if (transpose) {
    for (j = nl; j <= nh; j++) {
      for (i = ml; i <= mh; i++) {
        if (A[i][j] != 0)
          fprintf(fp_m, "%15.6e", A[i][j]);
        else
          fprintf(fp_m, "    0          ");
      }
      fprintf(fp_m, "\n");
    }
  } else {
    for (i = ml; i <= mh; i++) {
      for (j = nl; j <= nh; j++) {
        if (A[i][j] != 0)
          fprintf(fp_m, "%15.6e", A[i][j]);
        else
          fprintf(fp_m, "    0          ");
      }
      fprintf(fp_m, "\n");
    }
  }
  fclose(fp_m);
  return;
}


x86 assembly (clang, -O0):
<save_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,0x10(%rbp)
je     11b0 <save_matrix+0x40>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11bc <save_matrix+0x4c>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,0x10(%rbp)
je     11d7 <save_matrix+0x67>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11e3 <save_matrix+0x73>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1218 <save_matrix+0xa8>
mov    -0x8(%rbp),%rsi
lea    0xdf7(%rip),%rdi
call   1050 <printf@plt>
mov    $0x3f5,%edi
call   1090 <exit@plt>
lea    -0x3c(%rbp),%rdi
call   1070 <time@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x3c(%rbp),%rdi
call   1040 <ctime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    %rax,%rcx
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdd6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xdcb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0x0,0x10(%rbp)
je     1363 <save_matrix+0x1f3>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     135e <save_matrix+0x1ee>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     133e <save_matrix+0x1ce>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    12e9 <save_matrix+0x179>
jp     12e9 <save_matrix+0x179>
jmp    1319 <save_matrix+0x1a9>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd56(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    132b <save_matrix+0x1bb>
mov    -0x28(%rbp),%rdi
lea    0xd46(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1330 <save_matrix+0x1c0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12b1 <save_matrix+0x141>
mov    -0x28(%rbp),%rdi
lea    0xcd4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    129f <save_matrix+0x12f>
jmp    142d <save_matrix+0x2bd>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1428 <save_matrix+0x2b8>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1408 <save_matrix+0x298>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    13b3 <save_matrix+0x243>
jp     13b3 <save_matrix+0x243>
jmp    13e3 <save_matrix+0x273>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc8c(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    13f5 <save_matrix+0x285>
mov    -0x28(%rbp),%rdi
lea    0xc7c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13fa <save_matrix+0x28a>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    137b <save_matrix+0x20b>
mov    -0x28(%rbp),%rdi
lea    0xc0a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1369 <save_matrix+0x1f9>
jmp    142d <save_matrix+0x2bd>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%ebx
mov    %r8d,%ebp
mov    %ecx,%r14d
mov    %edx,%r13d
mov    %rsi,%r15
mov    0x68(%rsp),%rsi
mov    %rdi,0x18(%rsp)
call   1090 <fopen@plt>
test   %rax,%rax
je     13fb <save_matrix+0x26b>
mov    %rax,%r12
mov    %ebx,%eax
sub    %ebp,%eax
mov    %ebp,0xc(%rsp)
mov    %r14d,%ecx
sub    %r13d,%r14d
cmpl   $0x0,0x60(%rsp)
mov    %ebx,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %r13d,0x10(%rsp)
mov    %r14d,%r13d
cmove  %eax,%r13d
mov    %eax,0x14(%rsp)
mov    %eax,%ebx
cmove  %r14d,%ebx
add    $0x1,%ebx
add    $0x1,%r13d
lea    0x24(%rsp),%rbp
mov    %rbp,%rdi
call   1080 <time@plt>
mov    %rbp,%rdi
call   1040 <ctime@plt>
lea    0xe07(%rip),%rsi
mov    %r12,%rdi
mov    0x18(%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xe03(%rip),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xe04(%rip),%rsi
mov    %r12,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xdfe(%rip),%rsi
mov    %r12,%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
cmpl   $0x0,0x60(%rsp)
je     132a <save_matrix+0x19a>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
cmp    %eax,%ecx
mov    0x4(%rsp),%edx
mov    0x10(%rsp),%esi
jl     133a <save_matrix+0x1aa>
mov    %eax,%edi
movslq %esi,%rax
movslq %edi,%rbx
add    $0x1,%ecx
lea    (%r15,%rax,8),%rbp
add    $0x1,%r14d
lea    0xdc4(%rip),%r15
mov    %ecx,0x8(%rsp)
jmp    12d1 <save_matrix+0x141>
nopl   0x0(%rax)
mov    $0xa,%edi
mov    %r12,%rsi
call   1060 <fputc@plt>
add    $0x1,%rbx
mov    0x8(%rsp),%ecx
cmp    %ebx,%ecx
mov    0x4(%rsp),%edx
mov    0x10(%rsp),%esi
je     133a <save_matrix+0x1aa>
cmp    %esi,%edx
jl     12b0 <save_matrix+0x120>
xor    %r13d,%r13d
jmp    1302 <save_matrix+0x172>
nopw   0x0(%rax,%rax,1)
mov    $0xf,%esi
mov    $0x1,%edx
lea    0xd7d(%rip),%rdi
mov    %r12,%rcx
call   10b0 <fwrite@plt>
add    $0x1,%r13
cmp    %r13d,%r14d
je     12b0 <save_matrix+0x120>
mov    0x0(%rbp,%r13,8),%rax
movss  (%rax,%rbx,4),%xmm0
ucomiss 0xced(%rip),%xmm0
jne    1317 <save_matrix+0x187>
jnp    12e0 <save_matrix+0x150>
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    12f9 <save_matrix+0x169>
mov    0x10(%rsp),%edx
mov    0x4(%rsp),%ecx
cmp    %edx,%ecx
mov    0x8(%rsp),%eax
jge    1351 <save_matrix+0x1c1>
mov    %r12,%rdi
call   1030 <fclose@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movslq 0xc(%rsp),%rsi
mov    %rsi,0x18(%rsp)
movslq %edx,%rbx
add    $0x1,%ecx
addl   $0x1,0x14(%rsp)
lea    0xcfa(%rip),%rbp
mov    %ecx,0x4(%rsp)
jmp    139d <save_matrix+0x20d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
mov    %r12,%rsi
call   1060 <fputc@plt>
add    $0x1,%rbx
mov    0x4(%rsp),%ecx
cmp    %ebx,%ecx
mov    0x8(%rsp),%eax
je     133a <save_matrix+0x1aa>
cmp    0xc(%rsp),%eax
jl     1380 <save_matrix+0x1f0>
mov    0x14(%rsp),%r14d
mov    0x18(%rsp),%r13
jmp    13d3 <save_matrix+0x243>
nop
mov    $0xf,%esi
mov    $0x1,%edx
lea    0xcad(%rip),%rdi
mov    %r12,%rcx
call   10b0 <fwrite@plt>
add    $0x1,%r13
add    $0xffffffff,%r14d
je     1380 <save_matrix+0x1f0>
mov    (%r15,%rbx,8),%rax
movss  (%rax,%r13,4),%xmm0
ucomiss 0xc1c(%rip),%xmm0
jne    13e8 <save_matrix+0x258>
jnp    13b0 <save_matrix+0x220>
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    13c9 <save_matrix+0x239>
lea    0xc02(%rip),%rdi
mov    0x18(%rsp),%rsi
call   1050 <printf@plt>
mov    $0x3f5,%edi
call   10a0 <exit@plt>

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

LLVM IR (-O2):
@.str = [31 x i8] c" error: cannot open file: %s \0A\00"
@.str.1 = [21 x i8] c"%% filename: %s - %s\00"
@.str.2 = [18 x i8] c"%% type: matrix \0A\00"
@.str.3 = [13 x i8] c"%% rows: %d\0A\00"
@.str.4 = [16 x i8] c"%% columns: %d\0A\00"
@.str.5 = [7 x i8] c"%15.6e\00"
@.str.6 = [16 x i8] c" 0 \00"
define void @save_matrix(i8* %0, float** nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i8* nocapture %7) {
%9 = alloca i32
%10 = bitcast i32* %9 to i8*
%11 = icmp eq i32 %6, 0
%12 = sub nsw i32 %5, %4
%13 = sub nsw i32 %3, %2
%14 = tail call i32* @fopen(i8* %0, i8* %7)
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 1013)
unreachable
18: ; preds = %8
%19 = select i1 %11, i32 %12, i32 %13
%20 = select i1 %11, i32 %13, i32 %12
%21 = add nsw i32 %20, 1
%22 = add nsw i32 %19, 1
%23 = call i32 @time(i32* %9)
%24 = call i8* @ctime(i32* %9)
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %24)
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %22)
br i1 %11, label %37, label %29
29: ; preds = %18
%30 = icmp slt i32 %5, %4
br i1 %30, label %92, label %31
31: ; preds = %29
%32 = icmp slt i32 %3, %2
%33 = sext i32 %2 to i64
%34 = add i32 %3, 1
%35 = sext i32 %4 to i64
%36 = add i32 %5, 1
br label %45
37: ; preds = %18
%38 = icmp slt i32 %3, %2
br i1 %38, label %92, label %39
39: ; preds = %37
%40 = icmp slt i32 %5, %4
%41 = sext i32 %4 to i64
%42 = add i32 %5, 1
%43 = sext i32 %2 to i64
%44 = add i32 %3, 1
br label %68
45: ; preds = %31, %63
%46 = phi i64 [ %35, %31 ], [ %65, %63 ]
br i1 %32, label %63, label %47
47: ; preds = %45, %59
%48 = phi i64 [ %60, %59 ], [ %33, %45 ]
%49 = getelementptr inbounds float*, float** %1, i64 %48
%50 = load float*, float** %49
%51 = getelementptr inbounds float, float* %50, i64 %46
%52 = load float, float* %51
%53 = fcmp une float %52, 0.000000e+00
br i1 %53, label %54, label %57
54: ; preds = %47
%55 = fpext float %52 to double
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %55)
br label %59
57: ; preds = %47
%58 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i64 15, i64 1, i32* %14)
br label %59
59: ; preds = %54, %57
%60 = add nsw i64 %48, 1
%61 = trunc i64 %60 to i32
%62 = icmp eq i32 %34, %61
br i1 %62, label %63, label %47
63: ; preds = %59, %45
%64 = call i32 @fputc(i32 10, i32* %14)
%65 = add nsw i64 %46, 1
%66 = trunc i64 %65 to i32
%67 = icmp eq i32 %36, %66
br i1 %67, label %92, label %45
68: ; preds = %39, %87
%69 = phi i64 [ %43, %39 ], [ %89, %87 ]
br i1 %40, label %87, label %70
70: ; preds = %68
%71 = getelementptr inbounds float*, float** %1, i64 %69
br label %72
72: ; preds = %70, %83
%73 = phi i64 [ %41, %70 ], [ %84, %83 ]
%74 = load float*, float** %71
%75 = getelementptr inbounds float, float* %74, i64 %73
%76 = load float, float* %75
%77 = fcmp une float %76, 0.000000e+00
br i1 %77, label %78, label %81
78: ; preds = %72
%79 = fpext float %76 to double
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %79)
br label %83
81: ; preds = %72
%82 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i64 15, i64 1, i32* %14)
br label %83
83: ; preds = %78, %81
%84 = add nsw i64 %73, 1
%85 = trunc i64 %84 to i32
%86 = icmp eq i32 %42, %85
br i1 %86, label %87, label %72
87: ; preds = %83, %68
%88 = call i32 @fputc(i32 10, i32* %14)
%89 = add nsw i64 %69, 1
%90 = trunc i64 %89 to i32
%91 = icmp eq i32 %44, %90
br i1 %91, label %92, label %68
92: ; preds = %63, %87, %29, %37
%93 = call i32 @fclose(i32* %14)
ret void
}