#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_logical_tests() {
  int result = 1;
  printf("Testing boolean logical operations:\n");
  {
    double c_value, p_value;
    c_value = (double)2.0 && 3.0;
    p_value = parse_expression("2.0 && 3.0");
    printf("  '%s'\n", "2.0 && 3.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 && 0.0;
    p_value = parse_expression("2.0 && 0.0");
    printf("  '%s'\n", "2.0 && 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)0.0 && 3.0;
    p_value = parse_expression("0.0 && 3.0");
    printf("  '%s'\n", "0.0 && 3.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 && 0.0;
    p_value = parse_expression("0.0 && 0.0");
    printf("  '%s'\n", "0.0 && 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 || 3.0;
    p_value = parse_expression("2.0 || 3.0");
    printf("  '%s'\n", "2.0 || 3.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 || 0.0;
    p_value = parse_expression("2.0 || 0.0");
    printf("  '%s'\n", "2.0 || 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)0.0 || 3.0;
    p_value = parse_expression("0.0 || 3.0");
    printf("  '%s'\n", "0.0 || 3.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 || 0.0;
    p_value = parse_expression("0.0 || 0.0");
    printf("  '%s'\n", "0.0 || 0.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_logical_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x89(%rbp)
jne    1168 <run_boolean_logical_tests+0x38>
jmp    1175 <run_boolean_logical_tests+0x45>
mov    $0x1,%al
mov    %al,-0x89(%rbp)
jmp    1175 <run_boolean_logical_tests+0x45>
mov    -0x89(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe85(%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  0xe36(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1201 <run_boolean_logical_tests+0xd1>
movl   $0x0,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe59(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x8a(%rbp)
jne    1219 <run_boolean_logical_tests+0xe9>
jmp    1226 <run_boolean_logical_tests+0xf6>
xor    %eax,%eax
mov    %al,-0x8a(%rbp)
jmp    1226 <run_boolean_logical_tests+0xf6>
mov    -0x8a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xe1f(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x28(%rbp)
lea    0xde6(%rip),%rdi
lea    0xe07(%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  0xd85(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12b2 <run_boolean_logical_tests+0x182>
movl   $0x0,-0x4(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xda8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xda5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
test   $0x1,%al
mov    %al,-0x8b(%rbp)
jne    12c7 <run_boolean_logical_tests+0x197>
jmp    12d4 <run_boolean_logical_tests+0x1a4>
mov    $0x1,%al
mov    %al,-0x8b(%rbp)
jmp    12d4 <run_boolean_logical_tests+0x1a4>
mov    -0x8b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xd7c(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x38(%rbp)
lea    0xd38(%rip),%rdi
lea    0xd64(%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  0xcd7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1360 <run_boolean_logical_tests+0x230>
movl   $0x0,-0x4(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xcfa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xcf7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
test   $0x1,%al
mov    %al,-0x8c(%rbp)
jne    1375 <run_boolean_logical_tests+0x245>
jmp    1382 <run_boolean_logical_tests+0x252>
xor    %eax,%eax
mov    %al,-0x8c(%rbp)
jmp    1382 <run_boolean_logical_tests+0x252>
mov    -0x8c(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0xcd9(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x48(%rbp)
lea    0xc8a(%rip),%rdi
lea    0xcc1(%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  0xc29(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    140e <run_boolean_logical_tests+0x2de>
movl   $0x0,-0x4(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xc4c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xc49(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x8d(%rbp)
jne    1430 <run_boolean_logical_tests+0x300>
jmp    1423 <run_boolean_logical_tests+0x2f3>
mov    $0x1,%al
mov    %al,-0x8d(%rbp)
jmp    1430 <run_boolean_logical_tests+0x300>
mov    -0x8d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
lea    0xc36(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x58(%rbp)
lea    0xbdc(%rip),%rdi
lea    0xc1e(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xb7b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14bc <run_boolean_logical_tests+0x38c>
movl   $0x0,-0x4(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xb9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x58(%rbp),%xmm0
lea    0xb9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x8e(%rbp)
jne    14de <run_boolean_logical_tests+0x3ae>
jmp    14d1 <run_boolean_logical_tests+0x3a1>
xor    %eax,%eax
mov    %al,-0x8e(%rbp)
jmp    14de <run_boolean_logical_tests+0x3ae>
mov    -0x8e(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
lea    0xb93(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x68(%rbp)
lea    0xb2e(%rip),%rdi
lea    0xb7b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x60(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xacd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    156a <run_boolean_logical_tests+0x43a>
movl   $0x0,-0x4(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xaf0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x68(%rbp),%xmm0
lea    0xaed(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%al
xor    %ecx,%ecx
test   $0x1,%cl
mov    %al,-0x8f(%rbp)
jne    158f <run_boolean_logical_tests+0x45f>
jmp    1582 <run_boolean_logical_tests+0x452>
mov    $0x1,%al
mov    %al,-0x8f(%rbp)
jmp    158f <run_boolean_logical_tests+0x45f>
mov    -0x8f(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
lea    0xaed(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x78(%rbp)
lea    0xa7d(%rip),%rdi
lea    0xad5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x70(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xa1c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    161b <run_boolean_logical_tests+0x4eb>
movl   $0x0,-0x4(%rbp)
movsd  -0x70(%rbp),%xmm0
lea    0xa3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x78(%rbp),%xmm0
lea    0xa3c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%al
xor    %ecx,%ecx
test   $0x1,%cl
mov    %al,-0x90(%rbp)
jne    1640 <run_boolean_logical_tests+0x510>
jmp    1633 <run_boolean_logical_tests+0x503>
xor    %eax,%eax
mov    %al,-0x90(%rbp)
jmp    1640 <run_boolean_logical_tests+0x510>
mov    -0x90(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
lea    0xa47(%rip),%rdi
call   1050 <parse_expression@plt>
movsd  %xmm0,-0x88(%rbp)
ff
lea    0x9c9(%rip),%rdi
lea    0xa2c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x80(%rbp),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0x965(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    16d5 <run_boolean_logical_tests+0x5a5>
movl   $0x0,-0x4(%rbp)
movsd  -0x80(%rbp),%xmm0
lea    0x988(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x88(%rbp),%xmm0
ff
lea    0x982(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0x9da(%rip),%rsi
lea    0x9cc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0x9b9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_boolean_logical_tests>:
push   %rbp
push   %rbx
push   %rax
lea    0xf51(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xea9(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe82(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    11b7 <run_boolean_logical_tests+0x77>
lea    0xe88(%rip),%rdi
movsd  0xe65(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11bc <run_boolean_logical_tests+0x7c>
mov    $0x1,%ebp
lea    0xe78(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xe3c(%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    121a <run_boolean_logical_tests+0xda>
lea    0xe21(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe1f(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xe25(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xdde(%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    1278 <run_boolean_logical_tests+0x138>
lea    0xdc3(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdc1(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xdd2(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xd80(%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    12d6 <run_boolean_logical_tests+0x196>
lea    0xd65(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd63(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xd7f(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xd22(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xcfd(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    133c <run_boolean_logical_tests+0x1fc>
lea    0xd03(%rip),%rdi
movsd  0xce0(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xcfd(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xd24(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xcbc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xc97(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    13a2 <run_boolean_logical_tests+0x262>
lea    0xc9d(%rip),%rdi
movsd  0xc7a(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xc97(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xcc9(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xc56(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xc31(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1050 <fabs@plt>
test   %eax,%eax
jle    1408 <run_boolean_logical_tests+0x2c8>
lea    0xc37(%rip),%rdi
movsd  0xc14(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xc31(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xc6e(%rip),%rbx
mov    %rbx,%rdi
call   1060 <parse_expression@plt>
movsd  %xmm0,(%rsp)
lea    0xbf0(%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    146d <run_boolean_logical_tests+0x32d>
lea    0xbd5(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xbd3(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xc29(%rip),%rsi
jmp    1478 <run_boolean_logical_tests+0x338>
test   %ebp,%ebp
je     1464 <run_boolean_logical_tests+0x324>
lea    0xc15(%rip),%rsi
lea    0xc09(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Testing boolean logical operations:\0A\00"
@.str.1 = [11 x i8] c"2.0 && 3.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 = [11 x i8] c"2.0 && 0.0\00"
@.str.6 = [11 x i8] c"0.0 && 3.0\00"
@.str.7 = [11 x i8] c"0.0 && 0.0\00"
@.str.8 = [11 x i8] c"2.0 || 3.0\00"
@.str.9 = [11 x i8] c"2.0 || 0.0\00"
@.str.10 = [11 x i8] c"0.0 || 3.0\00"
@.str.11 = [11 x i8] c"0.0 || 0.0\00"
@.str.12 = [5 x i8] c"%s\0A\0A\00"
@.str.13 = [7 x i8] c"passed\00"
@.str.14 = [7 x i8] c"failed\00"
define void @run_boolean_logical_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
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32 1, i32* %1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br i1 true, label %19, label %20
19: ; preds = %0
br label %20
20: ; preds = %19, %0
%21 = phi i1 [ false, %0 ], [ true, %19 ]
%22 = zext i1 %21 to i32
%23 = sitofp i32 %22 to double
store double %23, double* %2
%24 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store double %24, double* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%26 = load double, double* %2
%27 = load double, double* %3
%28 = fsub double %26, %27
%29 = call i32 @fabs(double %28)
%30 = sitofp i32 %29 to double
%31 = fcmp ogt double %30, 1.000000e-10
br i1 %31, label %32, label %37
32: ; preds = %20
store i32 0, i32* %1
%33 = load double, double* %2
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %33)
%35 = load double, double* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %35)
br label %37
37: ; preds = %32, %20
br i1 true, label %38, label %39
38: ; preds = %37
br label %39
39: ; preds = %38, %37
%40 = phi i1 [ false, %37 ], [ false, %38 ]
%41 = zext i1 %40 to i32
%42 = sitofp i32 %41 to double
store double %42, double* %4
%43 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store double %43, double* %5
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%45 = load double, double* %4
%46 = load double, double* %5
%47 = fsub double %45, %46
%48 = call i32 @fabs(double %47)
%49 = sitofp i32 %48 to double
%50 = fcmp ogt double %49, 1.000000e-10
br i1 %50, label %51, label %56
51: ; preds = %39
store i32 0, i32* %1
%52 = load double, double* %4
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %52)
%54 = load double, double* %5
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %54)
br label %56
56: ; preds = %51, %39
br i1 false, label %57, label %58
57: ; preds = %56
br label %58
58: ; preds = %57, %56
%59 = phi i1 [ false, %56 ], [ true, %57 ]
%60 = zext i1 %59 to i32
%61 = sitofp i32 %60 to double
store double %61, double* %6
%62 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
store double %62, double* %7
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%64 = load double, double* %6
%65 = load double, double* %7
%66 = fsub double %64, %65
%67 = call i32 @fabs(double %66)
%68 = sitofp i32 %67 to double
%69 = fcmp ogt double %68, 1.000000e-10
br i1 %69, label %70, label %75
70: ; preds = %58
store i32 0, i32* %1
%71 = load double, double* %6
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %71)
%73 = load double, double* %7
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %73)
br label %75
75: ; preds = %70, %58
br i1 false, label %76, label %77
76: ; preds = %75
br label %77
77: ; preds = %76, %75
%78 = phi i1 [ false, %75 ], [ false, %76 ]
%79 = zext i1 %78 to i32
%80 = sitofp i32 %79 to double
store double %80, double* %8
%81 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store double %81, double* %9
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%83 = load double, double* %8
%84 = load double, double* %9
%85 = fsub double %83, %84
%86 = call i32 @fabs(double %85)
%87 = sitofp i32 %86 to double
%88 = fcmp ogt double %87, 1.000000e-10
br i1 %88, label %89, label %94
89: ; preds = %77
store i32 0, i32* %1
%90 = load double, double* %8
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %90)
%92 = load double, double* %9
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %92)
br label %94
94: ; preds = %89, %77
br i1 true, label %96, label %95
95: ; preds = %94
br label %96
96: ; preds = %95, %94
%97 = phi i1 [ true, %94 ], [ true, %95 ]
%98 = zext i1 %97 to i32
%99 = sitofp i32 %98 to double
store double %99, double* %10
%100 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
store double %100, double* %11
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%102 = load double, double* %10
%103 = load double, double* %11
%104 = fsub double %102, %103
%105 = call i32 @fabs(double %104)
%106 = sitofp i32 %105 to double
%107 = fcmp ogt double %106, 1.000000e-10
br i1 %107, label %108, label %113
108: ; preds = %96
store i32 0, i32* %1
%109 = load double, double* %10
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %109)
%111 = load double, double* %11
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %111)
br label %113
113: ; preds = %108, %96
br i1 true, label %115, label %114
114: ; preds = %113
br label %115
115: ; preds = %114, %113
%116 = phi i1 [ true, %113 ], [ false, %114 ]
%117 = zext i1 %116 to i32
%118 = sitofp i32 %117 to double
store double %118, double* %12
%119 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
store double %119, double* %13
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%121 = load double, double* %12
%122 = load double, double* %13
%123 = fsub double %121, %122
%124 = call i32 @fabs(double %123)
%125 = sitofp i32 %124 to double
%126 = fcmp ogt double %125, 1.000000e-10
br i1 %126, label %127, label %132
127: ; preds = %115
store i32 0, i32* %1
%128 = load double, double* %12
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %128)
%130 = load double, double* %13
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %130)
br label %132
132: ; preds = %127, %115
br i1 false, label %134, label %133
133: ; preds = %132
br label %134
134: ; preds = %133, %132
%135 = phi i1 [ true, %132 ], [ true, %133 ]
%136 = zext i1 %135 to i32
%137 = sitofp i32 %136 to double
store double %137, double* %14
%138 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
store double %138, double* %15
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%140 = load double, double* %14
%141 = load double, double* %15
%142 = fsub double %140, %141
%143 = call i32 @fabs(double %142)
%144 = sitofp i32 %143 to double
%145 = fcmp ogt double %144, 1.000000e-10
br i1 %145, label %146, label %151
146: ; preds = %134
store i32 0, i32* %1
%147 = load double, double* %14
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %147)
%149 = load double, double* %15
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %149)
br label %151
151: ; preds = %146, %134
br i1 false, label %153, label %152
152: ; preds = %151
br label %153
153: ; preds = %152, %151
%154 = phi i1 [ true, %151 ], [ false, %152 ]
%155 = zext i1 %154 to i32
%156 = sitofp i32 %155 to double
store double %156, double* %16
%157 = call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
store double %157, double* %17
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%159 = load double, double* %16
%160 = load double, double* %17
%161 = fsub double %159, %160
%162 = call i32 @fabs(double %161)
%163 = sitofp i32 %162 to double
%164 = fcmp ogt double %163, 1.000000e-10
br i1 %164, label %165, label %170
165: ; preds = %153
store i32 0, i32* %1
%166 = load double, double* %16
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %166)
%168 = load double, double* %17
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %168)
br label %170
170: ; preds = %165, %153
%171 = load i32, i32* %1
%172 = icmp ne i32 %171, 0
%173 = zext i1 %172 to i64
%174 = select i1 %172, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0)
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* %174)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"2.0 && 3.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 = [11 x i8] c"2.0 && 0.0\00"
@.str.6 = [11 x i8] c"0.0 && 3.0\00"
@.str.7 = [11 x i8] c"0.0 && 0.0\00"
@.str.8 = [11 x i8] c"2.0 || 3.0\00"
@.str.9 = [11 x i8] c"2.0 || 0.0\00"
@.str.10 = [11 x i8] c"0.0 || 3.0\00"
@.str.11 = [11 x i8] c"0.0 || 0.0\00"
@.str.12 = [5 x i8] c"%s\0A\0A\00"
@.str.13 = [7 x i8] c"passed\00"
@.str.14 = [7 x i8] c"failed\00"
@str = [36 x i8] c"Testing boolean logical operations:\00"
define void @run_boolean_logical_tests() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 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 ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = fsub double 1.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 1.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 ([11 x i8], [11 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 ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%14 = fsub double 0.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 0.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 ([11 x i8], [11 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 ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%24 = fsub double 0.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 0.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 ([11 x i8], [11 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 ([11 x i8], [11 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 %40
40: ; preds = %37, %30
%41 = phi i32 [ 0, %37 ], [ %31, %30 ]
%42 = tail call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%43 = 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 ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%44 = fsub double 1.000000e+00, %42
%45 = tail call i32 @fabs(double %44)
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %40
%48 = 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)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %42)
br label %50
50: ; preds = %47, %40
%51 = phi i32 [ 0, %47 ], [ %41, %40 ]
%52 = tail call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%53 = 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 ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%54 = fsub double 1.000000e+00, %52
%55 = tail call i32 @fabs(double %54)
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %50
%58 = 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)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %52)
br label %60
60: ; preds = %57, %50
%61 = phi i32 [ 0, %57 ], [ %51, %50 ]
%62 = tail call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%63 = 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 ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%64 = fsub double 1.000000e+00, %62
%65 = tail call i32 @fabs(double %64)
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %60
%68 = 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)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %62)
br label %70
70: ; preds = %67, %60
%71 = phi i32 [ 0, %67 ], [ %61, %60 ]
%72 = tail call double @parse_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%73 = 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 ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%74 = fsub double 0.000000e+00, %72
%75 = tail call i32 @fabs(double %74)
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %70
%78 = 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)
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %72)
br label %82
80: ; preds = %70
%81 = icmp eq i32 %71, 0
br i1 %81, label %82, label %83
82: ; preds = %77, %80
br label %83
83: ; preds = %80, %82
%84 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), %82 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), %80 ]
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* %84)
ret void
}