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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
scalar_t__ fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int ARGC, char *ARGV[]) {
  FILE *rec;
  char cmd[] = "rec -t raw -b 16 -c 1 -e s -r 48000 -";
  if ((rec = popen(cmd, "r")) == NULL) {
    perror("rec");
  }
  int n = 0;
  int16_t buf[144000];
  while (1) {
    n += fread(buf + n, sizeof(int16_t), 144000 - n, rec);
    if (n >= 144000) {
      break;
    }
  }
  char *text_file_name, *raw_file_name;
  int text_file_name_len =
      strlen("data/") + strlen(ARGV[1]) + strlen(".txt") + 1;
  int raw_file_name_len =
      strlen("data/") + strlen(ARGV[1]) + strlen(".raw") + 1;
  text_file_name = (char *)malloc(sizeof(char) * text_file_name_len);
  raw_file_name = (char *)malloc(sizeof(char) * raw_file_name_len);
  strcpy(text_file_name, "data/");
  strcpy(raw_file_name, "data/");
  strcat(text_file_name, ARGV[1]);
  strcat(raw_file_name, ARGV[1]);
  strcat(text_file_name, ".txt");
  strcat(raw_file_name, ".raw");
  FILE *text, *raw;
  if ((text = fopen(text_file_name, "w")) == NULL) {
    perror("fopen");
    exit(1);
  }
  if ((raw = fopen(raw_file_name, "w")) == NULL) {
    perror("fopen");
    exit(1);
  }
  for (int i = 0; i < 144000; i++) {
    fprintf(text, "%d %d\n", i, buf[i]);
    fwrite(&buf[i], sizeof(int16_t), 1, raw);
  }
  fclose(text);
  fclose(raw);
  pclose(rec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8ca90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xdfc(%rip),%rsi
mov    $0x26,%edx
call   1090 <memcpy@plt>
lea    -0x40(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1238 <main+0x58>
lea    0xdf5(%rip),%rdi
call   10d0 <perror@plt>
movl   $0x0,-0x44(%rbp)
lea    -0x8ca50(%rbp),%rdi
movslq -0x44(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    $0x23280,%edx
sub    -0x44(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fread@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
cmpl   $0x23280,-0x44(%rbp)
jl     1286 <main+0xa6>
jmp    128b <main+0xab>
jmp    123f <main+0x5f>
lea    0xd9a(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x8ca8c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x8ca8c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8ca88(%rbp)
lea    0xd71(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x8ca88(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8ca64(%rbp)
lea    0xd4c(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x8ca84(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x8ca84(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8ca80(%rbp)
lea    0xd28(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x8ca80(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8ca68(%rbp)
movslq -0x8ca64(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x8ca58(%rbp)
movslq -0x8ca68(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x8ca60(%rbp)
mov    -0x8ca58(%rbp),%rdi
lea    0xcc5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8ca60(%rbp),%rdi
lea    0xcb2(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8ca58(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10e0 <strcat@plt>
mov    -0x8ca60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10e0 <strcat@plt>
mov    -0x8ca58(%rbp),%rdi
lea    0xc7d(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x8ca60(%rbp),%rdi
lea    0xc6f(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x8ca58(%rbp),%rdi
lea    0xc5f(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x8ca70(%rbp)
cmp    $0x0,%rax
jne    1407 <main+0x227>
lea    0xc44(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x8ca60(%rbp),%rdi
lea    0xc25(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x8ca78(%rbp)
cmp    $0x0,%rax
jne    1441 <main+0x261>
lea    0xc0a(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movl   $0x0,-0x8ca7c(%rbp)
cmpl   $0x23280,-0x8ca7c(%rbp)
jge    14c1 <main+0x2e1>
mov    -0x8ca70(%rbp),%rdi
mov    -0x8ca7c(%rbp),%edx
movslq -0x8ca7c(%rbp),%rax
mov    -0x8ca50(%rbp,%rax,4),%ecx
lea    0xbc5(%rip),%rsi
call   1080 <fprintf@plt>
movslq -0x8ca7c(%rbp),%rax
lea    -0x8ca50(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8ca78(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1100 <fwrite@plt>
mov    -0x8ca7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8ca7c(%rbp)
jmp    144b <main+0x26b>
mov    -0x8ca70(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x8ca78(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1070 <pclose@plt>
xor    %eax,%eax
add    $0x8ca90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8ca38,%rsp
mov    %rsi,%r14
movaps 0xe25(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe09(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2d203030303834,%rax
mov    %rax,0x1e(%rsp)
lea    0xe15(%rip),%rsi
mov    %rsp,%rdi
call   10a0 <popen@plt>
mov    %rax,%r13
test   %rax,%rax
je     13c2 <main+0x1f2>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movslq %eax,%rbx
lea    (%rsp,%rbx,4),%rdi
add    $0x30,%rdi
mov    $0x23280,%edx
sub    %ebx,%edx
mov    $0x4,%esi
mov    %r13,%rcx
call   1040 <fread@plt>
add    %ebx,%eax
cmp    $0x23280,%eax
jl     1230 <main+0x60>
lea    0xdcd(%rip),%r12
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
mov    0x8(%r14),%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
lea    0xdb7(%rip),%rdi
call   1060 <strlen@plt>
add    %ebx,%ebp
lea    (%rax,%rbp,1),%r15d
add    $0x1,%r15d
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
mov    0x8(%r14),%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
lea    0xd91(%rip),%rdi
call   1060 <strlen@plt>
add    %ebx,%ebp
lea    (%rax,%rbp,1),%ebx
add    $0x1,%ebx
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    0x8(%r14),%rsi
mov    %r15,%rdi
call   10d0 <strcat@plt>
mov    0x8(%r14),%rsi
mov    %rbp,%rdi
call   10d0 <strcat@plt>
mov    %r15,%rdi
lea    0xd32(%rip),%rsi
call   10d0 <strcat@plt>
mov    %rbp,%rdi
lea    0xd28(%rip),%rsi
call   10d0 <strcat@plt>
lea    0xd1f(%rip),%rsi
mov    %r15,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13d3 <main+0x203>
mov    %rax,%r14
lea    0xd04(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13d3 <main+0x203>
mov    %rax,%r15
lea    0x30(%rsp),%rbp
xor    %ebx,%ebx
lea    0xcea(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%ecx
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1080 <fprintf@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10f0 <fwrite@plt>
add    $0x1,%rbx
add    $0x4,%rbp
cmp    $0x23280,%rbx
jne    1360 <main+0x190>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1070 <pclose@plt>
xor    %eax,%eax
add    $0x8ca38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc5f(%rip),%rdi
call   10c0 <perror@plt>
jmp    1225 <main+0x55>
lea    0xc62(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@__const.main.cmd = [38 x i8] c"rec -t raw -b 16 -c 1 -e s -r 48000 -\00"
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"rec\00"
@.str.2 = [6 x i8] c"data/\00"
@.str.3 = [5 x i8] c".txt\00"
@.str.4 = [5 x i8] c".raw\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [6 x i8] c"fopen\00"
@.str.7 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [38 x i8]
%8 = alloca i32
%9 = alloca [144000 x i32]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = bitcast [38 x i8]* %7 to i8*
%18 = getelementptr inbounds [38 x i8], [38 x i8]* %7, i64 0, i64 0
%19 = call i32* @popen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %6
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %2
store i32 0, i32* %8
br label %24
24: ; preds = %23, %40
%25 = getelementptr inbounds [144000 x i32], [144000 x i32]* %9, i64 0, i64 0
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %8
%30 = sub nsw i32 144000, %29
%31 = load i32*, i32** %6
%32 = call i64 @fread(i32* %28, i32 4, i32 %30, i32* %31)
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = add nsw i64 %34, %32
%36 = trunc i64 %35 to i32
store i32 %36, i32* %8
%37 = load i32, i32* %8
%38 = icmp sge i32 %37, 144000
br i1 %38, label %39, label %40
39: ; preds = %24
br label %41
40: ; preds = %24
br label %24
41: ; preds = %39
%42 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 @strlen(i8* %45)
%47 = add nsw i32 %42, %46
%48 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%49 = add nsw i32 %47, %48
%50 = add nsw i32 %49, 1
store i32 %50, i32* %12
%51 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i32 @strlen(i8* %54)
%56 = add nsw i32 %51, %55
%57 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%58 = add nsw i32 %56, %57
%59 = add nsw i32 %58, 1
store i32 %59, i32* %13
%60 = load i32, i32* %12
%61 = sext i32 %60 to i64
%62 = mul i64 1, %61
%63 = trunc i64 %62 to i32
%64 = call i64 @malloc(i32 %63)
%65 = inttoptr i64 %64 to i8*
store i8* %65, i8** %10
%66 = load i32, i32* %13
%67 = sext i32 %66 to i64
%68 = mul i64 1, %67
%69 = trunc i64 %68 to i32
%70 = call i64 @malloc(i32 %69)
%71 = inttoptr i64 %70 to i8*
store i8* %71, i8** %11
%72 = load i8*, i8** %10
%73 = call i32 @strcpy(i8* %72, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%74 = load i8*, i8** %11
%75 = call i32 @strcpy(i8* %74, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%76 = load i8*, i8** %10
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 1
%79 = load i8*, i8** %78
%80 = call i32 @strcat(i8* %76, i8* %79)
%81 = load i8*, i8** %11
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 1
%84 = load i8*, i8** %83
%85 = call i32 @strcat(i8* %81, i8* %84)
%86 = load i8*, i8** %10
%87 = call i32 @strcat(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%88 = load i8*, i8** %11
%89 = call i32 @strcat(i8* %88, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%90 = load i8*, i8** %10
%91 = call i32* @fopen(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %91, i32** %14
%92 = icmp eq i32* %91, null
br i1 %92, label %93, label %96
93: ; preds = %41
%94 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%95 = call i32 @exit(i32 1)
unreachable
96: ; preds = %41
%97 = load i8*, i8** %11
%98 = call i32* @fopen(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %98, i32** %15
%99 = icmp eq i32* %98, null
br i1 %99, label %100, label %103
100: ; preds = %96
%101 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%102 = call i32 @exit(i32 1)
unreachable
103: ; preds = %96
store i32 0, i32* %16
br label %104
104: ; preds = %120, %103
%105 = load i32, i32* %16
%106 = icmp slt i32 %105, 144000
br i1 %106, label %107, label %123
107: ; preds = %104
%108 = load i32*, i32** %14
%109 = load i32, i32* %16
%110 = load i32, i32* %16
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [144000 x i32], [144000 x i32]* %9, i64 0, i64 %111
%113 = load i32, i32* %112
%114 = call i32 @fprintf(i32* %108, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %109, i32 %113)
%115 = load i32, i32* %16
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [144000 x i32], [144000 x i32]* %9, i64 0, i64 %116
%118 = load i32*, i32** %15
%119 = call i32 @fwrite(i32* %117, i32 4, i32 1, i32* %118)
br label %120
120: ; preds = %107
%121 = load i32, i32* %16
%122 = add nsw i32 %121, 1
store i32 %122, i32* %16
br label %104
123: ; preds = %104
%124 = load i32*, i32** %14
%125 = call i32 @fclose(i32* %124)
%126 = load i32*, i32** %15
%127 = call i32 @fclose(i32* %126)
%128 = load i32*, i32** %6
%129 = call i32 @pclose(i32* %128)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cmd = [38 x i8] c"rec -t raw -b 16 -c 1 -e s -r 48000 -\00"
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"rec\00"
@.str.2 = [6 x i8] c"data/\00"
@.str.3 = [5 x i8] c".txt\00"
@.str.4 = [5 x i8] c".raw\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [6 x i8] c"fopen\00"
@.str.7 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [38 x i8]
%4 = alloca [144000 x i32]
%5 = getelementptr inbounds [38 x i8], [38 x i8]* %3, i64 0, i64 0
%6 = call i32* @popen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = bitcast [144000 x i32]* %4 to i8*
br label %12
12: ; preds = %12, %10
%13 = phi i32 [ 0, %10 ], [ %19, %12 ]
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [144000 x i32], [144000 x i32]* %4, i64 0, i64 %14
%16 = sub nsw i32 144000, %13
%17 = call i64 @fread(i32* %15, i32 4, i32 %16, i32* %6)
%18 = trunc i64 %17 to i32
%19 = add i32 %13, %18
%20 = icmp sgt i32 %19, 143999
br i1 %20, label %21, label %12
21: ; preds = %12
%22 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call i32 @strlen(i8* %24)
%26 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%27 = add i32 %22, 1
%28 = add i32 %27, %25
%29 = add i32 %28, %26
%30 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%31 = load i8*, i8** %23
%32 = tail call i32 @strlen(i8* %31)
%33 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%34 = add i32 %30, 1
%35 = add i32 %34, %32
%36 = add i32 %35, %33
%37 = tail call i64 @malloc(i32 %29)
%38 = inttoptr i64 %37 to i8*
%39 = tail call i64 @malloc(i32 %36)
%40 = inttoptr i64 %39 to i8*
%41 = tail call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%42 = tail call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%43 = load i8*, i8** %23
%44 = tail call i32 @strcat(i8* %38, i8* %43)
%45 = load i8*, i8** %23
%46 = tail call i32 @strcat(i8* %40, i8* %45)
%47 = tail call i32 @strcat(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%48 = tail call i32 @strcat(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%49 = tail call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %54
51: ; preds = %21
%52 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %21
%55 = tail call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %64
57: ; preds = %54
%58 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%59 = tail call i32 @exit(i32 1)
unreachable
60: ; preds = %64
%61 = tail call i32 @fclose(i32* %49)
%62 = tail call i32 @fclose(i32* %55)
%63 = tail call i32 @pclose(i32* %6)
ret i32 0
64: ; preds = %54, %64
%65 = phi i64 [ %71, %64 ], [ 0, %54 ]
%66 = getelementptr inbounds [144000 x i32], [144000 x i32]* %4, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = trunc i64 %65 to i32
%69 = tail call i32 @fprintf(i32* %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %68, i32 %67)
%70 = call i32 @fwrite(i32* %66, i32 4, i32 1, i32* %55)
%71 = add nuw nsw i64 %65, 1
%72 = icmp eq i64 %71, 144000
br i1 %72, label %60, label %64
}