void solSistema(double **A, double *B, double *v) {
  int i;
  double k;
  for (i = 1; i < 5; i++) {
    k = -A[i][i - 1] / A[i - 1][i - 1];
    A[i][i] = A[i][i] + k * A[i - 1][i];
    B[i] = B[i] + k * B[i - 1];
  }
  v[5 - 1] = B[5 - 1] / A[5 - 1][5 - 1];
  for (i = 5 - 2; i >= 0; i--) {
    v[i] = (B[i] - A[i][i + 1] * v[i + 1]) / A[i][i];
  }
}


x86 assembly (clang, -O0):
<solSistema>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    120e <solSistema+0x10e>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <solSistema+0x17>
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
divsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movl   $0x3,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     12c6 <solSistema+0x1c6>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1234 <solSistema+0x134>
pop    %rbp
ret

x86 assembly (clang, -O2):
<solSistema>:
mov    (%rdi),%r8
mov    0x8(%rdi),%r9
movsd  (%r9),%xmm1
movapd 0xeec(%rip),%xmm0
xorpd  %xmm0,%xmm1
divsd  (%r8),%xmm1
movsd  0x8(%r8),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x8(%r9),%xmm2
movsd  %xmm2,0x8(%r9)
mulsd  (%rsi),%xmm1
addsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x8(%rsi)
mov    0x10(%rdi),%rax
movsd  0x8(%rax),%xmm1
xorpd  %xmm0,%xmm1
divsd  0x8(%r9),%xmm1
movsd  0x10(%r9),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x10(%rax),%xmm2
movsd  %xmm2,0x10(%rax)
mulsd  0x8(%rsi),%xmm1
addsd  0x10(%rsi),%xmm1
movsd  %xmm1,0x10(%rsi)
mov    0x18(%rdi),%rcx
movsd  0x10(%rcx),%xmm1
xorpd  %xmm0,%xmm1
divsd  0x10(%rax),%xmm1
movsd  0x18(%rax),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x18(%rcx),%xmm2
movsd  %xmm2,0x18(%rcx)
mulsd  0x10(%rsi),%xmm1
addsd  0x18(%rsi),%xmm1
movsd  %xmm1,0x18(%rsi)
mov    0x20(%rdi),%rdi
movsd  0x18(%rdi),%xmm1
xorpd  %xmm0,%xmm1
divsd  0x18(%rcx),%xmm1
movsd  0x20(%rcx),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x20(%rdi)
mulsd  0x18(%rsi),%xmm1
addsd  0x20(%rsi),%xmm1
movsd  %xmm1,0x20(%rsi)
divsd  0x20(%rdi),%xmm1
movsd  %xmm1,0x20(%rdx)
mulsd  0x20(%rcx),%xmm1
movsd  0x18(%rsi),%xmm0
subsd  %xmm1,%xmm0
divsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x18(%rdx)
mulsd  0x18(%rax),%xmm0
movsd  0x10(%rsi),%xmm1
subsd  %xmm0,%xmm1
divsd  0x10(%rax),%xmm1
movsd  %xmm1,0x10(%rdx)
mulsd  0x10(%r9),%xmm1
movsd  0x8(%rsi),%xmm0
subsd  %xmm1,%xmm0
divsd  0x8(%r9),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  (%rsi),%xmm1
mulsd  0x8(%r8),%xmm0
subsd  %xmm0,%xmm1
divsd  (%r8),%xmm1
movsd  %xmm1,(%rdx)
ret

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

