#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__ powf(float, int);
float sqrtf(scalar_t__);
float mat3_frob(float *a) {
  return (sqrtf(powf(a[0], 2) + powf(a[1], 2) + powf(a[2], 2) + powf(a[3], 2) +
                powf(a[4], 2) + powf(a[5], 2) + powf(a[6], 2) + powf(a[7], 2) +
                powf(a[8], 2)));
}


x86 assembly (clang, -O0):
<mat3_frob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  0x10(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  0x14(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x20(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrtf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_frob>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movss  (%rdi),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rbx
movss  0x4(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x8(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0xc(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x10(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x14(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x18(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x1c(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x20(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sqrtf@plt>

LLVM IR (-O0):
define float @mat3_frob(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call i64 @powf(float %5, i32 2)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 1
%9 = load float, float* %8
%10 = call i64 @powf(float %9, i32 2)
%11 = add nsw i64 %6, %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = call i64 @powf(float %14, i32 2)
%16 = add nsw i64 %11, %15
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 3
%19 = load float, float* %18
%20 = call i64 @powf(float %19, i32 2)
%21 = add nsw i64 %16, %20
%22 = load float*, float** %2
%23 = getelementptr inbounds float, float* %22, i64 4
%24 = load float, float* %23
%25 = call i64 @powf(float %24, i32 2)
%26 = add nsw i64 %21, %25
%27 = load float*, float** %2
%28 = getelementptr inbounds float, float* %27, i64 5
%29 = load float, float* %28
%30 = call i64 @powf(float %29, i32 2)
%31 = add nsw i64 %26, %30
%32 = load float*, float** %2
%33 = getelementptr inbounds float, float* %32, i64 6
%34 = load float, float* %33
%35 = call i64 @powf(float %34, i32 2)
%36 = add nsw i64 %31, %35
%37 = load float*, float** %2
%38 = getelementptr inbounds float, float* %37, i64 7
%39 = load float, float* %38
%40 = call i64 @powf(float %39, i32 2)
%41 = add nsw i64 %36, %40
%42 = load float*, float** %2
%43 = getelementptr inbounds float, float* %42, i64 8
%44 = load float, float* %43
%45 = call i64 @powf(float %44, i32 2)
%46 = add nsw i64 %41, %45
%47 = call float @sqrtf(i64 %46)
ret float %47
}

LLVM IR (-O2):
define float @mat3_frob(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i64 @powf(float %2, i32 2)
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call i64 @powf(float %5, i32 2)
%7 = add nsw i64 %6, %3
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = tail call i64 @powf(float %9, i32 2)
%11 = add nsw i64 %7, %10
%12 = getelementptr inbounds float, float* %0, i64 3
%13 = load float, float* %12
%14 = tail call i64 @powf(float %13, i32 2)
%15 = add nsw i64 %11, %14
%16 = getelementptr inbounds float, float* %0, i64 4
%17 = load float, float* %16
%18 = tail call i64 @powf(float %17, i32 2)
%19 = add nsw i64 %15, %18
%20 = getelementptr inbounds float, float* %0, i64 5
%21 = load float, float* %20
%22 = tail call i64 @powf(float %21, i32 2)
%23 = add nsw i64 %19, %22
%24 = getelementptr inbounds float, float* %0, i64 6
%25 = load float, float* %24
%26 = tail call i64 @powf(float %25, i32 2)
%27 = add nsw i64 %23, %26
%28 = getelementptr inbounds float, float* %0, i64 7
%29 = load float, float* %28
%30 = tail call i64 @powf(float %29, i32 2)
%31 = add nsw i64 %27, %30
%32 = getelementptr inbounds float, float* %0, i64 8
%33 = load float, float* %32
%34 = tail call i64 @powf(float %33, i32 2)
%35 = add nsw i64 %31, %34
%36 = tail call float @sqrtf(i64 %35)
ret float %36
}