#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 exp(double);
void jacmeyer(double *p, double *jac, int m, int n, void *data) {
  register int i, j;
  double ui, tmp;
  for (i = j = 0; i < n; ++i) {
    ui = 0.45 + 0.05 * i;
    tmp = exp(10.0 * p[1] / (ui + p[2]) - 13.0);
    jac[j++] = tmp;
    jac[j++] = 10.0 * p[0] * tmp / (ui + p[2]);
    jac[j++] = -10.0 * p[0] * p[1] * tmp / ((ui + p[2]) * (ui + p[2]));
  }
}


x86 assembly (clang, -O0):
<jacmeyer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1260 <jacmeyer+0x150>
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe96(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0xe41(%rip),%xmm0
mulsd  (%rax),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0xdfb(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1138 <jacmeyer+0x28>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacmeyer>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %ecx,%ecx
jle    11fe <jacmeyer+0xee>
mov    %ecx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x10,%rbx
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm2
mulsd  0xeae(%rip),%xmm2
addsd  0xeae(%rip),%xmm2
movsd  %xmm2,(%rsp)
movsd  0x8(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x10(%rbp),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  0xe93(%rip),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbx)
movsd  0x0(%rbp),%xmm1
mulsd  0xe74(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rbp),%xmm2
movsd  (%rsp),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbx)
movsd  0x0(%rbp),%xmm1
mulsd  0xe5c(%rip),%xmm1
mulsd  0x8(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movapd %xmm3,%xmm2
addsd  0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
addsd  0xe38(%rip),%xmm0
add    $0x18,%rbx
add    $0xffffffff,%r14d
jne    1140 <jacmeyer+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @jacmeyer(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
store i32 0, i32* %12
store i32 0, i32* %11
br label %15
15: ; preds = %85, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %9
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %88
19: ; preds = %15
%20 = load i32, i32* %11
%21 = sitofp i32 %20 to double
%22 = call double @llvm.fmuladd.f64(double 5.000000e-02, double %21, double 4.500000e-01)
store double %22, double* %13
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
%25 = load double, double* %24
%26 = fmul double 1.000000e+01, %25
%27 = load double, double* %13
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fadd double %27, %30
%32 = fdiv double %26, %31
%33 = fsub double %32, 1.300000e+01
%34 = call double @exp(double %33)
store double %34, double* %14
%35 = load double, double* %14
%36 = load double*, double** %7
%37 = load i32, i32* %12
%38 = add nsw i32 %37, 1
store i32 %38, i32* %12
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds double, double* %36, i64 %39
store double %35, double* %40
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fmul double 1.000000e+01, %43
%45 = load double, double* %14
%46 = fmul double %44, %45
%47 = load double, double* %13
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = fadd double %47, %50
%52 = fdiv double %46, %51
%53 = load double*, double** %7
%54 = load i32, i32* %12
%55 = add nsw i32 %54, 1
store i32 %55, i32* %12
%56 = sext i32 %54 to i64
%57 = getelementptr inbounds double, double* %53, i64 %56
store double %52, double* %57
%58 = load double*, double** %6
%59 = getelementptr inbounds double, double* %58, i64 0
%60 = load double, double* %59
%61 = fmul double -1.000000e+01, %60
%62 = load double*, double** %6
%63 = getelementptr inbounds double, double* %62, i64 1
%64 = load double, double* %63
%65 = fmul double %61, %64
%66 = load double, double* %14
%67 = fmul double %65, %66
%68 = load double, double* %13
%69 = load double*, double** %6
%70 = getelementptr inbounds double, double* %69, i64 2
%71 = load double, double* %70
%72 = fadd double %68, %71
%73 = load double, double* %13
%74 = load double*, double** %6
%75 = getelementptr inbounds double, double* %74, i64 2
%76 = load double, double* %75
%77 = fadd double %73, %76
%78 = fmul double %72, %77
%79 = fdiv double %67, %78
%80 = load double*, double** %7
%81 = load i32, i32* %12
%82 = add nsw i32 %81, 1
store i32 %82, i32* %12
%83 = sext i32 %81 to i64
%84 = getelementptr inbounds double, double* %80, i64 %83
store double %79, double* %84
br label %85
85: ; preds = %19
%86 = load i32, i32* %11
%87 = add nsw i32 %86, 1
store i32 %87, i32* %11
br label %15
88: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @jacmeyer(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %45
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = getelementptr inbounds double, double* %0, i64 2
br label %10
10: ; preds = %7, %10
%11 = phi i64 [ 0, %7 ], [ %41, %10 ]
%12 = phi i32 [ 0, %7 ], [ %43, %10 ]
%13 = sitofp i32 %12 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 5.000000e-02, double 4.500000e-01)
%15 = load double, double* %8
%16 = fmul double %15, 1.000000e+01
%17 = load double, double* %9
%18 = fadd double %14, %17
%19 = fdiv double %16, %18
%20 = fadd double %19, -1.300000e+01
%21 = tail call double @exp(double %20)
%22 = add nuw nsw i64 %11, 1
%23 = getelementptr inbounds double, double* %1, i64 %11
store double %21, double* %23
%24 = load double, double* %0
%25 = fmul double %24, 1.000000e+01
%26 = fmul double %21, %25
%27 = load double, double* %9
%28 = fadd double %14, %27
%29 = fdiv double %26, %28
%30 = add nuw nsw i64 %11, 2
%31 = getelementptr inbounds double, double* %1, i64 %22
store double %29, double* %31
%32 = load double, double* %0
%33 = fmul double %32, -1.000000e+01
%34 = load double, double* %8
%35 = fmul double %33, %34
%36 = fmul double %21, %35
%37 = load double, double* %9
%38 = fadd double %14, %37
%39 = fmul double %38, %38
%40 = fdiv double %36, %39
%41 = add nuw nsw i64 %11, 3
%42 = getelementptr inbounds double, double* %1, i64 %30
store double %40, double* %42
%43 = add nuw nsw i32 %12, 1
%44 = icmp eq i32 %43, %3
br i1 %44, label %45, label %10
45: ; preds = %10, %5
ret void
}