#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 */
typedef scalar_t__ uint;

/* Variables and functions */
int /*<<< orphan*/ DC(double, double *, scalar_t__ *, scalar_t__, double,
                      double, double);
double fabs(double);
double fmod(scalar_t__, double);
double pow(double, double);
void SQUARE(double amplitude, double frequency, double dutycycle,
            double *output, uint *index, uint Ni, double expon, double srate,
            double dt) {
  double tmp1, tmp2, tmp3;
  uint i;
  if (frequency == 0.) {
    DC(amplitude / 2., output, index, Ni, expon, srate, dt);
    return;
  }
  tmp1 = (1. / frequency) / dt;
  tmp2 = (dutycycle * 0.01 * tmp1);
  tmp3 = 2. * amplitude;
  if (expon == -1)
    for (i = 0; i < Ni; i++)
      output[(*index)++] = fabs(tmp3 * (fmod(i, tmp1) < tmp2) - amplitude);
  else if (expon == 0)
    for (i = 0; i < Ni; i++)
      output[(*index)++] = (((tmp3 * (fmod(i, tmp1) < tmp2) - amplitude) > 0)
                                ? tmp3 * (fmod(i, tmp1) < tmp2) - amplitude
                                : 0.);
  else if (expon != 1)
    for (i = 0; i < Ni; i++)
      output[(*index)++] =
          pow(tmp3 * (fmod(i, tmp1) < tmp2) - amplitude, expon);
  else
    for (i = 0; i < Ni; i++)
      output[(*index)++] = tmp3 * (fmod(i, tmp1) < tmp2) - amplitude;
  return;
}


