#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 EOF;
int /*<<< orphan*/ fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int scanf(char *, double *);
int /*<<< orphan*/ stdin;
int main(void) {
  double d;
  int check = 0;
  while (check != EOF) {
    if (!check)
      fpurge(stdin);
    else
      printf("%f\n", d);
    check = scanf("%lf", &d);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
je     119e <main+0x6e>
cmpl   $0x0,-0x14(%rbp)
jne    1175 <main+0x45>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <fpurge@plt>
jmp    1186 <main+0x56>
movsd  -0x10(%rbp),%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%r12
cmpl   $0x0,(%r12)
je     119e <main+0x6e>
xor    %eax,%eax
mov    0x2e94(%rip),%r13
lea    0xea9(%rip),%r14
lea    0x8(%rsp),%rbx
lea    0xe99(%rip),%r15
jmp    118f <main+0x5f>
nopl   0x0(%rax)
movsd  0x8(%rsp),%xmm0
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%eax
je     119e <main+0x6e>
test   %eax,%eax
jne    1170 <main+0x40>
mov    0x0(%r13),%edi
call   1050 <fpurge@plt>
jmp    117e <main+0x4e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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