#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 *, int *);
int main() {
  int num;
  printf("Compound if Example 1\n\n");
  printf("Enter a number: ");
  scanf("%d", &num);
  if (num >= 0 && num <= 100)
    printf("Number is in the range 0-100.\n");
  else
    printf("Number is NOT in the range of 0-100.\n");
  if (num == 5 || num == 120)
    printf("Number is either 5 or 120.\n");
  else
    printf("Number is NOT 5 or 120.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     117c <main+0x5c>
cmpl   $0x64,-0x8(%rbp)
jg     117c <main+0x5c>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
je     119c <main+0x7c>
cmpl   $0x78,-0x8(%rbp)
jne    11ad <main+0x8d>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x65,0x4(%rsp)
lea    0xf1d(%rip),%rax
lea    0xebe(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
lea    0xee4(%rip),%rcx
lea    0xec5(%rip),%rdi
cmove  %rcx,%rdi
cmp    $0x78,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Compound if Example 1\0A\0A\00"
@.str.1 = [17 x i8] c"Enter a number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"Number is in the range 0-100.\0A\00"
@.str.4 = [38 x i8] c"Number is NOT in the range of 0-100.\0A\00"
@.str.5 = [28 x i8] c"Number is either 5 or 120.\0A\00"
@.str.6 = [25 x i8] c"Number is NOT 5 or 120.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 100
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %15
13: ; preds = %8, %0
%14 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 5
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 120
br i1 %20, label %21, label %23
21: ; preds = %18, %15
%22 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %25
23: ; preds = %18
%24 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Enter a number: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [23 x i8] c"Compound if Example 1\0A\00"
@str.7 = [37 x i8] c"Number is NOT in the range of 0-100.\00"
@str.8 = [24 x i8] c"Number is NOT 5 or 120.\00"
@str.9 = [27 x i8] c"Number is either 5 or 120.\00"
@str.10 = [30 x i8] c"Number is in the range 0-100.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 101
%8 = select i1 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 120
%12 = icmp eq i32 %10, 5
%13 = or i1 %11, %12
%14 = select i1 %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
ret i32 0
}