x86 assembly (clang, -O0):
<SQUARE>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  %xmm5,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b3 <SQUARE+0x83>
jp     11b3 <SQUARE+0x83>
movsd  -0x8(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
call   1040 <DC@plt>
jmp    157e <SQUARE+0x44e>
movsd  0xe5d(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe3e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe1f(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe00(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12ba <SQUARE+0x18a>
jp     12ba <SQUARE+0x18a>
movq   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    12b5 <SQUARE+0x185>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x68(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
call   1030 <fmod@plt>
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xd9a(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    1218 <SQUARE+0xe8>
jmp    1579 <SQUARE+0x449>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13f9 <SQUARE+0x2c9>
jp     13f9 <SQUARE+0x2c9>
movq   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    13f4 <SQUARE+0x2c4>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x68(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
call   1030 <fmod@plt>
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13b7 <SQUARE+0x287>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x68(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
call   1030 <fmod@plt>
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    13c4 <SQUARE+0x294>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    13c4 <SQUARE+0x294>
movsd  -0x80(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    12da <SQUARE+0x1aa>
jmp    1574 <SQUARE+0x444>
movsd  -0x38(%rbp),%xmm0
movsd  0xc12(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    141b <SQUARE+0x2eb>
jp     141b <SQUARE+0x2eb>
jmp    14ca <SQUARE+0x39a>
movq   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    14c5 <SQUARE+0x395>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x68(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
call   1030 <fmod@plt>
movaps %xmm0,%xmm2
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
call   1050 <pow@plt>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    1423 <SQUARE+0x2f3>
jmp    156f <SQUARE+0x43f>
movq   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    156a <SQUARE+0x43a>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x68(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
call   1030 <fmod@plt>
movaps %xmm0,%xmm2
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    14d2 <SQUARE+0x3a2>
jmp    156f <SQUARE+0x43f>
jmp    1574 <SQUARE+0x444>
jmp    1579 <SQUARE+0x449>
jmp    157e <SQUARE+0x44e>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SQUARE>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm1
jne    117a <SQUARE+0x4a>
jp     117a <SQUARE+0x4a>
mulsd  0xec0(%rip),%xmm0
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
movaps %xmm3,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <DC@plt>
movsd  0xe7e(%rip),%xmm6
divsd  %xmm1,%xmm6
divsd  %xmm5,%xmm6
mulsd  0xe76(%rip),%xmm2
mulsd  %xmm6,%xmm2
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
ucomisd 0xe6a(%rip),%xmm3
movsd  %xmm6,0x28(%rsp)
jne    1258 <SQUARE+0x128>
jp     1258 <SQUARE+0x128>
test   %r14,%r14
movapd %xmm0,0x10(%rsp)
jle    124c <SQUARE+0x11c>
movapd 0x10(%rsp),%xmm0
xorpd  0xe4b(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xor    %ebx,%ebx
movsd  %xmm2,0x8(%rsp)
movapd %xmm4,0x30(%rsp)
nopl   0x0(%rax)
mov    %rbx,%rdi
movapd %xmm6,%xmm0
call   1030 <fmod@plt>
movapd 0x30(%rsp),%xmm4
movsd  0x8(%rsp),%xmm2
movsd  0x28(%rsp),%xmm6
cmpltsd %xmm2,%xmm0
movsd  0xde5(%rip),%xmm1
andpd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
addsd  0x10(%rsp),%xmm0
andpd  0xdff(%rip),%xmm0
mov    (%r12),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r12)
movlpd %xmm0,(%r15,%rax,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11f0 <SQUARE+0xc0>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
jne    131c <SQUARE+0x1ec>
jp     131c <SQUARE+0x1ec>
test   %r14,%r14
jle    124c <SQUARE+0x11c>
xorpd  0xda7(%rip),%xmm0
xor    %ebx,%ebx
movapd %xmm0,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movapd %xmm4,0x30(%rsp)
jmp    12b1 <SQUARE+0x181>
nop
mov    (%r12),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r12)
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rbx
cmp    %rbx,%r14
movsd  0x28(%rsp),%xmm6
je     124c <SQUARE+0x11c>
mov    %rbx,%rdi
movapd %xmm6,%xmm0
call   1030 <fmod@plt>
movapd %xmm0,%xmm1
cmpltsd 0x8(%rsp),%xmm1
movsd  0xd30(%rip),%xmm0
andpd  %xmm0,%xmm1
mulsd  0x30(%rsp),%xmm1
addsd  0x10(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    1290 <SQUARE+0x160>
mov    %rbx,%rdi
movsd  0x28(%rsp),%xmm0
call   1030 <fmod@plt>
cmpltsd 0x8(%rsp),%xmm0
movsd  0xcf9(%rip),%xmm1
andpd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
jmp    1290 <SQUARE+0x160>
ucomisd 0xcdc(%rip),%xmm3
movapd %xmm0,0x10(%rsp)
jne    1332 <SQUARE+0x202>
jnp    13cc <SQUARE+0x29c>
test   %r14,%r14
movsd  %xmm2,0x8(%rsp)
movapd %xmm4,0x30(%rsp)
movsd  %xmm3,0x40(%rsp)
jle    124c <SQUARE+0x11c>
movapd 0x10(%rsp),%xmm0
xorpd  0xcc5(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
movapd %xmm6,%xmm0
call   1030 <fmod@plt>
cmpltsd 0x8(%rsp),%xmm0
movsd  0xc75(%rip),%xmm1
andpd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
call   1050 <pow@plt>
movsd  0x28(%rsp),%xmm6
mov    (%r12),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r12)
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1370 <SQUARE+0x240>
jmp    124c <SQUARE+0x11c>
test   %r14,%r14
jle    124c <SQUARE+0x11c>
movapd 0x10(%rsp),%xmm0
xorpd  0xc3d(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xor    %ebx,%ebx
movsd  %xmm2,0x8(%rsp)
movapd %xmm4,0x30(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
movapd %xmm6,%xmm0
call   1030 <fmod@plt>
movapd 0x30(%rsp),%xmm4
movsd  0x8(%rsp),%xmm2
movsd  0x28(%rsp),%xmm6
cmpltsd %xmm2,%xmm0
movsd  0xbd5(%rip),%xmm1
andpd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
addsd  0x10(%rsp),%xmm0
mov    (%r12),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r12)
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1400 <SQUARE+0x2d0>
jmp    124c <SQUARE+0x11c>

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

LLVM IR (-O2):
define void @SQUARE(double %0, double %1, double %2, double* %3, i64* %4, i64 %5, double %6, double %7, double %8) {
%10 = fcmp oeq double %1, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = fmul double %0, 5.000000e-01
%13 = tail call i32 @DC(double %12, double* %3, i64* %4, i64 %5, double %6, double %7, double %8)
br label %94
14: ; preds = %9
%15 = fdiv double 1.000000e+00, %1
%16 = fdiv double %15, %8
%17 = fmul double %2, 1.000000e-02
%18 = fmul double %17, %16
%19 = fmul double %0, 2.000000e+00
%20 = fcmp oeq double %6, -1.000000e+00
br i1 %20, label %21, label %37
21: ; preds = %14
%22 = icmp sgt i64 %5, 0
br i1 %22, label %23, label %94
23: ; preds = %21
%24 = fneg double %0
br label %25
25: ; preds = %23, %25
%26 = phi i64 [ 0, %23 ], [ %35, %25 ]
%27 = tail call double @fmod(i64 %26, double %16)
%28 = fcmp olt double %27, %18
%29 = uitofp i1 %28 to double
%30 = tail call double @llvm.fmuladd.f64(double %19, double %29, double %24)
%31 = tail call double @llvm.fabs.f64(double %30)
%32 = load i64, i64* %4
%33 = add nsw i64 %32, 1
store i64 %33, i64* %4
%34 = getelementptr inbounds double, double* %3, i64 %32
store double %31, double* %34
%35 = add nuw nsw i64 %26, 1
%36 = icmp eq i64 %35, %5
br i1 %36, label %94, label %25
37: ; preds = %14
%38 = fcmp oeq double %6, 0.000000e+00
br i1 %38, label %39, label %62
39: ; preds = %37
%40 = icmp sgt i64 %5, 0
br i1 %40, label %41, label %94
41: ; preds = %39
%42 = fneg double %0
br label %43
43: ; preds = %41, %55
%44 = phi i64 [ 0, %41 ], [ %60, %55 ]
%45 = tail call double @fmod(i64 %44, double %16)
%46 = fcmp olt double %45, %18
%47 = uitofp i1 %46 to double
%48 = tail call double @llvm.fmuladd.f64(double %19, double %47, double %42)
%49 = fcmp ogt double %48, 0.000000e+00
br i1 %49, label %50, label %55
50: ; preds = %43
%51 = tail call double @fmod(i64 %44, double %16)
%52 = fcmp olt double %51, %18
%53 = uitofp i1 %52 to double
%54 = tail call double @llvm.fmuladd.f64(double %19, double %53, double %42)
br label %55
55: ; preds = %43, %50
%56 = phi double [ %54, %50 ], [ 0.000000e+00, %43 ]
%57 = load i64, i64* %4
%58 = add nsw i64 %57, 1
store i64 %58, i64* %4
%59 = getelementptr inbounds double, double* %3, i64 %57
store double %56, double* %59
%60 = add nuw nsw i64 %44, 1
%61 = icmp eq i64 %60, %5
br i1 %61, label %94, label %43
62: ; preds = %37
%63 = fcmp une double %6, 1.000000e+00
%64 = icmp sgt i64 %5, 0
br i1 %63, label %68, label %65
65: ; preds = %62
br i1 %64, label %66, label %94
66: ; preds = %65
%67 = fneg double %0
br label %83
68: ; preds = %62
br i1 %64, label %69, label %94
69: ; preds = %68
%70 = fneg double %0
br label %71
71: ; preds = %69, %71
%72 = phi i64 [ 0, %69 ], [ %81, %71 ]
%73 = tail call double @fmod(i64 %72, double %16)
%74 = fcmp olt double %73, %18
%75 = uitofp i1 %74 to double
%76 = tail call double @llvm.fmuladd.f64(double %19, double %75, double %70)
%77 = tail call double @pow(double %76, double %6)
%78 = load i64, i64* %4
%79 = add nsw i64 %78, 1
store i64 %79, i64* %4
%80 = getelementptr inbounds double, double* %3, i64 %78
store double %77, double* %80
%81 = add nuw nsw i64 %72, 1
%82 = icmp eq i64 %81, %5
br i1 %82, label %94, label %71
83: ; preds = %66, %83
%84 = phi i64 [ 0, %66 ], [ %92, %83 ]
%85 = tail call double @fmod(i64 %84, double %16)
%86 = fcmp olt double %85, %18
%87 = uitofp i1 %86 to double
%88 = tail call double @llvm.fmuladd.f64(double %19, double %87, double %67)
%89 = load i64, i64* %4
%90 = add nsw i64 %89, 1
store i64 %90, i64* %4
%91 = getelementptr inbounds double, double* %3, i64 %89
store double %88, double* %91
%92 = add nuw nsw i64 %84, 1
%93 = icmp eq i64 %92, %5
br i1 %93, label %94, label %83
94: ; preds = %83, %71, %55, %25, %65, %68, %39, %21, %11
ret void
}