#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *member_0;
  int member_1;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, ...);
main() {
  struct emp1 {
    char *name;
    int age;
  };
  struct emp2 {
    char *cp;
    struct emp1 e1;
  } e2 = {"ghi", {"jkl", 123}};
  struct emp1 e3 = {"rwer", 2341};
  printf("\n%s %d\n", e3.name, e3.age);
  printf("\n%s %s %d\n", e2.cp, e2.e1.name, e2.e1.age);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2cd9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cd6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ccd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%ecx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef5(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x925,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0xec7(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x7b,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.emp2 = type { i8*, %struct.emp1 }
%struct.emp1 = type { i8*, i32 }
@.str = [4 x i8] c"ghi\00"
@.str.1 = [4 x i8] c"jkl\00"
@__const.main.e2 = %struct.emp2 { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), %struct.emp1 { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 123 } }
@.str.2 = [5 x i8] c"rwer\00"
@__const.main.e3 = %struct.emp1 { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i32 2341 }
@.str.3 = [8 x i8] c"\0A%s %d\0A\00"
@.str.4 = [11 x i8] c"\0A%s %s %d\0A\00"
define i32 @main() {
%1 = alloca %struct.emp2
%2 = alloca %struct.emp1
%3 = bitcast %struct.emp2* %1 to i8*
%4 = bitcast %struct.emp1* %2 to i8*
%5 = getelementptr inbounds %struct.emp1, %struct.emp1* %2, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds %struct.emp1, %struct.emp1* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %6, i32 %8)
%10 = getelementptr inbounds %struct.emp2, %struct.emp2* %1, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = getelementptr inbounds %struct.emp2, %struct.emp2* %1, i32 0, i32 1
%13 = getelementptr inbounds %struct.emp1, %struct.emp1* %12, i32 0, i32 0
%14 = load i8*, i8** %13
%15 = getelementptr inbounds %struct.emp2, %struct.emp2* %1, i32 0, i32 1
%16 = getelementptr inbounds %struct.emp1, %struct.emp1* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %11, i8* %14, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"ghi\00"
@.str.1 = [4 x i8] c"jkl\00"
@.str.2 = [5 x i8] c"rwer\00"
@.str.3 = [8 x i8] c"\0A%s %d\0A\00"
@.str.4 = [11 x i8] c"\0A%s %s %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 2341)
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 123)
ret i32 0
}