int main() {
  struct student {
    char name[100];
    int roll;
    float marks;
  };
  struct student stu[] = {
      {"vandah", 12, 89.5f},
      {"edin", 15, 98.0f},
      {"david", 17, 90.0f},
  };
  stu[0].roll = 2;
  stu[-1].roll = 10;
  stu[1].marks = 90.5f;
  stu[20].marks = 89.5f;
  for (int i = 0; i < 3; ++i) {
    stu[i].roll = 5;
  }
  for (int i = 0; i < 10; ++i) {
    stu[i].roll = 5;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xee0(%rip),%rsi
mov    $0x144,%edx
call   1030 <memcpy@plt>
movl   $0x2,-0xec(%rbp)
movl   $0xa,-0x158(%rbp)
movss  0xeae(%rip),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  0xe9d(%rip),%xmm0
movss  %xmm0,0x788(%rbp)
movl   $0x0,-0x154(%rbp)
cmpl   $0x3,-0x154(%rbp)
jge    11b2 <main+0xa2>
movslq -0x154(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x6c,%rcx,%rcx
add    %rcx,%rax
movl   $0x5,0x64(%rax)
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    1175 <main+0x65>
movl   $0x0,-0x158(%rbp)
cmpl   $0xa,-0x158(%rbp)
jge    11f9 <main+0xe9>
movslq -0x158(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x6c,%rcx,%rcx
add    %rcx,%rax
movl   $0x5,0x64(%rax)
mov    -0x158(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x158(%rbp)
jmp    11bc <main+0xac>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.student = type { [100 x i8], i32, float }
@__const.main.stu = [3 x %struct.student] [%struct.student { [100 x i8] c"vandah\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 12, float 8.950000e+01 }, %struct.student { [100 x i8] c"edin\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 15, float 9.800000e+01 }, %struct.student { [100 x i8] c"david\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 17, float 9.000000e+01 }]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x %struct.student]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [3 x %struct.student]* %2 to i8*
%6 = getelementptr inbounds [3 x %struct.student], [3 x %struct.student]* %2, i64 0, i64 0
%7 = getelementptr inbounds %struct.student, %struct.student* %6, i32 0, i32 1
store i32 2, i32* %7
%8 = getelementptr inbounds [3 x %struct.student], [3 x %struct.student]* %2, i64 0, i64 -1
%9 = getelementptr inbounds %struct.student, %struct.student* %8, i32 0, i32 1
store i32 10, i32* %9
%10 = getelementptr inbounds [3 x %struct.student], [3 x %struct.student]* %2, i64 0, i64 1
%11 = getelementptr inbounds %struct.student, %struct.student* %10, i32 0, i32 2
store float 9.050000e+01, float* %11
%12 = getelementptr inbounds [3 x %struct.student], [3 x %struct.student]* %2, i64 0, i64 20
%13 = getelementptr inbounds %struct.student, %struct.student* %12, i32 0, i32 2
store float 8.950000e+01, float* %13
store i32 0, i32* %3
br label %14
14: ; preds = %22, %0
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %25
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x %struct.student], [3 x %struct.student]* %2, i64 0, i64 %19
%21 = getelementptr inbounds %struct.student, %struct.student* %20, i32 0, i32 1
store i32 5, i32* %21
br label %22
22: ; preds = %17
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %14
25: ; preds = %14
store i32 0, i32* %4
br label %26
26: ; preds = %34, %25
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 10
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x %struct.student], [3 x %struct.student]* %2, i64 0, i64 %31
%33 = getelementptr inbounds %struct.student, %struct.student* %32, i32 0, i32 1
store i32 5, i32* %33
br label %34
34: ; preds = %29
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %26
37: ; preds = %26
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}