#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 *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
int ideviceimagemounter() {
  char buildCommand[1024];
  char option[80];
  char imgfile[80];
  system("clear");
  printf("Enter option : ");
  fget(option, 80);
  printf("Enter directory to the image file : ");
  fget(imgfile, 80);
  sprintf(buildCommand, "ideviceimagemounter %s %s ", option, imgfile);
  system(buildCommand);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<ideviceimagemounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4a0,%rsp
lea    0xeae(%rip),%rdi
call   1030 <system@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x450(%rbp),%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4a0(%rbp),%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    -0x400(%rbp),%rdi
lea    -0x450(%rbp),%rdx
lea    -0x4a0(%rbp),%rcx
lea    0xe8e(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <system@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%eax
add    $0x4a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ideviceimagemounter>:
push   %r15
push   %r14
push   %rbx
sub    $0x4a0,%rsp
lea    0xead(%rip),%rdi
call   1030 <system@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x50,%esi
call   1050 <fget@plt>
lea    0xea2(%rip),%rsi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%eax
add    $0x4a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [16 x i8] c"Enter option : \00"
@.str.2 = [37 x i8] c"Enter directory to the image file : \00"
@.str.3 = [27 x i8] c"ideviceimagemounter %s %s \00"
@EXIT_SUCCESS = global i32 0
define i32 @ideviceimagemounter() {
%1 = alloca [1024 x i8]
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @fget(i8* %6, i32 80)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%10 = call i32 @fget(i8* %9, i32 80)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %12, i8* %13)
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%16 = call i32 @system(i8* %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [16 x i8] c"Enter option : \00"
@.str.2 = [37 x i8] c"Enter directory to the image file : \00"
@.str.3 = [27 x i8] c"ideviceimagemounter %s %s \00"
@EXIT_SUCCESS = global i32 0
define i32 @ideviceimagemounter() {
%1 = alloca [1024 x i8]
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @fget(i8* %5, i32 80)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @fget(i8* %6, i32 80)
%12 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %5, i8* %6)
%13 = call i32 @system(i8* %4)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}