int DingShenShi_add_attack(int level) {
  int attack = 0;
  switch (level) {
  case 0:
    attack = 0;
    break;
  case 1:
    attack = 32;
    break;
  case 2:
    attack = 35;
    break;
  case 3:
    attack = 39;
    break;
  case 4:
    attack = 42;
    break;
  case 5:
    attack = 45;
    break;
  case 6:
    attack = 49;
    break;
  case 7:
    attack = 52;
    break;
  case 8:
    attack = 56;
    break;
  case 9:
    attack = 59;
    break;
  case 10:
    attack = 63;
    break;
  case 11:
    attack = 67;
    break;
  case 12:
    attack = 71;
    break;
  case 13:
    attack = 76;
    break;
  case 14:
    attack = 80;
    break;
  case 15:
    attack = 84;
    break;
  case 16:
    attack = 89;
    break;
  case 17:
    attack = 94;
    break;
  case 18:
    attack = 100;
    break;
  case 19:
    attack = 106;
    break;
  case 20:
    attack = 115;
    break;
  case 21:
    attack = 123;
    break;
  case 22:
    attack = 132;
    break;
  case 23:
    attack = 142;
    break;
  case 24:
    attack = 153;
    break;
  case 36:
    attack = 523;
    break;
  default:
    attack = (int)(0.00064 * (level * level - 42.8 * level + 747.0) *
                   (level * level + 7.43 * level + 64.0));
    break;
  }
  return attack;
}


