#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
  int tm_min;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct tm *tm;
  time_t now;
  int hour, minute;
  time(&now);
  tm = localtime(&now);
  hour = tm->tm_hour;
  minute = tm->tm_min;
  if (minute >= 30)
    hour += 1;
  hour %= 12;
  if (hour == 0)
    hour = 12;
  minute += 2;
  minute /= 5;
  if (minute == 0)
    minute = 12;
  printf("The big hand is at %d\n"
         "\tand the small hand is at %d.\n\n",
         hour, minute);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1e,-0x1c(%rbp)
jl     117b <main+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    119a <main+0x6a>
movl   $0xc,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11c2 <main+0x92>
movl   $0xc,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    0x4(%rax),%ecx
xor    %edx,%edx
cmp    $0x1e,%ecx
setge  %dl
add    (%rax),%edx
movslq %edx,%rsi
imul   $0x2aaaaaab,%rsi,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rax
add    %edx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%esi
mov    $0xc,%edx
cmove  %edx,%esi
lea    0x6(%rcx),%eax
cmp    $0x9,%eax
jb     11a0 <main+0x70>
add    $0x2,%ecx
movslq %ecx,%rax
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x21,%rdx
add    %eax,%edx
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@.str = [54 x i8] c"The big hand is at %d\0A\09and the small hand is at %d.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @time(i32* %3)
%7 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %7, %struct.tm** %2
%8 = load %struct.tm*, %struct.tm** %2
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %4
%11 = load %struct.tm*, %struct.tm** %2
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 30
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %0
%20 = load i32, i32* %4
%21 = srem i32 %20, 12
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 12, i32* %4
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 2
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = sdiv i32 %28, 5
store i32 %29, i32* %5
%30 = load i32, i32* %5
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %25
store i32 12, i32* %5
br label %33
33: ; preds = %32, %25
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %35)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@.str = [54 x i8] c"The big hand is at %d\0A\09and the small hand is at %d.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 29
%10 = zext i1 %9 to i32
%11 = add nsw i32 %6, %10
%12 = srem i32 %11, 12
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 12, i32 %12
%15 = add nsw i32 %8, 2
%16 = sdiv i32 %15, 5
%17 = add i32 %8, 6
%18 = icmp ult i32 %17, 9
%19 = select i1 %18, i32 12, i32 %16
%20 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %19)
ret i32 0
}