#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, char *, int, int, char *);
void print_results(int a, int b, int option) {
  char *op;
  int result;
  char *truthValue;
  switch (option) {
  case 1:
    op = "<";
    result = a < b;
    break;
  case 11:
    op = "<=";
    result = a <= b;
    break;
  case 2:
    op = ">";
    result = a > b;
    break;
  case 22:
    op = ">=";
    result = a >= b;
    break;
  case 3:
    op = "==";
    result = a == b;
    break;
  case 4:
    op = "!=";
    result = a != b;
    break;
  case 5:
    op = "&&";
    result = a && b;
    break;
  case 55:
    op = "&";
    result = a & b;
    break;
  case 6:
    op = "||";
    result = a || b;
    break;
  case 66:
    op = "|";
    result = a | b;
    break;
  }
  if (op != NULL) {
    truthValue = result != 0 ? "TRUE" : "FALSE";
    printf("\n%d %s %d evaluates to %d (%s)\n", a, op, b, result, truthValue);
  }
}


x86 assembly (clang, -O0):
<print_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x41,%eax
ja     12a5 <print_results+0x195>
mov    -0x30(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xf98(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xf7a(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xf5b(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xf3d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xf1f(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xf01(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x31(%rbp)
je     1234 <print_results+0x124>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x32(%rbp)
jne    1281 <print_results+0x171>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a5 <print_results+0x195>
lea    0xe84(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     12ea <print_results+0x1da>
mov    -0x1c(%rbp),%edx
lea    0xe69(%rip),%rax
lea    0xe5d(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_results>:
mov    %esi,%ecx
mov    %edi,%esi
add    $0xffffffff,%edx
lea    0xee2(%rip),%rax
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
xor    %r8d,%r8d
cmp    %ecx,%esi
setl   %r8b
lea    0xfd1(%rip),%rdx
jmp    11e2 <print_results+0xd2>
mov    %ecx,%r8d
or     %esi,%r8d
lea    0xfd3(%rip),%rdx
jmp    11e2 <print_results+0xd2>
test   %esi,%esi
setne  %al
test   %ecx,%ecx
setne  %dl
and    %al,%dl
movzbl %dl,%r8d
lea    0xfb3(%rip),%rdx
jmp    11e2 <print_results+0xd2>
xor    %r8d,%r8d
cmp    %ecx,%esi
sete   %r8b
lea    0xf9b(%rip),%rdx
jmp    11e2 <print_results+0xd2>
xor    %r8d,%r8d
cmp    %ecx,%esi
setge  %r8b
lea    0xf86(%rip),%rdx
jmp    11e2 <print_results+0xd2>
xor    %r8d,%r8d
cmp    %ecx,%esi
setg   %r8b
lea    0xf72(%rip),%rdx
jmp    11e2 <print_results+0xd2>
xor    %r8d,%r8d
cmp    %ecx,%esi
setne  %r8b
lea    0xf68(%rip),%rdx
jmp    11e2 <print_results+0xd2>
xor    %r8d,%r8d
cmp    %ecx,%esi
setle  %r8b
lea    0xf4b(%rip),%rdx
jmp    11e2 <print_results+0xd2>
mov    %ecx,%r8d
and    %esi,%r8d
lea    0xf4b(%rip),%rdx
jmp    11e2 <print_results+0xd2>
xor    %r8d,%r8d
mov    %ecx,%eax
or     %esi,%eax
setne  %r8b
lea    0xf39(%rip),%rdx
test   %r8d,%r8d
lea    0xf37(%rip),%rax
lea    0xf2b(%rip),%r9
cmove  %rax,%r9
lea    0xf2b(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"<\00"
@.str.1 = [3 x i8] c"<=\00"
@.str.2 = [2 x i8] c">\00"
@.str.3 = [3 x i8] c">=\00"
@.str.4 = [3 x i8] c"==\00"
@.str.5 = [3 x i8] c"!=\00"
@.str.6 = [3 x i8] c"&&\00"
@.str.7 = [2 x i8] c"&\00"
@.str.8 = [3 x i8] c"||\00"
@.str.9 = [2 x i8] c"|\00"
@.str.10 = [5 x i8] c"TRUE\00"
@.str.11 = [6 x i8] c"FALSE\00"
@.str.12 = [32 x i8] c"\0A%d %s %d evaluates to %d (%s)\0A\00"
define void @print_results(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
switch i32 %10, label %67 [
i32 1, label %11
i32 11, label %16
i32 2, label %21
i32 22, label %26
i32 3, label %31
i32 4, label %36
i32 5, label %41
i32 55, label %50
i32 6, label %54
i32 66, label %63
]
11: ; preds = %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %8
br label %67
16: ; preds = %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %7
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp sle i32 %17, %18
%20 = zext i1 %19 to i32
store i32 %20, i32* %8
br label %67
21: ; preds = %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %7
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = icmp sgt i32 %22, %23
%25 = zext i1 %24 to i32
store i32 %25, i32* %8
br label %67
26: ; preds = %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %7
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = icmp sge i32 %27, %28
%30 = zext i1 %29 to i32
store i32 %30, i32* %8
br label %67
31: ; preds = %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %7
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = icmp eq i32 %32, %33
%35 = zext i1 %34 to i32
store i32 %35, i32* %8
br label %67
36: ; preds = %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %7
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = icmp ne i32 %37, %38
%40 = zext i1 %39 to i32
store i32 %40, i32* %8
br label %67
41: ; preds = %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** %7
%42 = load i32, i32* %4
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %5
%46 = icmp ne i32 %45, 0
br label %47
47: ; preds = %44, %41
%48 = phi i1 [ false, %41 ], [ %46, %44 ]
%49 = zext i1 %48 to i32
store i32 %49, i32* %8
br label %67
50: ; preds = %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %7
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = and i32 %51, %52
store i32 %53, i32* %8
br label %67
54: ; preds = %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %7
%55 = load i32, i32* %4
%56 = icmp ne i32 %55, 0
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = load i32, i32* %5
%59 = icmp ne i32 %58, 0
br label %60
60: ; preds = %57, %54
%61 = phi i1 [ true, %54 ], [ %59, %57 ]
%62 = zext i1 %61 to i32
store i32 %62, i32* %8
br label %67
63: ; preds = %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %7
%64 = load i32, i32* %4
%65 = load i32, i32* %5
%66 = or i32 %64, %65
store i32 %66, i32* %8
br label %67
67: ; preds = %3, %63, %60, %50, %47, %36, %31, %26, %21, %16, %11
%68 = load i8*, i8** %7
%69 = icmp ne i8* %68, null
br i1 %69, label %70, label %81
70: ; preds = %67
%71 = load i32, i32* %8
%72 = icmp ne i32 %71, 0
%73 = zext i1 %72 to i64
%74 = select i1 %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0)
store i8* %74, i8** %9
%75 = load i32, i32* %4
%76 = load i8*, i8** %7
%77 = load i32, i32* %5
%78 = load i32, i32* %8
%79 = load i8*, i8** %9
%80 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i32 %75, i8* %76, i32 %77, i32 %78, i8* %79)
br label %81
81: ; preds = %70, %67
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"<\00"
@.str.1 = [3 x i8] c"<=\00"
@.str.2 = [2 x i8] c">\00"
@.str.3 = [3 x i8] c">=\00"
@.str.4 = [3 x i8] c"==\00"
@.str.5 = [3 x i8] c"!=\00"
@.str.6 = [3 x i8] c"&&\00"
@.str.7 = [2 x i8] c"&\00"
@.str.8 = [3 x i8] c"||\00"
@.str.9 = [2 x i8] c"|\00"
@.str.10 = [5 x i8] c"TRUE\00"
@.str.11 = [6 x i8] c"FALSE\00"
@.str.12 = [32 x i8] c"\0A%d %s %d evaluates to %d (%s)\0A\00"
define void @print_results(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %35 [
i32 1, label %4
i32 11, label %7
i32 2, label %10
i32 22, label %13
i32 3, label %16
i32 4, label %19
i32 5, label %22
i32 55, label %27
i32 6, label %29
i32 66, label %33
]
4: ; preds = %3
%5 = icmp slt i32 %0, %1
%6 = zext i1 %5 to i32
br label %36
7: ; preds = %3
%8 = icmp sle i32 %0, %1
%9 = zext i1 %8 to i32
br label %36
10: ; preds = %3
%11 = icmp sgt i32 %0, %1
%12 = zext i1 %11 to i32
br label %36
13: ; preds = %3
%14 = icmp sge i32 %0, %1
%15 = zext i1 %14 to i32
br label %36
16: ; preds = %3
%17 = icmp eq i32 %0, %1
%18 = zext i1 %17 to i32
br label %36
19: ; preds = %3
%20 = icmp ne i32 %0, %1
%21 = zext i1 %20 to i32
br label %36
22: ; preds = %3
%23 = icmp ne i32 %0, 0
%24 = icmp ne i32 %1, 0
%25 = and i1 %23, %24
%26 = zext i1 %25 to i32
br label %36
27: ; preds = %3
%28 = and i32 %1, %0
br label %36
29: ; preds = %3
%30 = or i32 %1, %0
%31 = icmp ne i32 %30, 0
%32 = zext i1 %31 to i32
br label %36
33: ; preds = %3
%34 = or i32 %1, %0
br label %36
35: ; preds = %3
unreachable
36: ; preds = %4, %7, %10, %13, %16, %19, %22, %27, %29, %33
%37 = phi i32 [ %34, %33 ], [ %32, %29 ], [ %28, %27 ], [ %26, %22 ], [ %21, %19 ], [ %18, %16 ], [ %15, %13 ], [ %12, %10 ], [ %9, %7 ], [ %6, %4 ]
%38 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), %33 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %29 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), %27 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %22 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %19 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %16 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %10 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %7 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %4 ]
%39 = icmp eq i32 %37, 0
%40 = select i1 %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i32 %0, i8* %38, i32 %1, i32 %37, i8* %40)
ret void
}