acc_struct() {
  struct s1 {
    char s1_a[3];
  } ss1, is1;
  struct s2 {
    int s2_i;
    struct s1 s2_s1;
  };
  struct s3 {
    int s3_i;
    struct s2 s3_s2;
  } ss3, *ps3;
  set_err("acc_struct");
  ps3 = &ss3;
  is1.s1_a[0] = 1;
  is1.s1_a[1] = 100;
  is1.s1_a[2] = 127;
  ss3.s3_s2.s2_s1 = is1;
  ss1 = ps3->s3_s2.s2_s1;
  if (ss1.s1_a[0] != 1)
    e(1);
  if (ss1.s1_a[1] != 100)
    e(2);
  if (ss1.s1_a[2] != 127)
    e(3);
}


x86 assembly (clang, -O0):
<acc_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1040 <set_err@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movb   $0x1,-0x10(%rbp)
movb   $0x64,-0xf(%rbp)
movb   $0x7f,-0xe(%rbp)
mov    -0x10(%rbp),%ax
mov    %ax,-0x18(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0x16(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%cx
mov    %cx,-0x8(%rbp)
mov    0xa(%rax),%al
mov    %al,-0x6(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
je     1183 <acc_struct+0x63>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <e@plt>
movsbl -0x7(%rbp),%eax
cmp    $0x64,%eax
je     119c <acc_struct+0x7c>
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <e@plt>
movsbl -0x6(%rbp),%eax
cmp    $0x7f,%eax
je     11b5 <acc_struct+0x95>
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <e@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_struct>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <set_err@plt>

LLVM IR (-O0):
%struct.s1 = type { [3 x i8] }
%struct.s3 = type { i32, %struct.s2 }
%struct.s2 = type { i32, %struct.s1 }
@.str = [11 x i8] c"acc_struct\00"
define i32 @acc_struct() {
%1 = alloca i32
%2 = alloca %struct.s1
%3 = alloca %struct.s1
%4 = alloca %struct.s3
%5 = alloca %struct.s3*
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @set_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store %struct.s3* %4, %struct.s3** %5
%7 = getelementptr inbounds %struct.s1, %struct.s1* %3, i32 0, i32 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8 1, i8* %8
%9 = getelementptr inbounds %struct.s1, %struct.s1* %3, i32 0, i32 0
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 1
store i8 100, i8* %10
%11 = getelementptr inbounds %struct.s1, %struct.s1* %3, i32 0, i32 0
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 2
store i8 127, i8* %12
%13 = getelementptr inbounds %struct.s3, %struct.s3* %4, i32 0, i32 1
%14 = getelementptr inbounds %struct.s2, %struct.s2* %13, i32 0, i32 1
%15 = bitcast %struct.s1* %14 to i8*
%16 = bitcast %struct.s1* %3 to i8*
%17 = load %struct.s3*, %struct.s3** %5
%18 = getelementptr inbounds %struct.s3, %struct.s3* %17, i32 0, i32 1
%19 = getelementptr inbounds %struct.s2, %struct.s2* %18, i32 0, i32 1
%20 = bitcast %struct.s1* %2 to i8*
%21 = bitcast %struct.s1* %19 to i8*
%22 = getelementptr inbounds %struct.s1, %struct.s1* %2, i32 0, i32 0
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %22, i64 0, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 1
br i1 %26, label %27, label %29
27: ; preds = %0
%28 = call i32 (i32, ...) bitcast (i32 (...)* @e to i32 (i32, ...)*)(i32 1)
br label %29
29: ; preds = %27, %0
%30 = getelementptr inbounds %struct.s1, %struct.s1* %2, i32 0, i32 0
%31 = getelementptr inbounds [3 x i8], [3 x i8]* %30, i64 0, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 100
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 (i32, ...) bitcast (i32 (...)* @e to i32 (i32, ...)*)(i32 2)
br label %37
37: ; preds = %35, %29
%38 = getelementptr inbounds %struct.s1, %struct.s1* %2, i32 0, i32 0
%39 = getelementptr inbounds [3 x i8], [3 x i8]* %38, i64 0, i64 2
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 127
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = call i32 (i32, ...) bitcast (i32 (...)* @e to i32 (i32, ...)*)(i32 3)
br label %45
45: ; preds = %43, %37
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
%struct.s3 = type { i32, %struct.s2 }
%struct.s2 = type { i32, %struct.s1 }
%struct.s1 = type { [3 x i8] }
@.str = [11 x i8] c"acc_struct\00"
define i32 @acc_struct() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @set_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}