#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*/ glRotatef(double, double, double, double);
void rotateCamera(double deg, int axis) {
  double x, y, z;
  x = 0;
  y = 0;
  z = 0;
  if (axis == 0) {
    x = 1.0f;
  } else if (axis == 1) {
    y = 1.0f;
  } else if (axis == 2) {
    z = 1.0f;
  }
  glRotatef(deg, x, y, z);
}


x86 assembly (clang, -O0):
<rotateCamera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1154 <rotateCamera+0x44>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1191 <rotateCamera+0x81>
cmpl   $0x1,-0xc(%rbp)
jne    1170 <rotateCamera+0x60>
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    118c <rotateCamera+0x7c>
cmpl   $0x2,-0xc(%rbp)
jne    1187 <rotateCamera+0x77>
movsd  0xe7e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    118c <rotateCamera+0x7c>
jmp    1191 <rotateCamera+0x81>
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1030 <glRotatef@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateCamera>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
cmp    $0x2,%edi
ja     1145 <rotateCamera+0x35>
movslq %edi,%rax
lea    0xed8(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
lea    0xee4(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm2
lea    0xef0(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm3
jmp    1030 <glRotatef@plt>

LLVM IR (-O0):
define void @rotateCamera(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store double 1.000000e+00, double* %5
br label %21
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
store double 1.000000e+00, double* %6
br label %20
15: ; preds = %11
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %19
18: ; preds = %15
store double 1.000000e+00, double* %7
br label %19
19: ; preds = %18, %15
br label %20
20: ; preds = %19, %14
br label %21
21: ; preds = %20, %10
%22 = load double, double* %3
%23 = load double, double* %5
%24 = load double, double* %6
%25 = load double, double* %7
%26 = call i32 @glRotatef(double %22, double %23, double %24, double %25)
ret void
}

LLVM IR (-O2):
@switch.table.rotateCamera = [3 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00]
@switch.table.rotateCamera.1 = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00]
@switch.table.rotateCamera.2 = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
define void @rotateCamera(double %0, i32 %1) {
%3 = icmp ult i32 %1, 3
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds [3 x double], [3 x double]* @switch.table.rotateCamera, i64 0, i64 %5
%7 = load double, double* %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds [3 x double], [3 x double]* @switch.table.rotateCamera.1, i64 0, i64 %8
%10 = load double, double* %9
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds [3 x double], [3 x double]* @switch.table.rotateCamera.2, i64 0, i64 %11
%13 = load double, double* %12
br label %14
14: ; preds = %2, %4
%15 = phi double [ %7, %4 ], [ 0.000000e+00, %2 ]
%16 = phi double [ %10, %4 ], [ 0.000000e+00, %2 ]
%17 = phi double [ %13, %4 ], [ 0.000000e+00, %2 ]
%18 = tail call i32 @glRotatef(double %0, double %15, double %16, double %17)
ret void
}