#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 */
scalar_t__ EOF;
scalar_t__ pop(float *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ push(float);
scalar_t__ scanf(char *, float *);
int main() {
  float data;
  while (((scanf("%f", &data)) != EOF) && (push(data) != 0))
    ;
  while ((pop(&data)) != 0)
    printf("%.2f ", data);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e7d(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     118b <main+0x4b>
movss  -0x8(%rbp),%xmm0
call   1060 <push@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    119b <main+0x5b>
jmp    11a0 <main+0x60>
jmp    114f <main+0xf>
jmp    11a5 <main+0x65>
lea    -0x8(%rbp),%rdi
call   1040 <pop@plt>
cmp    $0x0,%rax
je     11d4 <main+0x94>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11a5 <main+0x65>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea0(%rip),%r14
lea    0xc(%rsp),%r15
mov    0x2e7c(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
cmp    (%rbx),%rax
je     1190 <main+0x40>
movss  0xc(%rsp),%xmm0
call   1070 <push@plt>
test   %rax,%rax
jne    1170 <main+0x20>
lea    0xc(%rsp),%rdi
call   1050 <pop@plt>
test   %rax,%rax
je     11d1 <main+0x81>
lea    0xe5d(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <pop@plt>
test   %rax,%rax
jne    11b0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%.2f \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load float, float* %2
%9 = call i64 @push(float %8)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %3
14: ; preds = %11
br label %15
15: ; preds = %18, %14
%16 = call i64 @pop(float* %2)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %20)
br label %15
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%.2f \00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %7, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load float, float* %1
%9 = call i64 @push(float %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = call i64 @pop(float* %1)
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %11, %14
%15 = load float, float* %1
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = call i64 @pop(float* %1)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %14
20: ; preds = %14, %11
%21 = call i32 @putchar(i32 10)
ret i32 0
}