#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 mat4_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) + powf(a[9], 2) + powf(a[10], 2) +
                powf(a[11], 2) + powf(a[12], 2) + powf(a[13], 2) +
                powf(a[14], 2) + powf(a[15], 2)));
}


x86 assembly (clang, -O0):
<mat4_frob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,-0x80(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movss  0x10(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movss  0x14(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movss  0x20(%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  0x24(%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  0x28(%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  0x2c(%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  0x30(%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  0x34(%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  0x38(%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  0x3c(%rax),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrtf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_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
movss  0x24(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x28(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x2c(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x30(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x34(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x38(%r14),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
add    %rax,%rbx
movss  0x3c(%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 @mat4_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 = load float*, float** %2
%48 = getelementptr inbounds float, float* %47, i64 9
%49 = load float, float* %48
%50 = call i64 @powf(float %49, i32 2)
%51 = add nsw i64 %46, %50
%52 = load float*, float** %2
%53 = getelementptr inbounds float, float* %52, i64 10
%54 = load float, float* %53
%55 = call i64 @powf(float %54, i32 2)
%56 = add nsw i64 %51, %55
%57 = load float*, float** %2
%58 = getelementptr inbounds float, float* %57, i64 11
%59 = load float, float* %58
%60 = call i64 @powf(float %59, i32 2)
%61 = add nsw i64 %56, %60
%62 = load float*, float** %2
%63 = getelementptr inbounds float, float* %62, i64 12
%64 = load float, float* %63
%65 = call i64 @powf(float %64, i32 2)
%66 = add nsw i64 %61, %65
%67 = load float*, float** %2
%68 = getelementptr inbounds float, float* %67, i64 13
%69 = load float, float* %68
%70 = call i64 @powf(float %69, i32 2)
%71 = add nsw i64 %66, %70
%72 = load float*, float** %2
%73 = getelementptr inbounds float, float* %72, i64 14
%74 = load float, float* %73
%75 = call i64 @powf(float %74, i32 2)
%76 = add nsw i64 %71, %75
%77 = load float*, float** %2
%78 = getelementptr inbounds float, float* %77, i64 15
%79 = load float, float* %78
%80 = call i64 @powf(float %79, i32 2)
%81 = add nsw i64 %76, %80
%82 = call float @sqrtf(i64 %81)
ret float %82
}

LLVM IR (-O2):
define float @mat4_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 = getelementptr inbounds float, float* %0, i64 9
%37 = load float, float* %36
%38 = tail call i64 @powf(float %37, i32 2)
%39 = add nsw i64 %35, %38
%40 = getelementptr inbounds float, float* %0, i64 10
%41 = load float, float* %40
%42 = tail call i64 @powf(float %41, i32 2)
%43 = add nsw i64 %39, %42
%44 = getelementptr inbounds float, float* %0, i64 11
%45 = load float, float* %44
%46 = tail call i64 @powf(float %45, i32 2)
%47 = add nsw i64 %43, %46
%48 = getelementptr inbounds float, float* %0, i64 12
%49 = load float, float* %48
%50 = tail call i64 @powf(float %49, i32 2)
%51 = add nsw i64 %47, %50
%52 = getelementptr inbounds float, float* %0, i64 13
%53 = load float, float* %52
%54 = tail call i64 @powf(float %53, i32 2)
%55 = add nsw i64 %51, %54
%56 = getelementptr inbounds float, float* %0, i64 14
%57 = load float, float* %56
%58 = tail call i64 @powf(float %57, i32 2)
%59 = add nsw i64 %55, %58
%60 = getelementptr inbounds float, float* %0, i64 15
%61 = load float, float* %60
%62 = tail call i64 @powf(float %61, i32 2)
%63 = add nsw i64 %59, %62
%64 = tail call float @sqrtf(i64 %63)
ret float %64
}