#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 */
typedef float GLfloat;
typedef float GLdouble;

/* Variables and functions */
int /*<<< orphan*/ __gluMakeIdentityf(float *);
int /*<<< orphan*/ cross(float *, float *, float *);
int /*<<< orphan*/ glMultMatrixf(float *);
int /*<<< orphan*/ glTranslated(float, float, float);
int /*<<< orphan*/ normalize(float *);
void gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx,
               GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy,
               GLdouble upz) {
  float forward[3], side[3], up[3];
  GLfloat m[4][4];
  forward[0] = centerx - eyex;
  forward[1] = centery - eyey;
  forward[2] = centerz - eyez;
  up[0] = upx;
  up[1] = upy;
  up[2] = upz;
  normalize(forward);
  cross(forward, up, side);
  normalize(side);
  cross(side, forward, up);
  __gluMakeIdentityf(&m[0][0]);
  m[0][0] = side[0];
  m[1][0] = side[1];
  m[2][0] = side[2];
  m[0][1] = up[0];
  m[1][1] = up[1];
  m[2][1] = up[2];
  m[0][2] = -forward[0];
  m[1][2] = -forward[1];
  m[2][2] = -forward[2];
  glMultMatrixf(&m[0][0]);
  glTranslated(-eyex, -eyey, -eyez);
}


x86 assembly (clang, -O0):
<gluLookAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  0x10(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
lea    -0x2c(%rbp),%rdi
call   1030 <normalize@plt>
lea    -0x2c(%rbp),%rdi
lea    -0x44(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1070 <cross@plt>
lea    -0x38(%rbp),%rdi
call   1030 <normalize@plt>
lea    -0x38(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   1070 <cross@plt>
lea    -0x90(%rbp),%rdi
call   1060 <__gluMakeIdentityf@plt>
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x2c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x28(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x68(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <glMultMatrixf@plt>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0xc(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
call   1050 <glTranslated@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gluLookAt>:
push   %r15
push   %r14
push   %rbx
sub    $0xa0,%rsp
movaps %xmm2,0x90(%rsp)
movaps %xmm1,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movss  0xc0(%rsp),%xmm8
subss  %xmm0,%xmm3
movss  %xmm3,0x18(%rsp)
subss  %xmm1,%xmm4
movss  %xmm4,0x1c(%rsp)
subss  %xmm2,%xmm5
movss  %xmm5,0x20(%rsp)
movss  %xmm6,0xc(%rsp)
movss  %xmm7,0x10(%rsp)
movss  %xmm8,0x14(%rsp)
lea    0x18(%rsp),%r15
mov    %r15,%rdi
call   1030 <normalize@plt>
lea    0xc(%rsp),%r14
lea    0x24(%rsp),%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1070 <cross@plt>
mov    %rbx,%rdi
call   1030 <normalize@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1070 <cross@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <__gluMakeIdentityf@plt>
movss  0x24(%rsp),%xmm0
movss  0x28(%rsp),%xmm1
movss  %xmm0,0x30(%rsp)
movss  %xmm1,0x40(%rsp)
movss  0x2c(%rsp),%xmm0
movss  %xmm0,0x50(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  %xmm0,0x34(%rsp)
movss  %xmm1,0x44(%rsp)
movss  0x14(%rsp),%xmm0
movss  %xmm0,0x54(%rsp)
movaps 0xdbd(%rip),%xmm3
movss  0x18(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0x20(%rsp),%xmm2
xorps  %xmm3,%xmm0
movss  %xmm0,0x38(%rsp)
xorps  %xmm3,%xmm1
movss  %xmm1,0x48(%rsp)
xorps  %xmm3,%xmm2
movss  %xmm2,0x58(%rsp)
mov    %rbx,%rdi
call   1040 <glMultMatrixf@plt>
movaps 0x80(%rsp),%xmm0
movaps 0xd79(%rip),%xmm2
xorps  %xmm2,%xmm0
movaps 0x70(%rsp),%xmm1
xorps  %xmm2,%xmm1
movaps %xmm2,%xmm3
movaps 0x90(%rsp),%xmm2
xorps  %xmm3,%xmm2
call   1050 <glTranslated@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gluLookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca [3 x float]
%11 = alloca [3 x float]
%12 = alloca [3 x float]
%13 = alloca [4 x [4 x float]]
%14 = bitcast [3 x float]* %10 to i8*
%15 = bitcast [3 x float]* %11 to i8*
%16 = bitcast [3 x float]* %12 to i8*
%17 = bitcast [4 x [4 x float]]* %13 to i8*
%18 = fsub float %3, %0
%19 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
store float %18, float* %19
%20 = fsub float %4, %1
%21 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 1
store float %20, float* %21
%22 = fsub float %5, %2
%23 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 2
store float %22, float* %23
%24 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 0, i64 0
store float %6, float* %24
%25 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 0, i64 1
store float %7, float* %25
%26 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 0, i64 2
store float %8, float* %26
%27 = call i32 @normalize(float* %19)
%28 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%29 = call i32 @cross(float* %19, float* %24, float* %28)
%30 = call i32 @normalize(float* %28)
%31 = call i32 @cross(float* %28, float* %19, float* %24)
%32 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 0, i64 0
%33 = call i32 @__gluMakeIdentityf(float* %32)
%34 = load float, float* %28
store float %34, float* %32
%35 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 1
%36 = load float, float* %35
%37 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 1, i64 0
store float %36, float* %37
%38 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 2
%39 = load float, float* %38
%40 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 2, i64 0
store float %39, float* %40
%41 = load float, float* %24
%42 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 0, i64 1
store float %41, float* %42
%43 = load float, float* %25
%44 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 1, i64 1
store float %43, float* %44
%45 = load float, float* %26
%46 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 2, i64 1
store float %45, float* %46
%47 = load float, float* %19
%48 = fneg float %47
%49 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 0, i64 2
store float %48, float* %49
%50 = load float, float* %21
%51 = fneg float %50
%52 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 1, i64 2
store float %51, float* %52
%53 = load float, float* %23
%54 = fneg float %53
%55 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %13, i64 0, i64 2, i64 2
store float %54, float* %55
%56 = call i32 @glMultMatrixf(float* %32)
%57 = fneg float %0
%58 = fneg float %1
%59 = fneg float %2
%60 = call i32 @glTranslated(float %57, float %58, float %59)
ret void
}