#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 M_PI;
double exp(double);
int pow(double, double);
double sin(int);
int /*<<< orphan*/ strncmp(char const *, char *, int);
double strtod(char const *, int /*<<< orphan*/);
void compute_exact_solution(int n, double *a, double dx, char const *ic,
                            double alpha, double t, double bc0, double bc1) {
  int i;
  double x;
  if (bc0 == 0 && bc1 == 0 && !strncmp(ic, "sin(Pi*x)", 9)) {
    for (i = 0, x = 0; i < n; i++, x += dx)
      a[i] = sin(M_PI * x) * exp(-alpha * M_PI * M_PI * t);
  } else if (bc0 == 0 && bc1 == 0 && !strncmp(ic, "const(", 6)) {
    double cval = strtod(ic + 6, 0);
    for (i = 0, x = 0; i < n; i++, x += dx) {
      int n;
      double fsum = 0;
      for (n = 1; n < 200; n++) {
        double coeff = 2 * cval * (1 - pow(-1.0, (double)n)) / (n * M_PI);
        double func = sin(n * M_PI * x) * exp(-alpha * n * n * M_PI * M_PI * t);
        fsum += coeff * func;
      }
      a[i] = fsum;
    }
  } else {
    for (i = 0, x = 0; i < n; i++, x += dx)
      a[i] = bc0 + (bc1 - bc0) * x;
  }
}


