#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*/ printf(char *);
int /*<<< orphan*/ sing(int);
int main() {
  int bottles = 10;
  while (bottles) {
    sing(bottles);
    sing(bottles);
    printf("And if one green bottle should accidently fall,\nThere'd be ");
    sing(--bottles);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117b <main+0x5b>
mov    -0x8(%rbp),%edi
call   1040 <sing@plt>
mov    -0x8(%rbp),%edi
call   1040 <sing@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x8(%rbp)
call   1040 <sing@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1050 <sing@plt>
lea    0xeb4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x9,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
call   1050 <sing@plt>
mov    $0x9,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1050 <sing@plt>
mov    $0x8,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x7,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7,%edi
call   1050 <sing@plt>
mov    $0x7,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x6,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
call   1050 <sing@plt>
mov    $0x6,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
call   1050 <sing@plt>
mov    $0x5,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1050 <sing@plt>
mov    $0x4,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1050 <sing@plt>
mov    $0x3,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
call   1050 <sing@plt>
mov    $0x2,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <sing@plt>
mov    $0x1,%edi
call   1050 <sing@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <sing@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"And if one green bottle should accidently fall,\0AThere'd be \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @sing(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @sing(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -1
store i32 %13, i32* %2
%14 = call i32 @sing(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [60 x i8] c"And if one green bottle should accidently fall,\0AThere'd be \00"
define i32 @main() {
%1 = tail call i32 @sing(i32 10)
%2 = tail call i32 @sing(i32 10)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sing(i32 9)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @sing(i32 9)
%7 = tail call i32 @sing(i32 9)
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @sing(i32 8)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @sing(i32 8)
%12 = tail call i32 @sing(i32 8)
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @sing(i32 7)
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 @sing(i32 7)
%17 = tail call i32 @sing(i32 7)
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @sing(i32 6)
%20 = tail call i32 @putchar(i32 10)
%21 = tail call i32 @sing(i32 6)
%22 = tail call i32 @sing(i32 6)
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%24 = tail call i32 @sing(i32 5)
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @sing(i32 5)
%27 = tail call i32 @sing(i32 5)
%28 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%29 = tail call i32 @sing(i32 4)
%30 = tail call i32 @putchar(i32 10)
%31 = tail call i32 @sing(i32 4)
%32 = tail call i32 @sing(i32 4)
%33 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%34 = tail call i32 @sing(i32 3)
%35 = tail call i32 @putchar(i32 10)
%36 = tail call i32 @sing(i32 3)
%37 = tail call i32 @sing(i32 3)
%38 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%39 = tail call i32 @sing(i32 2)
%40 = tail call i32 @putchar(i32 10)
%41 = tail call i32 @sing(i32 2)
%42 = tail call i32 @sing(i32 2)
%43 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%44 = tail call i32 @sing(i32 1)
%45 = tail call i32 @putchar(i32 10)
%46 = tail call i32 @sing(i32 1)
%47 = tail call i32 @sing(i32 1)
%48 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%49 = tail call i32 @sing(i32 0)
%50 = tail call i32 @putchar(i32 10)
ret i32 0
}