#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 LinearAD_DiracIC_du(int *, double *, int, double, double *, double *);
int LinearAD_DiracIC_diffusiveVelocity(int *iwork, double *rwork, int nPoints,
                                       double T, double *x, double *f) {
  int i, j, iret;
  double a = rwork[4];
  iret = LinearAD_DiracIC_du(iwork, rwork, nPoints, T, x, f);
  for (i = 0; i < nPoints; i++) {
    for (j = 0; j < 3; j++) {
      f[i * 3 + j] = -a * f[i * 3 + j];
    }
  }
  return iret;
}


x86 assembly (clang, -O0):
<LinearAD_DiracIC_diffusiveVelocity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <LinearAD_DiracIC_du@plt>
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e5 <LinearAD_DiracIC_diffusiveVelocity+0xd5>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    11d2 <LinearAD_DiracIC_diffusiveVelocity+0xc2>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x30(%rbp),%rax
imul   $0x3,-0x34(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
imul   $0x3,-0x34(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1178 <LinearAD_DiracIC_diffusiveVelocity+0x68>
jmp    11d7 <LinearAD_DiracIC_diffusiveVelocity+0xc7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1165 <LinearAD_DiracIC_diffusiveVelocity+0x55>
mov    -0x3c(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearAD_DiracIC_diffusiveVelocity>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %r8,%rbx
mov    %edx,%ebp
movsd  0x20(%rsi),%xmm1
movapd %xmm1,(%rsp)
call   1030 <LinearAD_DiracIC_du@plt>
movapd (%rsp),%xmm6
test   %ebp,%ebp
jle    12d4 <LinearAD_DiracIC_diffusiveVelocity+0x1c4>
xorpd  0xec1(%rip),%xmm6
mov    %ebp,%ecx
cmp    $0x1,%ebp
jne    114d <LinearAD_DiracIC_diffusiveVelocity+0x3d>
xor    %edx,%edx
jmp    128b <LinearAD_DiracIC_diffusiveVelocity+0x17b>
mov    %ecx,%edx
and    $0xfffffffe,%edx
movapd %xmm6,%xmm0
unpcklpd %xmm6,%xmm0
lea    -0x2(%rdx),%rsi
mov    %rsi,%rbp
shr    %rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     12db <LinearAD_DiracIC_diffusiveVelocity+0x1cb>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movupd (%rbx,%rsi,8),%xmm2
movupd 0x10(%rbx,%rsi,8),%xmm3
movupd 0x20(%rbx,%rsi,8),%xmm4
movupd 0x30(%rbx,%rsi,8),%xmm1
movapd %xmm3,%xmm5
movsd  %xmm2,%xmm5
shufpd $0x1,%xmm4,%xmm2
movsd  %xmm3,%xmm4
mulpd  %xmm0,%xmm5
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm4
movapd %xmm2,%xmm3
unpckhpd %xmm4,%xmm3
shufpd $0x2,%xmm5,%xmm4
unpcklpd %xmm2,%xmm5
movupd %xmm5,(%rbx,%rsi,8)
movupd %xmm4,0x10(%rbx,%rsi,8)
movupd %xmm3,0x20(%rbx,%rsi,8)
movupd 0x50(%rbx,%rsi,8),%xmm2
movupd 0x40(%rbx,%rsi,8),%xmm3
movapd %xmm3,%xmm4
movsd  %xmm1,%xmm4
shufpd $0x1,%xmm2,%xmm1
movsd  %xmm3,%xmm2
mulpd  %xmm0,%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movapd %xmm1,%xmm3
unpckhpd %xmm2,%xmm3
shufpd $0x2,%xmm4,%xmm2
unpcklpd %xmm1,%xmm4
movupd %xmm4,0x30(%rbx,%rsi,8)
movupd %xmm2,0x40(%rbx,%rsi,8)
movupd %xmm3,0x50(%rbx,%rsi,8)
add    $0xc,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1180 <LinearAD_DiracIC_diffusiveVelocity+0x70>
test   $0x1,%bpl
je     1286 <LinearAD_DiracIC_diffusiveVelocity+0x176>
movupd (%rbx,%rsi,8),%xmm1
movupd 0x10(%rbx,%rsi,8),%xmm2
movupd 0x20(%rbx,%rsi,8),%xmm3
movapd %xmm2,%xmm4
movsd  %xmm1,%xmm4
shufpd $0x1,%xmm3,%xmm1
movsd  %xmm2,%xmm3
mulpd  %xmm0,%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm3
movapd %xmm1,%xmm0
unpckhpd %xmm3,%xmm0
shufpd $0x2,%xmm4,%xmm3
unpcklpd %xmm1,%xmm4
movupd %xmm4,(%rbx,%rsi,8)
movupd %xmm3,0x10(%rbx,%rsi,8)
movupd %xmm0,0x20(%rbx,%rsi,8)
cmp    %rcx,%rdx
je     12d4 <LinearAD_DiracIC_diffusiveVelocity+0x1c4>
movapd %xmm6,%xmm0
unpcklpd %xmm6,%xmm0
lea    (%rdx,%rdx,2),%rsi
lea    (%rbx,%rsi,8),%rsi
add    $0x10,%rsi
sub    %rdx,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd -0x10(%rsi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,-0x10(%rsi)
movsd  (%rsi),%xmm1
mulsd  %xmm6,%xmm1
movsd  %xmm1,(%rsi)
add    $0x18,%rsi
add    $0xffffffffffffffff,%rcx
jne    12b0 <LinearAD_DiracIC_diffusiveVelocity+0x1a0>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%bpl
jne    1236 <LinearAD_DiracIC_diffusiveVelocity+0x126>
jmp    1286 <LinearAD_DiracIC_diffusiveVelocity+0x176>

LLVM IR (-O0):
define i32 @LinearAD_DiracIC_diffusiveVelocity(i32* %0, double* %1, i32 %2, double %3, double* %4, double* %5) {
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
store i32* %0, i32** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%17 = load double*, double** %8
%18 = getelementptr inbounds double, double* %17, i64 4
%19 = load double, double* %18
store double %19, double* %16
%20 = load i32*, i32** %7
%21 = load double*, double** %8
%22 = load i32, i32* %9
%23 = load double, double* %10
%24 = load double*, double** %11
%25 = load double*, double** %12
%26 = call i32 @LinearAD_DiracIC_du(i32* %20, double* %21, i32 %22, double %23, double* %24, double* %25)
store i32 %26, i32* %15
store i32 0, i32* %13
br label %27
27: ; preds = %58, %6
%28 = load i32, i32* %13
%29 = load i32, i32* %9
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %61
31: ; preds = %27
store i32 0, i32* %14
br label %32
32: ; preds = %54, %31
%33 = load i32, i32* %14
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %57
35: ; preds = %32
%36 = load double, double* %16
%37 = fneg double %36
%38 = load double*, double** %12
%39 = load i32, i32* %13
%40 = mul nsw i32 %39, 3
%41 = load i32, i32* %14
%42 = add nsw i32 %40, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %38, i64 %43
%45 = load double, double* %44
%46 = fmul double %37, %45
%47 = load double*, double** %12
%48 = load i32, i32* %13
%49 = mul nsw i32 %48, 3
%50 = load i32, i32* %14
%51 = add nsw i32 %49, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %47, i64 %52
store double %46, double* %53
br label %54
54: ; preds = %35
%55 = load i32, i32* %14
%56 = add nsw i32 %55, 1
store i32 %56, i32* %14
br label %32
57: ; preds = %32
br label %58
58: ; preds = %57
%59 = load i32, i32* %13
%60 = add nsw i32 %59, 1
store i32 %60, i32* %13
br label %27
61: ; preds = %27
%62 = load i32, i32* %15
ret i32 %62
}

LLVM IR (-O2):
define i32 @LinearAD_DiracIC_diffusiveVelocity(i32* %0, double* %1, i32 %2, double %3, double* %4, double* %5) {
%7 = getelementptr inbounds double, double* %1, i64 4
%8 = load double, double* %7
%9 = tail call i32 @LinearAD_DiracIC_du(i32* %0, double* %1, i32 %2, double %3, double* %4, double* %5)
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %103
11: ; preds = %6
%12 = fneg double %8
%13 = zext i32 %2 to i64
%14 = icmp eq i32 %2, 1
br i1 %14, label %85, label %15
15: ; preds = %11
%16 = and i64 %13, 4294967294
%17 = insertelement <2 x double> poison, double %12, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = add nsw i64 %16, -2
%20 = lshr exact i64 %19, 1
%21 = add nuw i64 %20, 1
%22 = and i64 %21, 1
%23 = icmp eq i64 %19, 0
br i1 %23, label %65, label %24
24: ; preds = %15
%25 = and i64 %21, -2
br label %26
26: ; preds = %26, %24
%27 = phi i64 [ 0, %24 ], [ %60, %26 ]
%28 = phi i64 [ 0, %24 ], [ %61, %26 ]
%29 = mul nuw nsw i64 %27, 3
%30 = getelementptr inbounds double, double* %5, i64 %29
%31 = bitcast double* %30 to <6 x double>*
%32 = load <6 x double>, <6 x double>* %31
%33 = shufflevector <6 x double> %32, <6 x double> poison, <2 x i32> <i32 0, i32 3>
%34 = shufflevector <6 x double> %32, <6 x double> poison, <2 x i32> <i32 1, i32 4>
%35 = shufflevector <6 x double> %32, <6 x double> poison, <2 x i32> <i32 2, i32 5>
%36 = fmul <2 x double> %33, %18
%37 = fmul <2 x double> %34, %18
%38 = fmul <2 x double> %35, %18
%39 = getelementptr inbounds double, double* %5, i64 %29
%40 = bitcast double* %39 to <6 x double>*
%41 = shufflevector <2 x double> %36, <2 x double> %37, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%42 = shufflevector <2 x double> %38, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%43 = shufflevector <4 x double> %41, <4 x double> %42, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %43, <6 x double>* %40
%44 = or i64 %27, 2
%45 = mul nuw nsw i64 %44, 3
%46 = getelementptr inbounds double, double* %5, i64 %45
%47 = bitcast double* %46 to <6 x double>*
%48 = load <6 x double>, <6 x double>* %47
%49 = shufflevector <6 x double> %48, <6 x double> poison, <2 x i32> <i32 0, i32 3>
%50 = shufflevector <6 x double> %48, <6 x double> poison, <2 x i32> <i32 1, i32 4>
%51 = shufflevector <6 x double> %48, <6 x double> poison, <2 x i32> <i32 2, i32 5>
%52 = fmul <2 x double> %49, %18
%53 = fmul <2 x double> %50, %18
%54 = fmul <2 x double> %51, %18
%55 = getelementptr inbounds double, double* %5, i64 %45
%56 = bitcast double* %55 to <6 x double>*
%57 = shufflevector <2 x double> %52, <2 x double> %53, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%58 = shufflevector <2 x double> %54, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%59 = shufflevector <4 x double> %57, <4 x double> %58, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %59, <6 x double>* %56
%60 = add nuw i64 %27, 4
%61 = add nuw i64 %28, 2
%62 = icmp eq i64 %61, %25
br i1 %62, label %63, label %26
63: ; preds = %26
%64 = mul i64 %60, 3
br label %65
65: ; preds = %63, %15
%66 = phi i64 [ 0, %15 ], [ %64, %63 ]
%67 = icmp eq i64 %22, 0
br i1 %67, label %83, label %68
68: ; preds = %65
%69 = getelementptr inbounds double, double* %5, i64 %66
%70 = bitcast double* %69 to <6 x double>*
%71 = load <6 x double>, <6 x double>* %70
%72 = shufflevector <6 x double> %71, <6 x double> poison, <2 x i32> <i32 0, i32 3>
%73 = shufflevector <6 x double> %71, <6 x double> poison, <2 x i32> <i32 1, i32 4>
%74 = shufflevector <6 x double> %71, <6 x double> poison, <2 x i32> <i32 2, i32 5>
%75 = fmul <2 x double> %72, %18
%76 = fmul <2 x double> %73, %18
%77 = fmul <2 x double> %74, %18
%78 = getelementptr inbounds double, double* %5, i64 %66
%79 = bitcast double* %78 to <6 x double>*
%80 = shufflevector <2 x double> %75, <2 x double> %76, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%81 = shufflevector <2 x double> %77, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%82 = shufflevector <4 x double> %80, <4 x double> %81, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %82, <6 x double>* %79
br label %83
83: ; preds = %65, %68
%84 = icmp eq i64 %16, %13
br i1 %84, label %103, label %85
85: ; preds = %11, %83
%86 = phi i64 [ 0, %11 ], [ %16, %83 ]
%87 = insertelement <2 x double> poison, double %12, i64 0
%88 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> zeroinitializer
br label %89
89: ; preds = %85, %89
%90 = phi i64 [ %101, %89 ], [ %86, %85 ]
%91 = mul nuw nsw i64 %90, 3
%92 = getelementptr inbounds double, double* %5, i64 %91
%93 = bitcast double* %92 to <2 x double>*
%94 = load <2 x double>, <2 x double>* %93
%95 = fmul <2 x double> %94, %88
%96 = bitcast double* %92 to <2 x double>*
store <2 x double> %95, <2 x double>* %96
%97 = add nuw nsw i64 %91, 2
%98 = getelementptr inbounds double, double* %5, i64 %97
%99 = load double, double* %98
%100 = fmul double %99, %12
store double %100, double* %98
%101 = add nuw nsw i64 %90, 1
%102 = icmp eq i64 %101, %13
br i1 %102, label %103, label %89
103: ; preds = %89, %83, %6
ret i32 %9
}