#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*/ err(int, char *);
int /*<<< orphan*/ execv(char *, char **);
void self(const char *arg1, const char *arg2) {
  const char *args[4];
  args[0] = "/testbin/factorial";
  args[1] = arg1;
  args[2] = arg2;
  args[3] = NULL;
  execv("/testbin/factorial", (char **)args);
  err(1, "execv");
}


x86 assembly (clang, -O0):
<self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <execv@plt>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1030 <err@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<self>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rax
mov    %rax,(%rsp)
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    %rsp,%rsi
mov    %rax,%rdi
call   1040 <execv@plt>
lea    0xebf(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"/testbin/factorial\00"
@.str.1 = [6 x i8] c"execv\00"
define void @self(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [4 x i8*]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 1
store i8* %7, i8** %8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 2
store i8* %9, i8** %10
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 3
store i8* null, i8** %11
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 0
%13 = call i32 @execv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %12)
%14 = call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/testbin/factorial\00"
@.str.1 = [6 x i8] c"execv\00"
define void @self(i8* %0, i8* %1) {
%3 = alloca [4 x i8*]
%4 = bitcast [4 x i8*]* %3 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 1
store i8* %0, i8** %6
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 2
store i8* %1, i8** %7
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 3
store i8* null, i8** %8
%9 = call i32 @execv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %5)
%10 = call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}