#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 /*<<< orphan*/ tm_sec;
  int /*<<< orphan*/ tm_min;
  int /*<<< orphan*/ tm_hour;
};

/* Variables and functions */
int COLS;
int LINES;
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mvprintw(int, int, char *, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void business() {
  time_t tt;
  struct tm *t;
  while (1) {
    tt = time(0);
    t = localtime(&tt);
    mvprintw(LINES / 2, (COLS - 8) / 2, "%02d:%02d:%02d", t->tm_hour, t->tm_min,
             t->tm_sec);
    refresh();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<business>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    (%rax),%r9d
lea    0xe48(%rip),%rdx
call   1070 <mvprintw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1158 <business+0x8>

x86 assembly (clang, -O2):
<business>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
mov    0x2e84(%rip),%r15
mov    0x2e75(%rip),%r12
lea    0xe8e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    (%r15),%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
add    %ecx,%edi
sar    %edi
mov    (%r12),%ecx
mov    %ecx,%edx
add    $0xfffffff8,%edx
shr    $0x1f,%edx
lea    (%rcx,%rdx,1),%esi
add    $0xfffffff8,%esi
sar    %esi
mov    0x8(%rax),%ecx
mov    (%rax),%r9d
mov    0x4(%rax),%r8d
mov    %rbx,%rdx
call   1070 <mvprintw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1180 <business+0x30>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@LINES = global i32 0
@COLS = global i32 0
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @business() {
%1 = alloca i32
%2 = alloca %struct.tm*
br label %3
3: ; preds = %0, %3
%4 = call i32 @time(i32 0)
store i32 %4, i32* %1
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %2
%6 = load i32, i32* @LINES
%7 = sdiv i32 %6, 2
%8 = load i32, i32* @COLS
%9 = sub nsw i32 %8, 8
%10 = sdiv i32 %9, 2
%11 = load %struct.tm*, %struct.tm** %2
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 2
%13 = load i32, i32* %12
%14 = load %struct.tm*, %struct.tm** %2
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = load %struct.tm*, %struct.tm** %2
%18 = getelementptr inbounds %struct.tm, %struct.tm* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = call i32 @mvprintw(i32 %7, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16, i32 %19)
%21 = call i32 (...) @refresh()
%22 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@LINES = global i32 0
@COLS = global i32 0
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @business() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @time(i32 0)
store i32 %4, i32* %1
%5 = call %struct.tm* @localtime(i32* %1)
%6 = load i32, i32* @LINES
%7 = sdiv i32 %6, 2
%8 = load i32, i32* @COLS
%9 = add nsw i32 %8, -8
%10 = sdiv i32 %9, 2
%11 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @mvprintw(i32 %7, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %14, i32 %16)
%18 = call i32 (...) @refresh()
%19 = call i32 @sleep(i32 1)
br label %3
}