#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*/ assert(int);
main() {
  union {
    struct {
      int st_first;
      int st_second;
    } st;
    int hello;
    union {
      int a, b, c;
    } un;
  } x;
  x.st.st_first = 5;
  assert(x.un.a == 5);
  assert(x.un.b == 5);
  assert(x.un.c == 5);
  assert(x.hello == 5);
  return *(int *)((void *)&x.st.st_second - sizeof(int)) == 5 ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x5,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x5,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x5,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x5,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { i32, i32 }
%union.anon.0 = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to %struct.anon*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
store i32 5, i32* %4
%5 = bitcast %union.anon* %2 to %union.anon.0*
%6 = bitcast %union.anon.0* %5 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 5
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = bitcast %union.anon* %2 to %union.anon.0*
%12 = bitcast %union.anon.0* %11 to i32*
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 5
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = bitcast %union.anon* %2 to %union.anon.0*
%18 = bitcast %union.anon.0* %17 to i32*
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 5
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = bitcast %union.anon* %2 to i32*
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 5
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = bitcast %union.anon* %2 to %struct.anon*
%29 = getelementptr inbounds %struct.anon, %struct.anon* %28, i32 0, i32 1
%30 = bitcast i32* %29 to i8*
%31 = getelementptr i8, i8* %30, i64 -4
%32 = bitcast i8* %31 to i32*
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 5
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 0, i32 1
ret i32 %36
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}