#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_mday;
  int tm_mon;
  int tm_year;
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  struct tm *local;
  time_t t;
  t = time(NULL);
  local = localtime(&t);
  printf("Dia: %d\n", local->tm_mday);
  printf("Mês: %d\n", local->tm_mon + 1);
  printf("Ano: %d\n", local->tm_year + 1900);
  printf("Horas: %d\n", local->tm_hour);
  printf("Minutos: %d\n", local->tm_min);
  printf("Segundos: %d\n", local->tm_sec);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%esi
add    $0x1,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%esi
add    $0x76c,%esi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%esi
lea    0xe67(%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
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rbx),%esi
add    $0x1,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x76c,%esi
add    0x8(%rbx),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    0xc(%rbx),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    0x14(%rbx),%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [9 x i8] c"Dia: %d\0A\00"
@.str.1 = [10 x i8] c"M\C3\AAs: %d\0A\00"
@.str.2 = [9 x i8] c"Ano: %d\0A\00"
@.str.3 = [11 x i8] c"Horas: %d\0A\00"
@.str.4 = [13 x i8] c"Minutos: %d\0A\00"
@.str.5 = [14 x i8] c"Segundos: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.tm*
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %8, %struct.tm** %5
%9 = load %struct.tm*, %struct.tm** %5
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load %struct.tm*, %struct.tm** %5
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load %struct.tm*, %struct.tm** %5
%19 = getelementptr inbounds %struct.tm, %struct.tm* %18, i32 0, i32 2
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1900
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = load %struct.tm*, %struct.tm** %5
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i32 0, i32 3
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load %struct.tm*, %struct.tm** %5
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 4
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %29)
%31 = load %struct.tm*, %struct.tm** %5
%32 = getelementptr inbounds %struct.tm, %struct.tm* %31, i32 0, i32 5
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %33)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [9 x i8] c"Dia: %d\0A\00"
@.str.1 = [10 x i8] c"M\C3\AAs: %d\0A\00"
@.str.2 = [9 x i8] c"Ano: %d\0A\00"
@.str.3 = [11 x i8] c"Horas: %d\0A\00"
@.str.4 = [13 x i8] c"Minutos: %d\0A\00"
@.str.5 = [14 x i8] c"Segundos: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 2
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1900
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 3
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 4
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 5
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %25)
ret i32 0
}