#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_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int lseek(int, int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int strlen(char *);
int main(int argc, char **argv, char **arge) {
  if (argc != 3 || strlen(argv[2]) != 1) {
    printf("Syntaxe incorrecte : %s fic.txt c\n", argv[0]);
    return 1;
  }
  int f = open(argv[1], O_RDONLY);
  if (f < 0) {
    printf("Impossible d'ouvrir %s !\n", argv[1]);
    return 2;
  }
  char x = argv[2][0];
  int debut = 0;
  int fin = lseek(f, 0, SEEK_END);
  if (fin == -1) {
    printf("Impossible de se déplacer dans %s !\n", argv[1]);
    return 3;
  } else if (fin == 0) {
    printf("Fichier vide : %s !\n", argv[1]);
    return 4;
  }
  int milieu, i;
  char c;
  do {
    milieu = (debut + fin) / 2;
    i = lseek(f, milieu, SEEK_SET);
    if (i == -1) {
      printf("Impossible de se déplacer en %d dans %s !\n", milieu, argv[1]);
      return 5;
    }
    i = read(f, &c, 1);
    if (i != 1) {
      printf("Impossible de lire dans %s !\n", argv[1]);
      return 6;
    }
    if (c > x) {
      fin = milieu - 1;
    } else if (c < x) {
      debut = milieu + 1;
    }
  } while (c != x && debut <= fin);
  close(f);
  if (c == x)
    printf("Le caractère %c est en position %d !\n", x, milieu);
  else
    printf("Le caractère %c est introuvable !\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    119a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
je     11bb <main+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13d4 <main+0x274>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e16(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1200 <main+0xa0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    13d4 <main+0x274>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x1d(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2dca(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    1256 <main+0xf6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    13d4 <main+0x274>
cmpl   $0x0,-0x28(%rbp)
jne    1282 <main+0x122>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x4(%rbp)
jmp    13d4 <main+0x274>
jmp    1287 <main+0x127>
jmp    128c <main+0x12c>
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    0x2d26(%rip),%rax
mov    (%rax),%edx
call   1050 <lseek@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    12e3 <main+0x183>
mov    -0x2c(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x4(%rbp)
jmp    13d4 <main+0x274>
mov    -0x1c(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
call   1070 <read@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x1,-0x30(%rbp)
je     1323 <main+0x1c3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x6,-0x4(%rbp)
jmp    13d4 <main+0x274>
movsbl -0x31(%rbp),%eax
movsbl -0x1d(%rbp),%ecx
cmp    %ecx,%eax
jle    1341 <main+0x1e1>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    135f <main+0x1ff>
movsbl -0x31(%rbp),%eax
movsbl -0x1d(%rbp),%ecx
cmp    %ecx,%eax
jge    135a <main+0x1fa>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    135f <main+0x1ff>
jmp    1364 <main+0x204>
movsbl -0x31(%rbp),%ecx
movsbl -0x1d(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x32(%rbp)
je     1385 <main+0x225>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
setle  %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    128c <main+0x12c>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
movsbl -0x31(%rbp),%eax
movsbl -0x1d(%rbp),%ecx
cmp    %ecx,%eax
jne    13c2 <main+0x262>
movsbl -0x1d(%rbp),%esi
mov    -0x2c(%rbp),%edx
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13d4 <main+0x274>
movsbl -0x1d(%rbp),%esi
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
cmp    $0x3,%edi
jne    11dc <main+0x7c>
mov    0x10(%r12),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    11dc <main+0x7c>
mov    0x8(%r12),%rdi
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
test   %eax,%eax
js     1204 <main+0xa4>
mov    %eax,%r15d
mov    0x10(%r12),%rax
movsbl (%rax),%ebp
mov    0x2e3d(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
test   %eax,%eax
je     121e <main+0xbe>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1238 <main+0xd8>
mov    0x8(%r12),%rsi
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%ebx
jmp    11f3 <main+0x93>
mov    (%r12),%rsi
lea    0xe19(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r12),%rsi
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%ebx
jmp    11f3 <main+0x93>
mov    0x8(%r12),%rsi
lea    0xe39(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4,%ebx
jmp    11f3 <main+0x93>
mov    %ebp,0x4(%rsp)
xor    %r13d,%r13d
nop
lea    (%rbx,%r13,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    0x2d7c(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    %ebp,%esi
call   1050 <lseek@plt>
cmp    $0xffffffff,%eax
je     12c7 <main+0x167>
mov    %r15d,%edi
lea    0x3(%rsp),%rsi
mov    $0x1,%edx
call   1070 <read@plt>
cmp    $0x1,%eax
jne    12e6 <main+0x186>
movzbl 0x3(%rsp),%r14d
lea    -0x1(%rbp),%eax
lea    0x1(%rbp),%ecx
cmp    0x4(%rsp),%r14b
cmovge %r13d,%ecx
cmovle %ecx,%r13d
cmovg  %eax,%ebx
je     129f <main+0x13f>
cmp    %ebx,%r13d
jle    1240 <main+0xe0>
mov    %r15d,%edi
call   1060 <close@plt>
mov    0x4(%rsp),%esi
cmp    %sil,%r14b
jne    1303 <main+0x1a3>
lea    0xe0b(%rip),%rdi
xor    %ebx,%ebx
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11f3 <main+0x93>
mov    0x8(%r12),%rdx
lea    0xda5(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x5,%ebx
jmp    11f3 <main+0x93>
mov    0x8(%r12),%rsi
lea    0xdb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6,%ebx
jmp    11f3 <main+0x93>
lea    0xddf(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11f3 <main+0x93>

LLVM IR (-O0):
@.str = [35 x i8] c"Syntaxe incorrecte : %s fic.txt c\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [26 x i8] c"Impossible d'ouvrir %s !\0A\00"
@SEEK_END = global i32 0
@.str.2 = [38 x i8] c"Impossible de se d\C3\A9placer dans %s !\0A\00"
@.str.3 = [21 x i8] c"Fichier vide : %s !\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [44 x i8] c"Impossible de se d\C3\A9placer en %d dans %s !\0A\00"
@.str.5 = [30 x i8] c"Impossible de lire dans %s !\0A\00"
@.str.6 = [39 x i8] c"Le caract\C3\A8re %c est en position %d !\0A\00"
@.str.7 = [36 x i8] c"Le caract\C3\A8re %c est introuvable !\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 3
br i1 %16, label %23, label %17
17: ; preds = %3
%18 = load i8**, i8*** %6
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @strlen(i8* %20)
%22 = icmp ne i32 %21, 1
br i1 %22, label %23, label %28
23: ; preds = %17, %3
%24 = load i8**, i8*** %6
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %26)
store i32 1, i32* %4
br label %143
28: ; preds = %17
%29 = load i8**, i8*** %6
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = load i32, i32* @O_RDONLY
%33 = call i32 @open(i8* %31, i32 %32)
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %28
%37 = load i8**, i8*** %6
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %39)
store i32 2, i32* %4
br label %143
41: ; preds = %28
%42 = load i8**, i8*** %6
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = getelementptr inbounds i8, i8* %44, i64 0
%46 = load i8, i8* %45
store i8 %46, i8* %9
store i32 0, i32* %10
%47 = load i32, i32* %8
%48 = load i32, i32* @SEEK_END
%49 = call i32 @lseek(i32 %47, i32 0, i32 %48)
store i32 %49, i32* %11
%50 = load i32, i32* %11
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %57
52: ; preds = %41
%53 = load i8**, i8*** %6
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %55)
store i32 3, i32* %4
br label %143
57: ; preds = %41
%58 = load i32, i32* %11
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %57
%61 = load i8**, i8*** %6
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %63)
store i32 4, i32* %4
br label %143
65: ; preds = %57
br label %66
66: ; preds = %65
br label %67
67: ; preds = %124, %66
%68 = load i32, i32* %10
%69 = load i32, i32* %11
%70 = add nsw i32 %68, %69
%71 = sdiv i32 %70, 2
store i32 %71, i32* %12
%72 = load i32, i32* %8
%73 = load i32, i32* %12
%74 = load i32, i32* @SEEK_SET
%75 = call i32 @lseek(i32 %72, i32 %73, i32 %74)
store i32 %75, i32* %13
%76 = load i32, i32* %13
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %84
78: ; preds = %67
%79 = load i32, i32* %12
%80 = load i8**, i8*** %6
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i32 %79, i8* %82)
store i32 5, i32* %4
br label %143
84: ; preds = %67
%85 = load i32, i32* %8
%86 = call i32 @read(i32 %85, i8* %14, i32 1)
store i32 %86, i32* %13
%87 = load i32, i32* %13
%88 = icmp ne i32 %87, 1
br i1 %88, label %89, label %94
89: ; preds = %84
%90 = load i8**, i8*** %6
%91 = getelementptr inbounds i8*, i8** %90, i64 1
%92 = load i8*, i8** %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %92)
store i32 6, i32* %4
br label %143
94: ; preds = %84
%95 = load i8, i8* %14
%96 = sext i8 %95 to i32
%97 = load i8, i8* %9
%98 = sext i8 %97 to i32
%99 = icmp sgt i32 %96, %98
br i1 %99, label %100, label %103
100: ; preds = %94
%101 = load i32, i32* %12
%102 = sub nsw i32 %101, 1
store i32 %102, i32* %11
br label %113
103: ; preds = %94
%104 = load i8, i8* %14
%105 = sext i8 %104 to i32
%106 = load i8, i8* %9
%107 = sext i8 %106 to i32
%108 = icmp slt i32 %105, %107
br i1 %108, label %109, label %112
109: ; preds = %103
%110 = load i32, i32* %12
%111 = add nsw i32 %110, 1
store i32 %111, i32* %10
br label %112
112: ; preds = %109, %103
br label %113
113: ; preds = %112, %100
br label %114
114: ; preds = %113
%115 = load i8, i8* %14
%116 = sext i8 %115 to i32
%117 = load i8, i8* %9
%118 = sext i8 %117 to i32
%119 = icmp ne i32 %116, %118
br i1 %119, label %120, label %124
120: ; preds = %114
%121 = load i32, i32* %10
%122 = load i32, i32* %11
%123 = icmp sle i32 %121, %122
br label %124
124: ; preds = %120, %114
%125 = phi i1 [ false, %114 ], [ %123, %120 ]
br i1 %125, label %67, label %126
126: ; preds = %124
%127 = load i32, i32* %8
%128 = call i32 @close(i32 %127)
%129 = load i8, i8* %14
%130 = sext i8 %129 to i32
%131 = load i8, i8* %9
%132 = sext i8 %131 to i32
%133 = icmp eq i32 %130, %132
br i1 %133, label %134, label %139
134: ; preds = %126
%135 = load i8, i8* %9
%136 = sext i8 %135 to i32
%137 = load i32, i32* %12
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %136, i32 %137)
br label %143
139: ; preds = %126
%140 = load i8, i8* %9
%141 = sext i8 %140 to i32
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %141)
br label %143
143: ; preds = %23, %36, %52, %60, %78, %89, %139, %134
%144 = load i32, i32* %4
ret i32 %144
}

LLVM IR (-O2):
@.str = [35 x i8] c"Syntaxe incorrecte : %s fic.txt c\0A\00"
@O_RDONLY = global i32 0
@.str.1 = [26 x i8] c"Impossible d'ouvrir %s !\0A\00"
@SEEK_END = global i32 0
@.str.2 = [38 x i8] c"Impossible de se d\C3\A9placer dans %s !\0A\00"
@.str.3 = [21 x i8] c"Fichier vide : %s !\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [44 x i8] c"Impossible de se d\C3\A9placer en %d dans %s !\0A\00"
@.str.5 = [30 x i8] c"Impossible de lire dans %s !\0A\00"
@.str.6 = [39 x i8] c"Le caract\C3\A8re %c est en position %d !\0A\00"
@.str.7 = [36 x i8] c"Le caract\C3\A8re %c est introuvable !\0A\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = alloca i8
%5 = icmp eq i32 %0, 3
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @strlen(i8* %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %6, %3
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %74
14: ; preds = %6
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = load i32, i32* @O_RDONLY
%18 = tail call i32 @open(i8* %16, i32 %17)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i8*, i8** %15
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %74
23: ; preds = %14
%24 = load i8*, i8** %7
%25 = load i8, i8* %24
%26 = load i32, i32* @SEEK_END
%27 = tail call i32 @lseek(i32 %18, i32 0, i32 %26)
switch i32 %27, label %34 [
i32 -1, label %28
i32 0, label %31
]
28: ; preds = %23
%29 = load i8*, i8** %15
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %74
31: ; preds = %23
%32 = load i8*, i8** %15
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %32)
br label %74
34: ; preds = %23
br label %35
35: ; preds = %52, %34
%36 = phi i32 [ 0, %34 ], [ %59, %52 ]
%37 = phi i32 [ %27, %34 ], [ %60, %52 ]
%38 = add nsw i32 %37, %36
%39 = sdiv i32 %38, 2
%40 = load i32, i32* @SEEK_SET
%41 = tail call i32 @lseek(i32 %18, i32 %39, i32 %40)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %46
43: ; preds = %35
%44 = load i8*, i8** %15
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i32 %39, i8* %44)
br label %72
46: ; preds = %35
%47 = call i32 @read(i32 %18, i8* %4, i32 1)
%48 = icmp eq i32 %47, 1
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i8*, i8** %15
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %50)
br label %72
52: ; preds = %46
%53 = load i8, i8* %4
%54 = icmp sgt i8 %53, %25
%55 = add nsw i32 %39, -1
%56 = icmp slt i8 %53, %25
%57 = add nsw i32 %39, 1
%58 = select i1 %56, i32 %57, i32 %36
%59 = select i1 %54, i32 %36, i32 %58
%60 = select i1 %54, i32 %55, i32 %37
%61 = icmp ne i8 %53, %25
%62 = icmp sle i32 %59, %60
%63 = select i1 %61, i1 %62, i1 false
br i1 %63, label %35, label %64
64: ; preds = %52
%65 = sext i8 %25 to i32
%66 = tail call i32 @close(i32 %18)
%67 = icmp eq i8 %53, %25
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %65, i32 %39)
br label %72
70: ; preds = %64
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %65)
br label %72
72: ; preds = %68, %70, %49, %43
%73 = phi i32 [ 5, %43 ], [ 6, %49 ], [ 0, %70 ], [ 0, %68 ]
br label %74
74: ; preds = %20, %72, %31, %28, %11
%75 = phi i32 [ 1, %11 ], [ 2, %20 ], [ 3, %28 ], [ 4, %31 ], [ %73, %72 ]
ret i32 %75
}