#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 */
int fabs(double);
void stub1(double *, double *, int, int, ...);
void fdjac3(double x[], double fvec[], double a[], double b[], double c[],
            void (*vecfunc)(double x[], double fvec[], int n, int init, ...),
            int n) {
  int i, j;
  double h, temp, f[50];
  for (j = 0; j < n; j++) {
    temp = x[j];
    h = 1e-4 * fabs(temp);
    if (h == 0)
      h = 1e-4;
    x[j] = temp + h;
    h = x[j] - temp;
    (*vecfunc)(x, f, n, 0, j);
    x[j] = temp;
    b[j] = (f[j] - fvec[j]) / h;
    if (j != 0)
      c[j - 1] = (f[j - 1] - fvec[j - 1]) / h;
    if (j != n - 1)
      a[j + 1] = (f[j + 1] - fvec[j + 1]) / h;
  }
}


x86 assembly (clang, -O0):
<fdjac3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    12ca <fdjac3+0x1ba>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119f <fdjac3+0x8f>
jp     119f <fdjac3+0x8f>
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%r9
mov    -0x8(%rbp),%rdi
lea    -0x1e0(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    -0x38(%rbp),%r8d
xor    %ecx,%ecx
mov    $0x0,%al
call   *%r9
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x38(%rbp),%rax
movsd  -0x1e0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x0,-0x38(%rbp)
je     126c <fdjac3+0x15c>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x1e0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     12b7 <fdjac3+0x1a7>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0x1e0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12bc <fdjac3+0x1ac>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    113d <fdjac3+0x2d>
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdjac3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d8,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x38(%rsp)
mov    %rdx,0x10(%rsp)
mov    0x210(%rsp),%eax
test   %eax,%eax
jle    131d <fdjac3+0x20d>
mov    %rcx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x210(%rsp),%r15d
lea    -0x1(%r15),%r14d
movsd  (%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm3
cmpeqsd %xmm1,%xmm3
movapd %xmm3,%xmm1
andnpd %xmm0,%xmm1
andpd  %xmm2,%xmm3
orpd   %xmm1,%xmm3
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm3
movsd  %xmm3,0x0(%rbp)
subsd  %xmm0,%xmm3
movapd %xmm3,0x20(%rsp)
lea    0x40(%rsp),%rsi
mov    %rbp,%rdi
mov    %r15d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   *0x18(%rsp)
movapd 0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp)
movsd  0x40(%rsp),%xmm0
subsd  (%rbx),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%r13)
test   %r14d,%r14d
je     131d <fdjac3+0x20d>
mov    0x210(%rsp),%eax
mov    %eax,%r15d
movsd  0x48(%rsp),%xmm0
subsd  0x8(%rbx),%xmm0
divsd  %xmm1,%xmm0
mov    0x10(%rsp),%rax
movsd  %xmm0,0x8(%rax)
mov    $0x1,%r12d
jmp    122c <fdjac3+0x11c>
nopl   0x0(%rax,%rax,1)
mov    %rax,%r12
cmp    %rax,%r15
je     131d <fdjac3+0x20d>
movsd  0x0(%rbp,%r12,8),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xdb3(%rip),%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm0,%xmm3
cmpeqsd 0xdaa(%rip),%xmm3
movapd %xmm3,%xmm1
andnpd %xmm0,%xmm1
andpd  %xmm2,%xmm3
orpd   %xmm1,%xmm3
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm3
movsd  %xmm3,0x0(%rbp,%r12,8)
subsd  %xmm0,%xmm3
movapd %xmm3,0x20(%rsp)
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
mov    0x210(%rsp),%edx
xor    %ecx,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   *0x18(%rsp)
movapd 0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%r12,8)
movsd  0x40(%rsp,%r12,8),%xmm0
subsd  (%rbx,%r12,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%r13,%r12,8)
movsd  0x38(%rsp,%r12,8),%xmm0
subsd  -0x8(%rbx,%r12,8),%xmm0
divsd  %xmm1,%xmm0
mov    0x38(%rsp),%rax
movsd  %xmm0,-0x8(%rax,%r12,8)
lea    0x1(%r12),%rax
cmp    %r12,%r14
je     1220 <fdjac3+0x110>
movsd  0x48(%rsp,%r12,8),%xmm0
subsd  0x8(%rbx,%r12,8),%xmm0
divsd  %xmm1,%xmm0
mov    0x10(%rsp),%rcx
movsd  %xmm0,0x8(%rcx,%r12,8)
jmp    1220 <fdjac3+0x110>
add    $0x1d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fdjac3(double* %0, double* %1, double* %2, double* %3, double* %4, void (double*, double*, i32, i32, ...)* %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca void (double*, double*, i32, i32, ...)*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca [50 x double]
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store double* %4, double** %12
store void (double*, double*, i32, i32, ...)* %5, void (double*, double*, i32, i32, ...)** %13
store i32 %6, i32* %14
store i32 0, i32* %16
br label %20
20: ; preds = %126, %7
%21 = load i32, i32* %16
%22 = load i32, i32* %14
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %129
24: ; preds = %20
%25 = load double*, double** %8
%26 = load i32, i32* %16
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %25, i64 %27
%29 = load double, double* %28
store double %29, double* %18
%30 = load double, double* %18
%31 = call i32 @fabs(double %30)
%32 = sitofp i32 %31 to double
%33 = fmul double 1.000000e-04, %32
store double %33, double* %17
%34 = load double, double* %17
%35 = fcmp oeq double %34, 0.000000e+00
br i1 %35, label %36, label %37
36: ; preds = %24
store double 1.000000e-04, double* %17
br label %37
37: ; preds = %36, %24
%38 = load double, double* %18
%39 = load double, double* %17
%40 = fadd double %38, %39
%41 = load double*, double** %8
%42 = load i32, i32* %16
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double %40, double* %44
%45 = load double*, double** %8
%46 = load i32, i32* %16
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = load double, double* %18
%51 = fsub double %49, %50
store double %51, double* %17
%52 = load void (double*, double*, i32, i32, ...)*, void (double*, double*, i32, i32, ...)** %13
%53 = load double*, double** %8
%54 = getelementptr inbounds [50 x double], [50 x double]* %19, i64 0, i64 0
%55 = load i32, i32* %14
%56 = load i32, i32* %16
%57 = load double, double* %18
%58 = load double*, double** %8
%59 = load i32, i32* %16
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
store double %57, double* %61
%62 = load i32, i32* %16
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [50 x double], [50 x double]* %19, i64 0, i64 %63
%65 = load double, double* %64
%66 = load double*, double** %9
%67 = load i32, i32* %16
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = fsub double %65, %70
%72 = load double, double* %17
%73 = fdiv double %71, %72
%74 = load double*, double** %11
%75 = load i32, i32* %16
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
store double %73, double* %77
%78 = load i32, i32* %16
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %100
80: ; preds = %37
%81 = load i32, i32* %16
%82 = sub nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [50 x double], [50 x double]* %19, i64 0, i64 %83
%85 = load double, double* %84
%86 = load double*, double** %9
%87 = load i32, i32* %16
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %86, i64 %89
%91 = load double, double* %90
%92 = fsub double %85, %91
%93 = load double, double* %17
%94 = fdiv double %92, %93
%95 = load double*, double** %12
%96 = load i32, i32* %16
%97 = sub nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %95, i64 %98
store double %94, double* %99
br label %100
100: ; preds = %80, %37
%101 = load i32, i32* %16
%102 = load i32, i32* %14
%103 = sub nsw i32 %102, 1
%104 = icmp ne i32 %101, %103
br i1 %104, label %105, label %125
105: ; preds = %100
%106 = load i32, i32* %16
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [50 x double], [50 x double]* %19, i64 0, i64 %108
%110 = load double, double* %109
%111 = load double*, double** %9
%112 = load i32, i32* %16
%113 = add nsw i32 %112, 1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %111, i64 %114
%116 = load double, double* %115
%117 = fsub double %110, %116
%118 = load double, double* %17
%119 = fdiv double %117, %118
%120 = load double*, double** %10
%121 = load i32, i32* %16
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %120, i64 %123
store double %119, double* %124
br label %125
125: ; preds = %105, %100
br label %126
126: ; preds = %125
%127 = load i32, i32* %16
%128 = add nsw i32 %127, 1
store i32 %128, i32* %16
br label %20
129: ; preds = %20
ret void
}

