#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 atoi(char *);
int errno;
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdin;
char *strerror(int);
int main(int argc, char *argv[]) {
  int delay = 10;
  int i;
  char line[1024];
  char *file = "./output_file";
  FILE *fout = NULL;
  if (argc == 2) {
    delay = atoi(argv[1]);
  }
  if (argc == 3) {
    delay = atoi(argv[1]);
    file = argv[2];
  }
  if (delay < 10) {
    printf("Delay has a minimum of 10 seconds\n");
    fflush(NULL);
    delay = 10;
  }
  fout = fopen(file, "a");
  if (fout == NULL) {
    printf("Can't open output file! %d(%s)\n", errno, strerror(errno));
  }
  printf("Dumping stdin:\n");
  fprintf(fout, "Dumping stdin:\n");
  fflush(NULL);
  while (fgets(line, 1024, stdin) != NULL) {
    printf("stdin: %s", line);
    fprintf(fout, "stdin: %s", line);
    fflush(NULL);
  }
  printf("Doing work for %d seconds\n", delay);
  fprintf(fout, "Doing work for %d seconds\n", delay);
  fflush(NULL);
  for (i = 0; i < delay; i++) {
    printf("i = %d\n", i);
    fprintf(fout, "i = %d\n", i);
    fflush(NULL);
    sleep(1);
  }
  printf("Done.\n");
  fprintf(fout, "Done.\n");
  fflush(NULL);
  if (fclose(fout) < 0) {
    printf("Failed to close fout? %d(%s)\n", errno, strerror(errno));
    fflush(NULL);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
lea    0xe49(%rip),%rax
mov    %rax,-0x428(%rbp)
movq   $0x0,-0x430(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11e3 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    120c <main+0x7c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x428(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1234 <main+0xa4>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x428(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x430(%rbp)
cmpq   $0x0,-0x430(%rbp)
jne    1290 <main+0x100>
mov    0x2d75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x434(%rbp)
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x434(%rbp),%esi
mov    %rax,%rdx
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x430(%rbp),%rdi
lea    0xda7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
lea    -0x420(%rbp),%rdi
mov    0x2d1e(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     131f <main+0x18f>
lea    -0x420(%rbp),%rsi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x430(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xd59(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
jmp    12bc <main+0x12c>
mov    -0x14(%rbp),%esi
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x430(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd2c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13ae <main+0x21e>
mov    -0x18(%rbp),%esi
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
mov    $0x1,%edi
call   10b0 <sleep@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1358 <main+0x1c8>
lea    0xcdb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x430(%rbp),%rdi
lea    0xcc6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
mov    -0x430(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
jge    142d <main+0x29d>
mov    0x2be1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x438(%rbp)
mov    0x2bd2(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    -0x438(%rbp),%esi
mov    %rax,%rdx
lea    0xc7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <fflush@plt>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    $0xa,%r14d
cmp    $0x3,%edi
je     11ec <main+0x3c>
cmp    $0x2,%edi
jne    1213 <main+0x63>
mov    0x8(%rbx),%rdi
call   10a0 <atoi@plt>
lea    0xe1e(%rip),%rbx
cmp    $0x9,%eax
jle    11fe <main+0x4e>
mov    %eax,%r14d
jmp    121a <main+0x6a>
mov    0x8(%rbx),%rdi
call   10a0 <atoi@plt>
mov    0x10(%rbx),%rbx
cmp    $0x9,%eax
jg     11e7 <main+0x37>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
jmp    121a <main+0x6a>
lea    0xde6(%rip),%rbx
lea    0xded(%rip),%rsi
mov    %rbx,%rdi
call   1090 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1254 <main+0xa4>
mov    0x2da0(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xdc8(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
lea    0xdc9(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
mov    0x2d61(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     12ea <main+0x13a>
lea    0xd9c(%rip),%rbp
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
test   %rax,%rax
jne    12b0 <main+0x100>
lea    0xd59(%rip),%rbx
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
test   %r14d,%r14d
jle    1364 <main+0x1b4>
lea    0xd44(%rip),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1330 <main+0x180>
lea    0xd36(%rip),%rdi
call   1030 <puts@plt>
lea    0xcf6(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
test   %rax,%rax
jns    13c7 <main+0x217>
mov    0x2c34(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xcc0(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"./output_file\00"
@.str.1 = [35 x i8] c"Delay has a minimum of 10 seconds\0A\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [32 x i8] c"Can't open output file! %d(%s)\0A\00"
@errno = global i32 0
@.str.4 = [16 x i8] c"Dumping stdin:\0A\00"
@stdin = global i32 0
@.str.5 = [10 x i8] c"stdin: %s\00"
@.str.6 = [27 x i8] c"Doing work for %d seconds\0A\00"
@.str.7 = [8 x i8] c"i = %d\0A\00"
@.str.8 = [7 x i8] c"Done.\0A\00"
@.str.9 = [30 x i8] c"Failed to close fout? %d(%s)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [1024 x i8]
%9 = alloca i8*
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %9
store i32* null, i32** %10
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %6
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
store i8* %28, i8** %9
br label %29
29: ; preds = %21, %18
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @fflush(i32* null)
store i32 10, i32* %6
br label %35
35: ; preds = %32, %29
%36 = load i8*, i8** %9
%37 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %37, i32** %10
%38 = load i32*, i32** %10
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %45
40: ; preds = %35
%41 = load i32, i32* @errno
%42 = load i32, i32* @errno
%43 = call i8* @strerror(i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %41, i8* %43)
br label %45
45: ; preds = %40, %35
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%47 = load i32*, i32** %10
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 @fflush(i32* null)
br label %50
50: ; preds = %55, %45
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%52 = load i32, i32* @stdin
%53 = call i32* @fgets(i8* %51, i32 1024, i32 %52)
%54 = icmp ne i32* %53, null
br i1 %54, label %55, label %62
55: ; preds = %50
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %56)
%58 = load i32*, i32** %10
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %59)
%61 = call i32 @fflush(i32* null)
br label %50
62: ; preds = %50
%63 = load i32, i32* %6
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %63)
%65 = load i32*, i32** %10
%66 = load i32, i32* %6
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %66)
%68 = call i32 @fflush(i32* null)
store i32 0, i32* %7
br label %69
69: ; preds = %81, %62
%70 = load i32, i32* %7
%71 = load i32, i32* %6
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %84
73: ; preds = %69
%74 = load i32, i32* %7
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %74)
%76 = load i32*, i32** %10
%77 = load i32, i32* %7
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %77)
%79 = call i32 @fflush(i32* null)
%80 = call i32 @sleep(i32 1)
br label %81
81: ; preds = %73
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
store i32 %83, i32* %7
br label %69
84: ; preds = %69
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%86 = load i32*, i32** %10
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%88 = call i32 @fflush(i32* null)
%89 = load i32*, i32** %10
%90 = call i64 @fclose(i32* %89)
%91 = icmp slt i64 %90, 0
br i1 %91, label %92, label %98
92: ; preds = %84
%93 = load i32, i32* @errno
%94 = load i32, i32* @errno
%95 = call i8* @strerror(i32 %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %93, i8* %95)
%97 = call i32 @fflush(i32* null)
br label %98
98: ; preds = %92, %84
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"./output_file\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [32 x i8] c"Can't open output file! %d(%s)\0A\00"
@errno = global i32 0
@.str.4 = [16 x i8] c"Dumping stdin:\0A\00"
@stdin = global i32 0
@.str.5 = [10 x i8] c"stdin: %s\00"
@.str.6 = [27 x i8] c"Doing work for %d seconds\0A\00"
@.str.7 = [8 x i8] c"i = %d\0A\00"
@.str.8 = [7 x i8] c"Done.\0A\00"
@.str.9 = [30 x i8] c"Failed to close fout? %d(%s)\0A\00"
@str = [15 x i8] c"Dumping stdin:\00"
@str.10 = [6 x i8] c"Done.\00"
@str.11 = [34 x i8] c"Delay has a minimum of 10 seconds\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
switch i32 %0, label %22 [
i32 2, label %5
i32 3, label %9
]
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
br label %15
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
br label %15
15: ; preds = %5, %9
%16 = phi i32 [ %12, %9 ], [ %8, %5 ]
%17 = phi i8* [ %14, %9 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %5 ]
%18 = icmp slt i32 %16, 10
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.11, i64 0, i64 0))
%21 = tail call i32 @fflush(i32* null)
br label %22
22: ; preds = %2, %19, %15
%23 = phi i8* [ %17, %19 ], [ %17, %15 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %2 ]
%24 = phi i32 [ 10, %19 ], [ %16, %15 ], [ 10, %2 ]
%25 = tail call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i32, i32* @errno
%29 = tail call i8* @strerror(i32 %28)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %28, i8* %29)
br label %31
31: ; preds = %27, %22
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i64 15, i64 1, i32* %25)
%34 = tail call i32 @fflush(i32* null)
%35 = load i32, i32* @stdin
%36 = call i32* @fgets(i8* %4, i32 1024, i32 %35)
%37 = icmp eq i32* %36, null
br i1 %37, label %45, label %38
38: ; preds = %31, %38
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%41 = call i32 @fflush(i32* null)
%42 = load i32, i32* @stdin
%43 = call i32* @fgets(i8* %4, i32 1024, i32 %42)
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %38
45: ; preds = %38, %31
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%48 = call i32 @fflush(i32* null)
%49 = icmp sgt i32 %24, 0
br i1 %49, label %50, label %58
50: ; preds = %45, %50
%51 = phi i32 [ %56, %50 ], [ 0, %45 ]
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %51)
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %51)
%54 = call i32 @fflush(i32* null)
%55 = call i32 @sleep(i32 1)
%56 = add nuw nsw i32 %51, 1
%57 = icmp eq i32 %56, %24
br i1 %57, label %58, label %50
58: ; preds = %50, %45
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.10, i64 0, i64 0))
%60 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i64 6, i64 1, i32* %25)
%61 = call i32 @fflush(i32* null)
%62 = call i64 @fclose(i32* %25)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %69
64: ; preds = %58
%65 = load i32, i32* @errno
%66 = call i8* @strerror(i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %65, i8* %66)
%68 = call i32 @fflush(i32* null)
br label %69
69: ; preds = %64, %58
ret i32 0
}