int main(void) {
  typedef struct {
    int a;
    int b;
  } pair;
  pair x = {1, 2};
  pair y = {.a = 1, .b = 2};
  pair z;
  z.a = 1;
  z.b = 2;
  x = (pair){4, 5};
  x = (pair){.a = 1, .b = 2};
  pair *m = malloc(sizeof(pair));
  m->a = 10;
  m->b = 20;
  printf("%d %d %d %d\n", x.a, y.a, z.a, m->a);
  free(m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x4,-0x28(%rbp)
movl   $0x5,-0x24(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x2,-0x2c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x38(%rbp),%rax
movl   $0x14,0x4(%rax)
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    (%rax),%r8d
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.pair = type { i32, i32 }
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1, i32 10)
ret i32 0
}