#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 */
char *bottle_s(int);
char *no_or_number(int);
int /*<<< orphan*/ printf(char *, ...);
void take_one_down(int number) {
  if (number == -1)
    printf(
        "Go to the store and buy some more, 99 bottles of beer on the wall.\n");
  else
    printf("Take one down and pass it around, %s %s of beer on the wall.\n",
           no_or_number(number), bottle_s(number));
}


x86 assembly (clang, -O0):
<take_one_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1158 <take_one_down+0x28>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1181 <take_one_down+0x51>
mov    -0x4(%rbp),%edi
call   1040 <no_or_number@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <bottle_s@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_one_down>:
cmp    $0xffffffff,%edi
je     1175 <take_one_down+0x35>
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1050 <no_or_number@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1060 <bottle_s@plt>
lea    0xe9f(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>
lea    0xec2(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Go to the store and buy some more, 99 bottles of beer on the wall.\0A\00"
@.str.1 = [62 x i8] c"Take one down and pass it around, %s %s of beer on the wall.\0A\00"
define void @take_one_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @no_or_number(i32 %8)
%10 = load i32, i32* %2
%11 = call i8* @bottle_s(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [62 x i8] c"Take one down and pass it around, %s %s of beer on the wall.\0A\00"
@str = [67 x i8] c"Go to the store and buy some more, 99 bottles of beer on the wall.\00"
define void @take_one_down(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = tail call i8* @no_or_number(i32 %0)
%7 = tail call i8* @bottle_s(i32 %0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
br label %9
9: ; preds = %5, %3
ret void
}