x86 assembly (clang, -O0):
<compute_exact_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    127d <compute_exact_solution+0x12d>
jp     127d <compute_exact_solution+0x12d>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    127d <compute_exact_solution+0x12d>
jp     127d <compute_exact_solution+0x12d>
mov    -0x20(%rbp),%rdi
lea    0xe56(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    127d <compute_exact_solution+0x12d>
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1278 <compute_exact_solution+0x128>
mov    0x2df9(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x2dbf(%rip),%rax
mulsd  (%rax),%xmm0
mov    0x2db4(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11dc <compute_exact_solution+0x8c>
jmp    14c0 <compute_exact_solution+0x370>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1455 <compute_exact_solution+0x305>
jp     1455 <compute_exact_solution+0x305>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1455 <compute_exact_solution+0x305>
jp     1455 <compute_exact_solution+0x305>
mov    -0x20(%rbp),%rdi
lea    0xd62(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1455 <compute_exact_solution+0x305>
mov    -0x20(%rbp),%rdi
add    $0x6,%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1450 <compute_exact_solution+0x300>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x1,-0x5c(%rbp)
cmpl   $0xc8,-0x5c(%rbp)
jge    1421 <compute_exact_solution+0x2d1>
movsd  0xcea(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdl -0x5c(%rbp),%xmm1
movsd  0xcc8(%rip),%xmm0
call   1070 <pow@plt>
movsd  -0x90(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x5c(%rbp),%xmm1
mov    0x2c86(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm0
mov    0x2c6d(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsi2sdl -0x5c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x5c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2c1e(%rip),%rax
mulsd  (%rax),%xmm0
mov    0x2c13(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1309 <compute_exact_solution+0x1b9>
movsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    12ee <compute_exact_solution+0x19e>
jmp    14bb <compute_exact_solution+0x36b>
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14b6 <compute_exact_solution+0x366>
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1464 <compute_exact_solution+0x314>
jmp    14bb <compute_exact_solution+0x36b>
jmp    14c0 <compute_exact_solution+0x370>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_exact_solution>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%r15
mov    %edi,%r14d
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm3
jne    11df <compute_exact_solution+0x8f>
jp     11df <compute_exact_solution+0x8f>
ucomisd %xmm5,%xmm4
jne    11df <compute_exact_solution+0x8f>
jp     11df <compute_exact_solution+0x8f>
mov    %rdx,%rbp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm4,(%rsp)
movapd %xmm1,0x20(%rsp)
movsd  %xmm2,0x30(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xe83(%rip),%rsi
mov    %rdx,%rdi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12b3 <compute_exact_solution+0x163>
lea    0xe71(%rip),%rsi
mov    %rbp,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
movsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
je     133e <compute_exact_solution+0x1ee>
test   %r14d,%r14d
jle    149a <compute_exact_solution+0x34a>
subsd  %xmm3,%xmm4
mov    %r14d,%ecx
lea    -0x1(%rcx),%rdx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0x3,%rdx
jae    1206 <compute_exact_solution+0xb6>
xorpd  %xmm2,%xmm2
xor    %edx,%edx
jmp    1274 <compute_exact_solution+0x124>
and    $0xfffffffc,%ecx
xorpd  %xmm2,%xmm2
xor    %edx,%edx
nop
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,(%r15,%rdx,8)
addsd  %xmm0,%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x8(%r15,%rdx,8)
addsd  %xmm0,%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x10(%r15,%rdx,8)
addsd  %xmm0,%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x18(%r15,%rdx,8)
add    $0x4,%rdx
addsd  %xmm0,%xmm2
cmp    %rdx,%rcx
jne    1210 <compute_exact_solution+0xc0>
test   %rax,%rax
je     149a <compute_exact_solution+0x34a>
lea    (%r15,%rdx,8),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,(%rcx,%rdx,8)
addsd  %xmm0,%xmm2
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1290 <compute_exact_solution+0x140>
jmp    149a <compute_exact_solution+0x34a>
test   %r14d,%r14d
jle    149a <compute_exact_solution+0x34a>
movapd 0x20(%rsp),%xmm0
xorpd  0xd36(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
mov    %r14d,%r14d
xorpd  %xmm1,%xmm1
xor    %ebp,%ebp
mov    0x2d08(%rip),%rbx
movsd  %xmm1,(%rsp)
movsd  (%rbx),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm1
movapd %xmm1,%xmm0
mulsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
call   1060 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r15,%rbp,8)
add    $0x1,%rbp
addsd  0x10(%rsp),%xmm1
cmp    %rbp,%r14
jne    12e0 <compute_exact_solution+0x190>
jmp    149a <compute_exact_solution+0x34a>
add    $0x6,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
movsd  %xmm0,0x18(%rsp)
test   %r14d,%r14d
jle    149a <compute_exact_solution+0x34a>
movsd  0x18(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
movapd 0x20(%rsp),%xmm0
xorpd  0xc87(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
mov    %r14d,%r14d
xorpd  %xmm0,%xmm0
xor    %r12d,%r12d
movsd  0xc7f(%rip),%xmm4
movsd  0xc7f(%rip),%xmm2
mov    0x2c48(%rip),%rbx
movsd  %xmm0,0x38(%rsp)
mov    $0xc7,%ebp
xorpd  %xmm0,%xmm0
movapd %xmm4,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1070 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  (%rbx),%xmm0
mulsd  (%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x48(%rsp)
mulsd  0x38(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movapd 0x20(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  (%rbx),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
call   1060 <exp@plt>
movsd  0xbd9(%rip),%xmm2
movsd  0xbc9(%rip),%xmm4
mulsd  0x40(%rsp),%xmm0
mulsd  0x48(%rsp),%xmm0
movsd  0x8(%rsp),%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x8(%rsp)
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm4,%xmm1
add    $0xffffffff,%ebp
jne    13c0 <compute_exact_solution+0x270>
movsd  %xmm0,(%r15,%r12,8)
add    $0x1,%r12
movsd  0x38(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
cmp    %r14,%r12
jne    13a0 <compute_exact_solution+0x250>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"sin(Pi*x)\00"
@M_PI = global double 0.000000e+00
@.str.1 = [7 x i8] c"const(\00"
define void @compute_exact_solution(i32 %0, double* nocapture writeonly %1, double %2, i8* %3, double %4, double %5, double %6, double %7) {
%9 = fcmp oeq double %6, 0.000000e+00
%10 = fcmp oeq double %7, 0.000000e+00
%11 = and i1 %9, %10
br i1 %11, label %12, label %81
12: ; preds = %8
%13 = tail call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %37
15: ; preds = %12
%16 = icmp sgt i32 %0, 0
br i1 %16, label %17, label %127
17: ; preds = %15
%18 = fneg double %4
%19 = zext i32 %0 to i64
br label %20
20: ; preds = %17, %20
%21 = phi i64 [ 0, %17 ], [ %34, %20 ]
%22 = phi double [ 0.000000e+00, %17 ], [ %35, %20 ]
%23 = load double, double* @M_PI
%24 = fmul double %22, %23
%25 = fptosi double %24 to i32
%26 = tail call double @sin(i32 %25)
%27 = load double, double* @M_PI
%28 = fmul double %27, %18
%29 = fmul double %27, %28
%30 = fmul double %29, %5
%31 = tail call double @exp(double %30)
%32 = fmul double %26, %31
%33 = getelementptr inbounds double, double* %1, i64 %21
store double %32, double* %33
%34 = add nuw nsw i64 %21, 1
%35 = fadd double %22, %2
%36 = icmp eq i64 %34, %19
br i1 %36, label %127, label %20
37: ; preds = %12
%38 = tail call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %81
40: ; preds = %37
%41 = getelementptr inbounds i8, i8* %3, i64 6
%42 = tail call double @strtod(i8* %41, i32 0)
%43 = icmp sgt i32 %0, 0
br i1 %43, label %44, label %127
44: ; preds = %40
%45 = fmul double %42, 2.000000e+00
%46 = fneg double %4
%47 = zext i32 %0 to i64
br label %48
48: ; preds = %44, %76
%49 = phi i64 [ 0, %44 ], [ %78, %76 ]
%50 = phi double [ 0.000000e+00, %44 ], [ %79, %76 ]
br label %51
51: ; preds = %48, %51
%52 = phi double [ 0.000000e+00, %48 ], [ %73, %51 ]
%53 = phi i32 [ 1, %48 ], [ %74, %51 ]
%54 = sitofp i32 %53 to double
%55 = tail call i32 @pow(double -1.000000e+00, double %54)
%56 = sub nsw i32 1, %55
%57 = sitofp i32 %56 to double
%58 = fmul double %45, %57
%59 = load double, double* @M_PI
%60 = fmul double %59, %54
%61 = fdiv double %58, %60
%62 = fmul double %50, %60
%63 = fptosi double %62 to i32
%64 = tail call double @sin(i32 %63)
%65 = fmul double %46, %54
%66 = fmul double %65, %54
%67 = load double, double* @M_PI
%68 = fmul double %66, %67
%69 = fmul double %67, %68
%70 = fmul double %69, %5
%71 = tail call double @exp(double %70)
%72 = fmul double %64, %71
%73 = tail call double @llvm.fmuladd.f64(double %61, double %72, double %52)
%74 = add nuw nsw i32 %53, 1
%75 = icmp eq i32 %74, 200
br i1 %75, label %76, label %51
76: ; preds = %51
%77 = getelementptr inbounds double, double* %1, i64 %49
store double %73, double* %77
%78 = add nuw nsw i64 %49, 1
%79 = fadd double %50, %2
%80 = icmp eq i64 %78, %47
br i1 %80, label %127, label %48
81: ; preds = %8, %37
%82 = icmp sgt i32 %0, 0
br i1 %82, label %83, label %127
83: ; preds = %81
%84 = fsub double %7, %6
%85 = zext i32 %0 to i64
%86 = add nsw i64 %85, -1
%87 = and i64 %85, 3
%88 = icmp ult i64 %86, 3
br i1 %88, label %113, label %89
89: ; preds = %83
%90 = and i64 %85, 4294967292
br label %91
91: ; preds = %91, %89
%92 = phi i64 [ 0, %89 ], [ %109, %91 ]
%93 = phi double [ 0.000000e+00, %89 ], [ %110, %91 ]
%94 = phi i64 [ 0, %89 ], [ %111, %91 ]
%95 = tail call double @llvm.fmuladd.f64(double %84, double %93, double %6)
%96 = getelementptr inbounds double, double* %1, i64 %92
store double %95, double* %96
%97 = or i64 %92, 1
%98 = fadd double %93, %2
%99 = tail call double @llvm.fmuladd.f64(double %84, double %98, double %6)
%100 = getelementptr inbounds double, double* %1, i64 %97
store double %99, double* %100
%101 = or i64 %92, 2
%102 = fadd double %98, %2
%103 = tail call double @llvm.fmuladd.f64(double %84, double %102, double %6)
%104 = getelementptr inbounds double, double* %1, i64 %101
store double %103, double* %104
%105 = or i64 %92, 3
%106 = fadd double %102, %2
%107 = tail call double @llvm.fmuladd.f64(double %84, double %106, double %6)
%108 = getelementptr inbounds double, double* %1, i64 %105
store double %107, double* %108
%109 = add nuw nsw i64 %92, 4
%110 = fadd double %106, %2
%111 = add i64 %94, 4
%112 = icmp eq i64 %111, %90
br i1 %112, label %113, label %91
113: ; preds = %91, %83
%114 = phi i64 [ 0, %83 ], [ %109, %91 ]
%115 = phi double [ 0.000000e+00, %83 ], [ %110, %91 ]
%116 = icmp eq i64 %87, 0
br i1 %116, label %127, label %117
117: ; preds = %113, %117
%118 = phi i64 [ %123, %117 ], [ %114, %113 ]
%119 = phi double [ %124, %117 ], [ %115, %113 ]
%120 = phi i64 [ %125, %117 ], [ 0, %113 ]
%121 = tail call double @llvm.fmuladd.f64(double %84, double %119, double %6)
%122 = getelementptr inbounds double, double* %1, i64 %118
store double %121, double* %122
%123 = add nuw nsw i64 %118, 1
%124 = fadd double %119, %2
%125 = add i64 %120, 1
%126 = icmp eq i64 %125, %87
br i1 %126, label %127, label %117
127: ; preds = %113, %117, %76, %20, %81, %40, %15
ret void
}