#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 pow(double, int);
void funcs(double x, double a[], double *y, double dyda[], int N) {
  double A, B, den;
  A = pow(x - a[2], 2);
  B = pow(a[3], 2) / 4.0;
  den = A + B;
  N = 3;
  *y = a[1] / den;
  dyda[1] = 1 / den;
  dyda[2] = 2.0 * a[1] * (x - a[2]) / pow(den, 2);
  dyda[3] = -(a[1] * a[3]) / (2.0 * pow(den, 2));
}


x86 assembly (clang, -O0):
<funcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x3,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe67(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe45(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  0xdb8(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcs>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm0,0x10(%rsp)
subsd  0x10(%rdi),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rbx),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xeac(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0x8(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
movsd  0xe98(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,0x8(%r14)
movsd  0x8(%rbx),%xmm2
addsd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
subsd  0x10(%rbx),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%r14)
movsd  0x8(%rbx),%xmm0
xorpd  0xe4b(%rip),%xmm0
mulsd  0x18(%rbx),%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  %xmm0,%xmm0
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @funcs(double %0, double* %1, double* %2, double* %3, i32 %4) {
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
%14 = load double, double* %6
%15 = load double*, double** %7
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = fsub double %14, %17
%19 = call double @pow(double %18, i32 2)
store double %19, double* %11
%20 = load double*, double** %7
%21 = getelementptr inbounds double, double* %20, i64 3
%22 = load double, double* %21
%23 = call double @pow(double %22, i32 2)
%24 = fdiv double %23, 4.000000e+00
store double %24, double* %12
%25 = load double, double* %11
%26 = load double, double* %12
%27 = fadd double %25, %26
store double %27, double* %13
store i32 3, i32* %10
%28 = load double*, double** %7
%29 = getelementptr inbounds double, double* %28, i64 1
%30 = load double, double* %29
%31 = load double, double* %13
%32 = fdiv double %30, %31
%33 = load double*, double** %8
store double %32, double* %33
%34 = load double, double* %13
%35 = fdiv double 1.000000e+00, %34
%36 = load double*, double** %9
%37 = getelementptr inbounds double, double* %36, i64 1
store double %35, double* %37
%38 = load double*, double** %7
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
%41 = fmul double 2.000000e+00, %40
%42 = load double, double* %6
%43 = load double*, double** %7
%44 = getelementptr inbounds double, double* %43, i64 2
%45 = load double, double* %44
%46 = fsub double %42, %45
%47 = fmul double %41, %46
%48 = load double, double* %13
%49 = call double @pow(double %48, i32 2)
%50 = fdiv double %47, %49
%51 = load double*, double** %9
%52 = getelementptr inbounds double, double* %51, i64 2
store double %50, double* %52
%53 = load double*, double** %7
%54 = getelementptr inbounds double, double* %53, i64 1
%55 = load double, double* %54
%56 = load double*, double** %7
%57 = getelementptr inbounds double, double* %56, i64 3
%58 = load double, double* %57
%59 = fmul double %55, %58
%60 = fneg double %59
%61 = load double, double* %13
%62 = call double @pow(double %61, i32 2)
%63 = fmul double 2.000000e+00, %62
%64 = fdiv double %60, %63
%65 = load double*, double** %9
%66 = getelementptr inbounds double, double* %65, i64 3
store double %64, double* %66
ret void
}

LLVM IR (-O2):
define void @funcs(double %0, double* nocapture %1, double* nocapture writeonly %2, double* nocapture writeonly %3, i32 %4) {
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %6
%8 = fsub double %0, %7
%9 = tail call double @pow(double %8, i32 2)
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = tail call double @pow(double %11, i32 2)
%13 = fmul double %12, 2.500000e-01
%14 = fadd double %9, %13
%15 = getelementptr inbounds double, double* %1, i64 1
%16 = load double, double* %15
%17 = fdiv double %16, %14
store double %17, double* %2
%18 = fdiv double 1.000000e+00, %14
%19 = getelementptr inbounds double, double* %3, i64 1
store double %18, double* %19
%20 = load double, double* %15
%21 = fmul double %20, 2.000000e+00
%22 = load double, double* %6
%23 = fsub double %0, %22
%24 = fmul double %21, %23
%25 = tail call double @pow(double %14, i32 2)
%26 = fdiv double %24, %25
%27 = getelementptr inbounds double, double* %3, i64 2
store double %26, double* %27
%28 = load double, double* %15
%29 = load double, double* %10
%30 = fneg double %28
%31 = fmul double %29, %30
%32 = tail call double @pow(double %14, i32 2)
%33 = fmul double %32, 2.000000e+00
%34 = fdiv double %31, %33
%35 = getelementptr inbounds double, double* %3, i64 3
store double %34, double* %35
ret void
}