#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ fget(char *, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcasecmp(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char choix[10], quit[4];
  printf("\nYou must have an internet connexion to use this software, do you "
         "want to continue ? : ");
  fget(choix, 10);
  if (strcasecmp(choix, "no") == 0) {
    printf("\n\nStopping...\n");
    return (EXIT_SUCCESS);
  } else if (strcasecmp(choix, "yes") != 0) {
    printf("\nError, bad answer ! Shutting down...\n\n");
    return (EXIT_FAILURE);
  }
  do {
    if (strcasecmp(choix, "yes") == 0) {
      system("echo Downloading sources...");
      system("git clone https://github.com/xerub/irecovery; git clone "
             "https://github.com/styden/makefile; git clone "
             "https://github.com/elrhk/library-iphone");
      system("echo Moving Makefile to irecovery folder; cd makefile; mv "
             "Makefile ../irecovery");
      chdir("library-iphone");
      system(
          "sudo chmod +x apt-get.sh; sudo ./apt-get.sh; sudo ./autobuild.sh");
      chdir("../irecovery");
      system("echo Compiling...; make irecoverylinux");
      chdir("..");
      system("echo Cleaning...;sudo rm -r irecovery; sudo rm -r makefile; sudo "
             "rm -r library-iphone");
      printf("iRecovery installation done !\n");
      return (EXIT_SUCCESS);
    } else if (strcasecmp(choix, "no") == 0) {
      printf("Do you want to leave ? : ");
      fget(quit, 4);
      if (strcasecmp(quit, "yes") == 0) {
        printf("\nStopping...\n\n");
        return (EXIT_SUCCESS);
      }
    }
  } while (strcasecmp(choix, "yes") == 0 && strcasecmp(quit, "no") == 0);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1060 <printf@plt>
