#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_SUCCESS;
int atoi(char *);
char *calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ run_fizzbuzz_until_with_buffer(int, char *);
int main(int argc, char **argv) {
  int fizzbuzz_until = 0;
  if (argc < 2)
    fizzbuzz_until = 15;
  else
    fizzbuzz_until = atoi(argv[1]);
  char *buffer = calloc(1, 9);
  run_fizzbuzz_until_with_buffer(fizzbuzz_until, buffer);
  free(buffer);
  exit(EXIT_SUCCESS);
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    1183 <main+0x33>
movl   $0xf,-0x14(%rbp)
jmp    1193 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
mov    $0x9,%esi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <run_fizzbuzz_until_with_buffer@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xf,%ebp
cmp    $0x2,%edi
jl     1168 <main+0x18>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    $0x1,%edi
mov    $0x9,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1040 <run_fizzbuzz_until_with_buffer@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 15, i32* %6
br 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, %10
%17 = call i8* @calloc(i32 1, i32 9)
store i8* %17, i8** %7
%18 = load i32, i32* %6
%19 = load i8*, i8** %7
%20 = call i32 @run_fizzbuzz_until_with_buffer(i32 %18, i8* %19)
%21 = load i8*, i8** %7
%22 = call i32 @free(i8* %21)
%23 = load i32, i32* @EXIT_SUCCESS
%24 = call i32 @exit(i32 %23)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
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 ], [ 15, %2 ]
%10 = tail call dereferenceable_or_null(9) i8* @calloc(i32 1, i32 9)
%11 = tail call i32 @run_fizzbuzz_until_with_buffer(i32 %9, i8* %10)
%12 = tail call i32 @free(i8* %10)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
}