#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*/ execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ execvp(char *, char **);
int main(int argc, char **argv) {
  if (argc == 0)
    execl("git", "git", NULL);
  int i = 1;
  char *args[255] = {"git"};
  for (; i < argc; i++) {
    args[i] = argv[i];
  }
  args[i] = NULL;
  execvp("git", args);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1166 <main+0x36>
lea    0xea6(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1050 <execl@plt>
movl   $0x1,-0x14(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x7f8,%edx
call   1030 <memset@plt>
lea    0xe79(%rip),%rax
mov    %rax,-0x810(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c0 <main+0x90>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0x14(%rbp),%rax
mov    %rcx,-0x810(%rbp,%rax,8)
ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <main+0x5e>
movslq -0x14(%rbp),%rax
movq   $0x0,-0x810(%rbp,%rax,8)
lea    -0x810(%rbp),%rsi
lea    0xe22(%rip),%rdi
call   1040 <execvp@plt>
mov    $0xffffffff,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7f8,%rsp
test   %edi,%edi
je     1193 <main+0x53>
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rsp,%rdi
mov    $0x7f8,%edx
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xe97(%rip),%rax
mov    %rax,(%rsp)
mov    $0x1,%eax
cmp    $0x2,%ebx
jl     11bf <main+0x7f>
lea    0x8(%rsp),%rdi
add    $0x8,%r14
lea    -0x1(%rbx),%edx
shl    $0x3,%rdx
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %ebx,%eax
jmp    11bf <main+0x7f>
lea    0xe66(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1060 <execl@plt>
mov    %rsp,%rdi
mov    $0x7f8,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,(%rsp)
mov    $0x1,%eax
movq   $0x0,(%rsp,%rax,8)
lea    0xe32(%rip),%rdi
mov    %rsp,%rsi
call   1050 <execvp@plt>
mov    $0xffffffff,%eax
add    $0x7f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"git\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [255 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @execl(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
br label %12
12: ; preds = %10, %2
store i32 1, i32* %6
%13 = bitcast [255 x i8*]* %7 to i8*
%14 = bitcast i8* %13 to <{ i8*, [254 x i8*] }>*
%15 = getelementptr inbounds <{ i8*, [254 x i8*] }>, <{ i8*, [254 x i8*] }>* %14, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %15
br label %16
16: ; preds = %29, %12
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %32
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [255 x i8*], [255 x i8*]* %7, i64 0, i64 %27
store i8* %25, i8** %28
br label %29
29: ; preds = %20
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %16
32: ; preds = %16
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [255 x i8*], [255 x i8*]* %7, i64 0, i64 %34
store i8* null, i8** %35
%36 = getelementptr inbounds [255 x i8*], [255 x i8*]* %7, i64 0, i64 0
%37 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %36)
ret i32 -1
}

LLVM IR (-O2):
@.str = [4 x i8] c"git\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8*]
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @execl(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
%7 = bitcast [255 x i8*]* %3 to i8*
%8 = getelementptr inbounds [255 x i8*], [255 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %8
br label %22
9: ; preds = %2
%10 = bitcast [255 x i8*]* %3 to i8*
%11 = getelementptr inbounds [255 x i8*], [255 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %11
%12 = icmp sgt i32 %0, 1
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = getelementptr inbounds [255 x i8*], [255 x i8*]* %3, i64 0, i64 1
%15 = bitcast i8** %14 to i8*
%16 = getelementptr i8*, i8** %1, i64 1
%17 = bitcast i8** %16 to i8*
%18 = add nsw i32 %0, -1
%19 = zext i32 %18 to i64
%20 = shl nuw nsw i64 %19, 3
%21 = zext i32 %0 to i64
br label %22
22: ; preds = %5, %13, %9
%23 = phi i64 [ 1, %9 ], [ %21, %13 ], [ 1, %5 ]
%24 = bitcast [255 x i8*]* %3 to i8*
%25 = getelementptr inbounds [255 x i8*], [255 x i8*]* %3, i64 0, i64 0
%26 = getelementptr inbounds [255 x i8*], [255 x i8*]* %3, i64 0, i64 %23
store i8* null, i8** %26
%27 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %25)
ret i32 -1
}