#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);
void ft_takes_place_next(int hour) {
  if (hour == 12) {
    printf("THE FOLLOWING TAKES BETWEEN %d.00 P.M.", hour);
    printf("AND 0%d.00 P.M.\n", (hour - 11));
  }
  if (hour >= 13 && hour <= 20) {
    printf("THE FOLLOWING TAKES BETWEEN 0%d.00 P.M.", (hour - 12));
    printf("AND 0%d.00 P.M.\n", (hour - 11));
  }
  if (hour == 21 || hour == 22) {
    printf("THE FOLLOWING TAKES BETWEEN %d.00 P.M.", (hour - 12));
    printf("AND %d.00 P.M.\n", (hour - 11));
  }
  if (hour == 23) {
    printf("THE FOLLOWING TAKES BETWEEN %d.00 P.M.", (hour - 12));
    printf("AND %d.00 A.M.\n", (hour - 11));
  }
  if (hour == 0) {
    printf("THE FOLLOWING TAKES BETWEEN %d.00 A.M.", (hour + 12));
    printf("AND 0%d.00 A.M.\n", (hour + 1));
  }
}


x86 assembly (clang, -O0):
<ft_takes_place_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jne    1146 <ft_takes_place_next+0x36>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
sub    $0xb,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xd,-0x4(%rbp)
jl     117e <ft_takes_place_next+0x6e>
cmpl   $0x14,-0x4(%rbp)
jg     117e <ft_takes_place_next+0x6e>
mov    -0x4(%rbp),%esi
sub    $0xc,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
sub    $0xb,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x15,-0x4(%rbp)
je     1192 <ft_takes_place_next+0x82>
cmpl   $0x16,-0x4(%rbp)
jne    11b6 <ft_takes_place_next+0xa6>
mov    -0x4(%rbp),%esi
sub    $0xc,%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
sub    $0xb,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x17,-0x4(%rbp)
jne    11e4 <ft_takes_place_next+0xd4>
mov    -0x4(%rbp),%esi
sub    $0xc,%esi
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
sub    $0xb,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1212 <ft_takes_place_next+0x102>
mov    -0x4(%rbp),%esi
add    $0xc,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_takes_place_next>:
push   %r14
push   %rbx
push   %rax
cmp    $0xc,%edi
jne    1136 <ft_takes_place_next+0x26>
lea    0xee0(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
jmp    11b9 <ft_takes_place_next+0xa9>
mov    %edi,%ebx
lea    -0xd(%rbx),%eax
cmp    $0x8,%eax
jae    1150 <ft_takes_place_next+0x40>
lea    0xee0(%rip),%r14
lea    0xeea(%rip),%rdi
jmp    1166 <ft_takes_place_next+0x56>
lea    -0x15(%rbx),%eax
cmp    $0x1,%eax
ja     1179 <ft_takes_place_next+0x69>
lea    0xf01(%rip),%r14
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbx),%esi
call   1030 <printf@plt>
lea    -0xb(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
test   %ebx,%ebx
je     11a1 <ft_takes_place_next+0x91>
cmp    $0x17,%ebx
jne    11ca <ft_takes_place_next+0xba>
lea    0xe77(%rip),%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0xc,%esi
jmp    11be <ft_takes_place_next+0xae>
lea    0xed8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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