int main(int argc, char **argv) {
  typedef int integer;
  typedef char **stringarray;
  init("typedef");
  integer a = argc;
  stringarray b = argv;
  typedef struct {
    int a;
  } foo_t;
  typedef union {
    foo_t *data;
  } bar_t;
  foo_t foo;
  bar_t bar;
  foo.a = argc;
  bar.data = &foo;
  typedef enum {
    fee,
    fi,
    fo,
  } fum_t;
  fum_t fum = fee;
  expecti(fum, fee);
  expecti(a, argc);
  expecti(b, argv);
  expecti(foo.a, a);
  expecti(bar.data->a, a);
  return ok();
}


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    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <init@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <expecti@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1050 <expecti@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <expecti@plt>
mov    -0x28(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1050 <expecti@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1050 <expecti@plt>
mov    $0x0,%al
call   1030 <ok@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <init@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <expecti@plt>
mov    %ebx,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <expecti@plt>
mov    %r14,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <expecti@plt>
mov    %ebx,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <expecti@plt>
mov    %ebx,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <expecti@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ok@plt>

LLVM IR (-O0):
%struct.foo_t = type { i32 }
%union.bar_t = type { %struct.foo_t* }
@.str = [8 x i8] c"typedef\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca %struct.foo_t
%9 = alloca %union.bar_t
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @init to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %4
store i32 %12, i32* %6
%13 = load i8**, i8*** %5
store i8** %13, i8*** %7
%14 = load i32, i32* %4
%15 = getelementptr inbounds %struct.foo_t, %struct.foo_t* %8, i32 0, i32 0
store i32 %14, i32* %15
%16 = bitcast %union.bar_t* %9 to %struct.foo_t**
store %struct.foo_t* %8, %struct.foo_t** %16
store i32 0, i32* %10
%17 = load i32, i32* %10
%18 = call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %17, i32 0)
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %19, i32 %20)
%22 = load i8**, i8*** %7
%23 = load i8**, i8*** %5
%24 = call i32 (i8**, i8**, ...) bitcast (i32 (...)* @expecti to i32 (i8**, i8**, ...)*)(i8** %22, i8** %23)
%25 = getelementptr inbounds %struct.foo_t, %struct.foo_t* %8, i32 0, i32 0
%26 = load i32, i32* %25
%27 = load i32, i32* %6
%28 = call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %26, i32 %27)
%29 = bitcast %union.bar_t* %9 to %struct.foo_t**
%30 = load %struct.foo_t*, %struct.foo_t** %29
%31 = getelementptr inbounds %struct.foo_t, %struct.foo_t* %30, i32 0, i32 0
%32 = load i32, i32* %31
%33 = load i32, i32* %6
%34 = call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %32, i32 %33)
%35 = call i32 (...) @ok()
ret i32 %35
}

LLVM IR (-O2):
%struct.foo_t = type { i32 }
@.str = [8 x i8] c"typedef\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @init to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 0, i32 0)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %0, i32 %0)
%6 = tail call i32 (i8**, i8**, ...) bitcast (i32 (...)* @expecti to i32 (i8**, i8**, ...)*)(i8** %1, i8** %1)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %0, i32 %0)
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %0, i32 %0)
%9 = tail call i32 (...) @ok()
ret i32 %9
}