#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 abs(double);
int /*<<< orphan*/ assert(int);
int mnm_barrsum(int *, unsigned int const);
int /*<<< orphan*/ mnm_darrscale(double *, unsigned int const, double);
double mnm_darrsum(double *, unsigned int const);
int /*<<< orphan*/ mnm_iarrscale(int *, unsigned int const, int);
int mnm_iarrsum(int *, unsigned int const);
int /*<<< orphan*/ mnm_larrscale(long *, unsigned int const, int);
int /*<<< orphan*/ puts(char *);
int main() {
  unsigned int k;
  const unsigned int n = 6;
  double d[] = {1.1, -1.1, 3.0, -9.3, 2.2, 9.3};
  bool b[] = {true, true, false, true, false, false};
  int i[] = {1, 2, 3, 4, 5, -6};
  long l[] = {100, 200, 300, 400, 500, 600};
  puts("Testing mnm_darrsum, mnm_iarrsum, mnm_barrsum ...");
  assert(mnm_darrsum(d, n) == 1.1 - 1.1 + 3.0 - 9.3 + 2.2 + 9.3 &&
         "mnm_darrsum test failed.");
  assert(mnm_barrsum(b, n) == 3 && "mnm_barrsum test failed.");
  assert(mnm_iarrsum(i, n) == 9);
  puts("... tests passed.");
  puts("Testing mnm_darrscale, mnm_iarrscale, mnm_barrscale ...");
  mnm_darrscale(d, n, -2.0);
  const double d_exp[] = {-2.2, 2.2, -6.0, 18.6, -4.4, -18.6};
  for (k = 0; k < n; k++)
    assert(abs(d[k] - d_exp[k]) < 1e-6 && "mnm_darrscale test failed.");
  mnm_iarrscale(i, n, 3);
  const int i_exp[] = {3, 6, 9, 12, 15, -18};
  for (k = 0; k < n; k++)
    assert(i[k] == i_exp[k] && "mnm_iarrscale test failed.");
  mnm_larrscale(l, n, -1);
  const long l_exp[] = {-100, -200, -300, -400, -500, -600};
  for (k = 0; k < n; k++)
    assert(l[k] == l_exp[k] && "mnm_larrscale test failed.");
  puts("All tests passed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe4a(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe35(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe20(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe0b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdf6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0xe52(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe4f(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe4c(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe51(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe4e(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe4b(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
movq   $0x64,-0xb0(%rbp)
movq   $0xc8,-0xa8(%rbp)
movq   $0x12c,-0xa0(%rbp)
movq   $0x190,-0x98(%rbp)
movq   $0x1f4,-0x90(%rbp)
movq   $0x258,-0x88(%rbp)
lea    0xe13(%rip),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
call   10b0 <mnm_darrsum@plt>
xor    %eax,%eax
movsd  0xd2e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x131(%rbp)
jne    12f5 <main+0x155>
jp     12f5 <main+0x155>
mov    $0x1,%al
mov    %al,-0x131(%rbp)
jmp    12f5 <main+0x155>
mov    -0x131(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x60(%rbp),%rdi
mov    $0x6,%esi
call   1060 <mnm_barrsum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
mov    %al,-0x132(%rbp)
jne    1333 <main+0x193>
mov    $0x1,%al
mov    %al,-0x132(%rbp)
jmp    1333 <main+0x193>
mov    -0x132(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x80(%rbp),%rdi
mov    $0x6,%esi
call   10a0 <mnm_iarrsum@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    0xdc4(%rip),%rdi
call   1030 <puts@plt>
lea    0xdca(%rip),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
movsd  0xcd6(%rip),%xmm0
call   10c0 <mnm_darrscale@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
movsd  0xcae(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xc56(%rip),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  0xc86(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xc6e(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xc56(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xc3e(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jae    1476 <main+0x2d6>
mov    -0x8(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
mov    -0x8(%rbp),%eax
subsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
call   1040 <abs@plt>
cvtsi2sd %eax,%xmm1
xor    %eax,%eax
movsd  0xc2d(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x133(%rbp)
jbe    1458 <main+0x2b8>
mov    $0x1,%al
mov    %al,-0x133(%rbp)
jmp    1458 <main+0x2b8>
mov    -0x133(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1409 <main+0x269>
lea    -0x80(%rbp),%rdi
mov    $0x6,%esi
mov    $0x3,%edx
call   1080 <mnm_iarrscale@plt>
mov    0xc20(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0xc1a(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0xc14(%rip),%rax
mov    %rax,-0xf0(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jae    1510 <main+0x370>
mov    -0x8(%rbp),%eax
mov    -0x80(%rbp,%rax,4),%ecx
mov    -0x8(%rbp),%eax
mov    %eax,%edx
xor    %eax,%eax
cmp    -0x100(%rbp,%rdx,4),%ecx
mov    %al,-0x134(%rbp)
jne    14f2 <main+0x352>
mov    $0x1,%al
mov    %al,-0x134(%rbp)
jmp    14f2 <main+0x352>
mov    -0x134(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    14ba <main+0x31a>
lea    -0xb0(%rbp),%rdi
mov    $0x6,%esi
mov    $0xffffffff,%edx
call   1050 <mnm_larrscale@plt>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
movq   $0xffffffffffffff9c,-0x130(%rbp)
9c ff ff ff
movq   $0xffffffffffffff38,-0x128(%rbp)
38 ff ff ff
movq   $0xfffffffffffffed4,-0x120(%rbp)
d4 fe ff ff
movq   $0xfffffffffffffe70,-0x118(%rbp)
70 fe ff ff
movq   $0xfffffffffffffe0c,-0x110(%rbp)
0c fe ff ff
movq   $0xfffffffffffffda8,-0x108(%rbp)
a8 fd ff ff
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jae    15dd <main+0x43d>
mov    -0x8(%rbp),%eax
mov    -0xb0(%rbp,%rax,8),%rcx
ff
mov    -0x8(%rbp),%eax
mov    %eax,%edx
xor    %eax,%eax
cmp    -0x130(%rbp,%rdx,8),%rcx
ff
mov    %al,-0x135(%rbp)
jne    15bf <main+0x41f>
mov    $0x1,%al
mov    %al,-0x135(%rbp)
jmp    15bf <main+0x41f>
mov    -0x135(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1582 <main+0x3e2>
lea    0xbe3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
movaps 0xe5f(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe63(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe67(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
mov    0xeeb(%rip),%rax
mov    %rax,0x90(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
mov    0xeed(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xe36(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe3a(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movapd 0xe3d(%rip),%xmm0
movapd %xmm0,0x40(%rsp)
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   10a0 <mnm_darrsum@plt>
cmpeqsd 0xe20(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1080 <assert@plt>
lea    0x80(%rsp),%rdi
mov    $0x6,%esi
call   1060 <mnm_barrsum@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1080 <assert@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x6,%esi
call   1090 <mnm_iarrsum@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1080 <assert@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
movsd  0xdbd(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
call   10b0 <mnm_darrscale@plt>
movsd  0x50(%rsp),%xmm0
addsd  0xdaa(%rip),%xmm0
call   1040 <abs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1080 <assert@plt>
movsd  0x58(%rsp),%xmm0
addsd  0xd92(%rip),%xmm0
call   1040 <abs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1080 <assert@plt>
movsd  0x60(%rsp),%xmm0
addsd  0xd7a(%rip),%xmm0
call   1040 <abs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1080 <assert@plt>
movsd  0x68(%rsp),%xmm0
addsd  0xd62(%rip),%xmm0
call   1040 <abs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1080 <assert@plt>
movsd  0x70(%rsp),%xmm0
addsd  0xd4a(%rip),%xmm0
call   1040 <abs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1080 <assert@plt>
movsd  0x78(%rsp),%xmm0
addsd  0xd32(%rip),%xmm0
call   1040 <abs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1080 <assert@plt>
mov    %r14,%rdi
mov    $0x6,%esi
mov    $0x3,%edx
call   1070 <mnm_iarrscale@plt>
xor    %edi,%edi
cmpl   $0x3,(%rsp)
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0x4(%rsp)
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x8(%rsp)
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0xc,0xc(%rsp)
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0xf,0x10(%rsp)
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpl   $0xffffffee,0x14(%rsp)
sete   %dil
call   1080 <assert@plt>
lea    0x20(%rsp),%rdi
mov    $0x6,%esi
mov    $0xffffffff,%edx
call   1050 <mnm_larrscale@plt>
xor    %edi,%edi
cmpq   $0xffffffffffffff9c,0x20(%rsp)
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpq   $0xffffffffffffff38,0x28(%rsp)
ff ff
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpq   $0xfffffffffffffed4,0x30(%rsp)
ff ff
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpq   $0xfffffffffffffe70,0x38(%rsp)
ff ff
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpq   $0xfffffffffffffe0c,0x40(%rsp)
ff ff
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
cmpq   $0xfffffffffffffda8,0x48(%rsp)
ff ff
sete   %dil
call   1080 <assert@plt>
lea    0xcdb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.b = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 0]
@__const.main.i = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 -6]
@.str = [50 x i8] c"Testing mnm_darrsum, mnm_iarrsum, mnm_barrsum ...\00"
@.str.1 = [25 x i8] c"mnm_darrsum test failed.\00"
@.str.2 = [25 x i8] c"mnm_barrsum test failed.\00"
@.str.3 = [18 x i8] c"... tests passed.\00"
@.str.4 = [56 x i8] c"Testing mnm_darrscale, mnm_iarrscale, mnm_barrscale ...\00"
@.str.5 = [27 x i8] c"mnm_darrscale test failed.\00"
@__const.main.i_exp = [6 x i32] [i32 3, i32 6, i32 9, i32 12, i32 15, i32 -18]
@.str.6 = [27 x i8] c"mnm_iarrscale test failed.\00"
@.str.7 = [27 x i8] c"mnm_larrscale test failed.\00"
@.str.8 = [19 x i8] c"All tests passed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [6 x double]
%5 = alloca [6 x i32]
%6 = alloca [6 x i32]
%7 = alloca [6 x i64]
%8 = alloca [6 x double]
%9 = alloca [6 x i32]
%10 = alloca [6 x i64]
store i32 0, i32* %1
store i32 6, i32* %3
%11 = bitcast [6 x double]* %4 to i8*
%12 = bitcast i8* %11 to [6 x double]*
%13 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 0
store double 1.100000e+00, double* %13
%14 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 1
store double -1.100000e+00, double* %14
%15 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 2
store double 3.000000e+00, double* %15
%16 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 3
store double -9.300000e+00, double* %16
%17 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 4
store double 2.200000e+00, double* %17
%18 = getelementptr inbounds [6 x double], [6 x double]* %12, i32 0, i32 5
store double 9.300000e+00, double* %18
%19 = bitcast [6 x i32]* %5 to i8*
%20 = bitcast [6 x i32]* %6 to i8*
%21 = bitcast [6 x i64]* %7 to i8*
%22 = bitcast i8* %21 to [6 x i64]*
%23 = getelementptr inbounds [6 x i64], [6 x i64]* %22, i32 0, i32 0
store i64 100, i64* %23
%24 = getelementptr inbounds [6 x i64], [6 x i64]* %22, i32 0, i32 1
store i64 200, i64* %24
%25 = getelementptr inbounds [6 x i64], [6 x i64]* %22, i32 0, i32 2
store i64 300, i64* %25
%26 = getelementptr inbounds [6 x i64], [6 x i64]* %22, i32 0, i32 3
store i64 400, i64* %26
%27 = getelementptr inbounds [6 x i64], [6 x i64]* %22, i32 0, i32 4
store i64 500, i64* %27
%28 = getelementptr inbounds [6 x i64], [6 x i64]* %22, i32 0, i32 5
store i64 600, i64* %28
%29 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%30 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 0
%31 = call double @mnm_darrsum(double* %30, i32 6)
%32 = fcmp oeq double %31, 5.200000e+00
br i1 %32, label %33, label %34
33: ; preds = %0
br label %34
34: ; preds = %33, %0
%35 = phi i1 [ false, %0 ], [ true, %33 ]
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%39 = call i32 @mnm_barrsum(i32* %38, i32 6)
%40 = icmp eq i32 %39, 3
br i1 %40, label %41, label %42
41: ; preds = %34
br label %42
42: ; preds = %41, %34
%43 = phi i1 [ false, %34 ], [ true, %41 ]
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%47 = call i32 @mnm_iarrsum(i32* %46, i32 6)
%48 = icmp eq i32 %47, 9
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%52 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%53 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 0
%54 = call i32 @mnm_darrscale(double* %53, i32 6, double -2.000000e+00)
%55 = bitcast [6 x double]* %8 to i8*
%56 = bitcast i8* %55 to [6 x double]*
%57 = getelementptr inbounds [6 x double], [6 x double]* %56, i32 0, i32 0
store double -2.200000e+00, double* %57
%58 = getelementptr inbounds [6 x double], [6 x double]* %56, i32 0, i32 1
store double 2.200000e+00, double* %58
%59 = getelementptr inbounds [6 x double], [6 x double]* %56, i32 0, i32 2
store double -6.000000e+00, double* %59
%60 = getelementptr inbounds [6 x double], [6 x double]* %56, i32 0, i32 3
store double 1.860000e+01, double* %60
%61 = getelementptr inbounds [6 x double], [6 x double]* %56, i32 0, i32 4
store double -4.400000e+00, double* %61
%62 = getelementptr inbounds [6 x double], [6 x double]* %56, i32 0, i32 5
store double -1.860000e+01, double* %62
store i32 0, i32* %2
br label %63
63: ; preds = %84, %42
%64 = load i32, i32* %2
%65 = icmp ult i32 %64, 6
br i1 %65, label %66, label %87
66: ; preds = %63
%67 = load i32, i32* %2
%68 = zext i32 %67 to i64
%69 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 %68
%70 = load double, double* %69
%71 = load i32, i32* %2
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 %72
%74 = load double, double* %73
%75 = fsub double %70, %74
%76 = call i32 @abs(double %75)
%77 = sitofp i32 %76 to double
%78 = fcmp olt double %77, 0x3EB0C6F7A0B5ED8D
br i1 %78, label %79, label %80
79: ; preds = %66
br label %80
80: ; preds = %79, %66
%81 = phi i1 [ false, %66 ], [ true, %79 ]
%82 = zext i1 %81 to i32
%83 = call i32 @assert(i32 %82)
br label %84
84: ; preds = %80
%85 = load i32, i32* %2
%86 = add i32 %85, 1
store i32 %86, i32* %2
br label %63
87: ; preds = %63
%88 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%89 = call i32 @mnm_iarrscale(i32* %88, i32 6, i32 3)
%90 = bitcast [6 x i32]* %9 to i8*
store i32 0, i32* %2
br label %91
91: ; preds = %109, %87
%92 = load i32, i32* %2
%93 = icmp ult i32 %92, 6
br i1 %93, label %94, label %112
94: ; preds = %91
%95 = load i32, i32* %2
%96 = zext i32 %95 to i64
%97 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 %96
%98 = load i32, i32* %97
%99 = load i32, i32* %2
%100 = zext i32 %99 to i64
%101 = getelementptr inbounds [6 x i32], [6 x i32]* %9, i64 0, i64 %100
%102 = load i32, i32* %101
%103 = icmp eq i32 %98, %102
br i1 %103, label %104, label %105
104: ; preds = %94
br label %105
105: ; preds = %104, %94
%106 = phi i1 [ false, %94 ], [ true, %104 ]
%107 = zext i1 %106 to i32
%108 = call i32 @assert(i32 %107)
br label %109
109: ; preds = %105
%110 = load i32, i32* %2
%111 = add i32 %110, 1
store i32 %111, i32* %2
br label %91
112: ; preds = %91
%113 = getelementptr inbounds [6 x i64], [6 x i64]* %7, i64 0, i64 0
%114 = call i32 @mnm_larrscale(i64* %113, i32 6, i32 -1)
%115 = bitcast [6 x i64]* %10 to i8*
%116 = bitcast i8* %115 to [6 x i64]*
%117 = getelementptr inbounds [6 x i64], [6 x i64]* %116, i32 0, i32 0
store i64 -100, i64* %117
%118 = getelementptr inbounds [6 x i64], [6 x i64]* %116, i32 0, i32 1
store i64 -200, i64* %118
%119 = getelementptr inbounds [6 x i64], [6 x i64]* %116, i32 0, i32 2
store i64 -300, i64* %119
%120 = getelementptr inbounds [6 x i64], [6 x i64]* %116, i32 0, i32 3
store i64 -400, i64* %120
%121 = getelementptr inbounds [6 x i64], [6 x i64]* %116, i32 0, i32 4
store i64 -500, i64* %121
%122 = getelementptr inbounds [6 x i64], [6 x i64]* %116, i32 0, i32 5
store i64 -600, i64* %122
store i32 0, i32* %2
br label %123
123: ; preds = %141, %112
%124 = load i32, i32* %2
%125 = icmp ult i32 %124, 6
br i1 %125, label %126, label %144
126: ; preds = %123
%127 = load i32, i32* %2
%128 = zext i32 %127 to i64
%129 = getelementptr inbounds [6 x i64], [6 x i64]* %7, i64 0, i64 %128
%130 = load i64, i64* %129
%131 = load i32, i32* %2
%132 = zext i32 %131 to i64
%133 = getelementptr inbounds [6 x i64], [6 x i64]* %10, i64 0, i64 %132
%134 = load i64, i64* %133
%135 = icmp eq i64 %130, %134
br i1 %135, label %136, label %137
136: ; preds = %126
br label %137
137: ; preds = %136, %126
%138 = phi i1 [ false, %126 ], [ true, %136 ]
%139 = zext i1 %138 to i32
%140 = call i32 @assert(i32 %139)
br label %141
141: ; preds = %137
%142 = load i32, i32* %2
%143 = add i32 %142, 1
store i32 %143, i32* %2
br label %123
144: ; preds = %123
%145 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.b = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 0]
@__const.main.i = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 -6]
@.str = [50 x i8] c"Testing mnm_darrsum, mnm_iarrsum, mnm_barrsum ...\00"
@.str.3 = [18 x i8] c"... tests passed.\00"
@.str.4 = [56 x i8] c"Testing mnm_darrscale, mnm_iarrscale, mnm_barrscale ...\00"
@.str.8 = [19 x i8] c"All tests passed.\0A\00"
define i32 @main() {
%1 = alloca [6 x double]
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
%4 = alloca [6 x i64]
%5 = bitcast [6 x double]* %1 to i8*
%6 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 0
%7 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 1
%8 = bitcast [6 x double]* %1 to <2 x double>*
store <2 x double> <double 1.100000e+00, double -1.100000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 2
%10 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 3
%11 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 3.000000e+00, double -9.300000e+00>, <2 x double>* %11
%12 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 4
%13 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 5
%14 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 2.200000e+00, double 9.300000e+00>, <2 x double>* %14
%15 = bitcast [6 x i32]* %2 to i8*
%16 = bitcast [6 x i32]* %3 to i8*
%17 = bitcast [6 x i64]* %4 to i8*
%18 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 0
%19 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 1
%20 = bitcast [6 x i64]* %4 to <2 x i64>*
store <2 x i64> <i64 100, i64 200>, <2 x i64>* %20
%21 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 2
%22 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 3
%23 = bitcast i64* %21 to <2 x i64>*
store <2 x i64> <i64 300, i64 400>, <2 x i64>* %23
%24 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 4
%25 = getelementptr inbounds [6 x i64], [6 x i64]* %4, i64 0, i64 5
%26 = bitcast i64* %24 to <2 x i64>*
store <2 x i64> <i64 500, i64 600>, <2 x i64>* %26
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%28 = call double @mnm_darrsum(double* %6, i32 6)
%29 = fcmp oeq double %28, 5.200000e+00
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%33 = call i32 @mnm_barrsum(i32* %32, i32 6)
%34 = icmp eq i32 %33, 3
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%38 = call i32 @mnm_iarrsum(i32* %37, i32 6)
%39 = icmp eq i32 %38, 9
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 @mnm_darrscale(double* %6, i32 6, double -2.000000e+00)
%45 = load double, double* %6
%46 = fadd double %45, 2.200000e+00
%47 = call i32 @abs(double %46)
%48 = icmp slt i32 %47, 1
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = load double, double* %7
%52 = fadd double %51, -2.200000e+00
%53 = call i32 @abs(double %52)
%54 = icmp slt i32 %53, 1
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = load double, double* %9
%58 = fadd double %57, 6.000000e+00
%59 = call i32 @abs(double %58)
%60 = icmp slt i32 %59, 1
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load double, double* %10
%64 = fadd double %63, -1.860000e+01
%65 = call i32 @abs(double %64)
%66 = icmp slt i32 %65, 1
%67 = zext i1 %66 to i32
%68 = call i32 @assert(i32 %67)
%69 = load double, double* %12
%70 = fadd double %69, 4.400000e+00
%71 = call i32 @abs(double %70)
%72 = icmp slt i32 %71, 1
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = load double, double* %13
%76 = fadd double %75, 1.860000e+01
%77 = call i32 @abs(double %76)
%78 = icmp slt i32 %77, 1
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 @mnm_iarrscale(i32* %37, i32 6, i32 3)
%82 = load i32, i32* %37
%83 = icmp eq i32 %82, 3
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%87 = load i32, i32* %86
%88 = icmp eq i32 %87, 6
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%92 = load i32, i32* %91
%93 = icmp eq i32 %92, 9
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%97 = load i32, i32* %96
%98 = icmp eq i32 %97, 12
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
%101 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%102 = load i32, i32* %101
%103 = icmp eq i32 %102, 15
%104 = zext i1 %103 to i32
%105 = call i32 @assert(i32 %104)
%106 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%107 = load i32, i32* %106
%108 = icmp eq i32 %107, -18
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
%111 = call i32 @mnm_larrscale(i64* %18, i32 6, i32 -1)
%112 = load i64, i64* %18
%113 = icmp eq i64 %112, -100
%114 = zext i1 %113 to i32
%115 = call i32 @assert(i32 %114)
%116 = load i64, i64* %19
%117 = icmp eq i64 %116, -200
%118 = zext i1 %117 to i32
%119 = call i32 @assert(i32 %118)
%120 = load i64, i64* %21
%121 = icmp eq i64 %120, -300
%122 = zext i1 %121 to i32
%123 = call i32 @assert(i32 %122)
%124 = load i64, i64* %22
%125 = icmp eq i64 %124, -400
%126 = zext i1 %125 to i32
%127 = call i32 @assert(i32 %126)
%128 = load i64, i64* %24
%129 = icmp eq i64 %128, -500
%130 = zext i1 %129 to i32
%131 = call i32 @assert(i32 %130)
%132 = load i64, i64* %25
%133 = icmp eq i64 %132, -600
%134 = zext i1 %133 to i32
%135 = call i32 @assert(i32 %134)
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}