#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);
char getch();
int getfloat(double *);
int main(int argc, char *argv[]) {
  double d;
  assert(getfloat(&d));
  assert(d == 0.0);
  assert(getfloat(&d));
  assert(d == 0.0);
  assert(getfloat(&d));
  assert(d == 123.45);
  assert(getfloat(&d));
  assert(d == -123.45);
  assert(!getfloat(&d));
  assert(getch() == '+');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe50(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe15(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xorpd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xorpd  %xmm0,%xmm0
cmpeqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  0xe5d(%rip),%xmm0
cmpeqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  0xe3a(%rip),%xmm0
cmpeqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %edi,%edi
cmp    $0x2b,%al
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @getfloat(double* %5)
%7 = call i32 @assert(i32 %6)
%8 = load double, double* %5
%9 = fcmp oeq double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @getfloat(double* %5)
%13 = call i32 @assert(i32 %12)
%14 = load double, double* %5
%15 = fcmp oeq double %14, 0.000000e+00
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @getfloat(double* %5)
%19 = call i32 @assert(i32 %18)
%20 = load double, double* %5
%21 = fcmp oeq double %20, 1.234500e+02
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call i32 @getfloat(double* %5)
%25 = call i32 @assert(i32 %24)
%26 = load double, double* %5
%27 = fcmp oeq double %26, -1.234500e+02
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = call i32 @getfloat(double* %5)
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call signext i8 (...) @getch()
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 43
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @getfloat(double* %3)
%6 = call i32 @assert(i32 %5)
%7 = load double, double* %3
%8 = fcmp oeq double %7, 0.000000e+00
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @getfloat(double* %3)
%12 = call i32 @assert(i32 %11)
%13 = load double, double* %3
%14 = fcmp oeq double %13, 0.000000e+00
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @getfloat(double* %3)
%18 = call i32 @assert(i32 %17)
%19 = load double, double* %3
%20 = fcmp oeq double %19, 1.234500e+02
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @getfloat(double* %3)
%24 = call i32 @assert(i32 %23)
%25 = load double, double* %3
%26 = fcmp oeq double %25, -1.234500e+02
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 @getfloat(double* %3)
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call signext i8 (...) @getch()
%34 = icmp eq i8 %33, 43
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
ret i32 0
}