#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*/ pop();
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ push(int);
int size();
int main() {
  push(4);
  print();
  printf("size = %d\n", size());
  push(3);
  print();
  printf("size = %d\n", size());
  push(2);
  print();
  printf("size = %d\n", size());
  pop();
  print();
  printf("size = %d\n", size());
  pop();
  print();
  printf("size = %d\n", size());
  pop();
  print();
  printf("size = %d\n", size());
  push(1);
  print();
  printf("size = %d\n", size());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1070 <push@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1070 <push@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <push@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xe34(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pop@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xe11(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pop@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xdee(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pop@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xdcb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <push@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x0,%al
call   1030 <size@plt>
mov    %eax,%esi
lea    0xda5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1070 <push@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
lea    0xe90(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1070 <push@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <push@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pop@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pop@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pop@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <push@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
call   1030 <size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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