#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 atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ sierp(int, int);
int /*<<< orphan*/ stderr;
int main(int c, char **v) {
  int size, depth;
  depth = (c > 1) ? atoi(v[1]) : 10;
  size = 1 << depth;
  fprintf(stderr, "size: %d depth: %d\n", size, depth);
  sierp(size, depth + 2);
  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)
cmpl   $0x1,-0x8(%rbp)
jle    1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1172 <main+0x42>
mov    $0xa,%eax
mov    %eax,-0x1c(%rbp)
jmp    1172 <main+0x42>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe65(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
add    $0x2,%esi
call   1030 <sierp@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xa,%ebx
cmp    $0x2,%edi
jl     1148 <main+0x18>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <fprintf@plt>
add    $0x2,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <sierp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"size: %d depth: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %10
%17 = phi i32 [ %14, %10 ], [ 10, %15 ]
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = shl i32 1, %18
store i32 %19, i32* %6
%20 = load i32, i32* @stderr
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 2
%27 = call i32 @sierp(i32 %24, i32 %26)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"size: %d depth: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 10, %2 ]
%10 = shl nuw i32 1, %9
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%13 = add nsw i32 %9, 2
%14 = tail call i32 @sierp(i32 %10, i32 %13)
ret i32 0
}