#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 atol(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int internal_api(int, int (*)(int, char **), char *);
int libcall(int, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int retval = 0;
  if (argc != 2) {
    retval = libcall(argc, argc);
  } else {
    retval = libcall(atol(argv[1]), 1) * libcall(atol(argv[1]), 2) *
             internal_api(3, &main, "Z") *
             internal_api(4, NULL, (char *)&main) *
             internal_api(5, &main, (char *)&main);
  }
  fprintf(stderr, "main returning %d\n", retval);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117a <main+0x3a>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <libcall@plt>
mov    %eax,-0x14(%rbp)
jmp    121c <main+0xdc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atol@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <libcall@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atol@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1050 <libcall@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    $0x3,%edi
mov    0x2e22(%rip),%rsi
lea    0xe33(%rip),%rdx
call   1030 <internal_api@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    0x2dfb(%rip),%rdx
call   1030 <internal_api@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x5,%edi
mov    0x2ddf(%rip),%rsi
mov    %rsi,%rdx
call   1030 <internal_api@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xdd3(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    11d2 <main+0x92>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <atol@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <libcall@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   1060 <atol@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1050 <libcall@plt>
mov    %eax,%r15d
imul   %ebp,%r15d
mov    0x2e5b(%rip),%r14
lea    0xe6c(%rip),%rdx
mov    $0x3,%edi
mov    %r14,%rsi
call   1030 <internal_api@plt>
mov    %eax,%ebp
mov    $0x4,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <internal_api@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
mov    $0x5,%edi
mov    %r14,%rsi
mov    %r14,%rdx
call   1030 <internal_api@plt>
mov    %eax,%ebp
imul   %ebx,%ebp
imul   %r15d,%ebp
jmp    11db <main+0x9b>
mov    %edi,%esi
call   1050 <libcall@plt>
mov    %eax,%ebp
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
lea    0xe17(%rip),%rsi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"Z\00"
@stderr = global i32 0
@.str.1 = [19 x i8] c"main returning %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @libcall(i32 %10, i32 %11)
store i32 %12, i32* %6
br label %31
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atol(i8* %16)
%18 = call i32 @libcall(i32 %17, i32 1)
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atol(i8* %21)
%23 = call i32 @libcall(i32 %22, i32 2)
%24 = mul nsw i32 %18, %23
%25 = call i32 @internal_api(i32 3, i32 (i32, i8**)* @main, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = mul nsw i32 %24, %25
%27 = call i32 @internal_api(i32 4, i32 (i32, i8**)* null, i8* bitcast (i32 (i32, i8**)* @main to i8*))
%28 = mul nsw i32 %26, %27
%29 = call i32 @internal_api(i32 5, i32 (i32, i8**)* @main, i8* bitcast (i32 (i32, i8**)* @main to i8*))
%30 = mul nsw i32 %28, %29
store i32 %30, i32* %6
br label %31
31: ; preds = %13, %9
%32 = load i32, i32* @stderr
%33 = load i32, i32* %6
%34 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %6
ret i32 %35
}

LLVM IR (-O2):
@.str = [2 x i8] c"Z\00"
@stderr = global i32 0
@.str.1 = [19 x i8] c"main returning %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @libcall(i32 %0, i32 %0)
br label %21
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atol(i8* %8)
%10 = tail call i32 @libcall(i32 %9, i32 1)
%11 = load i8*, i8** %7
%12 = tail call i32 @atol(i8* %11)
%13 = tail call i32 @libcall(i32 %12, i32 2)
%14 = mul nsw i32 %13, %10
%15 = tail call i32 @internal_api(i32 3, i32 (i32, i8**)* @main, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = mul nsw i32 %14, %15
%17 = tail call i32 @internal_api(i32 4, i32 (i32, i8**)* null, i8* bitcast (i32 (i32, i8**)* @main to i8*))
%18 = mul nsw i32 %16, %17
%19 = tail call i32 @internal_api(i32 5, i32 (i32, i8**)* @main, i8* bitcast (i32 (i32, i8**)* @main to i8*))
%20 = mul nsw i32 %18, %19
br label %21
21: ; preds = %6, %4
%22 = phi i32 [ %5, %4 ], [ %20, %6 ]
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 %22
}