#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*/ exit(int);
int /*<<< orphan*/ fileExist(char *);
int /*<<< orphan*/ printUsage();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printUsage();
    exit(1);
  }
  if (!fileExist(argv[1])) {
    printf("\'%s\' not exist!\n", argv[1]);
    exit(1);
  }
  char str[300];
  sprintf(str, "mipsel-linux-objdump -D -m mips -b binary %s | sed \'1, 7d\'",
          argv[1]);
  system(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1194 <main+0x34>
mov    $0x0,%al
call   1050 <printUsage@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <fileExist@plt>
cmp    $0x0,%eax
jne    11c8 <main+0x68>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    -0x140(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe33(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x140(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x130,%rsp
cmp    $0x2,%edi
jne    11a6 <main+0x46>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <fileExist@plt>
test   %eax,%eax
je     11b7 <main+0x57>
mov    0x8(%rbx),%rdx
lea    0xe89(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1050 <printUsage@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x8(%rbx),%rsi
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"'%s' not exist!\0A\00"
@.str.1 = [59 x i8] c"mipsel-linux-objdump -D -m mips -b binary %s | sed '1, 7d'\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [300 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (...) @printUsage()
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @fileExist(i8* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %12
%25 = getelementptr inbounds [300 x i8], [300 x i8]* %6, i64 0, i64 0
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [300 x i8], [300 x i8]* %6, i64 0, i64 0
%31 = call i32 @system(i8* %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"'%s' not exist!\0A\00"
@.str.1 = [59 x i8] c"mipsel-linux-objdump -D -m mips -b binary %s | sed '1, 7d'\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [300 x i8]
%4 = icmp eq i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 (...) @printUsage()
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @fileExist(i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i8*, i8** %9
%15 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %8
%18 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%19 = load i8*, i8** %9
%20 = call i32 @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = call i32 @system(i8* %18)
ret i32 0
}