LLVM IR (-O2):
define void @fdjac3(double* %0, double* nocapture %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4, void (double*, double*, i32, i32, ...)* nocapture %5, i32 %6) {
%8 = alloca [50 x double]
%9 = bitcast [50 x double]* %8 to i8*
%10 = icmp sgt i32 %6, 0
br i1 %10, label %11, label %76
11: ; preds = %7
%12 = getelementptr inbounds [50 x double], [50 x double]* %8, i64 0, i64 0
%13 = add nsw i32 %6, -1
%14 = zext i32 %13 to i64
%15 = zext i32 %6 to i64
%16 = load double, double* %0
%17 = call i32 @fabs(double %16)
%18 = sitofp i32 %17 to double
%19 = fmul double %18, 1.000000e-04
%20 = fcmp oeq double %19, 0.000000e+00
%21 = select i1 %20, double 1.000000e-04, double %19
%22 = fadd double %16, %21
store double %22, double* %0
%23 = fsub double %22, %16
store double %16, double* %0
%24 = load double, double* %12
%25 = load double, double* %1
%26 = fsub double %24, %25
%27 = fdiv double %26, %23
store double %27, double* %3
%28 = icmp eq i32 %13, 0
br i1 %28, label %76, label %29
29: ; preds = %11
%30 = getelementptr inbounds [50 x double], [50 x double]* %8, i64 0, i64 1
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %1, i64 1
%33 = load double, double* %32
%34 = fsub double %31, %33
%35 = fdiv double %34, %23
%36 = getelementptr inbounds double, double* %2, i64 1
store double %35, double* %36
br label %37
37: ; preds = %29, %74
%38 = phi i64 [ 1, %29 ], [ %65, %74 ]
%39 = getelementptr inbounds double, double* %0, i64 %38
%40 = load double, double* %39
%41 = call i32 @fabs(double %40)
%42 = sitofp i32 %41 to double
%43 = fmul double %42, 1.000000e-04
%44 = fcmp oeq double %43, 0.000000e+00
%45 = select i1 %44, double 1.000000e-04, double %43
%46 = fadd double %40, %45
store double %46, double* %39
%47 = fsub double %46, %40
%48 = trunc i64 %38 to i32
store double %40, double* %39
%49 = getelementptr inbounds [50 x double], [50 x double]* %8, i64 0, i64 %38
%50 = load double, double* %49
%51 = getelementptr inbounds double, double* %1, i64 %38
%52 = load double, double* %51
%53 = fsub double %50, %52
%54 = fdiv double %53, %47
%55 = getelementptr inbounds double, double* %3, i64 %38
store double %54, double* %55
%56 = add nsw i64 %38, -1
%57 = getelementptr inbounds [50 x double], [50 x double]* %8, i64 0, i64 %56
%58 = load double, double* %57
%59 = getelementptr inbounds double, double* %1, i64 %56
%60 = load double, double* %59
%61 = fsub double %58, %60
%62 = fdiv double %61, %47
%63 = getelementptr inbounds double, double* %4, i64 %56
store double %62, double* %63
%64 = icmp eq i64 %38, %14
%65 = add nuw nsw i64 %38, 1
br i1 %64, label %74, label %66
66: ; preds = %37
%67 = getelementptr inbounds [50 x double], [50 x double]* %8, i64 0, i64 %65
%68 = load double, double* %67
%69 = getelementptr inbounds double, double* %1, i64 %65
%70 = load double, double* %69
%71 = fsub double %68, %70
%72 = fdiv double %71, %47
%73 = getelementptr inbounds double, double* %2, i64 %65
store double %72, double* %73
br label %74
74: ; preds = %37, %66
%75 = icmp eq i64 %65, %15
br i1 %75, label %76, label %37
76: ; preds = %74, %11, %7
ret void
}