#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*/ ext2_main(int, char **, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  char *child_argv[5];
  child_argv[0] = "glick";
  child_argv[1] = argv[1];
  child_argv[2] = "-o";
  child_argv[3] = "debug,ro,default_permissions,fsname=glick";
  child_argv[4] = NULL;
  ext2_main(4, child_argv, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xefa(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb4(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x40(%rbp),%rsi
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ext2_main@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xf0c(%rip),%rax
mov    %rax,(%rsp)
mov    0x8(%rsi),%rax
mov    %rax,0x8(%rsp)
lea    0xed1(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xec8(%rip),%rax
mov    %rax,0x18(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
xor    %edx,%edx
call   1030 <ext2_main@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"glick\00"
@.str.1 = [3 x i8] c"-o\00"
@.str.2 = [42 x i8] c"debug,ro,default_permissions,fsname=glick\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 1
store i8* %10, i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 3
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 4
store i8* null, i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%16 = call i32 @ext2_main(i32 4, i8** %15, i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"glick\00"
@.str.1 = [3 x i8] c"-o\00"
@.str.2 = [42 x i8] c"debug,ro,default_permissions,fsname=glick\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5 x i8*]
%4 = bitcast [5 x i8*]* %3 to i8*
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* %7, i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* null, i8** %11
%12 = call i32 @ext2_main(i32 4, i8** %5, i32* null)
ret i32 0
}