int main(void) {
  volatile struct struct_libtype_opaque *pointer_struct_opaque = (void *)0;
  volatile struct struct_libtype_empty *pointer_struct_empty = (void *)0;
  volatile struct struct_libtype_filled *pointer_struct_filled = (void *)0;
  volatile union union_libtype_opaque *pointer_union_opaque = (void *)0;
  volatile union union_libtype_empty *pointer_union_empty = (void *)0;
  volatile union union_libtype_filled *pointer_union_filled = (void *)0;
  return (long)pointer_struct_opaque + (long)pointer_struct_empty +
         (long)pointer_struct_filled + (long)pointer_union_opaque +
         (long)pointer_union_empty + (long)pointer_union_filled;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
add    %rcx,%rax
mov    -0x30(%rbp),%rcx
add    %rcx,%rax
mov    -0x38(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.struct_libtype_opaque = type opaque
%struct.struct_libtype_empty = type opaque
%struct.struct_libtype_filled = type opaque
%union.union_libtype_opaque = type opaque
%union.union_libtype_empty = type opaque
%union.union_libtype_filled = type opaque
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.struct_libtype_opaque*
%3 = alloca %struct.struct_libtype_empty*
%4 = alloca %struct.struct_libtype_filled*
%5 = alloca %union.union_libtype_opaque*
%6 = alloca %union.union_libtype_empty*
%7 = alloca %union.union_libtype_filled*
store i32 0, i32* %1
store %struct.struct_libtype_opaque* null, %struct.struct_libtype_opaque** %2
store %struct.struct_libtype_empty* null, %struct.struct_libtype_empty** %3
store %struct.struct_libtype_filled* null, %struct.struct_libtype_filled** %4
store %union.union_libtype_opaque* null, %union.union_libtype_opaque** %5
store %union.union_libtype_empty* null, %union.union_libtype_empty** %6
store %union.union_libtype_filled* null, %union.union_libtype_filled** %7
%8 = load %struct.struct_libtype_opaque*, %struct.struct_libtype_opaque** %2
%9 = ptrtoint %struct.struct_libtype_opaque* %8 to i64
%10 = load %struct.struct_libtype_empty*, %struct.struct_libtype_empty** %3
%11 = ptrtoint %struct.struct_libtype_empty* %10 to i64
%12 = add nsw i64 %9, %11
%13 = load %struct.struct_libtype_filled*, %struct.struct_libtype_filled** %4
%14 = ptrtoint %struct.struct_libtype_filled* %13 to i64
%15 = add nsw i64 %12, %14
%16 = load %union.union_libtype_opaque*, %union.union_libtype_opaque** %5
%17 = ptrtoint %union.union_libtype_opaque* %16 to i64
%18 = add nsw i64 %15, %17
%19 = load %union.union_libtype_empty*, %union.union_libtype_empty** %6
%20 = ptrtoint %union.union_libtype_empty* %19 to i64
%21 = add nsw i64 %18, %20
%22 = load %union.union_libtype_filled*, %union.union_libtype_filled** %7
%23 = ptrtoint %union.union_libtype_filled* %22 to i64
%24 = add nsw i64 %21, %23
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
%struct.struct_libtype_opaque = type opaque
%struct.struct_libtype_empty = type opaque
%struct.struct_libtype_filled = type opaque
%union.union_libtype_opaque = type opaque
%union.union_libtype_empty = type opaque
%union.union_libtype_filled = type opaque
define i32 @main() {
ret i32 0
}