#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 fabs(double);
double parse_expression(char *);
int /*<<< orphan*/ printf(char *, ...);
void run_boolean_not_tests() {
  int result = 1;
  printf("Testing boolean not:\n");
  {
    double c_value, p_value;
    c_value = (double)0.0;
    p_value = parse_expression("0.0");
    printf("  '%s'\n", "0.0");
    if (fabs(c_value - p_value) > (1e-10)) {
      *&result = 0;
      printf("         C: %f\n", c_value);
      printf("    Parsed: %f\n", p_value);
    }
  };
  {
    double c_value, p_value;
    c_value = (double)2.0;
    p_value = parse_expression("2.0");
    printf("  '%s'\n", "2.0");
    if (fabs(c_value - p_value) > (1e-10)) {
      *&result = 0;
      printf("         C: %f\n", c_value);
      printf("    Parsed: %f\n", p_value);
    }
  };
  {
    double c_value, p_value;
    c_value = (double)!0.0;
    p_value = parse_expression("!0.0");
    printf("  '%s'\n", "!0.0");
    if (fabs(c_value - p_value) > (1e-10)) {
      *&result = 0;
      printf("         C: %f\n", c_value);
      printf("    Parsed: %f\n", p_value);
    }
  };
  {
    double c_value, p_value;
    c_value = (double)!3.0;
    p_value = parse_expression("!3.0");
    printf("  '%s'\n", "!3.0");
    if (fabs(c_value - p_value) > (1e-10)) {
      *&result = 0;
      printf("         C: %f\n", c_value);
      printf("    Parsed: %f\n", p_value);
    }
  };
  printf("%s\n\n", result ? "passed" : "failed");
}


