void nested_vectors_with_int_expression_indices() {
  int vec_in_vec[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
  int i = 1, j = 2;
  printf("%d\n", vec_in_vec[0 + 1][3 - 1]);
  printf("%d\n", vec_in_vec[0 + i][4 - j]);
  printf("%d\n", (3 - 1)[vec_in_vec[0 + 1]]);
  printf("%d\n", (4 - j)[(0 + i)[vec_in_vec]]);
  printf("%d\n", j[vec_in_vec[i ^ i]]);
  printf("%d\n", (j || i)[vec_in_vec[i & i]]);
  printf("%d\n",
         vec_in_vec[i][((i + 2) * 0) * 32598 + (j / (i + i + i)) * 0 + j]);
  printf("%d\n",
         (((i + 2) * 0) * 32598 + (j / (i + i + i)) * 0 + j)[vec_in_vec[i]]);
}


x86 assembly (clang, -O0):
<nested_vectors_with_int_expression_indices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x1,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rcx
lea    -0x30(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    $0x4,%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%ecx
sub    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rdx
lea    -0x30(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%eax
xor    -0x34(%rbp),%eax
movslq %eax,%rdx
lea    -0x30(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x38(%rbp)
mov    %al,-0x39(%rbp)
jne    1211 <nested_vectors_with_int_expression_indices+0xf1>
cmpl   $0x0,-0x34(%rbp)
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x34(%rbp),%eax
and    -0x34(%rbp),%eax
movslq %eax,%rdx
lea    -0x30(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x34(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
imul   $0x0,%eax,%eax
imul   $0x7f56,%eax,%ecx
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%esi
add    -0x34(%rbp),%esi
add    -0x34(%rbp),%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x48(%rbp),%rax
imul   $0x0,%edx,%edx
add    %edx,%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x2,%eax
imul   $0x0,%eax,%eax
imul   $0x7f56,%eax,%ecx
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%esi
add    -0x34(%rbp),%esi
add    -0x34(%rbp),%esi
cltd
idiv   %esi
imul   $0x0,%eax,%eax
add    %eax,%ecx
add    -0x38(%rbp),%ecx
movslq -0x34(%rbp),%rdx
lea    -0x30(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nested_vectors_with_int_expression_indices>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.nested_vectors_with_int_expression_indices.vec_in_vec = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9]]
@.str = [4 x i8] c"%d\0A\00"
define void @nested_vectors_with_int_expression_indices() {
%1 = alloca [3 x [3 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [3 x [3 x i32]]* %1 to i8*
store i32 1, i32* %2
store i32 2, i32* %3
%5 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 1
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 0, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %11
%13 = load i32, i32* %3
%14 = sub nsw i32 4, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 1
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 0, i64 2
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %3
%24 = sub nsw i32 4, %23
%25 = load i32, i32* %2
%26 = add nsw i32 0, %25
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %27
%29 = sext i32 %24 to i64
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %28, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %3
%34 = load i32, i32* %2
%35 = load i32, i32* %2
%36 = xor i32 %34, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %37
%39 = sext i32 %33 to i64
%40 = getelementptr inbounds [3 x i32], [3 x i32]* %38, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %3
%44 = icmp ne i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %0
%46 = load i32, i32* %2
%47 = icmp ne i32 %46, 0
br label %48
48: ; preds = %45, %0
%49 = phi i1 [ true, %0 ], [ %47, %45 ]
%50 = zext i1 %49 to i32
%51 = load i32, i32* %2
%52 = load i32, i32* %2
%53 = and i32 %51, %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %54
%56 = sext i32 %50 to i64
%57 = getelementptr inbounds [3 x i32], [3 x i32]* %55, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %61
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 2
%65 = mul nsw i32 %64, 0
%66 = mul nsw i32 %65, 32598
%67 = load i32, i32* %3
%68 = load i32, i32* %2
%69 = load i32, i32* %2
%70 = add nsw i32 %68, %69
%71 = load i32, i32* %2
%72 = add nsw i32 %70, %71
%73 = sdiv i32 %67, %72
%74 = mul nsw i32 %73, 0
%75 = add nsw i32 %66, %74
%76 = load i32, i32* %3
%77 = add nsw i32 %75, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [3 x i32], [3 x i32]* %62, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %2
%83 = add nsw i32 %82, 2
%84 = mul nsw i32 %83, 0
%85 = mul nsw i32 %84, 32598
%86 = load i32, i32* %3
%87 = load i32, i32* %2
%88 = load i32, i32* %2
%89 = add nsw i32 %87, %88
%90 = load i32, i32* %2
%91 = add nsw i32 %89, %90
%92 = sdiv i32 %86, %91
%93 = mul nsw i32 %92, 0
%94 = add nsw i32 %85, %93
%95 = load i32, i32* %3
%96 = add nsw i32 %94, %95
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %98
%100 = sext i32 %96 to i64
%101 = getelementptr inbounds [3 x i32], [3 x i32]* %99, i64 0, i64 %100
%102 = load i32, i32* %101
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %102)
ret void
}

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