#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 */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("\ndatastructure started\n\n");
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today, *datePtr;
  datePtr = &today;
  datePtr->month = 12;
  datePtr->day = 28;
  datePtr->year = 2016;
  printf("Today's date is %i/%i/%.2i.\n\n", datePtr->month, datePtr->day,
         datePtr->year % 100);
  printf("datastructure ended\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1c,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7e0,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x1c(%rbp),%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0xc,%esi
mov    $0x1c,%edx
mov    $0x10,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [25 x i8] c"\0Adatastructure started\0A\0A\00"
@.str.1 = [30 x i8] c"Today's date is %i/%i/%.2i.\0A\0A\00"
@.str.2 = [22 x i8] c"datastructure ended\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
%3 = alloca %struct.date*
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store %struct.date* %2, %struct.date** %3
%5 = load %struct.date*, %struct.date** %3
%6 = getelementptr inbounds %struct.date, %struct.date* %5, i32 0, i32 0
store i32 12, i32* %6
%7 = load %struct.date*, %struct.date** %3
%8 = getelementptr inbounds %struct.date, %struct.date* %7, i32 0, i32 1
store i32 28, i32* %8
%9 = load %struct.date*, %struct.date** %3
%10 = getelementptr inbounds %struct.date, %struct.date* %9, i32 0, i32 2
store i32 2016, i32* %10
%11 = load %struct.date*, %struct.date** %3
%12 = getelementptr inbounds %struct.date, %struct.date* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.date*, %struct.date** %3
%15 = getelementptr inbounds %struct.date, %struct.date* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = load %struct.date*, %struct.date** %3
%18 = getelementptr inbounds %struct.date, %struct.date* %17, i32 0, i32 2
%19 = load i32, i32* %18
%20 = srem i32 %19, 100
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %16, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.date = type { i32, i32, i32 }
@.str.1 = [30 x i8] c"Today's date is %i/%i/%.2i.\0A\0A\00"
@str = [24 x i8] c"\0Adatastructure started\0A\00"
@str.3 = [21 x i8] c"datastructure ended\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 12, i32 28, i32 16)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}