#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 *, ...);
void ft_takes_place(int hour) {
  if (hour > 0 && hour < 11) {
    printf("THE FOLLOWING TAKES PLACE BETWEEN %d", hour);
    printf(".00 A.M. AND %d.00 A.M.\n", hour + 1);
  }
  if (hour > 12 && hour < 23) {
    printf("THE FOLLOWING TAKES PLACE BETWEEN %d", hour - 12);
    printf(".00 P.M. AND %d.00 P.M.\n", hour - 11);
  }
  if (hour == 0)
    printf("THE FOLLOWING TAKES PLACE BETWEEN 12.00 A.M. AND 1.00 A.M.\n");
  if (hour == 11)
    printf("THE FOLLOWING TAKES PLACE BETWEEN 11.00 A.M. AND 12.00 P.M.\n");
  if (hour == 12)
    printf("THE FOLLOWING TAKES PLACE BETWEEN 12.00 P.M. AND 1.00 P.M.\n");
  if (hour == 23)
    printf("THE FOLLOWING TAKES PLACE BETWEEN 11.00 P.M. AND 12.00 A.M.\n");
  return;
}


x86 assembly (clang, -O0):
<ft_takes_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1154 <ft_takes_place+0x44>
cmpl   $0xb,-0x4(%rbp)
jge    1154 <ft_takes_place+0x44>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xc,-0x4(%rbp)
jle    1190 <ft_takes_place+0x80>
cmpl   $0x17,-0x4(%rbp)
jge    1190 <ft_takes_place+0x80>
mov    -0x4(%rbp),%esi
sub    $0xc,%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
sub    $0xb,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    11a8 <ft_takes_place+0x98>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xb,-0x4(%rbp)
jne    11c0 <ft_takes_place+0xb0>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xc,-0x4(%rbp)
jne    11d8 <ft_takes_place+0xc8>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x17,-0x4(%rbp)
jne    11f0 <ft_takes_place+0xe0>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_takes_place>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%eax
cmp    $0xa,%eax
jae    113e <ft_takes_place+0x1e>
lea    0xf50(%rip),%r14
mov    $0x1,%ebp
mov    %ebx,%esi
jmp    1155 <ft_takes_place+0x35>
lea    -0xd(%rbx),%eax
cmp    $0x9,%eax
ja     1171 <ft_takes_place+0x51>
lea    -0xc(%rbx),%esi
lea    0xf4e(%rip),%r14
mov    $0xfffffff5,%ebp
lea    0xf04(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x17,%ebx
ja     1198 <ft_takes_place+0x78>
lea    0xfed(%rip),%rdi
mov    %ebx,%eax
lea    0xe7a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf98(%rip),%rdi
jmp    11ad <ft_takes_place+0x8d>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xf4f(%rip),%rdi
jmp    11ad <ft_takes_place+0x8d>
lea    0xf0a(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN %d\00"
@.str.1 = [25 x i8] c".00 A.M. AND %d.00 A.M.\0A\00"
@.str.2 = [25 x i8] c".00 P.M. AND %d.00 P.M.\0A\00"
@.str.3 = [60 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 12.00 A.M. AND 1.00 A.M.\0A\00"
@.str.4 = [61 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 11.00 A.M. AND 12.00 P.M.\0A\00"
@.str.5 = [60 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 12.00 P.M. AND 1.00 P.M.\0A\00"
@.str.6 = [61 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 11.00 P.M. AND 12.00 A.M.\0A\00"
define void @ft_takes_place(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 11
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %8, %5, %1
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 12
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 23
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 12
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %2
%25 = sub nsw i32 %24, 11
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %20, %17, %14
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
%33 = load i32, i32* %2
%34 = icmp eq i32 %33, 11
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35, %32
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 12
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = load i32, i32* %2
%44 = icmp eq i32 %43, 23
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN %d\00"
@.str.1 = [25 x i8] c".00 A.M. AND %d.00 A.M.\0A\00"
@.str.2 = [25 x i8] c".00 P.M. AND %d.00 P.M.\0A\00"
@str = [60 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 11.00 P.M. AND 12.00 A.M.\00"
@str.7 = [59 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 12.00 P.M. AND 1.00 P.M.\00"
@str.8 = [60 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 11.00 A.M. AND 12.00 P.M.\00"
@str.9 = [59 x i8] c"THE FOLLOWING TAKES PLACE BETWEEN 12.00 A.M. AND 1.00 A.M.\00"
define void @ft_takes_place(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 10
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = add i32 %0, -13
%6 = icmp ult i32 %5, 10
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = add nsw i32 %0, -12
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %8, %7 ], [ %0, %1 ]
%11 = phi i32 [ -11, %7 ], [ 1, %1 ]
%12 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %1 ]
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %10)
%14 = add nsw i32 %11, %0
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12, i32 %14)
br label %16
16: ; preds = %9, %4
switch i32 %0, label %23 [
i32 0, label %20
i32 11, label %17
i32 12, label %18
i32 23, label %19
]
17: ; preds = %16
br label %20
18: ; preds = %16
br label %20
19: ; preds = %16
br label %20
20: ; preds = %16, %19, %17, %18
%21 = phi i8* [ getelementptr inbounds ([59 x i8], [59 x i8]* @str.7, i64 0, i64 0), %18 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @str.8, i64 0, i64 0), %17 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0), %19 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @str.9, i64 0, i64 0), %16 ]
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
br label %23
23: ; preds = %20, %16
ret void
}