#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*/ WINDOW;

/* Variables and functions */
scalar_t__ get_day(long);
int /*<<< orphan*/ get_hour(long);
int /*<<< orphan*/ get_minute(long);
scalar_t__ get_month(long);
int /*<<< orphan*/ get_year(long);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *,
                             int /*<<< orphan*/, int /*<<< orphan*/, ...);
void draw_time(WINDOW *win, int x, int y, long time) {
  mvwprintw(win, y, x, "%02d.%02d.%d", 1 + get_day(time), 1 + get_month(time),
            get_year(time));
  mvwprintw(win, y + 1, x, "%02d:%02d", get_hour(time), get_minute(time));
}


x86 assembly (clang, -O0):
<draw_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <get_day@plt>
add    $0x1,%rax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <get_month@plt>
add    $0x1,%rax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <get_year@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%r8d
mov    -0x34(%rbp),%r9d
lea    0xe34(%rip),%rcx
mov    %eax,(%rsp)
mov    $0x0,%al
call   1070 <mvwprintw@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <get_hour@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <get_minute@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%r8d
mov    %eax,%r9d
lea    0xdf3(%rip),%rcx
mov    $0x0,%al
call   1070 <mvwprintw@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_time>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rcx,%rdi
call   1030 <get_day@plt>
lea    0x1(%rax),%r12d
mov    %rbx,%rdi
call   1080 <get_month@plt>
lea    0x1(%rax),%r13d
mov    %rbx,%rdi
call   1050 <get_year@plt>
mov    %eax,(%rsp)
lea    0xe60(%rip),%rcx
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r12d,%r8d
mov    %r13d,%r9d
xor    %eax,%eax
call   1070 <mvwprintw@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1060 <get_hour@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1040 <get_minute@plt>
lea    0xe3b(%rip),%rcx
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r12d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <mvwprintw@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%02d.%02d.%d\00"
@.str.1 = [10 x i8] c"%02d:%02d\00"
define void @draw_time(i32* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = load i64, i64* %8
%13 = call i64 @get_day(i64 %12)
%14 = add nsw i64 1, %13
%15 = trunc i64 %14 to i32
%16 = load i64, i64* %8
%17 = call i64 @get_month(i64 %16)
%18 = add nsw i64 1, %17
%19 = trunc i64 %18 to i32
%20 = load i64, i64* %8
%21 = call i32 @get_year(i64 %20)
%22 = call i32 (i32*, i32, i32, i8*, i32, i32, ...) @mvwprintw(i32* %9, i32 %10, i32 %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %19, i32 %21)
%23 = load i32*, i32** %5
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
%26 = load i32, i32* %6
%27 = load i64, i64* %8
%28 = call i32 @get_hour(i64 %27)
%29 = load i64, i64* %8
%30 = call i32 @get_minute(i64 %29)
%31 = call i32 (i32*, i32, i32, i8*, i32, i32, ...) @mvwprintw(i32* %23, i32 %25, i32 %26, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %30)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%02d.%02d.%d\00"
@.str.1 = [10 x i8] c"%02d:%02d\00"
define void @draw_time(i32* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i64 @get_day(i64 %3)
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = tail call i64 @get_month(i64 %3)
%9 = trunc i64 %8 to i32
%10 = add i32 %9, 1
%11 = tail call i32 @get_year(i64 %3)
%12 = tail call i32 (i32*, i32, i32, i8*, i32, i32, ...) @mvwprintw(i32* %0, i32 %2, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %11)
%13 = add nsw i32 %2, 1
%14 = tail call i32 @get_hour(i64 %3)
%15 = tail call i32 @get_minute(i64 %3)
%16 = tail call i32 (i32*, i32, i32, i8*, i32, i32, ...) @mvwprintw(i32* %0, i32 %13, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
ret void
}