#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ showaddr(char *, long *);
int main(int argc, char *argv[]) {
  struct some {
    char c1;
    char c2;
    long n;
  } st1;
  struct any {
    union {
      char c;
      long n;
    } u1;
    union {
      char c;
      long n;
    } u2;
    long n;
  } st2;
  showaddr("st1.c1  ", &st1.c1);
  showaddr("st1.c2  ", &st1.c2);
  showaddr("st1.n   ", &st1.n);
  showaddr("st2.u1.c", &st2.u1.c);
  showaddr("st2.u2.c", &st2.u2.c);
  showaddr("st2.n   ", &st2.n);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <showaddr@plt>
lea    -0x20(%rbp),%rsi
add    $0x1,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <showaddr@plt>
lea    -0x20(%rbp),%rsi
add    $0x8,%rsi
lea    0xea9(%rip),%rdi
call   1030 <showaddr@plt>
lea    -0x38(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1030 <showaddr@plt>
lea    -0x38(%rbp),%rsi
add    $0x8,%rsi
lea    0xe97(%rip),%rdi
call   1030 <showaddr@plt>
lea    -0x38(%rbp),%rsi
add    $0x10,%rsi
lea    0xe8c(%rip),%rdi
call   1030 <showaddr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1030 <showaddr@plt>
lea    0x1(%rsp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <showaddr@plt>
lea    0x8(%rsp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <showaddr@plt>
lea    0xebf(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <showaddr@plt>
lea    0x18(%rsp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <showaddr@plt>
lea    0x20(%rsp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <showaddr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.some = type { i8, i8, i64 }
%struct.any = type { %union.anon, %union.anon.0, i64 }
%union.anon = type { i64 }
%union.anon.0 = type { i64 }
@.str = [9 x i8] c"st1.c1 \00"
@.str.1 = [9 x i8] c"st1.c2 \00"
@.str.2 = [9 x i8] c"st1.n \00"
@.str.3 = [9 x i8] c"st2.u1.c\00"
@.str.4 = [9 x i8] c"st2.u2.c\00"
@.str.5 = [9 x i8] c"st2.n \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.some
%7 = alloca %struct.any
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds %struct.some, %struct.some* %6, i32 0, i32 0
%9 = bitcast i8* %8 to i64*
%10 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %9)
%11 = getelementptr inbounds %struct.some, %struct.some* %6, i32 0, i32 1
%12 = bitcast i8* %11 to i64*
%13 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64* %12)
%14 = getelementptr inbounds %struct.some, %struct.some* %6, i32 0, i32 2
%15 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64* %14)
%16 = getelementptr inbounds %struct.any, %struct.any* %7, i32 0, i32 0
%17 = bitcast %union.anon* %16 to i8*
%18 = bitcast i8* %17 to i64*
%19 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64* %18)
%20 = getelementptr inbounds %struct.any, %struct.any* %7, i32 0, i32 1
%21 = bitcast %union.anon.0* %20 to i8*
%22 = bitcast i8* %21 to i64*
%23 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i64* %22)
%24 = getelementptr inbounds %struct.any, %struct.any* %7, i32 0, i32 2
%25 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i64* %24)
%26 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.some = type { i8, i8, i64 }
%struct.any = type { %union.anon, %union.anon.0, i64 }
%union.anon = type { i64 }
%union.anon.0 = type { i64 }
@.str = [9 x i8] c"st1.c1 \00"
@.str.1 = [9 x i8] c"st1.c2 \00"
@.str.2 = [9 x i8] c"st1.n \00"
@.str.3 = [9 x i8] c"st2.u1.c\00"
@.str.4 = [9 x i8] c"st2.u2.c\00"
@.str.5 = [9 x i8] c"st2.n \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.some
%4 = alloca %struct.any
%5 = getelementptr inbounds %struct.some, %struct.some* %3, i64 0, i32 0
%6 = bitcast %struct.any* %4 to i8*
%7 = bitcast %struct.some* %3 to i64*
%8 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %7)
%9 = getelementptr inbounds %struct.some, %struct.some* %3, i64 0, i32 1
%10 = bitcast i8* %9 to i64*
%11 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64* %10)
%12 = getelementptr inbounds %struct.some, %struct.some* %3, i64 0, i32 2
%13 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64* %12)
%14 = getelementptr inbounds %struct.any, %struct.any* %4, i64 0, i32 0, i32 0
%15 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64* %14)
%16 = getelementptr inbounds %struct.any, %struct.any* %4, i64 0, i32 1, i32 0
%17 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i64* %16)
%18 = getelementptr inbounds %struct.any, %struct.any* %4, i64 0, i32 2
%19 = call i32 @showaddr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i64* %18)
%20 = call i32 @exit(i32 0)
unreachable
}