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

/* Variables and functions */
struct calendario *malloc(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  struct calendario {
    int dia;
    int mes;
    int ano;
  };
  struct calendario *ptr = malloc(sizeof(struct calendario));
  ptr->dia = 5;
  ptr->mes = 10;
  ptr->ano = 1990;
  printf("%i/%i/%i", ptr->dia, ptr->mes, ptr->ano);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xa,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x7c6,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0x7c6,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.calendario = type { i32, i32, i32 }
%struct.calendario.0 = type opaque
@.str = [9 x i8] c"%i/%i/%i\00"
define i32 @main() {
%1 = alloca %struct.calendario*
%2 = call %struct.calendario.0* @malloc(i32 12)
%3 = bitcast %struct.calendario.0* %2 to %struct.calendario*
store %struct.calendario* %3, %struct.calendario** %1
%4 = load %struct.calendario*, %struct.calendario** %1
%5 = getelementptr inbounds %struct.calendario, %struct.calendario* %4, i32 0, i32 0
store i32 5, i32* %5
%6 = load %struct.calendario*, %struct.calendario** %1
%7 = getelementptr inbounds %struct.calendario, %struct.calendario* %6, i32 0, i32 1
store i32 10, i32* %7
%8 = load %struct.calendario*, %struct.calendario** %1
%9 = getelementptr inbounds %struct.calendario, %struct.calendario* %8, i32 0, i32 2
store i32 1990, i32* %9
%10 = load %struct.calendario*, %struct.calendario** %1
%11 = getelementptr inbounds %struct.calendario, %struct.calendario* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.calendario*, %struct.calendario** %1
%14 = getelementptr inbounds %struct.calendario, %struct.calendario* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.calendario*, %struct.calendario** %1
%17 = getelementptr inbounds %struct.calendario, %struct.calendario* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %18)
ret i32 0
}

LLVM IR (-O2):
%struct.calendario.0 = type opaque
@.str = [9 x i8] c"%i/%i/%i\00"
define i32 @main() {
%1 = tail call %struct.calendario.0* @malloc(i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5, i32 10, i32 1990)
ret i32 0
}