#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 */
double sqrt(double);
void matrix_normalize_size(double *matrix) {
  double scalar;
  scalar = sqrt(matrix[0] * matrix[0] + matrix[4] * matrix[4] +
                matrix[8] * matrix[8]);
  matrix[0] *= scalar;
  matrix[4] *= scalar;
  matrix[8] *= scalar;
  scalar = sqrt(matrix[1] * matrix[1] + matrix[5] * matrix[5] +
                matrix[9] * matrix[9]);
  matrix[1] *= scalar;
  matrix[5] *= scalar;
  matrix[9] *= scalar;
  scalar = sqrt(matrix[2] * matrix[2] + matrix[6] * matrix[6] +
                matrix[10] * matrix[10]);
  matrix[2] *= scalar;
  matrix[6] *= scalar;
  matrix[10] *= scalar;
}


x86 assembly (clang, -O0):
<matrix_normalize_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,0x20(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x40(%rax),%xmm0
movsd  %xmm0,0x40(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
movsd  %xmm0,0x28(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x48(%rax),%xmm0
movsd  %xmm0,0x48(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x30(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x30(%rax),%xmm0
movsd  %xmm0,0x30(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x50(%rax),%xmm0
movsd  %xmm0,0x50(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_normalize_size>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  0x20(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x40(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1146 <matrix_normalize_size+0x36>
sqrtsd %xmm0,%xmm0
jmp    114f <matrix_normalize_size+0x3f>
call   1030 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  (%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
movsd  0x20(%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rbx)
mulsd  0x40(%rbx),%xmm0
movsd  %xmm0,0x40(%rbx)
movsd  0x8(%rbx),%xmm1
movsd  0x28(%rbx),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x48(%rbx),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     11a2 <matrix_normalize_size+0x92>
sqrtsd %xmm0,%xmm0
jmp    11a7 <matrix_normalize_size+0x97>
call   1030 <sqrt@plt>
movsd  0x8(%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx)
movsd  0x28(%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rbx)
mulsd  0x48(%rbx),%xmm0
movsd  %xmm0,0x48(%rbx)
movsd  0x10(%rbx),%xmm1
movsd  0x30(%rbx),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x50(%rbx),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1200 <matrix_normalize_size+0xf0>
sqrtsd %xmm0,%xmm0
jmp    1205 <matrix_normalize_size+0xf5>
call   1030 <sqrt@plt>
movsd  0x10(%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx)
movsd  0x30(%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rbx)
mulsd  0x50(%rbx),%xmm0
movsd  %xmm0,0x50(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @matrix_normalize_size(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 4
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 8
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
%11 = load double, double* %0
%12 = fmul double %10, %11
store double %12, double* %0
%13 = load double, double* %3
%14 = fmul double %10, %13
store double %14, double* %3
%15 = load double, double* %7
%16 = fmul double %10, %15
store double %16, double* %7
%17 = getelementptr inbounds double, double* %0, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %0, i64 5
%20 = load double, double* %19
%21 = fmul double %20, %20
%22 = tail call double @llvm.fmuladd.f64(double %18, double %18, double %21)
%23 = getelementptr inbounds double, double* %0, i64 9
%24 = load double, double* %23
%25 = tail call double @llvm.fmuladd.f64(double %24, double %24, double %22)
%26 = tail call double @sqrt(double %25)
%27 = load double, double* %17
%28 = fmul double %26, %27
store double %28, double* %17
%29 = load double, double* %19
%30 = fmul double %26, %29
store double %30, double* %19
%31 = load double, double* %23
%32 = fmul double %26, %31
store double %32, double* %23
%33 = getelementptr inbounds double, double* %0, i64 2
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %0, i64 6
%36 = load double, double* %35
%37 = fmul double %36, %36
%38 = tail call double @llvm.fmuladd.f64(double %34, double %34, double %37)
%39 = getelementptr inbounds double, double* %0, i64 10
%40 = load double, double* %39
%41 = tail call double @llvm.fmuladd.f64(double %40, double %40, double %38)
%42 = tail call double @sqrt(double %41)
%43 = load double, double* %33
%44 = fmul double %42, %43
store double %44, double* %33
%45 = load double, double* %35
%46 = fmul double %42, %45
store double %46, double* %35
%47 = load double, double* %39
%48 = fmul double %42, %47
store double %48, double* %39
ret void
}