#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  struct date {
    int day;
    int month;
    int year;
  } birthday;
  struct family {
    char name[20];
    struct date birthday;
  } me, Doina;
  strcpy(Doina.name, "Stoica Doina");
  Doina.birthday.day = 12;
  Doina.birthday.month = 06;
  Doina.birthday.year = 1961;
  printf("Enter your date of birth here %c ", 16);
  scanf("%d", &me.birthday.day);
  printf("Now enter here the month in which you were born %c ", 16);
  scanf("%d", &me.birthday.month);
  printf("And the year please... %c ", 16);
  scanf("%d", &me.birthday.year);
  puts("\n\n\t....");
  printf("\t...\nI almost forgt, what is your name?");
  scanf("%s", me.name);
  printf("\n\n\n\tOk, so, the results just came in ...\n\n");
  printf("%s was born on %d-%d-%d\n", me.name, me.birthday.day,
         me.birthday.month, me.birthday.year);
  puts("\n\t.. and\n");
  printf("%s was born on %d-%d-%d\n", Doina.name, Doina.birthday.day,
         Doina.birthday.month, Doina.birthday.year);
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0xc,-0x3c(%rbp)
movl   $0x6,-0x38(%rbp)
movl   $0x7a9,-0x34(%rbp)
lea    0xe82(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x14,%rsi
lea    0xe89(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe80(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x14,%rsi
add    $0x4,%rsi
lea    0xe5e(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe89(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x14,%rsi
add    $0x8,%rsi
lea    0xe33(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe79(%rip),%rdi
call   1040 <puts@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1040 <puts@plt>
lea    -0x50(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xea0(%rip),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
movabs $0x60000000c,%rax
mov    %rax,0x34(%rsp)
movl   $0x7a9,0x3c(%rsp)
lea    0xe82(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%rsi
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe80(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe94(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
mov    0x14(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
lea    0xe7d(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
mov    0x34(%rsp),%edx
mov    0x38(%rsp),%ecx
mov    0x3c(%rsp),%r8d
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
%struct.family = type { [20 x i8], %struct.date }
@.str = [13 x i8] c"Stoica Doina\00"
@.str.1 = [34 x i8] c"Enter your date of birth here %c \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [52 x i8] c"Now enter here the month in which you were born %c \00"
@.str.4 = [27 x i8] c"And the year please... %c \00"
@.str.5 = [8 x i8] c"\0A\0A\09....\00"
@.str.6 = [40 x i8] c"\09...\0AI almost forgt, what is your name?\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [43 x i8] c"\0A\0A\0A\09Ok, so, the results just came in ...\0A\0A\00"
@.str.9 = [25 x i8] c"%s was born on %d-%d-%d\0A\00"
@.str.10 = [10 x i8] c"\0A\09.. and\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
%3 = alloca %struct.family
%4 = alloca %struct.family
store i32 0, i32* %1
%5 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 1
%9 = getelementptr inbounds %struct.date, %struct.date* %8, i32 0, i32 0
store i32 12, i32* %9
%10 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 1
%11 = getelementptr inbounds %struct.date, %struct.date* %10, i32 0, i32 1
store i32 6, i32* %11
%12 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 1
%13 = getelementptr inbounds %struct.date, %struct.date* %12, i32 0, i32 2
store i32 1961, i32* %13
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 16)
%15 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 1
%16 = getelementptr inbounds %struct.date, %struct.date* %15, i32 0, i32 0
%17 = bitcast i32* %16 to i8*
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 16)
%20 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 1
%21 = getelementptr inbounds %struct.date, %struct.date* %20, i32 0, i32 1
%22 = bitcast i32* %21 to i8*
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 16)
%25 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 1
%26 = getelementptr inbounds %struct.date, %struct.date* %25, i32 0, i32 2
%27 = bitcast i32* %26 to i8*
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
%31 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 0
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %31, i64 0, i64 0
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%35 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 0
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %35, i64 0, i64 0
%37 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 1
%38 = getelementptr inbounds %struct.date, %struct.date* %37, i32 0, i32 0
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 1
%41 = getelementptr inbounds %struct.date, %struct.date* %40, i32 0, i32 1
%42 = load i32, i32* %41
%43 = getelementptr inbounds %struct.family, %struct.family* %3, i32 0, i32 1
%44 = getelementptr inbounds %struct.date, %struct.date* %43, i32 0, i32 2
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8* %36, i32 %39, i32 %42, i32 %45)
%47 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%48 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 0
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %48, i64 0, i64 0
%50 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 1
%51 = getelementptr inbounds %struct.date, %struct.date* %50, i32 0, i32 0
%52 = load i32, i32* %51
%53 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 1
%54 = getelementptr inbounds %struct.date, %struct.date* %53, i32 0, i32 1
%55 = load i32, i32* %54
%56 = getelementptr inbounds %struct.family, %struct.family* %4, i32 0, i32 1
%57 = getelementptr inbounds %struct.date, %struct.date* %56, i32 0, i32 2
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8* %49, i32 %52, i32 %55, i32 %58)
%60 = call i32 (...) @getchar()
%61 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
%struct.family = type { [20 x i8], %struct.date }
%struct.date = type { i32, i32, i32 }
@.str = [13 x i8] c"Stoica Doina\00"
@.str.1 = [34 x i8] c"Enter your date of birth here %c \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [52 x i8] c"Now enter here the month in which you were born %c \00"
@.str.4 = [27 x i8] c"And the year please... %c \00"
@.str.5 = [8 x i8] c"\0A\0A\09....\00"
@.str.6 = [40 x i8] c"\09...\0AI almost forgt, what is your name?\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.9 = [25 x i8] c"%s was born on %d-%d-%d\0A\00"
@.str.10 = [10 x i8] c"\0A\09.. and\0A\00"
@str = [42 x i8] c"\0A\0A\0A\09Ok, so, the results just came in ...\0A\00"
define i32 @main() {
%1 = alloca %struct.family
%2 = alloca %struct.family
%3 = getelementptr inbounds %struct.family, %struct.family* %1, i64 0, i32 0, i64 0
%4 = getelementptr inbounds %struct.family, %struct.family* %2, i64 0, i32 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds %struct.family, %struct.family* %2, i64 0, i32 1, i32 0
store i32 12, i32* %6
%7 = getelementptr inbounds %struct.family, %struct.family* %2, i64 0, i32 1, i32 1
store i32 6, i32* %7
%8 = getelementptr inbounds %struct.family, %struct.family* %2, i64 0, i32 1, i32 2
store i32 1961, i32* %8
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 16)
%10 = getelementptr inbounds %struct.family, %struct.family* %1, i64 0, i32 1
%11 = getelementptr inbounds %struct.date, %struct.date* %10, i64 0, i32 0
%12 = bitcast %struct.date* %10 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 16)
%15 = getelementptr inbounds %struct.family, %struct.family* %1, i64 0, i32 1, i32 1
%16 = bitcast i32* %15 to i8*
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 16)
%19 = getelementptr inbounds %struct.family, %struct.family* %1, i64 0, i32 1, i32 2
%20 = bitcast i32* %19 to i8*
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%26 = load i32, i32* %11
%27 = load i32, i32* %15
%28 = load i32, i32* %19
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8* %3, i32 %26, i32 %27, i32 %28)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8* %4, i32 %31, i32 %32, i32 %33)
%35 = call i32 (...) @getchar()
%36 = call i32 (...) @getchar()
ret i32 0
}