#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*/ assert(int);
double gettop();
double pop();
int /*<<< orphan*/ push(double);
int /*<<< orphan*/ swap();
int main(int argc, char *argv[]) {
  double n1 = 12.34;
  double n2 = 56.2;
  double n3 = -78.9;
  push(n1);
  push(n2);
  assert(pop() == n2);
  push(n3);
  assert(pop() == n3);
  assert(pop() == n1);
  push(n1);
  push(n2);
  assert(gettop() == n2);
  swap();
  assert(pop() == n1);
  assert(pop() == n2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe94(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <push@plt>
movsd  -0x20(%rbp),%xmm0
call   1060 <push@plt>
mov    $0x0,%al
call   1030 <pop@plt>
ucomisd -0x20(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x28(%rbp),%xmm0
call   1060 <push@plt>
mov    $0x0,%al
call   1030 <pop@plt>
ucomisd -0x28(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <pop@plt>
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x18(%rbp),%xmm0
call   1060 <push@plt>
movsd  -0x20(%rbp),%xmm0
call   1060 <push@plt>
mov    $0x0,%al
call   1040 <gettop@plt>
ucomisd -0x20(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1070 <swap@plt>
mov    $0x0,%al
call   1030 <pop@plt>
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <pop@plt>
ucomisd -0x20(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xea7(%rip),%xmm0
call   1060 <push@plt>
movsd  0xea2(%rip),%xmm0
call   1060 <push@plt>
xor    %eax,%eax
call   1030 <pop@plt>
cmpeqsd 0xe8d(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
movsd  0xe80(%rip),%xmm0
call   1060 <push@plt>
xor    %eax,%eax
call   1030 <pop@plt>
cmpeqsd 0xe6b(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1030 <pop@plt>
cmpeqsd 0xe3e(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
movsd  0xe29(%rip),%xmm0
call   1060 <push@plt>
movsd  0xe24(%rip),%xmm0
call   1060 <push@plt>
xor    %eax,%eax
call   1040 <gettop@plt>
cmpeqsd 0xe0f(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1070 <swap@plt>
xor    %eax,%eax
call   1030 <pop@plt>
cmpeqsd 0xde3(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1030 <pop@plt>
cmpeqsd 0xdce(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
store double 1.234000e+01, double* %5
store double 5.620000e+01, double* %6
store double -7.890000e+01, double* %7
%8 = load double, double* %5
%9 = call i32 @push(double %8)
%10 = load double, double* %6
%11 = call i32 @push(double %10)
%12 = call double (...) @pop()
%13 = load double, double* %6
%14 = fcmp oeq double %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load double, double* %7
%18 = call i32 @push(double %17)
%19 = call double (...) @pop()
%20 = load double, double* %7
%21 = fcmp oeq double %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call double (...) @pop()
%25 = load double, double* %5
%26 = fcmp oeq double %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load double, double* %5
%30 = call i32 @push(double %29)
%31 = load double, double* %6
%32 = call i32 @push(double %31)
%33 = call double (...) @gettop()
%34 = load double, double* %6
%35 = fcmp oeq double %33, %34
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i32 (...) @swap()
%39 = call double (...) @pop()
%40 = load double, double* %5
%41 = fcmp oeq double %39, %40
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = call double (...) @pop()
%45 = load double, double* %6
%46 = fcmp oeq double %44, %45
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @push(double 1.234000e+01)
%4 = tail call i32 @push(double 5.620000e+01)
%5 = tail call double (...) @pop()
%6 = fcmp oeq double %5, 5.620000e+01
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @push(double -7.890000e+01)
%10 = tail call double (...) @pop()
%11 = fcmp oeq double %10, -7.890000e+01
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call double (...) @pop()
%15 = fcmp oeq double %14, 1.234000e+01
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @push(double 1.234000e+01)
%19 = tail call i32 @push(double 5.620000e+01)
%20 = tail call double (...) @gettop()
%21 = fcmp oeq double %20, 5.620000e+01
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = tail call i32 (...) @swap()
%25 = tail call double (...) @pop()
%26 = fcmp oeq double %25, 1.234000e+01
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call double (...) @pop()
%30 = fcmp oeq double %29, 5.620000e+01
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
ret i32 0
}