#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double a, b, c;
  printf("Enter a, b and c, seperated by space: ");
  scanf("%lf %lf %lf", &a, &b, &c);
  if (a == 0 || b == 0 || c == 0) {
    printf("0\n");
  } else if (a > 0 && b > 0 && c > 0) {
    printf("+\n");
  } else if (a < 0 && b < 0 && c < 0) {
    printf("-\n");
  } else if ((a < 0 ^ b < 0) && c > 0) {
    printf("-");
  } else if (a > 0 && (b < 0 ^ c < 0)) {
    printf("-\n");
  } else {
    printf("+\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1170 <main+0x50>
jp     1170 <main+0x50>
jmp    11a5 <main+0x85>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118d <main+0x6d>
jp     118d <main+0x6d>
jmp    11a5 <main+0x85>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b6 <main+0x96>
jp     11b6 <main+0x96>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    12f6 <main+0x1d6>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11fd <main+0xdd>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11fd <main+0xdd>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11fd <main+0xdd>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    12f1 <main+0x1d1>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1238 <main+0x118>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1238 <main+0x118>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1238 <main+0x118>
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
jmp    12ec <main+0x1cc>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     1287 <main+0x167>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1287 <main+0x167>
lea    0xdbf(%rip),%rdi
call   1030 <printf@plt>
jmp    12e7 <main+0x1c7>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12d6 <main+0x1b6>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     12d6 <main+0x1b6>
lea    0xd6d(%rip),%rdi
call   1030 <printf@plt>
jmp    12e2 <main+0x1c2>
lea    0xd59(%rip),%rdi
call   1030 <printf@plt>
jmp    12e7 <main+0x1c7>
jmp    12ec <main+0x1cc>
jmp    12f1 <main+0x1d1>
jmp    12f6 <main+0x1d6>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    117b <main+0x3b>
jnp    11b9 <main+0x79>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm2,%xmm1
jne    1189 <main+0x49>
jnp    11b9 <main+0x79>
movsd  (%rsp),%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    119a <main+0x5a>
jnp    11b9 <main+0x79>
ucomisd %xmm3,%xmm0
jbe    11c2 <main+0x82>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm1
jbe    11c2 <main+0x82>
ucomisd %xmm3,%xmm2
jbe    11c2 <main+0x82>
lea    0xe7e(%rip),%rdi
jmp    11e3 <main+0xa3>
lea    0xe77(%rip),%rdi
jmp    11e3 <main+0xa3>
xorpd  %xmm3,%xmm3
ucomisd %xmm0,%xmm3
jbe    11ef <main+0xaf>
ucomisd %xmm1,%xmm3
jbe    11ef <main+0xaf>
xorpd  %xmm4,%xmm4
ucomisd %xmm2,%xmm4
jbe    11ef <main+0xaf>
lea    0xe50(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
ucomisd %xmm1,%xmm3
seta   %al
ucomisd %xmm0,%xmm3
seta   %cl
cmp    %al,%cl
je     1217 <main+0xd7>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jbe    1217 <main+0xd7>
mov    $0x2d,%edi
call   1030 <putchar@plt>
jmp    11e8 <main+0xa8>
xorpd  %xmm3,%xmm3
ucomisd %xmm2,%xmm3
seta   %al
ucomisd %xmm1,%xmm3
seta   %cl
ucomisd %xmm3,%xmm0
jbe    11b0 <main+0x70>
xor    %al,%cl
jne    11dc <main+0x9c>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@.str = [39 x i8] c"Enter a, b and c, seperated by space: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [3 x i8] c"0\0A\00"
@.str.3 = [3 x i8] c"+\0A\00"
@.str.4 = [3 x i8] c"-\0A\00"
@.str.5 = [2 x i8] c"-\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%7 = load double, double* %2
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %15, label %9
9: ; preds = %0
%10 = load double, double* %3
%11 = fcmp oeq double %10, 0.000000e+00
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load double, double* %4
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %12, %9, %0
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %73
17: ; preds = %12
%18 = load double, double* %2
%19 = fcmp ogt double %18, 0.000000e+00
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load double, double* %3
%22 = fcmp ogt double %21, 0.000000e+00
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load double, double* %4
%25 = fcmp ogt double %24, 0.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %72
28: ; preds = %23, %20, %17
%29 = load double, double* %2
%30 = fcmp olt double %29, 0.000000e+00
br i1 %30, label %31, label %39
31: ; preds = %28
%32 = load double, double* %3
%33 = fcmp olt double %32, 0.000000e+00
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = load double, double* %4
%36 = fcmp olt double %35, 0.000000e+00
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %71
39: ; preds = %34, %31, %28
%40 = load double, double* %2
%41 = fcmp olt double %40, 0.000000e+00
%42 = zext i1 %41 to i32
%43 = load double, double* %3
%44 = fcmp olt double %43, 0.000000e+00
%45 = zext i1 %44 to i32
%46 = xor i32 %42, %45
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %39
%49 = load double, double* %4
%50 = fcmp ogt double %49, 0.000000e+00
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %70
53: ; preds = %48, %39
%54 = load double, double* %2
%55 = fcmp ogt double %54, 0.000000e+00
br i1 %55, label %56, label %67
56: ; preds = %53
%57 = load double, double* %3
%58 = fcmp olt double %57, 0.000000e+00
%59 = zext i1 %58 to i32
%60 = load double, double* %4
%61 = fcmp olt double %60, 0.000000e+00
%62 = zext i1 %61 to i32
%63 = xor i32 %59, %62
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %56
%66 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %69
67: ; preds = %56, %53
%68 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %69
69: ; preds = %67, %65
br label %70
70: ; preds = %69, %51
br label %71
71: ; preds = %70, %37
br label %72
72: ; preds = %71, %26
br label %73
73: ; preds = %72, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Enter a, b and c, seperated by space: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@str.7 = [2 x i8] c"-\00"
@str.8 = [2 x i8] c"+\00"
@str.9 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = fcmp oeq double %9, 0.000000e+00
%11 = load double, double* %2
%12 = fcmp oeq double %11, 0.000000e+00
%13 = select i1 %10, i1 true, i1 %12
%14 = load double, double* %3
%15 = fcmp oeq double %14, 0.000000e+00
%16 = select i1 %13, i1 true, i1 %15
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0))
br label %47
19: ; preds = %0
%20 = fcmp ogt double %9, 0.000000e+00
%21 = fcmp ogt double %11, 0.000000e+00
%22 = select i1 %20, i1 %21, i1 false
%23 = fcmp ogt double %14, 0.000000e+00
%24 = select i1 %22, i1 %23, i1 false
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
br label %47
27: ; preds = %19
%28 = fcmp olt double %9, 0.000000e+00
%29 = fcmp olt double %11, 0.000000e+00
%30 = select i1 %28, i1 %29, i1 false
%31 = fcmp olt double %14, 0.000000e+00
%32 = select i1 %30, i1 %31, i1 false
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
br label %47
35: ; preds = %27
%36 = xor i1 %28, %29
%37 = select i1 %36, i1 %23, i1 false
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 @putchar(i32 45)
br label %47
40: ; preds = %35
%41 = xor i1 %29, %31
%42 = select i1 %20, i1 %41, i1 false
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
br label %47
45: ; preds = %40
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
br label %47
47: ; preds = %25, %38, %45, %43, %33, %17
ret i32 0
}