#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*/ numbers(int);
int /*<<< orphan*/ printMinute(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int h;
  scanf("%d", &h);
  int m;
  scanf("%d", &m);
  if (m == 0) {
    numbers(h);
    printf("o' clock");
  } else {
    if (m < 30 && m != 15) {
      printMinute(m);
      printf("minutes past ");
      numbers(h);
    } else if (m == 30) {
      printf("half past ");
      numbers(h);
    } else if (m == 15) {
      printf("quarter past ");
      numbers(h);
    } else if (m == 45) {
      printf("quarter to ");
      numbers(h + 1);
    } else {
      printMinute(60 - m);
      printf("minutes to ");
      numbers(h + 1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1192 <main+0x52>
mov    -0x8(%rbp),%edi
call   1060 <numbers@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    126b <main+0x12b>
cmpl   $0x1e,-0xc(%rbp)
jge    11c7 <main+0x87>
cmpl   $0xf,-0xc(%rbp)
je     11c7 <main+0x87>
mov    -0xc(%rbp),%edi
call   1040 <printMinute@plt>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1060 <numbers@plt>
jmp    1266 <main+0x126>
cmpl   $0x1e,-0xc(%rbp)
jne    11ea <main+0xaa>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1060 <numbers@plt>
jmp    1261 <main+0x121>
cmpl   $0xf,-0xc(%rbp)
jne    120d <main+0xcd>
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1060 <numbers@plt>
jmp    125c <main+0x11c>
cmpl   $0x2d,-0xc(%rbp)
jne    1233 <main+0xf3>
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1060 <numbers@plt>
jmp    1257 <main+0x117>
mov    $0x3c,%edi
sub    -0xc(%rbp),%edi
call   1040 <printMinute@plt>
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1060 <numbers@plt>
jmp    125c <main+0x11c>
jmp    1261 <main+0x121>
jmp    1266 <main+0x126>
jmp    126b <main+0x12b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1186 <main+0x46>
cmp    $0x1d,%edi
jg     119d <main+0x5d>
cmp    $0xf,%edi
je     119d <main+0x5d>
call   1040 <printMinute@plt>
lea    0xe88(%rip),%rdi
jmp    11bc <main+0x7c>
mov    0x8(%rsp),%edi
call   1060 <numbers@plt>
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
jmp    11f6 <main+0xb6>
cmp    $0xf,%edi
je     11b5 <main+0x75>
cmp    $0x2d,%edi
je     11c7 <main+0x87>
cmp    $0x1e,%edi
jne    11d0 <main+0x90>
lea    0xe67(%rip),%rdi
jmp    11bc <main+0x7c>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%edi
jmp    11f1 <main+0xb1>
lea    0xe65(%rip),%rdi
jmp    11e5 <main+0xa5>
mov    $0x3c,%eax
sub    %edi,%eax
mov    %eax,%edi
call   1040 <printMinute@plt>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%edi
add    $0x1,%edi
call   1060 <numbers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"o' clock\00"
@.str.2 = [14 x i8] c"minutes past \00"
@.str.3 = [11 x i8] c"half past \00"
@.str.4 = [14 x i8] c"quarter past \00"
@.str.5 = [12 x i8] c"quarter to \00"
@.str.6 = [12 x i8] c"minutes to \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @numbers(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %58
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 30
br i1 %14, label %15, label %24
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 15
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i32, i32* %3
%20 = call i32 @printMinute(i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %2
%23 = call i32 @numbers(i32 %22)
br label %57
24: ; preds = %15, %12
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 30
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* %2
%30 = call i32 @numbers(i32 %29)
br label %56
31: ; preds = %24
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 15
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%36 = load i32, i32* %2
%37 = call i32 @numbers(i32 %36)
br label %55
38: ; preds = %31
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 45
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
%45 = call i32 @numbers(i32 %44)
br label %54
46: ; preds = %38
%47 = load i32, i32* %3
%48 = sub nsw i32 60, %47
%49 = call i32 @printMinute(i32 %48)
%50 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
%53 = call i32 @numbers(i32 %52)
br label %54
54: ; preds = %46, %41
br label %55
55: ; preds = %54, %34
br label %56
56: ; preds = %55, %27
br label %57
57: ; preds = %56, %18
br label %58
58: ; preds = %57, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"o' clock\00"
@.str.2 = [14 x i8] c"minutes past \00"
@.str.3 = [11 x i8] c"half past \00"
@.str.4 = [14 x i8] c"quarter past \00"
@.str.5 = [12 x i8] c"quarter to \00"
@.str.6 = [12 x i8] c"minutes to \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast i32* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i32 @numbers(i32 %10)
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %43
13: ; preds = %0
%14 = icmp slt i32 %7, 30
%15 = icmp ne i32 %7, 15
%16 = and i1 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = call i32 @printMinute(i32 %7)
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %1
%21 = call i32 @numbers(i32 %20)
br label %43
22: ; preds = %13
switch i32 %7, label %36 [
i32 30, label %23
i32 15, label %27
i32 45, label %31
]
23: ; preds = %22
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32, i32* %1
%26 = call i32 @numbers(i32 %25)
br label %43
27: ; preds = %22
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%29 = load i32, i32* %1
%30 = call i32 @numbers(i32 %29)
br label %43
31: ; preds = %22
%32 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
%35 = call i32 @numbers(i32 %34)
br label %43
36: ; preds = %22
%37 = sub nsw i32 60, %7
%38 = call i32 @printMinute(i32 %37)
%39 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%40 = load i32, i32* %1
%41 = add nsw i32 %40, 1
%42 = call i32 @numbers(i32 %41)
br label %43
43: ; preds = %17, %27, %36, %31, %23, %9
ret i32 0
}