#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 dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gotoxy(int, int);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ textcolor(int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void update_time() {
  struct tm *tm;
  time_t _time;
  char texto[50];
  textcolor(14);
  _time = time(NULL);
  tm = localtime(&_time);
  strftime(texto, 50, "%d/%m/%Y %H:%M:%S", tm);
  gotoxy(1, 1);
  printf("%s    ", texto);
}


x86 assembly (clang, -O0):
<update_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0xe,%edi
call   1050 <textcolor@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x32,%esi
lea    0xe61(%rip),%rdx
call   1070 <strftime@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1080 <gotoxy@plt>
lea    -0x40(%rbp),%rsi
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_time>:
push   %rbx
sub    $0x50,%rsp
mov    $0xe,%edi
call   1050 <textcolor@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe75(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1080 <gotoxy@plt>
lea    0xe5c(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%d/%m/%Y %H:%M:%S\00"
@.str.1 = [7 x i8] c"%s \00"
define void @update_time() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = alloca [50 x i8]
%4 = call i32 @textcolor(i32 14)
%5 = call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %6, %struct.tm** %1
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = load %struct.tm*, %struct.tm** %1
%9 = call i32 @strftime(i8* %7, i32 50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = call i32 @gotoxy(i32 1, i32 1)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%d/%m/%Y %H:%M:%S\00"
@.str.1 = [7 x i8] c"%s \00"
define void @update_time() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @textcolor(i32 14)
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %1
%7 = call %struct.tm* @localtime(i32* %1)
%8 = call i32 @strftime(i8* %4, i32 50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = call i32 @gotoxy(i32 1, i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}