#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;
  today.month = 12;
  today.day = 28;
  today.year = 2016;
  printf("Today's date is %i/%i/%.2i.\n\n", today.month, today.day,
         today.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>
movl   $0xc,-0x10(%rbp)
movl   $0x1c,-0xc(%rbp)
movl   $0x7e0,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x14(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%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
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
store i32 12, i32* %4
%5 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
store i32 28, i32* %5
%6 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
store i32 2016, i32* %6
%7 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
%12 = load i32, i32* %11
%13 = srem i32 %12, 100
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10, i32 %13)
%15 = 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):
@.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
}