#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 SignOfDouble(double);
int /*<<< orphan*/ printf(char *);
void TestSignOfDouble() {
  if (SignOfDouble(-15.0) == -1)
    printf("Test SignOfDouble: PASSED for -15.0\n");
  else
    printf("Test SignOfDouble: FAILED for -15.0\n");
  if (SignOfDouble(56.0) == 1)
    printf("Test SignOfDouble: PASSED for 56.0\n");
  else
    printf("Test SignOfDouble: FAILED for 56.0\n");
  if (SignOfDouble(0.0) == 0)
    printf("Test SignOfDouble: PASSED for 0.0\n");
  else
    printf("Test SignOfDouble: FAILED for 0.0\n");
}


x86 assembly (clang, -O0):
<TestSignOfDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
call   1040 <SignOfDouble@plt>
cmp    $0xffffffff,%eax
jne    114b <TestSignOfDouble+0x2b>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <TestSignOfDouble+0x37>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea9(%rip),%xmm0
call   1040 <SignOfDouble@plt>
cmp    $0x1,%eax
jne    117e <TestSignOfDouble+0x5e>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <TestSignOfDouble+0x6a>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
call   1040 <SignOfDouble@plt>
cmp    $0x0,%eax
jne    11ac <TestSignOfDouble+0x8c>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
jmp    11b8 <TestSignOfDouble+0x98>
lea    0xf12(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestSignOfDouble>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <SignOfDouble@plt>
cmp    $0xffffffff,%eax
lea    0xf86(%rip),%rax
lea    0xed1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xeb8(%rip),%xmm0
call   1040 <SignOfDouble@plt>
cmp    $0x1,%eax
lea    0xf3c(%rip),%rax
lea    0xece(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
call   1040 <SignOfDouble@plt>
test   %eax,%eax
lea    0xef9(%rip),%rax
lea    0xed0(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Test SignOfDouble: PASSED for -15.0\0A\00"
@.str.1 = [37 x i8] c"Test SignOfDouble: FAILED for -15.0\0A\00"
@.str.2 = [36 x i8] c"Test SignOfDouble: PASSED for 56.0\0A\00"
@.str.3 = [36 x i8] c"Test SignOfDouble: FAILED for 56.0\0A\00"
@.str.4 = [35 x i8] c"Test SignOfDouble: PASSED for 0.0\0A\00"
@.str.5 = [35 x i8] c"Test SignOfDouble: FAILED for 0.0\0A\00"
define void @TestSignOfDouble() {
%1 = call i32 @SignOfDouble(double -1.500000e+01)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = call i32 @SignOfDouble(double 5.600000e+01)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = call i32 @SignOfDouble(double 0.000000e+00)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Test SignOfDouble: FAILED for -15.0\00"
@str.6 = [35 x i8] c"Test SignOfDouble: FAILED for 56.0\00"
@str.7 = [34 x i8] c"Test SignOfDouble: FAILED for 0.0\00"
@str.8 = [34 x i8] c"Test SignOfDouble: PASSED for 0.0\00"
@str.9 = [35 x i8] c"Test SignOfDouble: PASSED for 56.0\00"
@str.10 = [36 x i8] c"Test SignOfDouble: PASSED for -15.0\00"
define void @TestSignOfDouble() {
%1 = tail call i32 @SignOfDouble(double -1.500000e+01)
%2 = icmp eq i32 %1, -1
%3 = select i1 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i32 @SignOfDouble(double 5.600000e+01)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = tail call i32 @SignOfDouble(double 0.000000e+00)
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.7, i64 0, i64 0)
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
ret void
}