#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 calcTak(int, int, int);
int strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int a = argc > 1 ? strtol(argv[1], NULL, 0) : 500;
  int b = argc > 2 ? strtol(argv[2], NULL, 0) : 450;
  int c = argc > 3 ? strtol(argv[3], NULL, 0) : 405;
  int ret = calcTak(a, b, c);
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x24(%rbp)
jmp    1168 <main+0x48>
mov    $0x1f4,%eax
mov    %eax,-0x24(%rbp)
jmp    1168 <main+0x48>
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1193 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x28(%rbp)
jmp    11a0 <main+0x80>
mov    $0x1c2,%eax
mov    %eax,-0x28(%rbp)
jmp    11a0 <main+0x80>
mov    -0x28(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    11cb <main+0xab>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x2c(%rbp)
jmp    11d8 <main+0xb8>
mov    $0x195,%eax
mov    %eax,-0x2c(%rbp)
jmp    11d8 <main+0xb8>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <calcTak@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x195,%r14d
mov    $0x1f4,%r12d
mov    $0x1c2,%r15d
cmp    $0x2,%edi
jl     117e <main+0x5e>
mov    %rsi,%rbp
mov    %edi,%ebx
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%r12d
cmp    $0x2,%ebx
je     117e <main+0x5e>
mov    0x10(%rbp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%r15d
cmp    $0x4,%ebx
jb     117e <main+0x5e>
mov    0x18(%rbp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%r14d
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <calcTak@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strtol(i8* %15, i32* null, i32 0)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 500, %17 ]
store i32 %19, i32* %6
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 2
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @strtol(i8* %25, i32* null, i32 0)
br label %28
27: ; preds = %18
br label %28
28: ; preds = %27, %22
%29 = phi i32 [ %26, %22 ], [ 450, %27 ]
store i32 %29, i32* %7
%30 = load i32, i32* %4
%31 = icmp sgt i32 %30, 3
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 3
%35 = load i8*, i8** %34
%36 = call i32 @strtol(i8* %35, i32* null, i32 0)
br label %38
37: ; preds = %28
br label %38
38: ; preds = %37, %32
%39 = phi i32 [ %36, %32 ], [ 405, %37 ]
store i32 %39, i32* %8
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = load i32, i32* %8
%43 = call i32 @calcTak(i32 %40, i32 %41, i32 %42)
store i32 %43, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtol(i8* nocapture %6, i32* null, i32 0)
%8 = icmp eq i32 %0, 2
br i1 %8, label %18, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @strtol(i8* nocapture %11, i32* null, i32 0)
%13 = icmp ugt i32 %0, 3
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @strtol(i8* nocapture %16, i32* null, i32 0)
br label %18
18: ; preds = %2, %4, %9, %14
%19 = phi i32 [ %12, %14 ], [ %12, %9 ], [ 450, %4 ], [ 450, %2 ]
%20 = phi i32 [ %7, %14 ], [ %7, %9 ], [ %7, %4 ], [ 500, %2 ]
%21 = phi i32 [ %17, %14 ], [ 405, %9 ], [ 405, %4 ], [ 405, %2 ]
%22 = tail call i32 @calcTak(i32 %20, i32 %19, i32 %21)
ret i32 0
}