#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double a[20][40];
  double(*b)[40];
  double *c;
  int i, j;
  for (i = 0; i < 20; i++)
    for (j = 0; j < 40; j++)
      a[i][j] = i * 100 + j;
  b = a + 5;
  c = a[5];
  printf("a[5][7] \t= %f \n", a[5][7]);
  printf("b[0][7] \t= %f \n", b[0][7]);
  printf("c[7]    \t= %f \n", c[7]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1930,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1924(%rbp)
cmpl   $0x14,-0x1924(%rbp)
jge    11b2 <main+0xa2>
movl   $0x0,-0x1928(%rbp)
cmpl   $0x28,-0x1928(%rbp)
jge    1199 <main+0x89>
imul   $0x64,-0x1924(%rbp),%eax
add    -0x1928(%rbp),%eax
cvtsi2sd %eax,%xmm0
movslq -0x1924(%rbp),%rcx
lea    -0x1910(%rbp),%rax
imul   $0x140,%rcx,%rcx
add    %rcx,%rax
movslq -0x1928(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1928(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1928(%rbp)
jmp    1143 <main+0x33>
jmp    119e <main+0x8e>
mov    -0x1924(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1924(%rbp)
jmp    112c <main+0x1c>
lea    -0x1910(%rbp),%rax
add    $0x640,%rax
mov    %rax,-0x1918(%rbp)
lea    -0x1910(%rbp),%rax
add    $0x640,%rax
mov    %rax,-0x1920(%rbp)
movsd  -0x1298(%rbp),%xmm0
ff
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1918(%rbp),%rax
movsd  0x38(%rax),%xmm0
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1920(%rbp),%rax
movsd  0x38(%rax),%xmm0
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1930,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x1918,%rsp
lea    0x140(%rsp),%rax
xor    %ecx,%ecx
movdqa 0xf36(%rip),%xmm14
movdqa 0xf3d(%rip),%xmm15
movdqa 0xf44(%rip),%xmm13
movdqa 0xf4c(%rip),%xmm1
movdqa 0xf54(%rip),%xmm2
movdqa 0xf5c(%rip),%xmm3
movdqa 0xf64(%rip),%xmm4
movdqa 0xf6c(%rip),%xmm5
movdqa 0xf74(%rip),%xmm6
movdqa 0xf7c(%rip),%xmm7
movdqa 0xf83(%rip),%xmm8
movdqa 0xf8a(%rip),%xmm9
movdqa 0xf91(%rip),%xmm10
movdqa 0xf98(%rip),%xmm11
nopl   0x0(%rax,%rax,1)
movd   %ecx,%xmm0
pshufd $0x50,%xmm0,%xmm12
movdqa %xmm12,%xmm0
por    0xe49(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x130(%rax)
movdqa %xmm12,%xmm0
por    0xe41(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x120(%rax)
movdqa %xmm12,%xmm0
paddd  0xe39(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x110(%rax)
movdqa %xmm12,%xmm0
paddd  0xe31(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x100(%rax)
movdqa %xmm12,%xmm0
paddd  0xe29(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0xf0(%rax)
movdqa %xmm12,%xmm0
paddd  0xe21(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0xe0(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm14,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0xd0(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm15,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0xc0(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm13,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0xb0(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0xa0(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm2,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x90(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm3,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x80(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm4,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x70(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm5,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x60(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm6,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x50(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm7,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x40(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm8,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x30(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm9,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x20(%rax)
movdqa %xmm12,%xmm0
paddd  %xmm10,%xmm0
cvtdq2pd %xmm0,%xmm0
movaps %xmm0,-0x10(%rax)
paddd  %xmm11,%xmm12
cvtdq2pd %xmm12,%xmm0
movaps %xmm0,(%rax)
add    $0x140,%rax
add    $0x64,%rcx
cmp    $0x7d0,%rcx
jne    11a0 <main+0x90>
movsd  0x688(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
lea    0xdde(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xddc(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1918,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a[5][7] \09= %f \0A\00"
@.str.1 = [16 x i8] c"b[0][7] \09= %f \0A\00"
@.str.2 = [16 x i8] c"c[7] \09= %f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [40 x double]]
%3 = alloca [40 x double]*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %7
7: ; preds = %30, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 20
br i1 %9, label %10, label %33
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %26, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 40
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = load i32, i32* %5
%16 = mul nsw i32 %15, 100
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
%19 = sitofp i32 %18 to double
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %2, i64 0, i64 %21
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [40 x double], [40 x double]* %22, i64 0, i64 %24
store double %19, double* %25
br label %26
26: ; preds = %14
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %11
29: ; preds = %11
br label %30
30: ; preds = %29
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %7
33: ; preds = %7
%34 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %2, i64 0, i64 0
%35 = getelementptr inbounds [40 x double], [40 x double]* %34, i64 5
store [40 x double]* %35, [40 x double]** %3
%36 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %2, i64 0, i64 5
%37 = getelementptr inbounds [40 x double], [40 x double]* %36, i64 0, i64 0
store double* %37, double** %4
%38 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %2, i64 0, i64 5
%39 = getelementptr inbounds [40 x double], [40 x double]* %38, i64 0, i64 7
%40 = load double, double* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %40)
%42 = load [40 x double]*, [40 x double]** %3
%43 = getelementptr inbounds [40 x double], [40 x double]* %42, i64 0
%44 = getelementptr inbounds [40 x double], [40 x double]* %43, i64 0, i64 7
%45 = load double, double* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %45)
%47 = load double*, double** %4
%48 = getelementptr inbounds double, double* %47, i64 7
%49 = load double, double* %48
%50 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %49)
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@.str = [16 x i8] c"a[5][7] \09= %f \0A\00"
@.str.1 = [16 x i8] c"b[0][7] \09= %f \0A\00"
@.str.2 = [16 x i8] c"c[7] \09= %f \0A\00"
define i32 @main() {
%1 = alloca [20 x [40 x double]]
%2 = bitcast [20 x [40 x double]]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %108, %3 ]
%5 = mul nuw nsw i64 %4, 100
%6 = insertelement <2 x i64> poison, i64 %5, i64 0
%7 = shufflevector <2 x i64> %6, <2 x i64> poison, <2 x i32> zeroinitializer
%8 = trunc <2 x i64> %7 to <2 x i32>
%9 = or <2 x i32> %8, <i32 0, i32 1>
%10 = sitofp <2 x i32> %9 to <2 x double>
%11 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 0
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> %10, <2 x double>* %12
%13 = trunc <2 x i64> %7 to <2 x i32>
%14 = or <2 x i32> %13, <i32 2, i32 3>
%15 = sitofp <2 x i32> %14 to <2 x double>
%16 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 2
%17 = bitcast double* %16 to <2 x double>*
store <2 x double> %15, <2 x double>* %17
%18 = trunc <2 x i64> %7 to <2 x i32>
%19 = add <2 x i32> %18, <i32 4, i32 5>
%20 = sitofp <2 x i32> %19 to <2 x double>
%21 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 4
%22 = bitcast double* %21 to <2 x double>*
store <2 x double> %20, <2 x double>* %22
%23 = trunc <2 x i64> %7 to <2 x i32>
%24 = add <2 x i32> %23, <i32 6, i32 7>
%25 = sitofp <2 x i32> %24 to <2 x double>
%26 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 6
%27 = bitcast double* %26 to <2 x double>*
store <2 x double> %25, <2 x double>* %27
%28 = trunc <2 x i64> %7 to <2 x i32>
%29 = add <2 x i32> %28, <i32 8, i32 9>
%30 = sitofp <2 x i32> %29 to <2 x double>
%31 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 8
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> %30, <2 x double>* %32
%33 = trunc <2 x i64> %7 to <2 x i32>
%34 = add <2 x i32> %33, <i32 10, i32 11>
%35 = sitofp <2 x i32> %34 to <2 x double>
%36 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 10
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> %35, <2 x double>* %37
%38 = trunc <2 x i64> %7 to <2 x i32>
%39 = add <2 x i32> %38, <i32 12, i32 13>
%40 = sitofp <2 x i32> %39 to <2 x double>
%41 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 12
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> %40, <2 x double>* %42
%43 = trunc <2 x i64> %7 to <2 x i32>
%44 = add <2 x i32> %43, <i32 14, i32 15>
%45 = sitofp <2 x i32> %44 to <2 x double>
%46 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 14
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %45, <2 x double>* %47
%48 = trunc <2 x i64> %7 to <2 x i32>
%49 = add <2 x i32> %48, <i32 16, i32 17>
%50 = sitofp <2 x i32> %49 to <2 x double>
%51 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 16
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> %50, <2 x double>* %52
%53 = trunc <2 x i64> %7 to <2 x i32>
%54 = add <2 x i32> %53, <i32 18, i32 19>
%55 = sitofp <2 x i32> %54 to <2 x double>
%56 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 18
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %55, <2 x double>* %57
%58 = trunc <2 x i64> %7 to <2 x i32>
%59 = add <2 x i32> %58, <i32 20, i32 21>
%60 = sitofp <2 x i32> %59 to <2 x double>
%61 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 20
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %60, <2 x double>* %62
%63 = trunc <2 x i64> %7 to <2 x i32>
%64 = add <2 x i32> %63, <i32 22, i32 23>
%65 = sitofp <2 x i32> %64 to <2 x double>
%66 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 22
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %65, <2 x double>* %67
%68 = trunc <2 x i64> %7 to <2 x i32>
%69 = add <2 x i32> %68, <i32 24, i32 25>
%70 = sitofp <2 x i32> %69 to <2 x double>
%71 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 24
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %70, <2 x double>* %72
%73 = trunc <2 x i64> %7 to <2 x i32>
%74 = add <2 x i32> %73, <i32 26, i32 27>
%75 = sitofp <2 x i32> %74 to <2 x double>
%76 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 26
%77 = bitcast double* %76 to <2 x double>*
store <2 x double> %75, <2 x double>* %77
%78 = trunc <2 x i64> %7 to <2 x i32>
%79 = add <2 x i32> %78, <i32 28, i32 29>
%80 = sitofp <2 x i32> %79 to <2 x double>
%81 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 28
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> %80, <2 x double>* %82
%83 = trunc <2 x i64> %7 to <2 x i32>
%84 = add <2 x i32> %83, <i32 30, i32 31>
%85 = sitofp <2 x i32> %84 to <2 x double>
%86 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 30
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %85, <2 x double>* %87
%88 = trunc <2 x i64> %7 to <2 x i32>
%89 = add <2 x i32> %88, <i32 32, i32 33>
%90 = sitofp <2 x i32> %89 to <2 x double>
%91 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 32
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> %90, <2 x double>* %92
%93 = trunc <2 x i64> %7 to <2 x i32>
%94 = add <2 x i32> %93, <i32 34, i32 35>
%95 = sitofp <2 x i32> %94 to <2 x double>
%96 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 34
%97 = bitcast double* %96 to <2 x double>*
store <2 x double> %95, <2 x double>* %97
%98 = trunc <2 x i64> %7 to <2 x i32>
%99 = add <2 x i32> %98, <i32 36, i32 37>
%100 = sitofp <2 x i32> %99 to <2 x double>
%101 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 36
%102 = bitcast double* %101 to <2 x double>*
store <2 x double> %100, <2 x double>* %102
%103 = trunc <2 x i64> %7 to <2 x i32>
%104 = add <2 x i32> %103, <i32 38, i32 39>
%105 = sitofp <2 x i32> %104 to <2 x double>
%106 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 %4, i64 38
%107 = bitcast double* %106 to <2 x double>*
store <2 x double> %105, <2 x double>* %107
%108 = add nuw nsw i64 %4, 1
%109 = icmp eq i64 %108, 20
br i1 %109, label %110, label %3
110: ; preds = %3
%111 = getelementptr inbounds [20 x [40 x double]], [20 x [40 x double]]* %1, i64 0, i64 5, i64 7
%112 = load double, double* %111
%113 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %112)
%114 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %112)
%115 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %112)
ret i32 0
}