#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_SUCCESS;
int /*<<< orphan*/ fget(char *, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
int ideviceactivation() {
  char choice[80];
  system("clear");
  printf("1) Activate\n");
  printf("2) Deactivate\n");
  fget(choice, 80);
  if (strcmp(choice, "activate") == 0 || strcmp(choice, "1") == 0) {
    printf("Activation\n");
    system("ideviceactivation activate");
  }
  if (strcmp(choice, "deactivate") == 0 || strcmp(choice, "2") == 0) {
    printf("Desactivation\n");
    system("ideviceactivation deactivate");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<ideviceactivation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11ae <ideviceactivation+0x6e>
lea    -0x50(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11c6 <ideviceactivation+0x86>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
call   1030 <system@plt>
lea    -0x50(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11fa <ideviceactivation+0xba>
lea    -0x50(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1212 <ideviceactivation+0xd2>
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4f(%rip),%rdi
call   1030 <system@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ideviceactivation>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <system@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a1 <ideviceactivation+0x61>
lea    0xe72(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11b9 <ideviceactivation+0x79>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe54(%rip),%rdi
call   1040 <system@plt>
lea    0xe77(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11e1 <ideviceactivation+0xa1>
lea    0xe4f(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11f9 <ideviceactivation+0xb9>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
lea    0xe31(%rip),%rdi
call   1040 <system@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [13 x i8] c"1) Activate\0A\00"
@.str.2 = [15 x i8] c"2) Deactivate\0A\00"
@.str.3 = [9 x i8] c"activate\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [12 x i8] c"Activation\0A\00"
@.str.6 = [27 x i8] c"ideviceactivation activate\00"
@.str.7 = [11 x i8] c"deactivate\00"
@.str.8 = [2 x i8] c"2\00"
@.str.9 = [15 x i8] c"Desactivation\0A\00"
@.str.10 = [29 x i8] c"ideviceactivation deactivate\00"
@EXIT_SUCCESS = global i32 0
define i32 @ideviceactivation() {
%1 = alloca [80 x i8]
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @fget(i8* %5, i32 80)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %0
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10, %0
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %17
17: ; preds = %14, %10
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21, %17
%26 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0))
%27 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
br label %28
28: ; preds = %25, %21
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.3 = [9 x i8] c"activate\00"
@.str.4 = [2 x i8] c"1\00"
@.str.6 = [27 x i8] c"ideviceactivation activate\00"
@.str.7 = [11 x i8] c"deactivate\00"
@.str.8 = [2 x i8] c"2\00"
@.str.10 = [29 x i8] c"ideviceactivation deactivate\00"
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"1) Activate\00"
@str.11 = [14 x i8] c"2) Deactivate\00"
@str.12 = [14 x i8] c"Desactivation\00"
@str.13 = [11 x i8] c"Activation\00"
define i32 @ideviceactivation() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.11, i64 0, i64 0))
%6 = call i32 @fget(i8* %2, i32 80)
%7 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9, %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.13, i64 0, i64 0))
%14 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
%16 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18, %15
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.12, i64 0, i64 0))
%23 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
br label %24
24: ; preds = %21, %18
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}