#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 idevicepair() {
  char choice[80];
  printf("1) Pair\n");
  printf("2) Unpair\n");
  printf("3) List devices paired with this host\n");
  fget(choice, 80);
  if (strcmp(choice, "pair") == 0 || strcmp(choice, "1") == 0) {
    system("idevicepair pair");
  }
  if (strcmp(choice, "unpair") == 0 || strcmp(choice, "2") == 0) {
    system("idevicepair unpair");
  }
  if (strcmp(choice, "list") == 0 || strcmp(choice, "3") == 0) {
    system("idevicepair list");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<idevicepair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    -0x50(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11ae <idevicepair+0x6e>
lea    -0x50(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ba <idevicepair+0x7a>
lea    0xe88(%rip),%rdi
call   1030 <system@plt>
lea    -0x50(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11ee <idevicepair+0xae>
lea    -0x50(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11fa <idevicepair+0xba>
lea    0xe5b(%rip),%rdi
call   1030 <system@plt>
lea    -0x50(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     122e <idevicepair+0xee>
lea    -0x50(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    123a <idevicepair+0xfa>
lea    0xe30(%rip),%rdi
call   1030 <system@plt>
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idevicepair>:
push   %rbx
sub    $0x50,%rsp
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a1 <idevicepair+0x61>
lea    0xe6c(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11ad <idevicepair+0x6d>
lea    0xe5a(%rip),%rdi
call   1040 <system@plt>
lea    0xe6d(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11d5 <idevicepair+0x95>
lea    0xe4b(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11e1 <idevicepair+0xa1>
lea    0xe39(%rip),%rdi
call   1040 <system@plt>
lea    0xe4e(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1209 <idevicepair+0xc9>
lea    0xe2c(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1215 <idevicepair+0xd5>
lea    0xe1a(%rip),%rdi
call   1040 <system@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1) Pair\0A\00"
@.str.1 = [11 x i8] c"2) Unpair\0A\00"
@.str.2 = [39 x i8] c"3) List devices paired with this host\0A\00"
@.str.3 = [5 x i8] c"pair\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [17 x i8] c"idevicepair pair\00"
@.str.6 = [7 x i8] c"unpair\00"
@.str.7 = [2 x i8] c"2\00"
@.str.8 = [19 x i8] c"idevicepair unpair\00"
@.str.9 = [5 x i8] c"list\00"
@.str.10 = [2 x i8] c"3\00"
@.str.11 = [17 x i8] c"idevicepair list\00"
@EXIT_SUCCESS = global i32 0
define i32 @idevicepair() {
%1 = alloca [80 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 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 ([5 x i8], [5 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 %16
14: ; preds = %10, %0
%15 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20, %16
%25 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30, %26
%35 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0))
br label %36
36: ; preds = %34, %30
%37 = load i32, i32* @EXIT_SUCCESS
ret i32 %37
}

LLVM IR (-O2):
@.str.3 = [5 x i8] c"pair\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [17 x i8] c"idevicepair pair\00"
@.str.6 = [7 x i8] c"unpair\00"
@.str.7 = [2 x i8] c"2\00"
@.str.8 = [19 x i8] c"idevicepair unpair\00"
@.str.9 = [5 x i8] c"list\00"
@.str.10 = [2 x i8] c"3\00"
@.str.11 = [17 x i8] c"idevicepair list\00"
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"1) Pair\00"
@str.12 = [10 x i8] c"2) Unpair\00"
@str.13 = [38 x i8] c"3) List devices paired with this host\00"
define i32 @idevicepair() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.12, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.13, i64 0, i64 0))
%6 = call i32 @fget(i8* %2, i32 80)
%7 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 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 %14
12: ; preds = %9, %0
%13 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17, %14
%21 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25, %22
%29 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = load i32, i32* @EXIT_SUCCESS
ret i32 %31
}