#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_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int member_0;
  double member_1;
  double member_2;
};
struct TYPE_3__ {
  char member_0;
  char member_1;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, float);
int main() {
  struct A {
    int a;
    double b;
    float c;
  };
  struct {
    char e[2];
    int f;
    double g;
    short h;
    struct A i;
  } B = {{'a', 'b'}, 10, 11.11, 32, {12, 12.12, 12.1212}};
  void *p = &B;
  printf("B.e[0]: %c\n", *((char *)p));
  printf("B.e[1]: %c\n", *((char *)p) + 1);
  p = (char *)p + 4;
  printf("B.f: %d\n", *((int *)p));
  p = (char *)p + 4;
  printf("B.g: %f\n", *((double *)p));
  p = (char *)p + 8;
  printf("B.h: %d\n", *((short *)p));
  p = (char *)p + 8;
  printf("B.i.a: %d\n", *((int *)p));
  p = (char *)p + 8;
  printf("B.i.b: %f\n", *((double *)p));
  p = (char *)p + 8;
  printf("B.i.c: %f\n", *((float *)p));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movups 0xefa(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movups 0xedf(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movups 0xec4(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cvtsi2ss %eax,%xmm0
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
movss  0xec0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
movss  0xeb0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
movss  0xea0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
movss  0xe90(%rip),%xmm0
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
movss  0xe80(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
movss  0xe70(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { [2 x i8], i32, double, i16, %struct.A }
%struct.A = type { i32, double, float }
@__const.main.B = %struct.anon { [2 x i8] c"ab", i32 10, double 1.111000e+01, i16 32, %struct.A { i32 12, double 1.212000e+01, float 0x40283E0DE0000000 } }
@.str = [12 x i8] c"B.e[0]: %c\0A\00"
@.str.1 = [12 x i8] c"B.e[1]: %c\0A\00"
@.str.2 = [9 x i8] c"B.f: %d\0A\00"
@.str.3 = [9 x i8] c"B.g: %f\0A\00"
@.str.4 = [9 x i8] c"B.h: %d\0A\00"
@.str.5 = [11 x i8] c"B.i.a: %d\0A\00"
@.str.6 = [11 x i8] c"B.i.b: %f\0A\00"
@.str.7 = [11 x i8] c"B.i.c: %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast %struct.anon* %2 to i8*
%5 = bitcast %struct.anon* %2 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sitofp i8 %7 to float
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %8)
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 1
%14 = sitofp i32 %13 to float
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), float %14)
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 4
store i8* %17, i8** %3
%18 = load i8*, i8** %3
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = sitofp i32 %20 to float
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), float %21)
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 4
store i8* %24, i8** %3
%25 = load i8*, i8** %3
%26 = bitcast i8* %25 to double*
%27 = load double, double* %26
%28 = fptrunc double %27 to float
%29 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), float %28)
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 8
store i8* %31, i8** %3
%32 = load i8*, i8** %3
%33 = bitcast i8* %32 to i16*
%34 = load i16, i16* %33
%35 = sitofp i16 %34 to float
%36 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), float %35)
%37 = load i8*, i8** %3
%38 = getelementptr inbounds i8, i8* %37, i64 8
store i8* %38, i8** %3
%39 = load i8*, i8** %3
%40 = bitcast i8* %39 to i32*
%41 = load i32, i32* %40
%42 = sitofp i32 %41 to float
%43 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), float %42)
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 8
store i8* %45, i8** %3
%46 = load i8*, i8** %3
%47 = bitcast i8* %46 to double*
%48 = load double, double* %47
%49 = fptrunc double %48 to float
%50 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), float %49)
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i64 8
store i8* %52, i8** %3
%53 = load i8*, i8** %3
%54 = bitcast i8* %53 to float*
%55 = load float, float* %54
%56 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), float %55)
%57 = load i32, i32* @EXIT_SUCCESS
ret i32 %57
}

LLVM IR (-O2):
@.str = [12 x i8] c"B.e[0]: %c\0A\00"
@.str.1 = [12 x i8] c"B.e[1]: %c\0A\00"
@.str.2 = [9 x i8] c"B.f: %d\0A\00"
@.str.3 = [9 x i8] c"B.g: %f\0A\00"
@.str.4 = [9 x i8] c"B.h: %d\0A\00"
@.str.5 = [11 x i8] c"B.i.a: %d\0A\00"
@.str.6 = [11 x i8] c"B.i.b: %f\0A\00"
@.str.7 = [11 x i8] c"B.i.c: %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float 9.700000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), float 9.800000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), float 1.000000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), float 0x40263851E0000000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), float 3.200000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), float 1.200000e+01)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), float 0x40283D70A0000000)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), float 0x40283E0DE0000000)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}