#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ stderr;
int write_beta_sparse(char *file, double *beta, int p, int K) {
  int j = 0, k;
  FILE *out = NULL;
  if (!(out = fopen(file, "w"))) {
    fprintf(stderr, "can't open file %s\n", file);
    return 0;
  };
  fprintf(out, "%d,", j);
  for (k = 0; k < K; k++) {
    fprintf(out, "%.10f", beta[p * k + j]);
    if (k == K - 1)
      fprintf(out, "\n");
    else
      fprintf(out, ",");
  }
  for (j = 1; j < p; j++) {
    for (k = 0; k < K; k++)
      if (beta[p * k + j] != 0)
        break;
    if (k < K) {
      fprintf(out, "%d,", j);
      for (k = 0; k < K; k++) {
        if (beta[p * k + j] != 0)
          fprintf(out, "%.10f", beta[p * k + j]);
        else
          fprintf(out, "0");
        if (k == K - 1)
          fprintf(out, "\n");
        else
          fprintf(out, ",");
      }
    }
  }
  fflush(out);
  fclose(out);
  return 1;
}


x86 assembly (clang, -O0):
<write_beta_sparse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11ab <write_beta_sparse+0x6b>
mov    0x2e56(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13d3 <write_beta_sparse+0x293>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1248 <write_beta_sparse+0x108>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe26(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1223 <write_beta_sparse+0xe3>
mov    -0x30(%rbp),%rdi
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1235 <write_beta_sparse+0xf5>
mov    -0x30(%rbp),%rdi
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    123a <write_beta_sparse+0xfa>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11c7 <write_beta_sparse+0x87>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13ba <write_beta_sparse+0x27a>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12b4 <write_beta_sparse+0x174>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    129c <write_beta_sparse+0x15c>
jp     129c <write_beta_sparse+0x15c>
jmp    12a1 <write_beta_sparse+0x161>
jmp    12b4 <write_beta_sparse+0x174>
jmp    12a6 <write_beta_sparse+0x166>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1262 <write_beta_sparse+0x122>
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13a7 <write_beta_sparse+0x267>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xd48(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13a2 <write_beta_sparse+0x262>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1316 <write_beta_sparse+0x1d6>
jp     1316 <write_beta_sparse+0x1d6>
jmp    1343 <write_beta_sparse+0x203>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xce3(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
jmp    1355 <write_beta_sparse+0x215>
mov    -0x30(%rbp),%rdi
lea    0xcd2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    137d <write_beta_sparse+0x23d>
mov    -0x30(%rbp),%rdi
lea    0xca3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    138f <write_beta_sparse+0x24f>
mov    -0x30(%rbp),%rdi
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1394 <write_beta_sparse+0x254>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12dc <write_beta_sparse+0x19c>
jmp    13a7 <write_beta_sparse+0x267>
jmp    13ac <write_beta_sparse+0x26c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    124f <write_beta_sparse+0x10f>
mov    -0x30(%rbp),%rdi
call   1050 <fflush@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_beta_sparse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%ebp
mov    %edx,%r12d
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xe98(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1340 <write_beta_sparse+0x1f0>
mov    %rax,%rbx
mov    %r12d,0x8(%rsp)
mov    %r15,0x10(%rsp)
lea    0xe8c(%rip),%rsi
mov    %rax,%rdi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebp,%r13d
mov    %rbp,0x18(%rsp)
test   %ebp,%ebp
jle    120a <write_beta_sparse+0xba>
mov    0x18(%rsp),%rax
lea    -0x1(%rax),%r15d
movslq 0x8(%rsp),%rbp
shl    $0x3,%rbp
xor    %r12d,%r12d
mov    0x10(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r14),%xmm0
mov    %rbx,%rdi
lea    0xe43(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
cmp    %r12,%r15
mov    $0x2c,%edi
mov    $0xa,%eax
cmove  %eax,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0x1,%r12
add    %rbp,%r14
cmp    %r12,%r13
jne    11d0 <write_beta_sparse+0x80>
mov    0x8(%rsp),%edx
cmp    $0x2,%edx
mov    0x10(%rsp),%rcx
jl     1329 <write_beta_sparse+0x1d9>
mov    0x18(%rsp),%rax
lea    -0x1(%rax),%r14d
mov    %edx,%eax
add    $0x8,%rcx
mov    %rax,0x20(%rsp)
lea    0x0(,%rax,8),%rbp
mov    $0x1,%eax
mov    %rax,0x8(%rsp)
jmp    1272 <write_beta_sparse+0x122>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%rax
add    $0x1,%rax
mov    0x10(%rsp),%rcx
add    $0x8,%rcx
mov    %rax,0x8(%rsp)
cmp    0x20(%rsp),%rax
je     1329 <write_beta_sparse+0x1d9>
mov    %r13,%rax
mov    %rcx,0x10(%rsp)
cmpl   $0x0,0x18(%rsp)
jle    1250 <write_beta_sparse+0x100>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rcx),%xmm0
ucomisd 0xd64(%rip),%xmm0
jne    12b0 <write_beta_sparse+0x160>
jp     12b0 <write_beta_sparse+0x160>
add    %rbp,%rcx
add    $0xffffffffffffffff,%rax
jne    1290 <write_beta_sparse+0x140>
jmp    1250 <write_beta_sparse+0x100>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xd64(%rip),%rsi
mov    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x10(%rsp),%r15
xor    %r12d,%r12d
jmp    1305 <write_beta_sparse+0x1b5>
mov    $0x30,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
cmp    %r12,%r14
mov    $0x2c,%edi
mov    $0xa,%eax
cmove  %eax,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0x1,%r12
add    %rbp,%r15
cmp    %r12,%r13
je     1250 <write_beta_sparse+0x100>
movsd  (%r15),%xmm0
ucomisd 0xcee(%rip),%xmm0
jne    1316 <write_beta_sparse+0x1c6>
jnp    12d0 <write_beta_sparse+0x180>
mov    %rbx,%rdi
lea    0xd02(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    12dd <write_beta_sparse+0x18d>
mov    %rbx,%rdi
call   1060 <fflush@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%ebx
jmp    135d <write_beta_sparse+0x20d>
mov    0x2c99(%rip),%rax
movslq (%rax),%rdi
lea    0xcb9(%rip),%rsi
xor    %ebx,%ebx
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"can't open file %s\0A\00"
@.str.2 = [4 x i8] c"%d,\00"
@.str.3 = [6 x i8] c"%.10f\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [2 x i8] c",\00"
@.str.6 = [2 x i8] c"0\00"
define i32 @write_beta_sparse(i8* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
store i8* %0, i8** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 0, i32* %10
store i32* null, i32** %12
%13 = load i8*, i8** %6
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %12
%15 = icmp ne i32* %14, null
br i1 %15, label %22, label %16
16: ; preds = %4
%17 = load i32, i32* @stderr
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load i8*, i8** %6
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %20)
store i32 0, i32* %5
br label %145
22: ; preds = %4
%23 = load i32*, i32** %12
%24 = load i32, i32* %10
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %24)
store i32 0, i32* %11
br label %26
26: ; preds = %53, %22
%27 = load i32, i32* %11
%28 = load i32, i32* %9
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %56
30: ; preds = %26
%31 = load i32*, i32** %12
%32 = load double*, double** %7
%33 = load i32, i32* %8
%34 = load i32, i32* %11
%35 = mul nsw i32 %33, %34
%36 = load i32, i32* %10
%37 = add nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %32, i64 %38
%40 = load double, double* %39
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %40)
%42 = load i32, i32* %11
%43 = load i32, i32* %9
%44 = sub nsw i32 %43, 1
%45 = icmp eq i32 %42, %44
br i1 %45, label %46, label %49
46: ; preds = %30
%47 = load i32*, i32** %12
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %52
49: ; preds = %30
%50 = load i32*, i32** %12
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %52
52: ; preds = %49, %46
br label %53
53: ; preds = %52
%54 = load i32, i32* %11
%55 = add nsw i32 %54, 1
store i32 %55, i32* %11
br label %26
56: ; preds = %26
store i32 1, i32* %10
br label %57
57: ; preds = %137, %56
%58 = load i32, i32* %10
%59 = load i32, i32* %8
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %140
61: ; preds = %57
store i32 0, i32* %11
br label %62
62: ; preds = %79, %61
%63 = load i32, i32* %11
%64 = load i32, i32* %9
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %82
66: ; preds = %62
%67 = load double*, double** %7
%68 = load i32, i32* %8
%69 = load i32, i32* %11
%70 = mul nsw i32 %68, %69
%71 = load i32, i32* %10
%72 = add nsw i32 %70, %71
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %67, i64 %73
%75 = load double, double* %74
%76 = fcmp une double %75, 0.000000e+00
br i1 %76, label %77, label %78
77: ; preds = %66
br label %82
78: ; preds = %66
br label %79
79: ; preds = %78
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 1
store i32 %81, i32* %11
br label %62
82: ; preds = %77, %62
%83 = load i32, i32* %11
%84 = load i32, i32* %9
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %136
86: ; preds = %82
%87 = load i32*, i32** %12
%88 = load i32, i32* %10
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %88)
store i32 0, i32* %11
br label %90
90: ; preds = %132, %86
%91 = load i32, i32* %11
%92 = load i32, i32* %9
%93 = icmp slt i32 %91, %92
br i1 %93, label %94, label %135
94: ; preds = %90
%95 = load double*, double** %7
%96 = load i32, i32* %8
%97 = load i32, i32* %11
%98 = mul nsw i32 %96, %97
%99 = load i32, i32* %10
%100 = add nsw i32 %98, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %95, i64 %101
%103 = load double, double* %102
%104 = fcmp une double %103, 0.000000e+00
br i1 %104, label %105, label %117
105: ; preds = %94
%106 = load i32*, i32** %12
%107 = load double*, double** %7
%108 = load i32, i32* %8
%109 = load i32, i32* %11
%110 = mul nsw i32 %108, %109
%111 = load i32, i32* %10
%112 = add nsw i32 %110, %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %107, i64 %113
%115 = load double, double* %114
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %115)
br label %120
117: ; preds = %94
%118 = load i32*, i32** %12
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %120
120: ; preds = %117, %105
%121 = load i32, i32* %11
%122 = load i32, i32* %9
%123 = sub nsw i32 %122, 1
%124 = icmp eq i32 %121, %123
br i1 %124, label %125, label %128
125: ; preds = %120
%126 = load i32*, i32** %12
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %131
128: ; preds = %120
%129 = load i32*, i32** %12
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %129, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %131
131: ; preds = %128, %125
br label %132
132: ; preds = %131
%133 = load i32, i32* %11
%134 = add nsw i32 %133, 1
store i32 %134, i32* %11
br label %90
135: ; preds = %90
br label %136
136: ; preds = %135, %82
br label %137
137: ; preds = %136
%138 = load i32, i32* %10
%139 = add nsw i32 %138, 1
store i32 %139, i32* %10
br label %57
140: ; preds = %57
%141 = load i32*, i32** %12
%142 = call i32 @fflush(i32* %141)
%143 = load i32*, i32** %12
%144 = call i32 @fclose(i32* %143)
store i32 1, i32* %5
br label %145
145: ; preds = %140, %16
%146 = load i32, i32* %5
ret i32 %146
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"can't open file %s\0A\00"
@.str.2 = [4 x i8] c"%d,\00"
@.str.3 = [6 x i8] c"%.10f\00"
define i32 @write_beta_sparse(i8* %0, double* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %77
12: ; preds = %4
%13 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
%14 = icmp sgt i32 %3, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = add nsw i32 %3, -1
%17 = sext i32 %2 to i64
%18 = zext i32 %16 to i64
%19 = zext i32 %3 to i64
br label %28
20: ; preds = %28, %12
%21 = icmp sgt i32 %2, 1
br i1 %21, label %22, label %74
22: ; preds = %20
%23 = add nsw i32 %3, -1
%24 = zext i32 %2 to i64
%25 = zext i32 %23 to i64
%26 = zext i32 %2 to i64
%27 = zext i32 %3 to i64
br label %39
28: ; preds = %15, %28
%29 = phi i64 [ 0, %15 ], [ %37, %28 ]
%30 = mul nsw i64 %29, %17
%31 = getelementptr inbounds double, double* %1, i64 %30
%32 = load double, double* %31
%33 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %32)
%34 = icmp eq i64 %29, %18
%35 = select i1 %34, i32 10, i32 44
%36 = tail call i32 @fputc(i32 %35, i32* %5)
%37 = add nuw nsw i64 %29, 1
%38 = icmp eq i64 %37, %19
br i1 %38, label %20, label %28
39: ; preds = %22, %71
%40 = phi i64 [ 1, %22 ], [ %72, %71 ]
br i1 %14, label %43, label %71
41: ; preds = %43
%42 = icmp eq i64 %50, %27
br i1 %42, label %71, label %43
43: ; preds = %39, %41
%44 = phi i64 [ %50, %41 ], [ 0, %39 ]
%45 = mul nsw i64 %44, %24
%46 = add nuw nsw i64 %45, %40
%47 = getelementptr inbounds double, double* %1, i64 %46
%48 = load double, double* %47
%49 = fcmp une double %48, 0.000000e+00
%50 = add nuw nsw i64 %44, 1
br i1 %49, label %51, label %41
51: ; preds = %43
%52 = trunc i64 %40 to i32
%53 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %65
%55 = phi i64 [ 0, %51 ], [ %69, %65 ]
%56 = mul nsw i64 %55, %24
%57 = add nuw nsw i64 %56, %40
%58 = getelementptr inbounds double, double* %1, i64 %57
%59 = load double, double* %58
%60 = fcmp une double %59, 0.000000e+00
br i1 %60, label %61, label %63
61: ; preds = %54
%62 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %59)
br label %65
63: ; preds = %54
%64 = tail call i32 @fputc(i32 48, i32* %5)
br label %65
65: ; preds = %63, %61
%66 = icmp eq i64 %55, %25
%67 = select i1 %66, i32 10, i32 44
%68 = tail call i32 @fputc(i32 %67, i32* %5)
%69 = add nuw nsw i64 %55, 1
%70 = icmp eq i64 %69, %27
br i1 %70, label %71, label %54
71: ; preds = %41, %65, %39
%72 = add nuw nsw i64 %40, 1
%73 = icmp eq i64 %72, %26
br i1 %73, label %74, label %39
74: ; preds = %71, %20
%75 = tail call i32 @fflush(i32* %5)
%76 = tail call i32 @fclose(i32* %5)
br label %77
77: ; preds = %74, %7
%78 = phi i32 [ 1, %74 ], [ 0, %7 ]
ret i32 %78
}