#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 */
int /*<<< orphan*/ glmCrossProduct3f(float *, float *, float *);
int /*<<< orphan*/ glmNormalizeVector3f(float *);
void glmOrthonormalizeMatrix3f(float m[9]) {
  glmNormalizeVector3f(m);
  glmCrossProduct3f(&m[6], m, &m[3]);
  glmNormalizeVector3f(&m[6]);
  glmCrossProduct3f(&m[3], &m[6], m);
  glmNormalizeVector3f(&m[3]);
}


x86 assembly (clang, -O0):
<glmOrthonormalizeMatrix3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <glmNormalizeVector3f@plt>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
add    $0xc,%rdx
call   1040 <glmCrossProduct3f@plt>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
call   1030 <glmNormalizeVector3f@plt>
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
mov    -0x8(%rbp),%rsi
add    $0x18,%rsi
mov    -0x8(%rbp),%rdx
call   1040 <glmCrossProduct3f@plt>
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
call   1030 <glmNormalizeVector3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmOrthonormalizeMatrix3f>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <glmNormalizeVector3f@plt>
lea    0x18(%rbx),%r14
lea    0xc(%rbx),%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <glmCrossProduct3f@plt>
mov    %r14,%rdi
call   1030 <glmNormalizeVector3f@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <glmCrossProduct3f@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <glmNormalizeVector3f@plt>

LLVM IR (-O0):
define void @glmOrthonormalizeMatrix3f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @glmNormalizeVector3f(float* %3)
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 6
%7 = load float*, float** %2
%8 = load float*, float** %2
%9 = getelementptr inbounds float, float* %8, i64 3
%10 = call i32 @glmCrossProduct3f(float* %6, float* %7, float* %9)
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 6
%13 = call i32 @glmNormalizeVector3f(float* %12)
%14 = load float*, float** %2
%15 = getelementptr inbounds float, float* %14, i64 3
%16 = load float*, float** %2
%17 = getelementptr inbounds float, float* %16, i64 6
%18 = load float*, float** %2
%19 = call i32 @glmCrossProduct3f(float* %15, float* %17, float* %18)
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 3
%22 = call i32 @glmNormalizeVector3f(float* %21)
ret void
}

LLVM IR (-O2):
define void @glmOrthonormalizeMatrix3f(float* %0) {
%2 = tail call i32 @glmNormalizeVector3f(float* %0)
%3 = getelementptr inbounds float, float* %0, i64 6
%4 = getelementptr inbounds float, float* %0, i64 3
%5 = tail call i32 @glmCrossProduct3f(float* %3, float* %0, float* %4)
%6 = tail call i32 @glmNormalizeVector3f(float* %3)
%7 = tail call i32 @glmCrossProduct3f(float* %4, float* %3, float* %0)
%8 = tail call i32 @glmNormalizeVector3f(float* %4)
ret void
}