#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 pop();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ push(int);
void main() {
  push(10);
  push(20);
  push(30);
  printf("%d ", pop());
  printf("%d ", pop());
  printf("%d ", pop());
  printf("%d ", pop());
  push(100);
  push(200);
  push(300);
  printf("%d ", pop());
  printf("%d ", pop());
  push(1000);
  push(2000);
  push(3000);
  printf("%d ", pop());
  printf("%d ", pop());
  printf("%d ", pop());
  printf("%d ", pop());
  printf("%d ", pop());
  printf("%d ", pop());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1050 <push@plt>
mov    $0x14,%edi
call   1050 <push@plt>
mov    $0x1e,%edi
call   1050 <push@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <push@plt>
mov    $0xc8,%edi
call   1050 <push@plt>
mov    $0x12c,%edi
call   1050 <push@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1050 <push@plt>
mov    $0x7d0,%edi
call   1050 <push@plt>
mov    $0xbb8,%edi
call   1050 <push@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xdba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xda5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xd90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xd7b(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <push@plt>
mov    $0x14,%edi
call   1050 <push@plt>
mov    $0x1e,%edi
call   1050 <push@plt>
xor    %eax,%eax
call   1040 <pop@plt>
lea    0xea3(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <push@plt>
mov    $0xc8,%edi
call   1050 <push@plt>
mov    $0x12c,%edi
call   1050 <push@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1050 <push@plt>
mov    $0x7d0,%edi
call   1050 <push@plt>
mov    $0xbb8,%edi
call   1050 <push@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @main() {
%1 = call i32 @push(i32 10)
%2 = call i32 @push(i32 20)
%3 = call i32 @push(i32 30)
%4 = call i32 (...) @pop()
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @pop()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @pop()
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @pop()
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @push(i32 100)
%13 = call i32 @push(i32 200)
%14 = call i32 @push(i32 300)
%15 = call i32 (...) @pop()
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 (...) @pop()
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 @push(i32 1000)
%20 = call i32 @push(i32 2000)
%21 = call i32 @push(i32 3000)
%22 = call i32 (...) @pop()
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = call i32 (...) @pop()
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = call i32 (...) @pop()
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = call i32 (...) @pop()
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = call i32 (...) @pop()
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = call i32 (...) @pop()
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @main() {
%1 = tail call i32 @push(i32 10)
%2 = tail call i32 @push(i32 20)
%3 = tail call i32 @push(i32 30)
%4 = tail call i32 (...) @pop()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @pop()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @pop()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @pop()
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = tail call i32 @push(i32 100)
%13 = tail call i32 @push(i32 200)
%14 = tail call i32 @push(i32 300)
%15 = tail call i32 (...) @pop()
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i32 (...) @pop()
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = tail call i32 @push(i32 1000)
%20 = tail call i32 @push(i32 2000)
%21 = tail call i32 @push(i32 3000)
%22 = tail call i32 (...) @pop()
%23 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = tail call i32 (...) @pop()
%25 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = tail call i32 (...) @pop()
%27 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = tail call i32 (...) @pop()
%29 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = tail call i32 (...) @pop()
%31 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = tail call i32 (...) @pop()
%33 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
ret void
}