main() {
  struct {
    int i, j, k;
  } sts[] = {[5] = {.j = 1}};
  for (int i = 0; i < 6; i++)
    printf("sts[%d] = { %d, %d, %d }\n", i, sts[i].i, sts[i].j, sts[i].k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1040 <memset@plt>
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x6,-0x54(%rbp)
jge    11ac <main+0x8c>
mov    -0x54(%rbp),%esi
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%edx
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%ecx
movslq -0x54(%rbp),%rdi
lea    -0x50(%rbp),%rax
imul   $0xc,%rdi,%rdi
add    %rdi,%rax
mov    0x8(%rax),%r8d
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    114d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32, i32 }
@.str = [26 x i8] c"sts[%d] = { %d, %d, %d }\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x %struct.anon]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x %struct.anon]* %2 to i8*
%5 = bitcast i8* %4 to [6 x %struct.anon]*
%6 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %5, i32 0, i32 5
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
store i32 1, i32* %7
store i32 0, i32* %3
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %32
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %2, i64 0, i64 %14
%16 = getelementptr inbounds %struct.anon, %struct.anon* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %2, i64 0, i64 %19
%21 = getelementptr inbounds %struct.anon, %struct.anon* %20, i32 0, i32 1
%22 = load i32, i32* %21
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %2, i64 0, i64 %24
%26 = getelementptr inbounds %struct.anon, %struct.anon* %25, i32 0, i32 2
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %17, i32 %22, i32 %27)
br label %29
29: ; preds = %11
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %8
32: ; preds = %8
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [26 x i8] c"sts[%d] = { %d, %d, %d }\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0, i32 0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 0, i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 3, i32 0, i32 0, i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 4, i32 0, i32 0, i32 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 5, i32 0, i32 1, i32 0)
ret i32 0
}