void iniMatriz(double **matriz, double *h) {
  int i, j;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 5; j++) {
      matriz[i][j] = 0;
    }
  }
  for (i = 1; i < 5 - 1; i++) {
    matriz[i][i] = 2 * (h[i - 1] + h[i]);
    matriz[i][i + 1] = h[i];
    matriz[i + 1][i] = h[i];
  }
  matriz[5 - 1][5 - 1] = 2 * h[3];
  matriz[5 - 1][5 - 2] = h[3];
  matriz[5 - 2][5 - 1] = h[3];
  matriz[0][0] = 2 * h[0];
  matriz[0][1] = h[0];
  matriz[1][0] = h[0];
}


x86 assembly (clang, -O0):
<iniMatriz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1167 <iniMatriz+0x67>
movl   $0x0,-0x18(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    1154 <iniMatriz+0x54>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1124 <iniMatriz+0x24>
jmp    1159 <iniMatriz+0x59>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <iniMatriz+0x13>
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1214 <iniMatriz+0x114>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xe61(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <iniMatriz+0x6e>
mov    -0x10(%rbp),%rax
movsd  0xde0(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0xd96(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iniMatriz>:
mov    (%rdi),%r8
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%r8)
movups %xmm0,(%r8)
movq   $0x0,0x20(%r8)
mov    0x8(%rdi),%rcx
movups %xmm0,0x10(%rcx)
movups %xmm0,(%rcx)
movq   $0x0,0x20(%rcx)
mov    0x10(%rdi),%rax
movups %xmm0,0x10(%rax)
movups %xmm0,(%rax)
movq   $0x0,0x20(%rax)
mov    0x18(%rdi),%rdx
movups %xmm0,0x10(%rdx)
movups %xmm0,(%rdx)
movq   $0x0,0x20(%rdx)
mov    0x20(%rdi),%rdi
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0x20(%rdi)
movsd  (%rsi),%xmm0
addsd  0x8(%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  0x8(%rsi),%xmm0
addsd  0x10(%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x18(%rax)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
movsd  0x10(%rsi),%xmm0
addsd  0x18(%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rdx)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x20(%rdx)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
movsd  0x18(%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x20(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x20(%rdx)
movsd  (%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%r8)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%r8)
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @iniMatriz(double** %0, double* %1) {
%3 = alloca double**
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double** %0, double*** %3
store double* %1, double** %4
store i32 0, i32* %5
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %30
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %23, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load double**, double*** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double*, double** %15, i64 %17
%19 = load double*, double** %18
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
store double 0.000000e+00, double* %22
br label %23
23: ; preds = %14
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %11
26: ; preds = %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %7
30: ; preds = %7
store i32 1, i32* %5
br label %31
31: ; preds = %84, %30
%32 = load i32, i32* %5
%33 = icmp slt i32 %32, 4
br i1 %33, label %34, label %87
34: ; preds = %31
%35 = load double*, double** %4
%36 = load i32, i32* %5
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %35, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %4
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = fadd double %40, %45
%47 = fmul double 2.000000e+00, %46
%48 = load double**, double*** %3
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double*, double** %48, i64 %50
%52 = load double*, double** %51
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %52, i64 %54
store double %47, double* %55
%56 = load double*, double** %4
%57 = load i32, i32* %5
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = load double**, double*** %3
%62 = load i32, i32* %5
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double*, double** %61, i64 %63
%65 = load double*, double** %64
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %65, i64 %68
store double %60, double* %69
%70 = load double*, double** %4
%71 = load i32, i32* %5
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = load double**, double*** %3
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double*, double** %75, i64 %78
%80 = load double*, double** %79
%81 = load i32, i32* %5
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
store double %74, double* %83
br label %84
84: ; preds = %34
%85 = load i32, i32* %5
%86 = add nsw i32 %85, 1
store i32 %86, i32* %5
br label %31
87: ; preds = %31
%88 = load double*, double** %4
%89 = getelementptr inbounds double, double* %88, i64 3
%90 = load double, double* %89
%91 = fmul double 2.000000e+00, %90
%92 = load double**, double*** %3
%93 = getelementptr inbounds double*, double** %92, i64 4
%94 = load double*, double** %93
%95 = getelementptr inbounds double, double* %94, i64 4
store double %91, double* %95
%96 = load double*, double** %4
%97 = getelementptr inbounds double, double* %96, i64 3
%98 = load double, double* %97
%99 = load double**, double*** %3
%100 = getelementptr inbounds double*, double** %99, i64 4
%101 = load double*, double** %100
%102 = getelementptr inbounds double, double* %101, i64 3
store double %98, double* %102
%103 = load double*, double** %4
%104 = getelementptr inbounds double, double* %103, i64 3
%105 = load double, double* %104
%106 = load double**, double*** %3
%107 = getelementptr inbounds double*, double** %106, i64 3
%108 = load double*, double** %107
%109 = getelementptr inbounds double, double* %108, i64 4
store double %105, double* %109
%110 = load double*, double** %4
%111 = getelementptr inbounds double, double* %110, i64 0
%112 = load double, double* %111
%113 = fmul double 2.000000e+00, %112
%114 = load double**, double*** %3
%115 = getelementptr inbounds double*, double** %114, i64 0
%116 = load double*, double** %115
%117 = getelementptr inbounds double, double* %116, i64 0
store double %113, double* %117
%118 = load double*, double** %4
%119 = getelementptr inbounds double, double* %118, i64 0
%120 = load double, double* %119
%121 = load double**, double*** %3
%122 = getelementptr inbounds double*, double** %121, i64 0
%123 = load double*, double** %122
%124 = getelementptr inbounds double, double* %123, i64 1
store double %120, double* %124
%125 = load double*, double** %4
%126 = getelementptr inbounds double, double* %125, i64 0
%127 = load double, double* %126
%128 = load double**, double*** %3
%129 = getelementptr inbounds double*, double** %128, i64 1
%130 = load double*, double** %129
%131 = getelementptr inbounds double, double* %130, i64 0
store double %127, double* %131
ret void
}

LLVM IR (-O2):
define void @iniMatriz(double** nocapture %0, double* nocapture %1) {
%3 = load double*, double** %0
%4 = bitcast double* %3 to i8*
%5 = getelementptr inbounds double*, double** %0, i64 1
%6 = load double*, double** %5
%7 = bitcast double* %6 to i8*
%8 = getelementptr inbounds double*, double** %0, i64 2
%9 = load double*, double** %8
%10 = bitcast double* %9 to i8*
%11 = getelementptr inbounds double*, double** %0, i64 3
%12 = load double*, double** %11
%13 = bitcast double* %12 to i8*
%14 = getelementptr inbounds double*, double** %0, i64 4
%15 = load double*, double** %14
%16 = bitcast double* %15 to i8*
%17 = load double, double* %1
%18 = getelementptr inbounds double, double* %1, i64 1
%19 = load double, double* %18
%20 = fadd double %17, %19
%21 = fmul double %20, 2.000000e+00
%22 = getelementptr inbounds double, double* %6, i64 1
store double %21, double* %22
%23 = load double, double* %18
%24 = getelementptr inbounds double, double* %6, i64 2
store double %23, double* %24
%25 = load double, double* %18
%26 = getelementptr inbounds double, double* %9, i64 1
store double %25, double* %26
%27 = load double, double* %18
%28 = getelementptr inbounds double, double* %1, i64 2
%29 = load double, double* %28
%30 = fadd double %27, %29
%31 = fmul double %30, 2.000000e+00
%32 = getelementptr inbounds double, double* %9, i64 2
store double %31, double* %32
%33 = load double, double* %28
%34 = getelementptr inbounds double, double* %9, i64 3
store double %33, double* %34
%35 = load double, double* %28
%36 = getelementptr inbounds double, double* %12, i64 2
store double %35, double* %36
%37 = load double, double* %28
%38 = getelementptr inbounds double, double* %1, i64 3
%39 = load double, double* %38
%40 = fadd double %37, %39
%41 = fmul double %40, 2.000000e+00
%42 = getelementptr inbounds double, double* %12, i64 3
store double %41, double* %42
%43 = load double, double* %38
%44 = getelementptr inbounds double, double* %12, i64 4
store double %43, double* %44
%45 = load double, double* %38
%46 = getelementptr inbounds double, double* %15, i64 3
store double %45, double* %46
%47 = load double, double* %38
%48 = fmul double %47, 2.000000e+00
%49 = getelementptr inbounds double, double* %15, i64 4
store double %48, double* %49
%50 = load double, double* %38
store double %50, double* %46
%51 = load double, double* %38
store double %51, double* %44
%52 = load double, double* %1
%53 = fmul double %52, 2.000000e+00
store double %53, double* %3
%54 = load double, double* %1
%55 = getelementptr inbounds double, double* %3, i64 1
store double %54, double* %55
%56 = load double, double* %1
store double %56, double* %6
ret void
}