x86 assembly (clang, -O0):
<run_boolean_not_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeff(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xec1(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe6a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11cd <run_boolean_not_tests+0x9d>
movl   $0x0,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xe75(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x28(%rbp)
lea    0xe3c(%rip),%rdi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xde5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1252 <run_boolean_not_tests+0x122>
movl   $0x0,-0x4(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xdfe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xdfb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xdb6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xdf4(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x38(%rbp)
lea    0xdb7(%rip),%rdi
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd60(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12d7 <run_boolean_not_tests+0x1a7>
movl   $0x0,-0x4(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xd79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xd76(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0xd79(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x48(%rbp)
lea    0xd37(%rip),%rdi
lea    0xd61(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xce0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1357 <run_boolean_not_tests+0x227>
movl   $0x0,-0x4(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xcf9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xcf6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0xd0f(%rip),%rsi
lea    0xd01(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xcee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_boolean_not_tests>:
push   %rbp
push   %rbx
push   %rax
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xea6(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xorpd  %xmm0,%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    11af <run_boolean_not_tests+0x6f>
lea    0xe89(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11b4 <run_boolean_not_tests+0x74>
mov    $0x1,%ebp
lea    0xe7d(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xe41(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe1f(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    121a <run_boolean_not_tests+0xda>
lea    0xe22(%rip),%rdi
movsd  0xe02(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe1c(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xe1b(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xddb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xdc1(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    1280 <run_boolean_not_tests+0x140>
lea    0xdbc(%rip),%rdi
movsd  0xda4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdb6(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xdba(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xd75(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xorpd  %xmm0,%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    12e5 <run_boolean_not_tests+0x1a5>
lea    0xd5a(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd58(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd6f(%rip),%rsi
jmp    12f0 <run_boolean_not_tests+0x1b0>
test   %ebp,%ebp
je     12dc <run_boolean_not_tests+0x19c>
lea    0xd5b(%rip),%rsi
lea    0xd4f(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Testing boolean not:\0A\00"
@.str.1 = [4 x i8] c"0.0\00"
@.str.2 = [8 x i8] c" '%s'\0A\00"
@.str.3 = [16 x i8] c" C: %f\0A\00"
@.str.4 = [16 x i8] c" Parsed: %f\0A\00"
@.str.5 = [4 x i8] c"2.0\00"
@.str.6 = [5 x i8] c"!0.0\00"
@.str.7 = [5 x i8] c"!3.0\00"
@.str.8 = [5 x i8] c"%s\0A\0A\00"
@.str.9 = [7 x i8] c"passed\00"
@.str.10 = [7 x i8] c"failed\00"
define void @run_boolean_not_tests() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 1, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %2
%11 = call double @parse_expression(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store double %11, double* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = load double, double* %2
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = call i32 @fabs(double %15)
%17 = sitofp i32 %16 to double
%18 = fcmp ogt double %17, 1.000000e-10
br i1 %18, label %19, label %24
19: ; preds = %0
store i32 0, i32* %1
%20 = load double, double* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %20)
%22 = load double, double* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %22)
br label %24
24: ; preds = %19, %0
store double 2.000000e+00, double* %4
%25 = call double @parse_expression(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store double %25, double* %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%27 = load double, double* %4
%28 = load double, double* %5
%29 = fsub double %27, %28
%30 = call i32 @fabs(double %29)
%31 = sitofp i32 %30 to double
%32 = fcmp ogt double %31, 1.000000e-10
br i1 %32, label %33, label %38
33: ; preds = %24
store i32 0, i32* %1
%34 = load double, double* %4
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %34)
%36 = load double, double* %5
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %36)
br label %38
38: ; preds = %33, %24
store double 1.000000e+00, double* %6
%39 = call double @parse_expression(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store double %39, double* %7
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%41 = load double, double* %6
%42 = load double, double* %7
%43 = fsub double %41, %42
%44 = call i32 @fabs(double %43)
%45 = sitofp i32 %44 to double
%46 = fcmp ogt double %45, 1.000000e-10
br i1 %46, label %47, label %52
47: ; preds = %38
store i32 0, i32* %1
%48 = load double, double* %6
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %48)
%50 = load double, double* %7
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %50)
br label %52
52: ; preds = %47, %38
store double 0.000000e+00, double* %8
%53 = call double @parse_expression(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
store double %53, double* %9
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%55 = load double, double* %8
%56 = load double, double* %9
%57 = fsub double %55, %56
%58 = call i32 @fabs(double %57)
%59 = sitofp i32 %58 to double
%60 = fcmp ogt double %59, 1.000000e-10
br i1 %60, label %61, label %66
61: ; preds = %52
store i32 0, i32* %1
%62 = load double, double* %8
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %62)
%64 = load double, double* %9
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %64)
br label %66
66: ; preds = %61, %52
%67 = load i32, i32* %1
%68 = icmp ne i32 %67, 0
%69 = zext i1 %68 to i64
%70 = select i1 %68, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %70)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"0.0\00"
@.str.2 = [8 x i8] c" '%s'\0A\00"
@.str.3 = [16 x i8] c" C: %f\0A\00"
@.str.4 = [16 x i8] c" Parsed: %f\0A\00"
@.str.5 = [4 x i8] c"2.0\00"
@.str.6 = [5 x i8] c"!0.0\00"
@.str.7 = [5 x i8] c"!3.0\00"
@.str.8 = [5 x i8] c"%s\0A\0A\00"
@.str.9 = [7 x i8] c"passed\00"
@.str.10 = [7 x i8] c"failed\00"
@str = [21 x i8] c"Testing boolean not:\00"
define void @run_boolean_not_tests() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call double @parse_expression(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = fsub double 0.000000e+00, %2
%5 = tail call i32 @fabs(double %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double 0.000000e+00)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %2)
br label %10
10: ; preds = %7, %0
%11 = phi i32 [ 0, %7 ], [ 1, %0 ]
%12 = tail call double @parse_expression(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%14 = fsub double 2.000000e+00, %12
%15 = tail call i32 @fabs(double %14)
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double 2.000000e+00)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %12)
br label %20
20: ; preds = %17, %10
%21 = phi i32 [ 0, %17 ], [ %11, %10 ]
%22 = tail call double @parse_expression(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%24 = fsub double 1.000000e+00, %22
%25 = tail call i32 @fabs(double %24)
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %20
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double 1.000000e+00)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %22)
br label %30
30: ; preds = %27, %20
%31 = phi i32 [ 0, %27 ], [ %21, %20 ]
%32 = tail call double @parse_expression(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%34 = fsub double 0.000000e+00, %32
%35 = tail call i32 @fabs(double %34)
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double 0.000000e+00)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %32)
br label %42
40: ; preds = %30
%41 = icmp eq i32 %31, 0
br i1 %41, label %42, label %43
42: ; preds = %37, %40
br label %43
43: ; preds = %40, %42
%44 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), %42 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), %40 ]
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %44)
ret void
}