double get_synodic_period(int Planet) {
  switch (Planet) {
  case 1:
    return 29.530588853;
  case 2:
    return 115.8775;
  case 3:
    return 583.9214;
  case 4:
    return 779.9361;
  case 5:
    return 398.8840;
  case 6:
    return 378.0919;
  case 7:
    return 369.6560;
  case 8:
    return 367.4867;
  case 9:
    return 366.7207;
  }
  return 366;
}


x86 assembly (clang, -O0):
<get_synodic_period>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x8,%eax
ja     11d2 <get_synodic_period+0xd2>
mov    -0x18(%rbp),%rax
lea    0xf29(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xf08(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xeee(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xe6c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xe52(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xe38(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11df <get_synodic_period+0xdf>
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_synodic_period>:
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     1118 <get_synodic_period+0x18>
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret
movsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_synodic_period(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
i32 8, label %12
i32 9, label %13
]
5: ; preds = %1
store double 0x403D87D4ABCB41D5, double* %2
br label %15
6: ; preds = %1
store double 0x405CF828F5C28F5C, double* %2
br label %15
7: ; preds = %1
store double 0x40823F5F06F69446, double* %2
br label %15
8: ; preds = %1
store double 0x40885F7D21FF2E49, double* %2
br label %15
9: ; preds = %1
store double 3.988840e+02, double* %2
br label %15
10: ; preds = %1
store double 0x4077A1786C22680A, double* %2
br label %15
11: ; preds = %1
store double 3.696560e+02, double* %2
br label %15
12: ; preds = %1
store double 0x4076F7C985F06F69, double* %2
br label %15
13: ; preds = %1
store double 0x4076EB87FCB923A3, double* %2
br label %15
14: ; preds = %1
store double 3.660000e+02, double* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
@switch.table.get_synodic_period = [9 x double] [double 0x403D87D4ABCB41D5, double 0x405CF828F5C28F5C, double 0x40823F5F06F69446, double 0x40885F7D21FF2E49, double 3.988840e+02, double 0x4077A1786C22680A, double 3.696560e+02, double 0x4076F7C985F06F69, double 0x4076EB87FCB923A3]
define double @get_synodic_period(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 9
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [9 x double], [9 x double]* @switch.table.get_synodic_period, i64 0, i64 %5
%7 = load double, double* %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 3.660000e+02, %1 ]
ret double %9
}