#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 sqrt(double);
void fnGarchC(int *n, int *order, double *alpha, double *delta, double *beta,
              double *h, double *u, int *sim) {
  int i, j, q, p, s;
  double ht;
  q = order[1] - 1;
  p = order[0];
  s = q;
  if (p > q)
    s = p;
  for (i = 0; i < s; i++) {
    h[i] = alpha[0];
    if (sim[i] == 1)
      u[i] = sqrt(h[i]) * u[i];
  }
  for (i = s; i <= *n; i++) {
    ht = alpha[0];
    if (q > 0) {
      for (j = 1; j <= q; j++) {
        if (delta[j - 1] == 0)
          ht = ht + alpha[j] * u[i - j] * u[i - j];
        if (delta[j - 1] > 0 && u[i - j] >= 0)
          ht = ht + alpha[j] * u[i - j] * u[i - j];
        if (delta[j - 1] > 0 && u[i - j] < 0)
          ht = ht + delta[j - 1] * u[i - j] * u[i - j];
      }
    }
    if (p > 0) {
      for (j = 1; j <= p; j++)
        ht = ht + beta[j - 1] * h[i - j];
    }
    h[i] = ht;
    if (sim[i] == 1)
      u[i] = sqrt(ht) * u[i];
  }
}


x86 assembly (clang, -O0):
<fnGarchC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jle    1166 <fnGarchC+0x56>
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11df <fnGarchC+0xcf>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    11cc <fnGarchC+0xbc>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <sqrt@plt>
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11d1 <fnGarchC+0xc1>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116d <fnGarchC+0x5d>
mov    -0x44(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jg     1462 <fnGarchC+0x352>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jle    13a1 <fnGarchC+0x291>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     139c <fnGarchC+0x28c>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1286 <fnGarchC+0x176>
jp     1286 <fnGarchC+0x176>
movsd  -0x50(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1307 <fnGarchC+0x1f7>
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1307 <fnGarchC+0x1f7>
movsd  -0x50(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1389 <fnGarchC+0x279>
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1389 <fnGarchC+0x279>
movsd  -0x50(%rbp),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    138e <fnGarchC+0x27e>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1212 <fnGarchC+0x102>
jmp    13a1 <fnGarchC+0x291>
cmpl   $0x0,-0x40(%rbp)
jle    1407 <fnGarchC+0x2f7>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
jg     1402 <fnGarchC+0x2f2>
movsd  -0x50(%rbp),%xmm1
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13b2 <fnGarchC+0x2a2>
jmp    1407 <fnGarchC+0x2f7>
movsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    144f <fnGarchC+0x33f>
movsd  -0x50(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1454 <fnGarchC+0x344>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11e5 <fnGarchC+0xd5>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnGarchC>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8,%rbx
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,0x18(%rsp)
mov    0x88(%rsp),%rdi
mov    0x80(%rsp),%r8
mov    (%rsi),%eax
mov    0x4(%rsi),%ecx
lea    -0x1(%rcx),%r14d
mov    %rcx,0x20(%rsp)
cmp    %ecx,%eax
mov    %rax,0x28(%rsp)
cmovge %eax,%r14d
test   %r14d,%r14d
mov    %r9,0x8(%rsp)
jle    1297 <fnGarchC+0x187>
mov    %r14d,%r13d
cmp    $0x1,%r14d
mov    %r13,0x10(%rsp)
jne    11ab <fnGarchC+0x9b>
xor    %ebp,%ebp
testb  $0x1,0x10(%rsp)
je     1297 <fnGarchC+0x187>
movsd  (%r12),%xmm0
movsd  %xmm0,(%r9,%rbp,8)
cmpl   $0x1,(%rdi,%rbp,4)
jne    1297 <fnGarchC+0x187>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1271 <fnGarchC+0x161>
sqrtsd %xmm0,%xmm0
jmp    128b <fnGarchC+0x17b>
and    $0xfffffffe,%r13d
xor    %ebp,%ebp
xorpd  %xmm1,%xmm1
jmp    11f9 <fnGarchC+0xe9>
nopw   0x0(%rax,%rax,1)
call   1030 <sqrt@plt>
xorpd  %xmm1,%xmm1
mov    0x80(%rsp),%r8
mov    0x88(%rsp),%rdi
mov    0x8(%rsp),%r9
mulsd  0x8(%r8,%rbp,8),%xmm0
movsd  %xmm0,0x8(%r8,%rbp,8)
add    $0x2,%rbp
cmp    %rbp,%r13
je     1173 <fnGarchC+0x63>
movsd  (%r12),%xmm0
movsd  %xmm0,(%r9,%rbp,8)
cmpl   $0x1,(%rdi,%rbp,4)
jne    124a <fnGarchC+0x13a>
ucomisd %xmm1,%xmm0
jb     1220 <fnGarchC+0x110>
sqrtsd %xmm0,%xmm0
jmp    123e <fnGarchC+0x12e>
nopw   0x0(%rax,%rax,1)
call   1030 <sqrt@plt>
xorpd  %xmm1,%xmm1
mov    0x80(%rsp),%r8
mov    0x88(%rsp),%rdi
mov    0x8(%rsp),%r9
mulsd  (%r8,%rbp,8),%xmm0
movsd  %xmm0,(%r8,%rbp,8)
movsd  (%r12),%xmm0
movsd  %xmm0,0x8(%r9,%rbp,8)
cmpl   $0x1,0x4(%rdi,%rbp,4)
jne    11ec <fnGarchC+0xdc>
ucomisd %xmm1,%xmm0
jb     11c0 <fnGarchC+0xb0>
sqrtsd %xmm0,%xmm0
jmp    11de <fnGarchC+0xce>
call   1030 <sqrt@plt>
mov    0x80(%rsp),%r8
mov    0x88(%rsp),%rdi
mov    0x8(%rsp),%r9
mulsd  (%r8,%rbp,8),%xmm0
movsd  %xmm0,(%r8,%rbp,8)
mov    0x18(%rsp),%rax
mov    (%rax),%eax
cmp    %eax,%r14d
jle    12b2 <fnGarchC+0x1a2>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x28(%rsp),%rcx
add    $0x1,%ecx
movslq %r14d,%r14
mov    %rcx,0x40(%rsp)
lea    -0x1(%rcx),%r11
lea    -0x8(%r8,%r14,8),%r10
mov    0x20(%rsp),%rcx
lea    -0x1(%rcx),%r13
lea    (%r9,%r14,8),%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,0x10(%rsp)
mov    %r11,%rbp
and    $0xfffffffffffffffe,%rbp
neg    %rbp
xorpd  %xmm4,%xmm4
mov    %r11,0x30(%rsp)
jmp    135d <fnGarchC+0x24d>
cs nopw 0x0(%rax,%rax,1)
mov    %r10,0x38(%rsp)
call   1030 <sqrt@plt>
xorpd  %xmm4,%xmm4
mov    0x38(%rsp),%r10
mov    0x30(%rsp),%r11
mov    0x80(%rsp),%r8
mov    0x88(%rsp),%rdi
mov    0x8(%rsp),%r9
mulsd  (%r8,%r14,8),%xmm0
movsd  %xmm0,(%r8,%r14,8)
mov    0x18(%rsp),%rax
mov    (%rax),%eax
lea    0x1(%r14),%rcx
movslq %eax,%rdx
add    $0x8,%r10
addq   $0x8,0x10(%rsp)
cmp    %rdx,%r14
mov    %rcx,%r14
jge    12a3 <fnGarchC+0x193>
movsd  (%r12),%xmm0
cmpl   $0x2,0x20(%rsp)
jl     13f0 <fnGarchC+0x2e0>
mov    %r10,%rcx
xor    %edx,%edx
jmp    138d <fnGarchC+0x27d>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rdx
add    $0xfffffffffffffff8,%rcx
cmp    %rdx,%r13
je     13f0 <fnGarchC+0x2e0>
movsd  (%r15,%rdx,8),%xmm1
ucomisd %xmm4,%xmm1
jne    13b2 <fnGarchC+0x2a2>
jp     13b2 <fnGarchC+0x2a2>
movsd  (%rcx),%xmm2
movsd  0x8(%r12,%rdx,8),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
ucomisd %xmm4,%xmm1
jbe    1380 <fnGarchC+0x270>
movsd  (%rcx),%xmm2
ucomisd %xmm4,%xmm2
jb     13d5 <fnGarchC+0x2c5>
movsd  0x8(%r12,%rdx,8),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
ucomisd %xmm2,%xmm4
jbe    1380 <fnGarchC+0x270>
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
jmp    1380 <fnGarchC+0x270>
nopl   0x0(%rax)
cmpl   $0x0,0x28(%rsp)
jle    1476 <fnGarchC+0x366>
mov    $0x1,%ecx
cmpl   $0x2,0x40(%rsp)
jne    1410 <fnGarchC+0x300>
movapd %xmm0,%xmm1
jmp    1456 <fnGarchC+0x346>
nopl   0x0(%rax)
mov    $0x1,%ecx
mov    0x10(%rsp),%rdx
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rbx,%rcx,8),%xmm2
movsd  (%rbx,%rcx,8),%xmm1
mulsd  (%rdx),%xmm2
addsd  %xmm0,%xmm2
mulsd  -0x8(%rdx),%xmm1
addsd  %xmm2,%xmm1
add    $0xfffffffffffffff0,%rdx
lea    (%rcx,%rbp,1),%rsi
add    $0x2,%rsi
add    $0x2,%rcx
movapd %xmm1,%xmm0
cmp    $0x1,%rsi
jne    1420 <fnGarchC+0x310>
movapd %xmm1,%xmm0
test   $0x1,%r11b
je     1476 <fnGarchC+0x366>
movsd  -0x8(%rbx,%rcx,8),%xmm0
mov    %r14,%rdx
sub    %rcx,%rdx
mulsd  (%r9,%rdx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r9,%r14,8)
cmpl   $0x1,(%rdi,%r14,4)
jne    1340 <fnGarchC+0x230>
ucomisd %xmm4,%xmm0
jb     1300 <fnGarchC+0x1f0>
sqrtsd %xmm0,%xmm0
jmp    132d <fnGarchC+0x21d>

LLVM IR (-O0):
define void @fnGarchC(i32* %0, i32* %1, double* %2, double* %3, double* %4, double* %5, double* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca double
store i32* %0, i32** %9
store i32* %1, i32** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store i32* %7, i32** %16
%23 = load i32*, i32** %10
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %19
%27 = load i32*, i32** %10
%28 = getelementptr inbounds i32, i32* %27, i64 0
%29 = load i32, i32* %28
store i32 %29, i32* %20
%30 = load i32, i32* %19
store i32 %30, i32* %21
%31 = load i32, i32* %20
%32 = load i32, i32* %19
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %36
34: ; preds = %8
%35 = load i32, i32* %20
store i32 %35, i32* %21
br label %36
36: ; preds = %34, %8
store i32 0, i32* %17
br label %37
37: ; preds = %73, %36
%38 = load i32, i32* %17
%39 = load i32, i32* %21
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %76
41: ; preds = %37
%42 = load double*, double** %11
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = load double*, double** %14
%46 = load i32, i32* %17
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
store double %44, double* %48
%49 = load i32*, i32** %16
%50 = load i32, i32* %17
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %49, i64 %51
%53 = load i32, i32* %52
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %72
55: ; preds = %41
%56 = load double*, double** %14
%57 = load i32, i32* %17
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = call double @sqrt(double %60)
%62 = load double*, double** %15
%63 = load i32, i32* %17
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
%66 = load double, double* %65
%67 = fmul double %61, %66
%68 = load double*, double** %15
%69 = load i32, i32* %17
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
store double %67, double* %71
br label %72
72: ; preds = %55, %41
br label %73
73: ; preds = %72
%74 = load i32, i32* %17
%75 = add nsw i32 %74, 1
store i32 %75, i32* %17
br label %37
76: ; preds = %37
%77 = load i32, i32* %21
store i32 %77, i32* %17
br label %78
78: ; preds = %265, %76
%79 = load i32, i32* %17
%80 = load i32*, i32** %9
%81 = load i32, i32* %80
%82 = icmp sle i32 %79, %81
br i1 %82, label %83, label %268
83: ; preds = %78
%84 = load double*, double** %11
%85 = getelementptr inbounds double, double* %84, i64 0
%86 = load double, double* %85
store double %86, double* %22
%87 = load i32, i32* %19
%88 = icmp sgt i32 %87, 0
br i1 %88, label %89, label %211
89: ; preds = %83
store i32 1, i32* %18
br label %90
90: ; preds = %207, %89
%91 = load i32, i32* %18
%92 = load i32, i32* %19
%93 = icmp sle i32 %91, %92
br i1 %93, label %94, label %210
94: ; preds = %90
%95 = load double*, double** %12
%96 = load i32, i32* %18
%97 = sub nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %95, i64 %98
%100 = load double, double* %99
%101 = fcmp oeq double %100, 0.000000e+00
br i1 %101, label %102, label %125
102: ; preds = %94
%103 = load double, double* %22
%104 = load double*, double** %11
%105 = load i32, i32* %18
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %104, i64 %106
%108 = load double, double* %107
%109 = load double*, double** %15
%110 = load i32, i32* %17
%111 = load i32, i32* %18
%112 = sub nsw i32 %110, %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %109, i64 %113
%115 = load double, double* %114
%116 = fmul double %108, %115
%117 = load double*, double** %15
%118 = load i32, i32* %17
%119 = load i32, i32* %18
%120 = sub nsw i32 %118, %119
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %117, i64 %121
%123 = load double, double* %122
%124 = call double @llvm.fmuladd.f64(double %116, double %123, double %103)
store double %124, double* %22
br label %125
125: ; preds = %102, %94
%126 = load double*, double** %12
%127 = load i32, i32* %18
%128 = sub nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %126, i64 %129
%131 = load double, double* %130
%132 = fcmp ogt double %131, 0.000000e+00
br i1 %132, label %133, label %165
133: ; preds = %125
%134 = load double*, double** %15
%135 = load i32, i32* %17
%136 = load i32, i32* %18
%137 = sub nsw i32 %135, %136
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %134, i64 %138
%140 = load double, double* %139
%141 = fcmp oge double %140, 0.000000e+00
br i1 %141, label %142, label %165
142: ; preds = %133
%143 = load double, double* %22
%144 = load double*, double** %11
%145 = load i32, i32* %18
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = load double*, double** %15
%150 = load i32, i32* %17
%151 = load i32, i32* %18
%152 = sub nsw i32 %150, %151
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %149, i64 %153
%155 = load double, double* %154
%156 = fmul double %148, %155
%157 = load double*, double** %15
%158 = load i32, i32* %17
%159 = load i32, i32* %18
%160 = sub nsw i32 %158, %159
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %157, i64 %161
%163 = load double, double* %162
%164 = call double @llvm.fmuladd.f64(double %156, double %163, double %143)
store double %164, double* %22
br label %165
165: ; preds = %142, %133, %125
%166 = load double*, double** %12
%167 = load i32, i32* %18
%168 = sub nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %166, i64 %169
%171 = load double, double* %170
%172 = fcmp ogt double %171, 0.000000e+00
br i1 %172, label %173, label %206
173: ; preds = %165
%174 = load double*, double** %15
%175 = load i32, i32* %17
%176 = load i32, i32* %18
%177 = sub nsw i32 %175, %176
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %174, i64 %178
%180 = load double, double* %179
%181 = fcmp olt double %180, 0.000000e+00
br i1 %181, label %182, label %206
182: ; preds = %173
%183 = load double, double* %22
%184 = load double*, double** %12
%185 = load i32, i32* %18
%186 = sub nsw i32 %185, 1
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %184, i64 %187
%189 = load double, double* %188
%190 = load double*, double** %15
%191 = load i32, i32* %17
%192 = load i32, i32* %18
%193 = sub nsw i32 %191, %192
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %190, i64 %194
%196 = load double, double* %195
%197 = fmul double %189, %196
%198 = load double*, double** %15
%199 = load i32, i32* %17
%200 = load i32, i32* %18
%201 = sub nsw i32 %199, %200
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds double, double* %198, i64 %202
%204 = load double, double* %203
%205 = call double @llvm.fmuladd.f64(double %197, double %204, double %183)
store double %205, double* %22
br label %206
206: ; preds = %182, %173, %165
br label %207
207: ; preds = %206
%208 = load i32, i32* %18
%209 = add nsw i32 %208, 1
store i32 %209, i32* %18
br label %90
210: ; preds = %90
br label %211
211: ; preds = %210, %83
%212 = load i32, i32* %20
%213 = icmp sgt i32 %212, 0
br i1 %213, label %214, label %239
214: ; preds = %211
store i32 1, i32* %18
br label %215
215: ; preds = %235, %214
%216 = load i32, i32* %18
%217 = load i32, i32* %20
%218 = icmp sle i32 %216, %217
br i1 %218, label %219, label %238
219: ; preds = %215
%220 = load double, double* %22
%221 = load double*, double** %13
%222 = load i32, i32* %18
%223 = sub nsw i32 %222, 1
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %221, i64 %224
%226 = load double, double* %225
%227 = load double*, double** %14
%228 = load i32, i32* %17
%229 = load i32, i32* %18
%230 = sub nsw i32 %228, %229
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %227, i64 %231
%233 = load double, double* %232
%234 = call double @llvm.fmuladd.f64(double %226, double %233, double %220)
store double %234, double* %22
br label %235
235: ; preds = %219
%236 = load i32, i32* %18
%237 = add nsw i32 %236, 1
store i32 %237, i32* %18
br label %215
238: ; preds = %215
br label %239
239: ; preds = %238, %211
%240 = load double, double* %22
%241 = load double*, double** %14
%242 = load i32, i32* %17
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %241, i64 %243
store double %240, double* %244
%245 = load i32*, i32** %16
%246 = load i32, i32* %17
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds i32, i32* %245, i64 %247
%249 = load i32, i32* %248
%250 = icmp eq i32 %249, 1
br i1 %250, label %251, label %264
251: ; preds = %239
%252 = load double, double* %22
%253 = call double @sqrt(double %252)
%254 = load double*, double** %15
%255 = load i32, i32* %17
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds double, double* %254, i64 %256
%258 = load double, double* %257
%259 = fmul double %253, %258
%260 = load double*, double** %15
%261 = load i32, i32* %17
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds double, double* %260, i64 %262
store double %259, double* %263
br label %264
264: ; preds = %251, %239
br label %265
265: ; preds = %264
%266 = load i32, i32* %17
%267 = add nsw i32 %266, 1
store i32 %267, i32* %17
br label %78
268: ; preds = %78
ret void
}

LLVM IR (-O2):
define void @fnGarchC(i32* nocapture %0, i32* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, i32* nocapture %7) {
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, -1
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, %10
%14 = select i1 %13, i32 %11, i32 %12
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %36
16: ; preds = %8
%17 = zext i32 %14 to i64
%18 = and i64 %17, 1
%19 = icmp eq i32 %14, 1
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = and i64 %17, 4294967294
br label %51
22: ; preds = %76, %16
%23 = phi i64 [ 0, %16 ], [ %77, %76 ]
%24 = icmp eq i64 %18, 0
br i1 %24, label %36, label %25
25: ; preds = %22
%26 = load double, double* %2
%27 = getelementptr inbounds double, double* %5, i64 %23
store double %26, double* %27
%28 = getelementptr inbounds i32, i32* %7, i64 %23
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %36
31: ; preds = %25
%32 = tail call double @sqrt(double %26)
%33 = getelementptr inbounds double, double* %6, i64 %23
%34 = load double, double* %33
%35 = fmul double %32, %34
store double %35, double* %33
br label %36
36: ; preds = %22, %31, %25, %8
%37 = load i32, i32* %0
%38 = icmp sgt i32 %14, %37
br i1 %38, label %175, label %39
39: ; preds = %36
%40 = icmp sgt i32 %10, 1
%41 = icmp slt i32 %12, 1
%42 = add i32 %12, 1
%43 = sext i32 %14 to i64
%44 = zext i32 %10 to i64
%45 = zext i32 %42 to i64
%46 = add nsw i64 %45, -1
%47 = and i64 %46, 1
%48 = icmp eq i32 %42, 2
%49 = and i64 %46, -2
%50 = icmp eq i64 %47, 0
br label %80
51: ; preds = %76, %20
%52 = phi i64 [ 0, %20 ], [ %77, %76 ]
%53 = phi i64 [ 0, %20 ], [ %78, %76 ]
%54 = load double, double* %2
%55 = getelementptr inbounds double, double* %5, i64 %52
store double %54, double* %55
%56 = getelementptr inbounds i32, i32* %7, i64 %52
%57 = load i32, i32* %56
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %64
59: ; preds = %51
%60 = tail call double @sqrt(double %54)
%61 = getelementptr inbounds double, double* %6, i64 %52
%62 = load double, double* %61
%63 = fmul double %60, %62
store double %63, double* %61
br label %64
64: ; preds = %51, %59
%65 = or i64 %52, 1
%66 = load double, double* %2
%67 = getelementptr inbounds double, double* %5, i64 %65
store double %66, double* %67
%68 = getelementptr inbounds i32, i32* %7, i64 %65
%69 = load i32, i32* %68
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %76
71: ; preds = %64
%72 = tail call double @sqrt(double %66)
%73 = getelementptr inbounds double, double* %6, i64 %65
%74 = load double, double* %73
%75 = fmul double %72, %74
store double %75, double* %73
br label %76
76: ; preds = %71, %64
%77 = add nuw nsw i64 %52, 2
%78 = add i64 %53, 2
%79 = icmp eq i64 %78, %21
br i1 %79, label %22, label %51
80: ; preds = %39, %170
%81 = phi i32 [ %37, %39 ], [ %171, %170 ]
%82 = phi i64 [ %43, %39 ], [ %172, %170 ]
%83 = load double, double* %2
br i1 %40, label %84, label %122
84: ; preds = %80, %118
%85 = phi i64 [ %120, %118 ], [ 1, %80 ]
%86 = phi double [ %119, %118 ], [ %83, %80 ]
%87 = add nsw i64 %85, -1
%88 = getelementptr inbounds double, double* %3, i64 %87
%89 = load double, double* %88
%90 = fcmp oeq double %89, 0.000000e+00
br i1 %90, label %91, label %99
91: ; preds = %84
%92 = getelementptr inbounds double, double* %2, i64 %85
%93 = load double, double* %92
%94 = sub nsw i64 %82, %85
%95 = getelementptr inbounds double, double* %6, i64 %94
%96 = load double, double* %95
%97 = fmul double %93, %96
%98 = tail call double @llvm.fmuladd.f64(double %97, double %96, double %86)
br label %99
99: ; preds = %91, %84
%100 = phi double [ %98, %91 ], [ %86, %84 ]
%101 = fcmp ogt double %89, 0.000000e+00
br i1 %101, label %102, label %118
102: ; preds = %99
%103 = sub nsw i64 %82, %85
%104 = getelementptr inbounds double, double* %6, i64 %103
%105 = load double, double* %104
%106 = fcmp ult double %105, 0.000000e+00
br i1 %106, label %112, label %107
107: ; preds = %102
%108 = getelementptr inbounds double, double* %2, i64 %85
%109 = load double, double* %108
%110 = fmul double %105, %109
%111 = tail call double @llvm.fmuladd.f64(double %110, double %105, double %100)
br label %112
112: ; preds = %107, %102
%113 = phi double [ %100, %102 ], [ %111, %107 ]
%114 = fcmp olt double %105, 0.000000e+00
br i1 %114, label %115, label %118
115: ; preds = %112
%116 = fmul double %89, %105
%117 = tail call double @llvm.fmuladd.f64(double %116, double %105, double %113)
br label %118
118: ; preds = %99, %112, %115
%119 = phi double [ %117, %115 ], [ %113, %112 ], [ %100, %99 ]
%120 = add nuw nsw i64 %85, 1
%121 = icmp eq i64 %120, %44
br i1 %121, label %122, label %84
122: ; preds = %118, %80
%123 = phi double [ %83, %80 ], [ %119, %118 ]
br i1 %41, label %158, label %124
124: ; preds = %122
br i1 %48, label %146, label %125
125: ; preds = %124, %125
%126 = phi i64 [ %143, %125 ], [ 1, %124 ]
%127 = phi double [ %142, %125 ], [ %123, %124 ]
%128 = phi i64 [ %144, %125 ], [ 0, %124 ]
%129 = add nsw i64 %126, -1
%130 = getelementptr inbounds double, double* %4, i64 %129
%131 = load double, double* %130
%132 = sub nsw i64 %82, %126
%133 = getelementptr inbounds double, double* %5, i64 %132
%134 = load double, double* %133
%135 = tail call double @llvm.fmuladd.f64(double %131, double %134, double %127)
%136 = xor i64 %126, -1
%137 = getelementptr inbounds double, double* %4, i64 %126
%138 = load double, double* %137
%139 = add i64 %82, %136
%140 = getelementptr inbounds double, double* %5, i64 %139
%141 = load double, double* %140
%142 = tail call double @llvm.fmuladd.f64(double %138, double %141, double %135)
%143 = add nuw nsw i64 %126, 2
%144 = add i64 %128, 2
%145 = icmp eq i64 %144, %49
br i1 %145, label %146, label %125
146: ; preds = %125, %124
%147 = phi double [ undef, %124 ], [ %142, %125 ]
%148 = phi i64 [ 1, %124 ], [ %143, %125 ]
%149 = phi double [ %123, %124 ], [ %142, %125 ]
br i1 %50, label %158, label %150
150: ; preds = %146
%151 = add nsw i64 %148, -1
%152 = getelementptr inbounds double, double* %4, i64 %151
%153 = load double, double* %152
%154 = sub nsw i64 %82, %148
%155 = getelementptr inbounds double, double* %5, i64 %154
%156 = load double, double* %155
%157 = tail call double @llvm.fmuladd.f64(double %153, double %156, double %149)
br label %158
158: ; preds = %150, %146, %122
%159 = phi double [ %123, %122 ], [ %147, %146 ], [ %157, %150 ]
%160 = getelementptr inbounds double, double* %5, i64 %82
store double %159, double* %160
%161 = getelementptr inbounds i32, i32* %7, i64 %82
%162 = load i32, i32* %161
%163 = icmp eq i32 %162, 1
br i1 %163, label %164, label %170
164: ; preds = %158
%165 = tail call double @sqrt(double %159)
%166 = getelementptr inbounds double, double* %6, i64 %82
%167 = load double, double* %166
%168 = fmul double %165, %167
store double %168, double* %166
%169 = load i32, i32* %0
br label %170
170: ; preds = %158, %164
%171 = phi i32 [ %81, %158 ], [ %169, %164 ]
%172 = add nsw i64 %82, 1
%173 = sext i32 %171 to i64
%174 = icmp slt i64 %82, %173
br i1 %174, label %80, label %175
175: ; preds = %170, %36
ret void
}