double f(double x, double y[], int i) {
  double q = 0;
  if (i == 0)
    return (1 * y[0] - .1 * y[1] * y[0] - q * y[0]);
  if (i == 1)
    return (-1.5 * y[1] + .03 * y[1] * y[0] - q * y[1]);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1194 <f+0x94>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0xeda(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <f+0x102>
cmpl   $0x1,-0x1c(%rbp)
jne    1202 <f+0x102>
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0xe55(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  0xe38(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x1,%esi
je     112f <f+0x2f>
test   %esi,%esi
jne    1160 <f+0x60>
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  0xefe(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xee6(%rip),%xmm0
addsd  %xmm1,%xmm0
ret
movsd  0x8(%rdi),%xmm0
movsd  0xec4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%rdi),%xmm1
movsd  0xebc(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  0xeb4(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
store double %0, double* %5
store double* %1, double** %6
store i32 %2, i32* %7
store double 0.000000e+00, double* %8
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %31
11: ; preds = %3
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double 1.000000e-01, %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %14, double %23)
%25 = load double, double* %8
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = fneg double %25
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double %24)
store double %30, double* %4
br label %53
31: ; preds = %3
%32 = load i32, i32* %7
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %53
34: ; preds = %31
%35 = load double*, double** %6
%36 = getelementptr inbounds double, double* %35, i64 1
%37 = load double, double* %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
%41 = fmul double 3.000000e-02, %40
%42 = load double*, double** %6
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = fmul double %41, %44
%46 = call double @llvm.fmuladd.f64(double -1.500000e+00, double %37, double %45)
%47 = load double, double* %8
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 1
%50 = load double, double* %49
%51 = fneg double %47
%52 = call double @llvm.fmuladd.f64(double %51, double %50, double %46)
store double %52, double* %4
br label %53
53: ; preds = %11, %34, %31
%54 = load double, double* %4
ret double %54
}

LLVM IR (-O2):
define double @f(double %0, double* nocapture %1, i32 %2) {
switch i32 %2, label %20 [
i32 0, label %4
i32 1, label %12
]
4: ; preds = %3
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, 1.000000e-01
%9 = fmul double %5, %8
%10 = fsub double %5, %9
%11 = tail call double @llvm.fmuladd.f64(double %5, double -0.000000e+00, double %10)
br label %20
12: ; preds = %3
%13 = getelementptr inbounds double, double* %1, i64 1
%14 = load double, double* %13
%15 = fmul double %14, 3.000000e-02
%16 = load double, double* %1
%17 = fmul double %15, %16
%18 = tail call double @llvm.fmuladd.f64(double %14, double -1.500000e+00, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %14, double -0.000000e+00, double %18)
br label %20
20: ; preds = %3, %12, %4
%21 = phi double [ %11, %4 ], [ %19, %12 ], [ undef, %3 ]
ret double %21
}