x86 assembly (clang, -O0):
<DingShenShi_add_attack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x24,%rax
ja     126b <DingShenShi_add_attack+0x16b>
mov    -0x10(%rbp),%rax
lea    0xefe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x20,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x23,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x27,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x2a,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x2d,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x31,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x34,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x38,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x3b,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x3f,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x43,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x47,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x4c,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x50,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x54,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x59,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x5e,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x64,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x6a,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x73,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x7b,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x84,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x8e,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x99,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
movl   $0x20b,-0x8(%rbp)
jmp    12da <DingShenShi_add_attack+0x1da>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xd9d(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd85(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd71(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xd4d(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xd35(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DingShenShi_add_attack>:
cmp    $0x25,%edi
jae    1115 <DingShenShi_add_attack+0x15>
movabs $0x1001ffffff,%rax
bt     %rdi,%rax
jb     1155 <DingShenShi_add_attack+0x55>
cvtsi2sd %edi,%xmm0
imul   %edi,%edi
cvtsi2sd %edi,%xmm1
unpcklpd %xmm0,%xmm0
mulpd  0xed4(%rip),%xmm0
unpcklpd %xmm1,%xmm1
addpd  %xmm1,%xmm0
addpd  0xed4(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mulsd  0xed4(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret
movslq %edi,%rax
lea    0xec9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @DingShenShi_add_attack(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %31 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 10, label %15
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %19
i32 15, label %20
i32 16, label %21
i32 17, label %22
i32 18, label %23
i32 19, label %24
i32 20, label %25
i32 21, label %26
i32 22, label %27
i32 23, label %28
i32 24, label %29
i32 36, label %30
]
5: ; preds = %1
store i32 0, i32* %3
br label %51
6: ; preds = %1
store i32 32, i32* %3
br label %51
7: ; preds = %1
store i32 35, i32* %3
br label %51
8: ; preds = %1
store i32 39, i32* %3
br label %51
9: ; preds = %1
store i32 42, i32* %3
br label %51
10: ; preds = %1
store i32 45, i32* %3
br label %51
11: ; preds = %1
store i32 49, i32* %3
br label %51
12: ; preds = %1
store i32 52, i32* %3
br label %51
13: ; preds = %1
store i32 56, i32* %3
br label %51
14: ; preds = %1
store i32 59, i32* %3
br label %51
15: ; preds = %1
store i32 63, i32* %3
br label %51
16: ; preds = %1
store i32 67, i32* %3
br label %51
17: ; preds = %1
store i32 71, i32* %3
br label %51
18: ; preds = %1
store i32 76, i32* %3
br label %51
19: ; preds = %1
store i32 80, i32* %3
br label %51
20: ; preds = %1
store i32 84, i32* %3
br label %51
21: ; preds = %1
store i32 89, i32* %3
br label %51
22: ; preds = %1
store i32 94, i32* %3
br label %51
23: ; preds = %1
store i32 100, i32* %3
br label %51
24: ; preds = %1
store i32 106, i32* %3
br label %51
25: ; preds = %1
store i32 115, i32* %3
br label %51
26: ; preds = %1
store i32 123, i32* %3
br label %51
27: ; preds = %1
store i32 132, i32* %3
br label %51
28: ; preds = %1
store i32 142, i32* %3
br label %51
29: ; preds = %1
store i32 153, i32* %3
br label %51
30: ; preds = %1
store i32 523, i32* %3
br label %51
31: ; preds = %1
%32 = load i32, i32* %2
%33 = load i32, i32* %2
%34 = mul nsw i32 %32, %33
%35 = sitofp i32 %34 to double
%36 = load i32, i32* %2
%37 = sitofp i32 %36 to double
%38 = call double @llvm.fmuladd.f64(double -4.280000e+01, double %37, double %35)
%39 = fadd double %38, 7.470000e+02
%40 = fmul double 6.400000e-04, %39
%41 = load i32, i32* %2
%42 = load i32, i32* %2
%43 = mul nsw i32 %41, %42
%44 = sitofp i32 %43 to double
%45 = load i32, i32* %2
%46 = sitofp i32 %45 to double
%47 = call double @llvm.fmuladd.f64(double 0x401DB851EB851EB8, double %46, double %44)
%48 = fadd double %47, 6.400000e+01
%49 = fmul double %40, %48
%50 = fptosi double %49 to i32
store i32 %50, i32* %3
br label %51
51: ; preds = %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@switch.table.DingShenShi_add_attack = [37 x i32] [i32 0, i32 32, i32 35, i32 39, i32 42, i32 45, i32 49, i32 52, i32 56, i32 59, i32 63, i32 67, i32 71, i32 76, i32 80, i32 84, i32 89, i32 94, i32 100, i32 106, i32 115, i32 123, i32 132, i32 142, i32 153, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 523]
define i32 @DingShenShi_add_attack(i32 %0) {
%2 = icmp ult i32 %0, 37
br i1 %2, label %18, label %3
3: ; preds = %18, %1
%4 = mul nsw i32 %0, %0
%5 = sitofp i32 %4 to double
%6 = sitofp i32 %0 to double
%7 = insertelement <2 x double> poison, double %6, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = insertelement <2 x double> poison, double %5, i64 0
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
%11 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> <double 0x401DB851EB851EB8, double -4.280000e+01>, <2 x double> %10)
%12 = fadd <2 x double> %11, <double 6.400000e+01, double 7.470000e+02>
%13 = extractelement <2 x double> %12, i64 1
%14 = fmul double %13, 6.400000e-04
%15 = extractelement <2 x double> %12, i64 0
%16 = fmul double %15, %14
%17 = fptosi double %16 to i32
br label %27
18: ; preds = %1
%19 = zext i32 %0 to i64
%20 = lshr i64 68753031167, %19
%21 = and i64 %20, 1
%22 = icmp eq i64 %21, 0
br i1 %22, label %3, label %23
23: ; preds = %18
%24 = sext i32 %0 to i64
%25 = getelementptr inbounds [37 x i32], [37 x i32]* @switch.table.DingShenShi_add_attack, i64 0, i64 %24
%26 = load i32, i32* %25
br label %27
27: ; preds = %23, %3
%28 = phi i32 [ %17, %3 ], [ %26, %23 ]
ret i32 %28
}