lea    -0xe(%rbp),%rdi
mov    $0xa,%esi
call   1070 <fget@plt>
lea    -0xe(%rbp),%rdi
lea    0xed4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11b0 <main+0x60>
lea    0xec1(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1361 <main+0x211>
lea    -0xe(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11e7 <main+0x97>
lea    0xe9d(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1361 <main+0x211>
jmp    11ec <main+0x9c>
jmp    11f1 <main+0xa1>
lea    -0xe(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1294 <main+0x144>
lea    0xe84(%rip),%rdi
call   1050 <system@plt>
lea    0xe94(%rip),%rdi
call   1050 <system@plt>
lea    0xf16(%rip),%rdi
call   1050 <system@plt>
lea    0x1009(%rip),%rdi
call   1040 <chdir@plt>
lea    0xf4e(%rip),%rdi
call   1050 <system@plt>
lea    0xf35(%rip),%rdi
call   1040 <chdir@plt>
lea    0xf77(%rip),%rdi
call   1050 <system@plt>
lea    0xe49(%rip),%rdi
call   1040 <chdir@plt>
lea    0xf86(%rip),%rdi
call   1050 <system@plt>
lea    0xfd0(%rip),%rdi
call   1060 <printf@plt>
mov    0x2d4e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1361 <main+0x211>
lea    -0xe(%rbp),%rdi
lea    0xdb9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1304 <main+0x1b4>
lea    0xfb8(%rip),%rdi
call   1060 <printf@plt>
lea    -0x12(%rbp),%rdi
mov    $0x4,%esi
call   1070 <fget@plt>
lea    -0x12(%rbp),%rdi
lea    0xd97(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12ff <main+0x1af>
lea    0xf9e(%rip),%rdi
call   1060 <printf@plt>
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1361 <main+0x211>
jmp    1304 <main+0x1b4>
jmp    1309 <main+0x1b9>
jmp    130e <main+0x1be>
lea    -0xe(%rbp),%rdi
lea    0xd51(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x13(%rbp)
jne    134a <main+0x1fa>
lea    -0x12(%rbp),%rdi
lea    0xd1d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
test   $0x1,%al
jne    11f1 <main+0xa1>
mov    0x2c7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe8b(%rip),%rdi
call   1070 <printf@plt>
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <fget@plt>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11c6 <main+0x66>
lea    0xeb4(%rip),%rsi
lea    0xa(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11ef <main+0x8f>
mov    0x2e23(%rip),%r13
lea    0x1099(%rip),%r14
jmp    11d4 <main+0x74>
mov    0x2e0b(%rip),%r13
lea    0x10b0(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    0x0(%r13),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe65(%rip),%r15
lea    0xa(%rsp),%rbx
lea    0xe56(%rip),%r12
lea    0x14(%rsp),%rbp
mov    0x2dca(%rip),%r13
lea    0x101c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1296 <main+0x136>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    126d <main+0x10d>
lea    0xfd0(%rip),%rdi
call   1070 <printf@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
call   1080 <fget@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11d4 <main+0x74>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    11dc <main+0x7c>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1220 <main+0xc0>
jmp    11dc <main+0x7c>
lea    0xdc2(%rip),%rdi
call   1060 <system@plt>
lea    0xdd2(%rip),%rdi
call   1060 <system@plt>
lea    0xe54(%rip),%rdi
call   1060 <system@plt>
lea    0xf47(%rip),%rdi
call   1050 <chdir@plt>
lea    0xe8c(%rip),%rdi
call   1060 <system@plt>
lea    0xe73(%rip),%rdi
call   1050 <chdir@plt>
lea    0xeb5(%rip),%rdi
call   1060 <system@plt>
lea    0xf9e(%rip),%rdi
call   1050 <chdir@plt>
lea    0xec4(%rip),%rdi
call   1060 <system@plt>
lea    0xf36(%rip),%r14
jmp    11d4 <main+0x74>

LLVM IR (-O0):
@.str = [88 x i8] c"\0AYou must have an internet connexion to use this software, do you want to continue ? : \00"
@.str.1 = [3 x i8] c"no\00"
@.str.2 = [15 x i8] c"\0A\0AStopping...\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.3 = [4 x i8] c"yes\00"
@.str.4 = [40 x i8] c"\0AError, bad answer ! Shutting down...\0A\0A\00"
@EXIT_FAILURE = global i32 0
@.str.5 = [28 x i8] c"echo Downloading sources...\00"
@.str.6 = [142 x i8] c"git clone https://github.com/xerub/irecovery; git clone https://github.com/styden/makefile; git clone https://github.com/elrhk/library-iphone\00"
@.str.7 = [80 x i8] c"echo Moving Makefile to irecovery folder; cd makefile; mv Makefile ../irecovery\00"
@.str.8 = [15 x i8] c"library-iphone\00"
@.str.9 = [65 x i8] c"sudo chmod +x apt-get.sh; sudo ./apt-get.sh; sudo ./autobuild.sh\00"
@.str.10 = [13 x i8] c"../irecovery\00"
@.str.11 = [39 x i8] c"echo Compiling...; make irecoverylinux\00"
@.str.12 = [3 x i8] c"..\00"
@.str.13 = [86 x i8] c"echo Cleaning...;sudo rm -r irecovery; sudo rm -r makefile; sudo rm -r library-iphone\00"
@.str.14 = [31 x i8] c"iRecovery installation done !\0A\00"
@.str.15 = [26 x i8] c"Do you want to leave ? : \00"
@.str.16 = [15 x i8] c"\0AStopping...\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @fget(i8* %5, i32 10)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcasecmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* @EXIT_SUCCESS
store i32 %12, i32* %1
br label %67
13: ; preds = %0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%15 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
store i32 %19, i32* %1
br label %67
20: ; preds = %13
br label %21
21: ; preds = %20
br label %22
22: ; preds = %63, %21
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%24 = call i64 @strcasecmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %38
26: ; preds = %22
%27 = call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 @system(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 @system(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.7, i64 0, i64 0))
%30 = call i32 @chdir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%31 = call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%32 = call i32 @chdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%33 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%34 = call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%35 = call i32 @system(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.13, i64 0, i64 0))
%36 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0))
%37 = load i32, i32* @EXIT_SUCCESS
store i32 %37, i32* %1
br label %67
38: ; preds = %22
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%40 = call i64 @strcasecmp(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %53
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
%44 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%45 = call i32 @fget(i8* %44, i32 4)
%46 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%47 = call i64 @strcasecmp(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %42
%50 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0))
%51 = load i32, i32* @EXIT_SUCCESS
store i32 %51, i32* %1
br label %67
52: ; preds = %42
br label %53
53: ; preds = %52, %38
br label %54
54: ; preds = %53
br label %55
55: ; preds = %54
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%57 = call i64 @strcasecmp(i8* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %63
59: ; preds = %55
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%61 = call i64 @strcasecmp(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br label %63
63: ; preds = %59, %55
%64 = phi i1 [ false, %55 ], [ %62, %59 ]
br i1 %64, label %22, label %65
65: ; preds = %63
%66 = load i32, i32* @EXIT_SUCCESS
store i32 %66, i32* %1
br label %67
67: ; preds = %65, %49, %26, %17, %10
%68 = load i32, i32* %1
ret i32 %68
}

LLVM IR (-O2):
@.str = [88 x i8] c"\0AYou must have an internet connexion to use this software, do you want to continue ? : \00"
@.str.1 = [3 x i8] c"no\00"
@EXIT_SUCCESS = global i32 0
@.str.3 = [4 x i8] c"yes\00"
@EXIT_FAILURE = global i32 0
@.str.5 = [28 x i8] c"echo Downloading sources...\00"
@.str.6 = [142 x i8] c"git clone https://github.com/xerub/irecovery; git clone https://github.com/styden/makefile; git clone https://github.com/elrhk/library-iphone\00"
@.str.7 = [80 x i8] c"echo Moving Makefile to irecovery folder; cd makefile; mv Makefile ../irecovery\00"
@.str.8 = [15 x i8] c"library-iphone\00"
@.str.9 = [65 x i8] c"sudo chmod +x apt-get.sh; sudo ./apt-get.sh; sudo ./autobuild.sh\00"
@.str.10 = [13 x i8] c"../irecovery\00"
@.str.11 = [39 x i8] c"echo Compiling...; make irecoverylinux\00"
@.str.12 = [3 x i8] c"..\00"
@.str.13 = [86 x i8] c"echo Cleaning...;sudo rm -r irecovery; sudo rm -r makefile; sudo rm -r library-iphone\00"
@.str.15 = [26 x i8] c"Do you want to leave ? : \00"
@str = [14 x i8] c"\0AStopping...\0A\00"
@str.17 = [30 x i8] c"iRecovery installation done !\00"
@str.18 = [39 x i8] c"\0AError, bad answer ! Shutting down...\0A\00"
@str.19 = [14 x i8] c"\0A\0AStopping...\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @fget(i8* %3, i32 10)
%7 = call i64 @strcasecmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %39, label %9
9: ; preds = %0
%10 = call i64 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %39
12: ; preds = %9, %36
%13 = call i64 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @system(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @system(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @chdir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%21 = call i32 @chdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%22 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%23 = call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%24 = call i32 @system(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.13, i64 0, i64 0))
br label %39
25: ; preds = %12
%26 = call i64 @strcasecmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
%30 = call i32 @fget(i8* %4, i32 4)
%31 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %39, label %33
33: ; preds = %28, %25
%34 = call i64 @strcasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %12, label %43
39: ; preds = %28, %9, %0, %15
%40 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @str.17, i64 0, i64 0), %15 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.19, i64 0, i64 0), %0 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str.18, i64 0, i64 0), %9 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), %28 ]
%41 = phi i32* [ @EXIT_SUCCESS, %15 ], [ @EXIT_SUCCESS, %0 ], [ @EXIT_FAILURE, %9 ], [ @EXIT_SUCCESS, %28 ]
%42 = call i32 @puts(i8* dereferenceable(1) %40)
br label %43
43: ; preds = %36, %33, %39
%44 = phi i32* [ %41, %39 ], [ @EXIT_SUCCESS, %33 ], [ @EXIT_SUCCESS, %36 ]
%45 = load i32, i32* %44
ret i32 %45
}