#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 EXIT_SUCCESS;
int /*<<< orphan*/ is_empty_float();
int /*<<< orphan*/ is_empty_int();
int /*<<< orphan*/ pop_float();
int /*<<< orphan*/ pop_int();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ push_float(double);
int /*<<< orphan*/ push_int(int);
double top_float();
int top_int();
int main() {
  push_int(5);
  push_int(22);
  push_int(15);
  push_float(25.3);
  push_float(-40.5);
  while (!is_empty_int()) {
    printf("Popping %d\n", top_int());
    pop_int();
  }
  while (!is_empty_float()) {
    printf("Popping %f\n", top_float());
    pop_float();
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   10b0 <push_int@plt>
mov    $0x16,%edi
call   10b0 <push_int@plt>
mov    $0xf,%edi
call   10b0 <push_int@plt>
movsd  0xe43(%rip),%xmm0
call   1030 <push_float@plt>
movsd  0xe2e(%rip),%xmm0
call   1030 <push_float@plt>
mov    $0x0,%al
call   1070 <is_empty_int@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11f3 <main+0x63>
jmp    1216 <main+0x86>
mov    $0x0,%al
call   1060 <top_int@plt>
cvtsi2sd %eax,%xmm0
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <pop_int@plt>
jmp    11d7 <main+0x47>
jmp    121b <main+0x8b>
mov    $0x0,%al
call   1090 <is_empty_float@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1237 <main+0xa7>
jmp    1256 <main+0xc6>
mov    $0x0,%al
call   1080 <top_float@plt>
lea    0xdd7(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <pop_float@plt>
jmp    121b <main+0x8b>
mov    0x2d83(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   10b0 <push_int@plt>
mov    $0x16,%edi
call   10b0 <push_int@plt>
mov    $0xf,%edi
call   10b0 <push_int@plt>
movsd  0xe49(%rip),%xmm0
call   1030 <push_float@plt>
movsd  0xe44(%rip),%xmm0
call   1030 <push_float@plt>
xor    %eax,%eax
call   1070 <is_empty_int@plt>
test   %eax,%eax
jne    1208 <main+0x78>
lea    0xe35(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <top_int@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10a0 <pop_int@plt>
xor    %eax,%eax
call   1070 <is_empty_int@plt>
test   %eax,%eax
je     11e0 <main+0x50>
xor    %eax,%eax
call   1090 <is_empty_float@plt>
test   %eax,%eax
jne    1241 <main+0xb1>
lea    0xe02(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <top_float@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <pop_float@plt>
xor    %eax,%eax
call   1090 <is_empty_float@plt>
test   %eax,%eax
je     1220 <main+0x90>
mov    0x2d98(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Popping %d\0A\00"
@.str.1 = [12 x i8] c"Popping %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @push_int(i32 5)
%3 = call i32 @push_int(i32 22)
%4 = call i32 @push_int(i32 15)
%5 = call i32 @push_float(double 2.530000e+01)
%6 = call i32 @push_float(double -4.050000e+01)
br label %7
7: ; preds = %11, %0
%8 = call i32 (...) @is_empty_int()
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 (...) @top_int()
%13 = sitofp i32 %12 to double
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %13)
%15 = call i32 (...) @pop_int()
br label %7
16: ; preds = %7
br label %17
17: ; preds = %21, %16
%18 = call i32 (...) @is_empty_float()
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = call double (...) @top_float()
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = call i32 (...) @pop_float()
br label %17
25: ; preds = %17
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@.str = [12 x i8] c"Popping %d\0A\00"
@.str.1 = [12 x i8] c"Popping %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @push_int(i32 5)
%2 = tail call i32 @push_int(i32 22)
%3 = tail call i32 @push_int(i32 15)
%4 = tail call i32 @push_float(double 2.530000e+01)
%5 = tail call i32 @push_float(double -4.050000e+01)
%6 = tail call i32 (...) @is_empty_int()
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %11, %0
%9 = tail call i32 (...) @is_empty_float()
%10 = icmp eq i32 %9, 0
br i1 %10, label %18, label %24
11: ; preds = %0, %11
%12 = tail call i32 (...) @top_int()
%13 = sitofp i32 %12 to double
%14 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %13)
%15 = tail call i32 (...) @pop_int()
%16 = tail call i32 (...) @is_empty_int()
%17 = icmp eq i32 %16, 0
br i1 %17, label %11, label %8
18: ; preds = %8, %18
%19 = tail call double (...) @top_float()
%20 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = tail call i32 (...) @pop_float()
%22 = tail call i32 (...) @is_empty_float()
%23 = icmp eq i32 %22, 0
br i1 %23, label %18, label %24
24: ; preds = %18, %8
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}