#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 */
double M_E;
double M_PI;
double pow(double, double);
double sin(double);
double sqrt(double);
double fu(double i, double x) {
  if (i == 1)
    return 1;
  if (i == 2)
    return 2 * x;
  if (i == 3)
    return 3 * (pow(x, 2.0));
  if (i == 4)
    return 4 * (pow(x, 3.0));
  if (i == 5)
    return 5 * pow(x, 4.0);
  if (i == 6)
    return 6 * pow(x, 5.0);
  if (i == 7)
    return 1.0 / (2.0 * (sqrt(2.0) - 1.0) * sqrt(x + 1.0));
  if (i == 8)
    return 2.0 / pow((x + 1.0), 2.0);
  if (i == 9)
    return (M_PI / 2.0) * sin((M_PI / 2.0) * x);
  if (i == 10)
    return pow(M_E, x) / (M_E - 1.0);
  return (0);
}


x86 assembly (clang, -O0):
<fu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1171 <fu+0x41>
jp     1171 <fu+0x41>
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11a5 <fu+0x75>
jp     11a5 <fu+0x75>
movsd  0xe72(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xe5e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ed <fu+0xbd>
jp     11ed <fu+0xbd>
movsd  -0x18(%rbp),%xmm0
movsd  0xe39(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1235 <fu+0x105>
jp     1235 <fu+0x105>
movsd  -0x18(%rbp),%xmm0
movsd  0xdf9(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdf1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xdde(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    127d <fu+0x14d>
jp     127d <fu+0x14d>
movsd  -0x18(%rbp),%xmm0
movsd  0xdb9(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xd9e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12c5 <fu+0x195>
jp     12c5 <fu+0x195>
movsd  -0x18(%rbp),%xmm0
movsd  0xd79(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd71(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xd5e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1340 <fu+0x210>
jp     1340 <fu+0x210>
movsd  0xd1e(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xd06(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xd02(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xce9(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xcce(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xceb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1390 <fu+0x260>
jp     1390 <fu+0x260>
movsd  0xc9b(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xc96(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xc86(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xca3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1400 <fu+0x2d0>
jp     1400 <fu+0x2d0>
mov    0x2c34(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xc48(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2c18(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xc2c(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
movsd  -0x10(%rbp),%xmm0
movsd  0xc3b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1457 <fu+0x327>
jp     1457 <fu+0x327>
mov    0x2bb4(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <pow@plt>
mov    0x2b9f(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xbbb(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    145f <fu+0x32f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm2
movsd  0xebf(%rip),%xmm0
ucomisd %xmm0,%xmm2
jne    114d <fu+0x1d>
jnp    1275 <fu+0x145>
ucomisd 0xeb3(%rip),%xmm2
jne    1166 <fu+0x36>
jp     1166 <fu+0x36>
addsd  %xmm1,%xmm1
movapd %xmm1,%xmm0
jmp    1275 <fu+0x145>
ucomisd 0xea2(%rip),%xmm2
jne    1187 <fu+0x57>
jp     1187 <fu+0x57>
mulsd  %xmm1,%xmm1
mulsd  0xe92(%rip),%xmm1
movapd %xmm1,%xmm0
jmp    1275 <fu+0x145>
ucomisd 0xe89(%rip),%xmm2
jne    11b5 <fu+0x85>
jp     11b5 <fu+0x85>
movsd  0xe75(%rip),%xmm2
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
call   1040 <pow@plt>
mulsd  0xe68(%rip),%xmm0
jmp    1275 <fu+0x145>
ucomisd 0xe63(%rip),%xmm2
jne    11e3 <fu+0xb3>
jp     11e3 <fu+0xb3>
movsd  0xe4f(%rip),%xmm2
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
call   1040 <pow@plt>
mulsd  0xe42(%rip),%xmm0
jmp    1275 <fu+0x145>
ucomisd 0xe3d(%rip),%xmm2
jne    120e <fu+0xde>
jp     120e <fu+0xde>
movsd  0xe29(%rip),%xmm2
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
call   1040 <pow@plt>
mulsd  0xe1c(%rip),%xmm0
jmp    1275 <fu+0x145>
ucomisd 0xe1a(%rip),%xmm2
jne    1232 <fu+0x102>
jp     1232 <fu+0x102>
addsd  0xdde(%rip),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1254 <fu+0x124>
sqrtsd %xmm1,%xmm1
jmp    1261 <fu+0x131>
ucomisd 0xdfe(%rip),%xmm2
jne    127b <fu+0x14b>
jp     127b <fu+0x14b>
addsd  0xdba(%rip),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xdb6(%rip),%xmm0
jmp    1271 <fu+0x141>
movapd %xmm1,%xmm0
call   1050 <sqrt@plt>
movapd %xmm0,%xmm1
mulsd  0xdf7(%rip),%xmm1
movsd  0xd8f(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret
ucomisd 0xdbd(%rip),%xmm2
jne    12b5 <fu+0x185>
jp     12b5 <fu+0x185>
mov    0x2d5a(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xdbe(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
jmp    1275 <fu+0x145>
ucomisd 0xd8b(%rip),%xmm2
jne    12df <fu+0x1af>
jp     12df <fu+0x1af>
mov    0x2d10(%rip),%rbx
movsd  (%rbx),%xmm0
call   1040 <pow@plt>
movsd  (%rbx),%xmm1
addsd  0xd73(%rip),%xmm1
jmp    1271 <fu+0x141>
xorpd  %xmm0,%xmm0
jmp    1275 <fu+0x145>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@M_E = global double 0.000000e+00
define double @fu(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %86
9: ; preds = %2
%10 = load double, double* %4
%11 = fcmp oeq double %10, 2.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %5
%14 = fmul double 2.000000e+00, %13
store double %14, double* %3
br label %86
15: ; preds = %9
%16 = load double, double* %4
%17 = fcmp oeq double %16, 3.000000e+00
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load double, double* %5
%20 = call double @pow(double %19, double 2.000000e+00)
%21 = fmul double 3.000000e+00, %20
store double %21, double* %3
br label %86
22: ; preds = %15
%23 = load double, double* %4
%24 = fcmp oeq double %23, 4.000000e+00
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load double, double* %5
%27 = call double @pow(double %26, double 3.000000e+00)
%28 = fmul double 4.000000e+00, %27
store double %28, double* %3
br label %86
29: ; preds = %22
%30 = load double, double* %4
%31 = fcmp oeq double %30, 5.000000e+00
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load double, double* %5
%34 = call double @pow(double %33, double 4.000000e+00)
%35 = fmul double 5.000000e+00, %34
store double %35, double* %3
br label %86
36: ; preds = %29
%37 = load double, double* %4
%38 = fcmp oeq double %37, 6.000000e+00
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load double, double* %5
%41 = call double @pow(double %40, double 5.000000e+00)
%42 = fmul double 6.000000e+00, %41
store double %42, double* %3
br label %86
43: ; preds = %36
%44 = load double, double* %4
%45 = fcmp oeq double %44, 7.000000e+00
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = call double @sqrt(double 2.000000e+00)
%48 = fsub double %47, 1.000000e+00
%49 = fmul double 2.000000e+00, %48
%50 = load double, double* %5
%51 = fadd double %50, 1.000000e+00
%52 = call double @sqrt(double %51)
%53 = fmul double %49, %52
%54 = fdiv double 1.000000e+00, %53
store double %54, double* %3
br label %86
55: ; preds = %43
%56 = load double, double* %4
%57 = fcmp oeq double %56, 8.000000e+00
br i1 %57, label %58, label %63
58: ; preds = %55
%59 = load double, double* %5
%60 = fadd double %59, 1.000000e+00
%61 = call double @pow(double %60, double 2.000000e+00)
%62 = fdiv double 2.000000e+00, %61
store double %62, double* %3
br label %86
63: ; preds = %55
%64 = load double, double* %4
%65 = fcmp oeq double %64, 9.000000e+00
br i1 %65, label %66, label %75
66: ; preds = %63
%67 = load double, double* @M_PI
%68 = fdiv double %67, 2.000000e+00
%69 = load double, double* @M_PI
%70 = fdiv double %69, 2.000000e+00
%71 = load double, double* %5
%72 = fmul double %70, %71
%73 = call double @sin(double %72)
%74 = fmul double %68, %73
store double %74, double* %3
br label %86
75: ; preds = %63
%76 = load double, double* %4
%77 = fcmp oeq double %76, 1.000000e+01
br i1 %77, label %78, label %85
78: ; preds = %75
%79 = load double, double* @M_E
%80 = load double, double* %5
%81 = call double @pow(double %79, double %80)
%82 = load double, double* @M_E
%83 = fsub double %82, 1.000000e+00
%84 = fdiv double %81, %83
store double %84, double* %3
br label %86
85: ; preds = %75
store double 0.000000e+00, double* %3
br label %86
86: ; preds = %85, %78, %66, %58, %46, %39, %32, %25, %18, %12, %8
%87 = load double, double* %3
ret double %87
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@M_E = global double 0.000000e+00
define double @fu(double %0, double %1) {
%3 = fcmp oeq double %0, 1.000000e+00
br i1 %3, label %57, label %4
4: ; preds = %2
%5 = fcmp oeq double %0, 2.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = fmul double %1, 2.000000e+00
br label %57
8: ; preds = %4
%9 = fcmp oeq double %0, 3.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = fmul double %1, %1
%12 = fmul double %11, 3.000000e+00
br label %57
13: ; preds = %8
%14 = fcmp oeq double %0, 4.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = tail call double @pow(double %1, double 3.000000e+00)
%17 = fmul double %16, 4.000000e+00
br label %57
18: ; preds = %13
%19 = fcmp oeq double %0, 5.000000e+00
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = tail call double @pow(double %1, double 4.000000e+00)
%22 = fmul double %21, 5.000000e+00
br label %57
23: ; preds = %18
%24 = fcmp oeq double %0, 6.000000e+00
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = tail call double @pow(double %1, double 5.000000e+00)
%27 = fmul double %26, 6.000000e+00
br label %57
28: ; preds = %23
%29 = fcmp oeq double %0, 7.000000e+00
br i1 %29, label %30, label %35
30: ; preds = %28
%31 = fadd double %1, 1.000000e+00
%32 = tail call double @sqrt(double %31)
%33 = fmul double %32, 0x3FEA827999FCEF34
%34 = fdiv double 1.000000e+00, %33
br label %57
35: ; preds = %28
%36 = fcmp oeq double %0, 8.000000e+00
br i1 %36, label %37, label %41
37: ; preds = %35
%38 = fadd double %1, 1.000000e+00
%39 = fmul double %38, %38
%40 = fdiv double 2.000000e+00, %39
br label %57
41: ; preds = %35
%42 = fcmp oeq double %0, 9.000000e+00
br i1 %42, label %43, label %49
43: ; preds = %41
%44 = load double, double* @M_PI
%45 = fmul double %44, 5.000000e-01
%46 = fmul double %45, %1
%47 = tail call double @sin(double %46)
%48 = fmul double %45, %47
br label %57
49: ; preds = %41
%50 = fcmp oeq double %0, 1.000000e+01
br i1 %50, label %51, label %57
51: ; preds = %49
%52 = load double, double* @M_E
%53 = tail call double @pow(double %52, double %1)
%54 = load double, double* @M_E
%55 = fadd double %54, -1.000000e+00
%56 = fdiv double %53, %55
br label %57
57: ; preds = %49, %2, %51, %43, %37, %30, %25, %20, %15, %10, %6
%58 = phi double [ %7, %6 ], [ %12, %10 ], [ %17, %15 ], [ %22, %20 ], [ %27, %25 ], [ %34, %30 ], [ %40, %37 ], [ %48, %43 ], [ %56, %51 ], [ 1.000000e+00, %2 ], [ 0.000000e+00, %49 ]
ret double %58
}