#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 EXIT_FAILURE;
int /*<<< orphan*/ animate(char **);
int /*<<< orphan*/ cowsay(char **);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2 || argv[1][0] != 't') {
    fprintf(stderr, "Usage: %s t<git args>\n", argv[0]);
    return EXIT_FAILURE;
  }
  if (!getenv("STOP_REMINDING_ME_THAT_I_SUCK_AT_TYPING")) {
    if (!cowsay(argv)) {
      animate(argv);
    }
  }
  argv[0] = "git";
  argv[1]++;
  execvp("git", argv);
  perror("Couldn't exec git");
  return EXIT_FAILURE;
}


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)
jl     1194 <main+0x34>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
je     11c1 <main+0x61>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe55(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    123c <main+0xdc>
lea    0xe4f(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%eax
jne    11f6 <main+0x96>
mov    -0x10(%rbp),%rdi
call   1080 <cowsay@plt>
cmp    $0x0,%eax
jne    11f1 <main+0x91>
mov    -0x10(%rbp),%rdi
call   1040 <animate@plt>
jmp    11f6 <main+0x96>
mov    -0x10(%rbp),%rax
lea    0xe4c(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
add    $0x1,%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rsi
lea    0xe2e(%rip),%rdi
call   1070 <execvp@plt>
lea    0xe14(%rip),%rdi
call   1060 <perror@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     1172 <main+0x12>
mov    0x8(%rbx),%rax
cmpb   $0x74,(%rax)
je     1195 <main+0x35>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe7b(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
lea    0xe7b(%rip),%rdi
call   1030 <getenv@plt>
test   %eax,%eax
jne    11b9 <main+0x59>
mov    %rbx,%rdi
call   1080 <cowsay@plt>
test   %eax,%eax
jne    11b9 <main+0x59>
mov    %rbx,%rdi
call   1040 <animate@plt>
lea    0xe8d(%rip),%rdi
mov    %rdi,(%rbx)
addq   $0x1,0x8(%rbx)
mov    %rbx,%rsi
call   1070 <execvp@plt>
lea    0xe68(%rip),%rdi
call   1060 <perror@plt>
jmp    118a <main+0x2a>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s t<git args>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [40 x i8] c"STOP_REMINDING_ME_THAT_I_SUCK_AT_TYPING\00"
@.str.2 = [4 x i8] c"git\00"
@.str.3 = [18 x i8] c"Couldn't exec git\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 slt i32 %6, 2
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 116
br i1 %15, label %16, label %23
16: ; preds = %8, %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @EXIT_FAILURE
store i32 %22, i32* %3
br label %45
23: ; preds = %8
%24 = call i32 @getenv(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %34, label %26
26: ; preds = %23
%27 = load i8**, i8*** %5
%28 = call i32 @cowsay(i8** %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %26
%31 = load i8**, i8*** %5
%32 = call i32 @animate(i8** %31)
br label %33
33: ; preds = %30, %26
br label %34
34: ; preds = %33, %23
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %36
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %38
%41 = load i8**, i8*** %5
%42 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %41)
%43 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
store i32 %44, i32* %3
br label %45
45: ; preds = %34, %16
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s t<git args>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [40 x i8] c"STOP_REMINDING_ME_THAT_I_SUCK_AT_TYPING\00"
@.str.2 = [4 x i8] c"git\00"
@.str.3 = [18 x i8] c"Couldn't exec git\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 116
br i1 %8, label %13, label %9
9: ; preds = %4, %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %1
%12 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %26
13: ; preds = %4
%14 = tail call i32 @getenv(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = tail call i32 @cowsay(i8** %1)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @animate(i8** %1)
br label %21
21: ; preds = %16, %19, %13
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %1
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8* %23, i8** %5
%24 = tail call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %1)
%25 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %21, %9
%27 = load i32, i32* @EXIT_FAILURE
ret i32 %27
}