LLVM IR (-O2):
define void @solSistema(double** nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = getelementptr inbounds double*, double** %0, i64 1
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = fneg double %6
%8 = load double*, double** %0
%9 = load double, double* %8
%10 = fdiv double %7, %9
%11 = getelementptr inbounds double, double* %5, i64 1
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %8, i64 1
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %10, double %14, double %12)
store double %15, double* %11
%16 = getelementptr inbounds double, double* %1, i64 1
%17 = load double, double* %16
%18 = load double, double* %1
%19 = tail call double @llvm.fmuladd.f64(double %10, double %18, double %17)
store double %19, double* %16
%20 = getelementptr inbounds double*, double** %0, i64 2
%21 = load double*, double** %20
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = fneg double %23
%25 = load double, double* %11
%26 = fdiv double %24, %25
%27 = getelementptr inbounds double, double* %21, i64 2
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %5, i64 2
%30 = load double, double* %29
%31 = tail call double @llvm.fmuladd.f64(double %26, double %30, double %28)
store double %31, double* %27
%32 = getelementptr inbounds double, double* %1, i64 2
%33 = load double, double* %32
%34 = load double, double* %16
%35 = tail call double @llvm.fmuladd.f64(double %26, double %34, double %33)
store double %35, double* %32
%36 = getelementptr inbounds double*, double** %0, i64 3
%37 = load double*, double** %36
%38 = getelementptr inbounds double, double* %37, i64 2
%39 = load double, double* %38
%40 = fneg double %39
%41 = load double, double* %27
%42 = fdiv double %40, %41
%43 = getelementptr inbounds double, double* %37, i64 3
%44 = load double, double* %43
%45 = getelementptr inbounds double, double* %21, i64 3
%46 = load double, double* %45
%47 = tail call double @llvm.fmuladd.f64(double %42, double %46, double %44)
store double %47, double* %43
%48 = getelementptr inbounds double, double* %1, i64 3
%49 = load double, double* %48
%50 = load double, double* %32
%51 = tail call double @llvm.fmuladd.f64(double %42, double %50, double %49)
store double %51, double* %48
%52 = getelementptr inbounds double*, double** %0, i64 4
%53 = load double*, double** %52
%54 = getelementptr inbounds double, double* %53, i64 3
%55 = load double, double* %54
%56 = fneg double %55
%57 = load double, double* %43
%58 = fdiv double %56, %57
%59 = getelementptr inbounds double, double* %53, i64 4
%60 = load double, double* %59
%61 = getelementptr inbounds double, double* %37, i64 4
%62 = load double, double* %61
%63 = tail call double @llvm.fmuladd.f64(double %58, double %62, double %60)
store double %63, double* %59
%64 = getelementptr inbounds double, double* %1, i64 4
%65 = load double, double* %64
%66 = load double, double* %48
%67 = tail call double @llvm.fmuladd.f64(double %58, double %66, double %65)
store double %67, double* %64
%68 = load double, double* %59
%69 = fdiv double %67, %68
%70 = getelementptr inbounds double, double* %2, i64 4
store double %69, double* %70
%71 = load double, double* %48
%72 = load double, double* %61
%73 = fneg double %72
%74 = tail call double @llvm.fmuladd.f64(double %73, double %69, double %71)
%75 = load double, double* %43
%76 = fdiv double %74, %75
%77 = getelementptr inbounds double, double* %2, i64 3
store double %76, double* %77
%78 = load double, double* %32
%79 = load double, double* %45
%80 = fneg double %79
%81 = tail call double @llvm.fmuladd.f64(double %80, double %76, double %78)
%82 = load double, double* %27
%83 = fdiv double %81, %82
%84 = getelementptr inbounds double, double* %2, i64 2
store double %83, double* %84
%85 = load double, double* %16
%86 = load double, double* %29
%87 = fneg double %86
%88 = tail call double @llvm.fmuladd.f64(double %87, double %83, double %85)
%89 = load double, double* %11
%90 = fdiv double %88, %89
%91 = getelementptr inbounds double, double* %2, i64 1
store double %90, double* %91
%92 = load double, double* %1
%93 = load double, double* %13
%94 = fneg double %93
%95 = tail call double @llvm.fmuladd.f64(double %94, double %90, double %92)
%96 = load double, double* %8
%97 = fdiv double %95, %96
store double %97, double* %2
ret void
}