#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 FileIfaceRun(char *);
int /*<<< orphan*/ IfaceRun();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc > 2) {
    printf("Too many arguments provided\n");
    printf("USAGE:\nyamsh\nOR\nyamsh filename\n");
    return 1;
  }
  if (argc == 2) {
    return FileIfaceRun("asd.sh");
  }
  IfaceRun();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1174 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a0 <main+0x70>
cmpl   $0x2,-0x8(%rbp)
jne    1192 <main+0x62>
lea    0xeb8(%rip),%rdi
call   1040 <FileIfaceRun@plt>
mov    %eax,-0x4(%rbp)
jmp    11a0 <main+0x70>
mov    $0x0,%al
call   1050 <IfaceRun@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jl     1155 <main+0x25>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    1170 <main+0x40>
cmp    $0x2,%edi
jne    1167 <main+0x37>
lea    0xe9f(%rip),%rdi
pop    %rbx
jmp    1040 <FileIfaceRun@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <IfaceRun@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Too many arguments provided\0A\00"
@.str.1 = [32 x i8] c"USAGE:\0Ayamsh\0AOR\0Ayamsh filename\0A\00"
@.str.2 = [7 x i8] c"asd.sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @FileIfaceRun(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 %15, i32* %3
br label %18
16: ; preds = %11
%17 = call i32 (...) @IfaceRun()
store i32 0, i32* %3
br label %18
18: ; preds = %16, %14, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str.2 = [7 x i8] c"asd.sh\00"
@str = [28 x i8] c"Too many arguments provided\00"
@str.3 = [31 x i8] c"USAGE:\0Ayamsh\0AOR\0Ayamsh filename\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
br label %13
7: ; preds = %2
%8 = icmp eq i32 %0, 2
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @FileIfaceRun(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %7
%12 = tail call i32 (...) @IfaceRun()
br label %13
13: ; preds = %11, %9, %4
%14 = phi i32 [ 1, %4 ], [ %10, %9 ], [ 0, %11 ]
ret i32 %14
}