#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 */
float gam(int);
float pow(double, int);
float omega(int k) {
  switch (k) {
  case 0:
    return 1;
  case 1:
    return 2;
  case 2:
    return 3.141592653589793238462643;
  case 3:
    return 3.141592653589793238462643 / .75;
  default:
    return pow(3.141592653589793238462643, k / 2.) / gam(1 + k / 2.);
  }
}


x86 assembly (clang, -O0):
<omega>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1198 <omega+0x78>
mov    -0x10(%rbp),%rax
lea    0xee1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f6 <omega+0xd6>
movss  0xe9e(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f6 <omega+0xd6>
movss  0xe88(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f6 <omega+0xd6>
movss  0xe72(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f6 <omega+0xd6>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xe6b(%rip),%xmm0
call   1040 <pow@plt>
movss  %xmm0,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe4c(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe38(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <gam@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omega>:
sub    $0x18,%rsp
cmp    $0x4,%edi
jae    113d <omega+0x1d>
movslq %edi,%rax
lea    0xee5(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
add    $0x18,%rsp
ret
cvtsi2sd %edi,%xmm0
mulsd  0xeb7(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
cvttsd2si %xmm0,%edi
movsd  0xead(%rip),%xmm0
call   1040 <pow@plt>
movss  %xmm0,0xc(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe9c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <gam@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @omega(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store float 1.000000e+00, float* %2
br label %22
6: ; preds = %1
store float 2.000000e+00, float* %2
br label %22
7: ; preds = %1
store float 0x400921FB60000000, float* %2
br label %22
8: ; preds = %1
store float 0x4010C15240000000, float* %2
br label %22
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 2.000000e+00
%13 = fptosi double %12 to i32
%14 = call float @pow(double 0x400921FB54442D18, i32 %13)
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 2.000000e+00
%18 = fadd double 1.000000e+00, %17
%19 = fptosi double %18 to i32
%20 = call float @gam(i32 %19)
%21 = fdiv float %14, %20
store float %21, float* %2
br label %22
22: ; preds = %9, %8, %7, %6, %5
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
@switch.table.omega = [4 x float] [float 1.000000e+00, float 2.000000e+00, float 0x400921FB60000000, float 0x4010C15240000000]
define float @omega(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
%5 = fmul double %4, 5.000000e-01
%6 = fptosi double %5 to i32
%7 = tail call float @pow(double 0x400921FB54442D18, i32 %6)
%8 = fadd double %5, 1.000000e+00
%9 = fptosi double %8 to i32
%10 = tail call float @gam(i32 %9)
%11 = fdiv float %7, %10
br label %16
12: ; preds = %1
%13 = sext i32 %0 to i64
%14 = getelementptr inbounds [4 x float], [4 x float]* @switch.table.omega, i64 0, i64 %13
%15 = load float, float* %14
br label %16
16: ; preds = %12, %3
%17 = phi float [ %11, %3 ], [ %15, %12 ]
ret float %17
}