#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*/ O_WRONLY;
int atoi(char *);
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int main(int ac, char *av[]) {
  int fd_audio, i, j, tmp, err, toterr, inst_num;
  char drv_name[32];
  printf("Hi... \n");
  if (ac == 1) {
    printf("This program checks that it is possible to open only once a driver "
           "instance\n");
    printf("-> main <supported_driver_instance_number>\n\n");
    return 0;
  }
  inst_num = atoi(av[1]);
  if (inst_num > 4) {
    printf("Sounds like too many instances.\n");
    inst_num = 4;
    printf("Will check till #%i. Change limitation in source and recompile if "
           "needed...\n",
           inst_num);
  }
  for (i = 0, toterr = 0; i < inst_num; i++) {
    if (i == 0)
      sprintf(drv_name, "/dev/sound/dsp");
    else
      sprintf(drv_name, "/dev/sound/dsp%i", i);
    for (j = 0, err = 0; j < 3; j++) {
      if ((tmp = open(drv_name, O_WRONLY)) < 0) {
        if (j == 0) {
          printf("Error at first opening %s\n", drv_name);
          err++;
          break;
        }
      } else {
        if (j == 0)
          fd_audio = tmp;
        else {
          printf("Error : driver re-opened\n");
          close(tmp);
          err++;
          break;
        }
      }
    }
    close(fd_audio);
    if (!err)
      printf("Test passed successfully for %s\n", drv_name);
    toterr += err;
  }
  if (!toterr)
    printf("\n --> All the tests were passed successfully\n");
  else
    printf("\nEncountered %i errors\n", toterr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11a6 <main+0x56>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    135c <main+0x20c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jle    11e6 <main+0x96>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x4,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1327 <main+0x1d7>
cmpl   $0x0,-0x18(%rbp)
jne    1221 <main+0xd1>
lea    -0x50(%rbp),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
jmp    1236 <main+0xe6>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    12ec <main+0x19c>
lea    -0x50(%rbp),%rdi
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    129b <main+0x14b>
cmpl   $0x0,-0x1c(%rbp)
jne    1296 <main+0x146>
lea    -0x50(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12ec <main+0x19c>
jmp    12d9 <main+0x189>
cmpl   $0x0,-0x1c(%rbp)
jne    12b0 <main+0x160>
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    12d4 <main+0x184>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12ec <main+0x19c>
jmp    12d9 <main+0x189>
jmp    12de <main+0x18e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1244 <main+0xf4>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1310 <main+0x1c0>
lea    -0x50(%rbp),%rsi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f4 <main+0xa4>
cmpl   $0x0,-0x28(%rbp)
jne    1344 <main+0x1f4>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x205>
mov    -0x28(%rbp),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebp
jne    119c <main+0x3c>
lea    0xfa3(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe3(%rip),%rdi
jmp    1297 <main+0x137>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
cmp    $0x5,%eax
jl     11d0 <main+0x70>
lea    0xf5d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe43(%rip),%rdi
mov    $0x4,%ebp
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11da <main+0x7a>
mov    %eax,%ebp
test   %eax,%eax
jle    1290 <main+0x130>
movabs $0x7073642f646e75,%rax
mov    %rax,0x17(%rsp)
movabs $0x756f732f7665642f,%rax
73 6f 75
mov    %rax,0x10(%rsp)
mov    0x2dd9(%rip),%rbx
mov    (%rbx),%esi
lea    0x10(%rsp),%rdi
call   1060 <open@plt>
mov    %eax,%r12d
test   %eax,%eax
js     1252 <main+0xf2>
mov    (%rbx),%esi
lea    0x10(%rsp),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    123d <main+0xdd>
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     12ad <main+0x14d>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
jmp    1265 <main+0x105>
lea    0xe14(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12d,%edi
call   1050 <close@plt>
mov    $0x1,%r14d
cmp    $0x1,%ebp
jne    12d0 <main+0x170>
test   %r14d,%r14d
je     1290 <main+0x130>
lea    0xe25(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    129c <main+0x13c>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12d,%edi
call   1050 <close@plt>
lea    0xdcc(%rip),%rdi
xor    %r14d,%r14d
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
je     1278 <main+0x118>
mov    $0x1,%ebx
mov    %ebp,0xc(%rsp)
nopl   0x0(%rax)
lea    0x10(%rsp),%r13
mov    %r13,%rdi
lea    0xd6d(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    0x2cd9(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %r13,%rdi
call   1060 <open@plt>
test   %eax,%eax
js     1350 <main+0x1f0>
mov    %eax,%r15d
mov    0x0(%rbp),%esi
mov    %r13,%rdi
call   1060 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1339 <main+0x1d9>
mov    0x2caf(%rip),%rax
mov    (%rax),%esi
mov    %r13,%rdi
call   1060 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
js     138b <main+0x22b>
lea    0xdb5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
call   1050 <close@plt>
jmp    1364 <main+0x204>
xchg   %ax,%ax
lea    0xd16(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12d,%r15d
mov    %r15d,%edi
call   1050 <close@plt>
mov    $0x1,%ebp
add    %ebp,%r14d
add    $0x1,%ebx
mov    %r15d,%r12d
mov    0xc(%rsp),%ebp
cmp    %ebx,%ebp
jne    12e0 <main+0x180>
jmp    1278 <main+0x118>
mov    %r15d,%edi
call   1050 <close@plt>
xor    %ebp,%ebp
lea    0xcec(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1371 <main+0x211>

LLVM IR (-O0):
@.str = [8 x i8] c"Hi... \0A\00"
@.str.1 = [77 x i8] c"This program checks that it is possible to open only once a driver instance\0A\00"
@.str.2 = [45 x i8] c"-> main <supported_driver_instance_number>\0A\0A\00"
@.str.3 = [33 x i8] c"Sounds like too many instances.\0A\00"
@.str.4 = [77 x i8] c"Will check till #%i. Change limitation in source and recompile if needed...\0A\00"
@.str.5 = [15 x i8] c"/dev/sound/dsp\00"
@.str.6 = [17 x i8] c"/dev/sound/dsp%i\00"
@O_WRONLY = global i32 0
@.str.7 = [27 x i8] c"Error at first opening %s\0A\00"
@.str.8 = [26 x i8] c"Error : driver re-opened\0A\00"
@.str.9 = [33 x i8] c"Test passed successfully for %s\0A\00"
@.str.10 = [46 x i8] c"\0A --> All the tests were passed successfully\0A\00"
@.str.11 = [24 x i8] c"\0AEncountered %i errors\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %104
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %12
%25 = load i32, i32* %12
%26 = icmp sgt i32 %25, 4
br i1 %26, label %27, label %31
27: ; preds = %20
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
store i32 4, i32* %12
%29 = load i32, i32* %12
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %27, %20
store i32 0, i32* %7
store i32 0, i32* %11
br label %32
32: ; preds = %92, %31
%33 = load i32, i32* %7
%34 = load i32, i32* %12
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %95
36: ; preds = %32
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%41 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %46
42: ; preds = %36
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%44 = load i32, i32* %7
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %43, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %42, %39
store i32 0, i32* %8
store i32 0, i32* %10
br label %47
47: ; preds = %77, %46
%48 = load i32, i32* %8
%49 = icmp slt i32 %48, 3
br i1 %49, label %50, label %80
50: ; preds = %47
%51 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%52 = load i32, i32* @O_WRONLY
%53 = call i32 @open(i8* %51, i32 %52)
store i32 %53, i32* %9
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %64
55: ; preds = %50
%56 = load i32, i32* %8
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %63
58: ; preds = %55
%59 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %59)
%61 = load i32, i32* %10
%62 = add nsw i32 %61, 1
store i32 %62, i32* %10
br label %80
63: ; preds = %55
br label %76
64: ; preds = %50
%65 = load i32, i32* %8
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = load i32, i32* %9
store i32 %68, i32* %6
br label %75
69: ; preds = %64
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%71 = load i32, i32* %9
%72 = call i32 @close(i32 %71)
%73 = load i32, i32* %10
%74 = add nsw i32 %73, 1
store i32 %74, i32* %10
br label %80
75: ; preds = %67
br label %76
76: ; preds = %75, %63
br label %77
77: ; preds = %76
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
store i32 %79, i32* %8
br label %47
80: ; preds = %69, %58, %47
%81 = load i32, i32* %6
%82 = call i32 @close(i32 %81)
%83 = load i32, i32* %10
%84 = icmp ne i32 %83, 0
br i1 %84, label %88, label %85
85: ; preds = %80
%86 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %86)
br label %88
88: ; preds = %85, %80
%89 = load i32, i32* %10
%90 = load i32, i32* %11
%91 = add nsw i32 %90, %89
store i32 %91, i32* %11
br label %92
92: ; preds = %88
%93 = load i32, i32* %7
%94 = add nsw i32 %93, 1
store i32 %94, i32* %7
br label %32
95: ; preds = %32
%96 = load i32, i32* %11
%97 = icmp ne i32 %96, 0
br i1 %97, label %100, label %98
98: ; preds = %95
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
br label %103
100: ; preds = %95
%101 = load i32, i32* %11
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %101)
br label %103
103: ; preds = %100, %98
store i32 0, i32* %3
br label %104
104: ; preds = %103, %17
%105 = load i32, i32* %3
ret i32 %105
}

LLVM IR (-O2):
@.str.4 = [77 x i8] c"Will check till #%i. Change limitation in source and recompile if needed...\0A\00"
@.str.5 = [15 x i8] c"/dev/sound/dsp\00"
@.str.6 = [17 x i8] c"/dev/sound/dsp%i\00"
@O_WRONLY = global i32 0
@.str.7 = [27 x i8] c"Error at first opening %s\0A\00"
@.str.9 = [33 x i8] c"Test passed successfully for %s\0A\00"
@.str.11 = [24 x i8] c"\0AEncountered %i errors\0A\00"
@str = [7 x i8] c"Hi... \00"
@str.12 = [45 x i8] c"\0A --> All the tests were passed successfully\00"
@str.13 = [25 x i8] c"Error : driver re-opened\00"
@str.14 = [32 x i8] c"Sounds like too many instances.\00"
@str.15 = [76 x i8] c"This program checks that it is possible to open only once a driver instance\00"
@str.16 = [44 x i8] c"-> main <supported_driver_instance_number>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.15, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.16, i64 0, i64 0))
br label %88
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = icmp sgt i32 %13, 4
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.14, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0), i32 4)
br label %20
18: ; preds = %10
%19 = icmp sgt i32 %13, 0
br i1 %19, label %20, label %84
20: ; preds = %15, %18
%21 = phi i32 [ 4, %15 ], [ %13, %18 ]
%22 = load i32, i32* @O_WRONLY
%23 = call i32 @open(i8* %4, i32 %22)
%24 = icmp slt i32 %23, 0
br i1 %24, label %40, label %25
25: ; preds = %20
%26 = load i32, i32* @O_WRONLY
%27 = call i32 @open(i8* %4, i32 %26)
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32, i32* @O_WRONLY
%31 = call i32 @open(i8* %4, i32 %30)
%32 = icmp slt i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %29, %25
%34 = phi i32 [ %27, %25 ], [ %31, %29 ]
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0))
%36 = call i32 @close(i32 %34)
br label %42
37: ; preds = %29
%38 = call i32 @close(i32 %23)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %4)
br label %44
40: ; preds = %20
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %4)
br label %42
42: ; preds = %40, %33
%43 = call i32 @close(i32 %23)
br label %44
44: ; preds = %42, %37
%45 = phi i32 [ 1, %42 ], [ 0, %37 ]
%46 = icmp eq i32 %21, 1
br i1 %46, label %81, label %47
47: ; preds = %44, %75
%48 = phi i32 [ %78, %75 ], [ %45, %44 ]
%49 = phi i32 [ %79, %75 ], [ 1, %44 ]
%50 = phi i32 [ %76, %75 ], [ %23, %44 ]
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %49)
%52 = load i32, i32* @O_WRONLY
%53 = call i32 @open(i8* %4, i32 %52)
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %61
55: ; preds = %47
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %4)
br label %72
57: ; preds = %65, %61
%58 = phi i32 [ %63, %61 ], [ %67, %65 ]
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0))
%60 = call i32 @close(i32 %58)
br label %72
61: ; preds = %47
%62 = load i32, i32* @O_WRONLY
%63 = call i32 @open(i8* %4, i32 %62)
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %57
65: ; preds = %61
%66 = load i32, i32* @O_WRONLY
%67 = call i32 @open(i8* %4, i32 %66)
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %57
69: ; preds = %65
%70 = call i32 @close(i32 %53)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %4)
br label %75
72: ; preds = %57, %55
%73 = phi i32 [ %53, %57 ], [ %50, %55 ]
%74 = call i32 @close(i32 %73)
br label %75
75: ; preds = %72, %69
%76 = phi i32 [ %73, %72 ], [ %53, %69 ]
%77 = phi i32 [ 1, %72 ], [ 0, %69 ]
%78 = add nuw nsw i32 %77, %48
%79 = add nuw nsw i32 %49, 1
%80 = icmp eq i32 %79, %21
br i1 %80, label %81, label %47
81: ; preds = %75, %44
%82 = phi i32 [ %45, %44 ], [ %78, %75 ]
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %18, %81
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.12, i64 0, i64 0))
br label %88
86: ; preds = %81
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %82)
br label %88
88: ; preds = %84, %86, %7
ret i32 0
}