#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*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int strtol(char *, char **, int);
int main(int argc, char **argv) {
  int arg1 = 0;
  int arg2 = 0;
  char *end = NULL;
  printf("You supplied %d explicit arguments\n", argc - 1);
  printf("This program thinks its name is %s\n", argv[0]);
  if (argc != 3) {
    fprintf(stderr, "Just give me two numbers.  Not rocket science.");
  }
  arg1 = strtol(argv[1], &end, 10);
  if (end == argv[1]) {
    fprintf(stderr, "A number. Nuuuumbeeerr. Figure it out.\n");
    exit(1);
  }
  arg2 = strtol(argv[2], &end, 10);
  if (end == argv[2]) {
    fprintf(stderr, "A number. Nuuuumbeeerr. Figure it out.\n");
    exit(1);
  }
  printf("The sum of %d and %d is %d\n", arg1, arg2, arg1 + arg2);
  printf("ARE WE NOT GODS?!\n");
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
je     11c4 <main+0x74>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    120e <main+0xbe>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x10(%rcx),%rax
jne    1258 <main+0x108>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
lea    0xe2e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,(%rsp)
lea    -0x1(%rbp),%esi
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3,%ebp
je     11ac <main+0x4c>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x8(%rbx),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,%ebp
mov    (%rsp),%rax
cmp    0x8(%rbx),%rax
je     121d <main+0xbd>
mov    0x10(%rbx),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    (%rsp),%rcx
cmp    0x10(%rbx),%rcx
je     121d <main+0xbd>
mov    %eax,%ecx
add    %ebp,%ecx
lea    0xeb0(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"You supplied %d explicit arguments\0A\00"
@.str.1 = [36 x i8] c"This program thinks its name is %s\0A\00"
@stderr = global i32 0
@.str.2 = [47 x i8] c"Just give me two numbers. Not rocket science.\00"
@.str.3 = [40 x i8] c"A number. Nuuuumbeeerr. Figure it out.\0A\00"
@.str.4 = [28 x i8] c"The sum of %d and %d is %d\0A\00"
@.str.5 = [19 x i8] c"ARE WE NOT GODS?!\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i8* null, i8** %8
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %18, %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strtol(i8* %24, i8** %8, i32 10)
store i32 %25, i32* %6
%26 = load i8*, i8** %8
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = icmp eq i8* %26, %29
br i1 %30, label %31, label %35
31: ; preds = %21
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %21
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @strtol(i8* %38, i8** %8, i32 10)
store i32 %39, i32* %7
%40 = load i8*, i8** %8
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 2
%43 = load i8*, i8** %42
%44 = icmp eq i8* %40, %43
br i1 %44, label %45, label %49
45: ; preds = %35
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %35
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = load i32, i32* %6
%53 = load i32, i32* %7
%54 = add nsw i32 %52, %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %50, i32 %51, i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%57 = load i32, i32* @stdout
%58 = call i32 @fflush(i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"You supplied %d explicit arguments\0A\00"
@.str.1 = [36 x i8] c"This program thinks its name is %s\0A\00"
@stderr = global i32 0
@.str.2 = [47 x i8] c"Just give me two numbers. Not rocket science.\00"
@.str.3 = [40 x i8] c"A number. Nuuuumbeeerr. Figure it out.\0A\00"
@.str.4 = [28 x i8] c"The sum of %d and %d is %d\0A\00"
@stdout = global i32 0
@str = [18 x i8] c"ARE WE NOT GODS?!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = add nsw i32 %0, -1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = icmp eq i32 %0, 3
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %10, %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strtol(i8* %15, i8** %3, i32 10)
%17 = load i8*, i8** %3
%18 = load i8*, i8** %14
%19 = icmp eq i8* %17, %18
br i1 %19, label %20, label %24
20: ; preds = %13
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %13
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @strtol(i8* %26, i8** %3, i32 10)
%28 = load i8*, i8** %3
%29 = load i8*, i8** %25
%30 = icmp eq i8* %28, %29
br i1 %30, label %31, label %35
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %24
%36 = add nsw i32 %27, %16
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %16, i32 %27, i32 %36)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%39 = load i32, i32* @stdout
%40 = tail call i32 @fflush(i32 %39)
ret i32 0
}