#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 */
struct solution {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ glow_level(struct solution *, int);
struct solution *new_solution(int, int, int);
int /*<<< orphan*/ print_solution(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int level = 1;
  struct solution *sol = new_solution(1, 1, 3);
  if (argc >= 2)
    level = atoi(argv[1]);
  print_solution(glow_level(sol, level));
  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   $0x1,-0x14(%rbp)
mov    $0x1,%esi
mov    $0x3,%edx
mov    %esi,%edi
call   1040 <new_solution@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     118c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <glow_level@plt>
mov    %eax,%edi
call   1060 <print_solution@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
mov    $0x1,%ebx
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <new_solution@plt>
mov    %rax,%r14
cmp    $0x2,%ebp
jl     1178 <main+0x38>
mov    0x8(%r15),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <glow_level@plt>
mov    %eax,%edi
call   1060 <print_solution@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.solution = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.solution*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%8 = call %struct.solution* @new_solution(i32 1, i32 1, i32 3)
store %struct.solution* %8, %struct.solution** %7
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
br label %16
16: ; preds = %11, %2
%17 = load %struct.solution*, %struct.solution** %7
%18 = load i32, i32* %6
%19 = call i32 @glow_level(%struct.solution* %17, i32 %18)
%20 = call i32 @print_solution(i32 %19)
ret i32 0
}

LLVM IR (-O2):
%struct.solution = type { i32 }
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call %struct.solution* @new_solution(i32 1, i32 1, i32 3)
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ %8, %5 ], [ 1, %2 ]
%11 = tail call i32 @glow_level(%struct.solution* %3, i32 %10)
%12 = tail call i32 @print_solution(i32 %11)
ret i32 0
}