#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, j, m, n;
  m = 2;
  n = 2;
  float **a = (float **)malloc(m * sizeof(float *));
  for (i = 0; i < m; i++) {
    a[i] = (float *)malloc(n * sizeof(float));
  }
  a[0][0] = 1;
  a[0][1] = 4;
  a[1][0] = 3;
  a[1][1] = 2;
  printf("raw value:\n");
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      printf("i = %d, j = %d, a[i][j] = %.1f\n", i, j, a[i][j]);
      a[i][j] *= 2;
    }
  }
  printf("processed value:\n");
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      printf("i = %d, j = %d, a[i][j] = %.1f\n", i, j, a[i][j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    118f <main+0x6f>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <main+0x37>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movss  0xe6e(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movss  0xe57(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
movss  0xe3e(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
movss  0xe26(%rip),%xmm0
movss  %xmm0,0x4(%rax)
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    127f <main+0x15f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    126c <main+0x14c>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  0xdac(%rip),%xmm0
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1205 <main+0xe5>
jmp    1271 <main+0x151>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f4 <main+0xd4>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    12fd <main+0x1dd>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    12ea <main+0x1ca>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd47(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12a5 <main+0x185>
jmp    12ef <main+0x1cf>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1294 <main+0x174>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,(%rbx)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    (%rbx),%rcx
movabs $0x408000003f800000,%rdx
mov    %rdx,(%rcx)
movabs $0x4000000040400000,%rcx
mov    %rcx,(%rax)
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe69(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rbx),%rax
movss  (%rax),%xmm0
movss  0x4(%rax),%xmm1
addss  %xmm0,%xmm0
movss  %xmm0,(%rax)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rbx),%rax
movss  0x4(%rax),%xmm0
addss  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    0x8(%rbx),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movss  (%rax),%xmm0
movss  0x4(%rax),%xmm1
addss  %xmm0,%xmm0
movss  %xmm0,(%rax)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movss  0x4(%rax),%xmm0
addss  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
lea    0xde3(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rbx),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [32 x i8] c"i = %d, j = %d, a[i][j] = %.1f\0A\00"
@str = [11 x i8] c"raw value:\00"
@str.3 = [17 x i8] c"processed value:\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to float**
%3 = tail call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to float*
store float* %4, float** %2
%5 = tail call i64 @malloc(i32 8)
%6 = inttoptr i64 %5 to float*
%7 = getelementptr inbounds float*, float** %2, i64 1
store float* %6, float** %7
%8 = load float*, float** %2
store float 1.000000e+00, float* %8
%9 = getelementptr inbounds float, float* %8, i64 1
store float 4.000000e+00, float* %9
store float 3.000000e+00, float* %6
%10 = getelementptr inbounds float, float* %6, i64 1
store float 2.000000e+00, float* %10
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%12 = load float*, float** %2
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, double %14)
%16 = load float*, float** %2
%17 = load float, float* %16
%18 = fmul float %17, 2.000000e+00
store float %18, float* %16
%19 = getelementptr inbounds float, float* %16, i64 1
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1, double %21)
%23 = load float*, float** %2
%24 = getelementptr inbounds float, float* %23, i64 1
%25 = load float, float* %24
%26 = fmul float %25, 2.000000e+00
store float %26, float* %24
%27 = load float*, float** %7
%28 = load float, float* %27
%29 = fpext float %28 to double
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0, double %29)
%31 = load float*, float** %7
%32 = load float, float* %31
%33 = fmul float %32, 2.000000e+00
store float %33, float* %31
%34 = getelementptr inbounds float, float* %31, i64 1
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, double %36)
%38 = load float*, float** %7
%39 = getelementptr inbounds float, float* %38, i64 1
%40 = load float, float* %39
%41 = fmul float %40, 2.000000e+00
store float %41, float* %39
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
%43 = load float*, float** %2
%44 = load float, float* %43
%45 = fpext float %44 to double
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, double %45)
%47 = load float*, float** %2
%48 = getelementptr inbounds float, float* %47, i64 1
%49 = load float, float* %48
%50 = fpext float %49 to double
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1, double %50)
%52 = load float*, float** %7
%53 = load float, float* %52
%54 = fpext float %53 to double
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0, double %54)
%56 = load float*, float** %7
%57 = getelementptr inbounds float, float* %56, i64 1
%58 = load float, float* %57
%59 = fpext float %58 to double
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, double %59)
ret i32 0
}