#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 /*<<< orphan*/ abort();
void test_reductions(void) {
  const int n = 10;
  int i;
  double array[n];
  for (i = 0; i < n; i++)
    array[i] = i + 1;
  {
    double res, vres;
    res = (0);
#pragma acc parallel num_gangs(ng) copy(res)

#pragma acc loop gang reduction(+ : res)
    for (i = 0; i < n; i++)
      res = res + (array[i]);
    vres = (0);
    for (i = 0; i < n; i++)
      vres = vres + (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (1);
#pragma acc parallel num_gangs(ng) copy(res)

#pragma acc loop gang reduction(* : res)
    for (i = 0; i < n; i++)
      res = res * (array[i]);
    vres = (1);
    for (i = 0; i < n; i++)
      vres = vres * (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (0);
#pragma acc parallel num_workers(nw) copy(res)

#pragma acc loop worker reduction(+ : res)
    for (i = 0; i < n; i++)
      res = res + (array[i]);
    vres = (0);
    for (i = 0; i < n; i++)
      vres = vres + (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (1);
#pragma acc parallel num_workers(nw) copy(res)

#pragma acc loop worker reduction(* : res)
    for (i = 0; i < n; i++)
      res = res * (array[i]);
    vres = (1);
    for (i = 0; i < n; i++)
      vres = vres * (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (0);
#pragma acc parallel vector_length(vl) copy(res)

#pragma acc loop vector reduction(+ : res)
    for (i = 0; i < n; i++)
      res = res + (array[i]);
    vres = (0);
    for (i = 0; i < n; i++)
      vres = vres + (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (1);
#pragma acc parallel vector_length(vl) copy(res)

#pragma acc loop vector reduction(* : res)
    for (i = 0; i < n; i++)
      res = res * (array[i]);
    vres = (1);
    for (i = 0; i < n; i++)
      vres = vres * (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (0);
#pragma acc parallel num_gangs(ng) num_workers(nw) vector_length(vl) copy(res)

#pragma acc loop gang worker vector reduction(+ : res)
    for (i = 0; i < n; i++)
      res = res + (array[i]);
    vres = (0);
    for (i = 0; i < n; i++)
      vres = vres + (array[i]);
    if (res != vres)
      abort();
  };
  {
    double res, vres;
    res = (1);
#pragma acc parallel num_gangs(ng) num_workers(nw) vector_length(vl) copy(res)

#pragma acc loop gang worker vector reduction(* : res)
    for (i = 0; i < n; i++)
      res = res * (array[i]);
    vres = (1);
    for (i = 0; i < n; i++)
      vres = vres * (array[i]);
    if (res != vres)
      abort();
  };
}


x86 assembly (clang, -O0):
<test_reductions>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0xa,-0x4(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115f <test_reductions+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0xe0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <test_reductions+0x20>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    119d <test_reductions+0x8d>
movsd  -0x18(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <test_reductions+0x5e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11db <test_reductions+0xcb>
movsd  -0x20(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ac <test_reductions+0x9c>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    11f6 <test_reductions+0xe6>
jp     11f6 <test_reductions+0xe6>
jmp    11fd <test_reductions+0xed>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xdfb(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1240 <test_reductions+0x130>
movsd  -0x28(%rbp),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1211 <test_reductions+0x101>
movsd  0xdb8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1283 <test_reductions+0x173>
movsd  -0x30(%rbp),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1254 <test_reductions+0x144>
movsd  -0x28(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jne    129e <test_reductions+0x18e>
jp     129e <test_reductions+0x18e>
jmp    12a5 <test_reductions+0x195>
mov    $0x0,%al
call   1030 <abort@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    12e3 <test_reductions+0x1d3>
movsd  -0x38(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b4 <test_reductions+0x1a4>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1321 <test_reductions+0x211>
movsd  -0x40(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12f2 <test_reductions+0x1e2>
movsd  -0x38(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jne    133c <test_reductions+0x22c>
jp     133c <test_reductions+0x22c>
jmp    1343 <test_reductions+0x233>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xcb5(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1386 <test_reductions+0x276>
movsd  -0x48(%rbp),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1357 <test_reductions+0x247>
movsd  0xc72(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    13c9 <test_reductions+0x2b9>
movsd  -0x50(%rbp),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    139a <test_reductions+0x28a>
movsd  -0x48(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jne    13e4 <test_reductions+0x2d4>
jp     13e4 <test_reductions+0x2d4>
jmp    13eb <test_reductions+0x2db>
mov    $0x0,%al
call   1030 <abort@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1429 <test_reductions+0x319>
movsd  -0x58(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13fa <test_reductions+0x2ea>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1467 <test_reductions+0x357>
movsd  -0x60(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1438 <test_reductions+0x328>
movsd  -0x58(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jne    1482 <test_reductions+0x372>
jp     1482 <test_reductions+0x372>
jmp    1489 <test_reductions+0x379>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xb6f(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    14cc <test_reductions+0x3bc>
movsd  -0x68(%rbp),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    149d <test_reductions+0x38d>
movsd  0xb2c(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    150f <test_reductions+0x3ff>
movsd  -0x70(%rbp),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    14e0 <test_reductions+0x3d0>
movsd  -0x68(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
jne    152a <test_reductions+0x41a>
jp     152a <test_reductions+0x41a>
jmp    1531 <test_reductions+0x421>
mov    $0x0,%al
call   1030 <abort@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    156f <test_reductions+0x45f>
movsd  -0x78(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1540 <test_reductions+0x430>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    15ad <test_reductions+0x49d>
movsd  -0x80(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    157e <test_reductions+0x46e>
movsd  -0x78(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jne    15c8 <test_reductions+0x4b8>
jp     15c8 <test_reductions+0x4b8>
jmp    15cf <test_reductions+0x4bf>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xa29(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    161b <test_reductions+0x50b>
movsd  -0x88(%rbp),%xmm0
ff
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    15e6 <test_reductions+0x4d6>
movsd  0x9dd(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1667 <test_reductions+0x557>
movsd  -0x90(%rbp),%xmm0
ff
movslq -0x8(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1632 <test_reductions+0x522>
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x90(%rbp),%xmm0
ff
jne    1688 <test_reductions+0x578>
jp     1688 <test_reductions+0x578>
jmp    168f <test_reductions+0x57f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reductions>:
ret

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

LLVM IR (-O2):
define void @test_reductions() {
ret void
}