#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 */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  long b = 0;
  typedef struct testers {
    int i, j, k, l;
  } tester;
  typedef struct testerlongs {
    int i, j, k;
    long l;
  } testerlong;
  typedef struct withunions {
    union {
      int children;
      long beard;
    } u;
  } withunion;
  tester name;
  testerlong sname;
  withunion union_size;
  name.i = 0, name.j = 0, name.k = 0, name.l = 0;
  sname.i = 0, sname.j = 0, sname.k = 0, sname.l = 0;
  union_size.u.children = 0;
  printf("size of int: %lu\n", sizeof(a));
  printf("size of long: %lu\n", sizeof(b));
  printf("size of tester with int: %lu\n", sizeof(tester));
  printf("size of tester with one long: %lu\n", sizeof(testerlong));
  printf("size of union %ld\n", sizeof(withunion));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x40(%rbp)
lea    0xe8b(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.testers = type { i32, i32, i32, i32 }
%struct.testerlongs = type { i32, i32, i32, i64 }
%struct.withunions = type { %union.anon }
%union.anon = type { i64 }
@.str = [18 x i8] c"size of int: %lu\0A\00"
@.str.1 = [19 x i8] c"size of long: %lu\0A\00"
@.str.2 = [30 x i8] c"size of tester with int: %lu\0A\00"
@.str.3 = [35 x i8] c"size of tester with one long: %lu\0A\00"
@.str.4 = [19 x i8] c"size of union %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca %struct.testers
%5 = alloca %struct.testerlongs
%6 = alloca %struct.withunions
store i32 0, i32* %1
store i32 0, i32* %2
store i64 0, i64* %3
%7 = getelementptr inbounds %struct.testers, %struct.testers* %4, i32 0, i32 0
store i32 0, i32* %7
%8 = getelementptr inbounds %struct.testers, %struct.testers* %4, i32 0, i32 1
store i32 0, i32* %8
%9 = getelementptr inbounds %struct.testers, %struct.testers* %4, i32 0, i32 2
store i32 0, i32* %9
%10 = getelementptr inbounds %struct.testers, %struct.testers* %4, i32 0, i32 3
store i32 0, i32* %10
%11 = getelementptr inbounds %struct.testerlongs, %struct.testerlongs* %5, i32 0, i32 0
store i32 0, i32* %11
%12 = getelementptr inbounds %struct.testerlongs, %struct.testerlongs* %5, i32 0, i32 1
store i32 0, i32* %12
%13 = getelementptr inbounds %struct.testerlongs, %struct.testerlongs* %5, i32 0, i32 2
store i32 0, i32* %13
%14 = getelementptr inbounds %struct.testerlongs, %struct.testerlongs* %5, i32 0, i32 3
store i64 0, i64* %14
%15 = getelementptr inbounds %struct.withunions, %struct.withunions* %6, i32 0, i32 0
%16 = bitcast %union.anon* %15 to i32*
store i32 0, i32* %16
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 8)
%19 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 16)
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 24)
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"size of int: %lu\0A\00"
@.str.1 = [19 x i8] c"size of long: %lu\0A\00"
@.str.2 = [30 x i8] c"size of tester with int: %lu\0A\00"
@.str.3 = [35 x i8] c"size of tester with one long: %lu\0A\00"
@.str.4 = [19 x i8] c"size of union %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 16)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 24)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 8)
ret i32 0
}