#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 getCurrentHour();
int /*<<< orphan*/ printf(char *, int);
void main() {
  int currentHour = getCurrentHour();
  if (currentHour >= 0 && currentHour < 12) {
    printf("Good morning, the hour is: %i", currentHour);
  }
  if (currentHour >= 12 && currentHour < 18) {
    printf("Good afternoon, the hour is: %i", currentHour);
  }
  if (currentHour >= 18 && currentHour < 24) {
    printf("Good evening, the hour is: %i", currentHour);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getCurrentHour@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1155 <main+0x35>
cmpl   $0xc,-0x4(%rbp)
jge    1155 <main+0x35>
mov    -0x4(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0xc,-0x4(%rbp)
jl     1178 <main+0x58>
cmpl   $0x12,-0x4(%rbp)
jge    1178 <main+0x58>
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x12,-0x4(%rbp)
jl     119b <main+0x7b>
cmpl   $0x18,-0x4(%rbp)
jge    119b <main+0x7b>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getCurrentHour@plt>
cmp    $0xc,%eax
jae    1136 <main+0x16>
lea    0xecc(%rip),%rdi
jmp    1156 <main+0x36>
lea    -0xc(%rax),%ecx
cmp    $0x6,%ecx
jae    1147 <main+0x27>
lea    0xed9(%rip),%rdi
jmp    1156 <main+0x36>
lea    -0x12(%rax),%ecx
cmp    $0x5,%ecx
ja     115e <main+0x3e>
lea    0xee8(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Good morning, the hour is: %i\00"
@.str.1 = [32 x i8] c"Good afternoon, the hour is: %i\00"
@.str.2 = [30 x i8] c"Good evening, the hour is: %i\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @getCurrentHour()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 12
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5, %0
%12 = load i32, i32* %1
%13 = icmp sge i32 %12, 12
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %1
%16 = icmp slt i32 %15, 18
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %1
%19 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14, %11
%21 = load i32, i32* %1
%22 = icmp sge i32 %21, 18
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %1
%25 = icmp slt i32 %24, 24
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %1
%28 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26, %23, %20
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Good morning, the hour is: %i\00"
@.str.1 = [32 x i8] c"Good afternoon, the hour is: %i\00"
@.str.2 = [30 x i8] c"Good evening, the hour is: %i\00"
define void @main() {
%1 = tail call i32 (...) @getCurrentHour()
%2 = icmp ult i32 %1, 12
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = add i32 %1, -12
%5 = icmp ult i32 %4, 6
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = add i32 %1, -18
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6, %3, %0
%10 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), %6 ]
%11 = tail call i32 @printf(i8* %10, i32 %1)
br label %12
12: ; preds = %9, %6
ret void
}