void layer_resize_backward(const int A, const int B, const double *delta,
                           double *output) {
  for (int i = 0; i < A; i++) {
    output[i] = 0.0;
  }
  if (A < B) {
    int j = 0;
    while (j < B) {
      for (int i = 0; i < A && j < B; ++i, ++j) {
        output[i] += delta[j];
      }
    }
  } else {
    for (int i = 0; i < B; ++i) {
      output[i] = delta[i];
    }
  }
}


x86 assembly (clang, -O0):
<layer_resize_backward>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <layer_resize_backward+0x43>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1119 <layer_resize_backward+0x19>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d6 <layer_resize_backward+0xd6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d1 <layer_resize_backward+0xd1>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x29(%rbp)
jge    1186 <layer_resize_backward+0x86>
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1196 <layer_resize_backward+0x96>
jmp    11cc <layer_resize_backward+0xcc>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1169 <layer_resize_backward+0x69>
jmp    1156 <layer_resize_backward+0x56>
jmp    1216 <layer_resize_backward+0x116>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1211 <layer_resize_backward+0x111>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11dd <layer_resize_backward+0xdd>
jmp    1216 <layer_resize_backward+0x116>
pop    %rbp
ret

x86 assembly (clang, -O2):
<layer_resize_backward>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %esi,%r13d
mov    %edi,%r15d
test   %edi,%edi
jle    113f <layer_resize_backward+0x2f>
mov    %r15d,%edx
shl    $0x3,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
cmp    %r13d,%r15d
jge    1355 <layer_resize_backward+0x245>
test   %r13d,%r13d
jle    14d8 <layer_resize_backward+0x3c8>
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
movslq %r15d,%rcx
mov    %r13d,%edx
lea    0x8(%rbx),%rsi
mov    %rsi,0x20(%rsp)
lea    -0x1(%rcx),%r12
lea    0x8(%r14),%r8
lea    0x30(%r14),%rsi
mov    %rsi,0x8(%rsp)
xor    %esi,%esi
mov    $0x1,%r9d
add    $0x2,%rax
mov    %rax,0x10(%rsp)
mov    %r8,0x18(%rsp)
jmp    11a9 <layer_resize_backward+0x99>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %r13d,%esi
jge    14d8 <layer_resize_backward+0x3c8>
test   %r15d,%r15d
jle    11a0 <layer_resize_backward+0x90>
cmp    %r13d,%esi
jge    11a0 <layer_resize_backward+0x90>
movslq %esi,%rsi
mov    %rsi,%rax
not    %rax
add    %rdx,%rax
cmp    %r12,%rax
mov    %r12,%rdi
cmovb  %rax,%rdi
add    $0x1,%rdi
test   %r12,%r12
cmove  %r9,%rdi
cmp    $0x4,%rdi
jb     120e <layer_resize_backward+0xfe>
cmp    %r12,%rax
cmovae %r12,%rax
test   %r12,%r12
cmove  %r12,%rax
lea    (%rax,%rsi,1),%rbp
lea    (%r8,%rbp,8),%rbp
cmp    %rbx,%rbp
jbe    124d <layer_resize_backward+0x13d>
mov    0x20(%rsp),%rbp
lea    0x0(,%rax,8),%rax
add    %rbp,%rax
lea    (%r14,%rsi,8),%rbp
cmp    %rax,%rbp
jae    124d <layer_resize_backward+0x13d>
xor    %eax,%eax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r14,%rsi,8),%xmm0
addsd  -0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,-0x8(%rbx,%rax,8)
add    $0x1,%rsi
cmp    %rcx,%rax
jge    11a0 <layer_resize_backward+0x90>
add    $0x1,%rax
cmp    %rdx,%rsi
jl     1220 <layer_resize_backward+0x110>
jmp    11a0 <layer_resize_backward+0x90>
mov    %rdi,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rbp
mov    %rbp,%r10
shr    $0x2,%r10
add    $0x1,%r10
test   %rbp,%rbp
je     12fd <layer_resize_backward+0x1ed>
mov    %r10,%r9
and    0x10(%rsp),%r9
mov    0x8(%rsp),%rbp
lea    0x0(,%rsi,8),%r11
add    %rbp,%r11
xor    %r8d,%r8d
nopw   0x0(%rax,%rax,1)
movupd -0x30(%r11,%r8,8),%xmm0
movupd -0x20(%r11,%r8,8),%xmm1
movupd (%rbx,%r8,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%rbx,%r8,8),%xmm0
addpd  %xmm1,%xmm0
movupd 0x20(%rbx,%r8,8),%xmm1
movupd 0x30(%rbx,%r8,8),%xmm3
movupd %xmm2,(%rbx,%r8,8)
movupd %xmm0,0x10(%rbx,%r8,8)
movupd -0x10(%r11,%r8,8),%xmm0
addpd  %xmm1,%xmm0
movupd (%r11,%r8,8),%xmm1
addpd  %xmm3,%xmm1
movupd %xmm0,0x20(%rbx,%r8,8)
movupd %xmm1,0x30(%rbx,%r8,8)
add    $0x8,%r8
add    $0xfffffffffffffffe,%r9
jne    1290 <layer_resize_backward+0x180>
jmp    1300 <layer_resize_backward+0x1f0>
xor    %r8d,%r8d
test   $0x1,%r10b
mov    $0x1,%r9d
je     133f <layer_resize_backward+0x22f>
lea    (%r8,%rsi,1),%rbp
movupd (%r14,%rbp,8),%xmm0
movupd 0x10(%r14,%rbp,8),%xmm1
movupd (%rbx,%r8,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%rbx,%r8,8),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm2,(%rbx,%r8,8)
movupd %xmm0,0x10(%rbx,%r8,8)
add    %rax,%rsi
cmp    %rax,%rdi
mov    0x18(%rsp),%r8
je     11a0 <layer_resize_backward+0x90>
jmp    1210 <layer_resize_backward+0x100>
test   %r13d,%r13d
jle    14d8 <layer_resize_backward+0x3c8>
mov    %r13d,%eax
cmp    $0x4,%r13d
jb     1381 <layer_resize_backward+0x271>
lea    (%r14,%rax,8),%rcx
cmp    %rbx,%rcx
jbe    1400 <layer_resize_backward+0x2f0>
lea    (%rbx,%rax,8),%rcx
cmp    %r14,%rcx
jbe    1400 <layer_resize_backward+0x2f0>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
mov    %rax,%rsi
and    $0x3,%rsi
je     13b5 <layer_resize_backward+0x2a5>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    13a0 <layer_resize_backward+0x290>
cmp    $0x3,%rdx
jb     14d8 <layer_resize_backward+0x3c8>
nop
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rcx,8)
movsd  0x10(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rcx,8)
movsd  0x18(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    13c0 <layer_resize_backward+0x2b0>
jmp    14d8 <layer_resize_backward+0x3c8>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x3,%edx
cmp    $0xc,%rdi
jae    1423 <layer_resize_backward+0x313>
xor    %edi,%edi
jmp    1494 <layer_resize_backward+0x384>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nopl   0x0(%rax)
movups (%r14,%rdi,8),%xmm0
movups 0x10(%r14,%rdi,8),%xmm1
movups %xmm0,(%rbx,%rdi,8)
movups %xmm1,0x10(%rbx,%rdi,8)
movups 0x20(%r14,%rdi,8),%xmm0
movups 0x30(%r14,%rdi,8),%xmm1
movups %xmm0,0x20(%rbx,%rdi,8)
movups %xmm1,0x30(%rbx,%rdi,8)
movups 0x40(%r14,%rdi,8),%xmm0
movups 0x50(%r14,%rdi,8),%xmm1
movups %xmm0,0x40(%rbx,%rdi,8)
movups %xmm1,0x50(%rbx,%rdi,8)
movupd 0x60(%r14,%rdi,8),%xmm0
movupd 0x70(%r14,%rdi,8),%xmm1
movupd %xmm0,0x60(%rbx,%rdi,8)
movupd %xmm1,0x70(%rbx,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1430 <layer_resize_backward+0x320>
test   %rdx,%rdx
je     14cf <layer_resize_backward+0x3bf>
lea    (%rbx,%rdi,8),%rsi
add    $0x10,%rsi
lea    (%r14,%rdi,8),%rdi
add    $0x10,%rdi
shl    $0x5,%rdx
xor    %ebp,%ebp
nop
movupd -0x10(%rdi,%rbp,1),%xmm0
movupd (%rdi,%rbp,1),%xmm1
movupd %xmm0,-0x10(%rsi,%rbp,1)
movupd %xmm1,(%rsi,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%rdx
jne    14b0 <layer_resize_backward+0x3a0>
cmp    %rax,%rcx
jne    1383 <layer_resize_backward+0x273>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @layer_resize_backward(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
store i32 0, i32* %9
br label %13
13: ; preds = %22, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load double*, double** %8
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double 0.000000e+00, double* %21
br label %22
22: ; preds = %17
%23 = load i32, i32* %9
%24 = add nsw i32 %23, 1
store i32 %24, i32* %9
br label %13
25: ; preds = %13
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %64
29: ; preds = %25
store i32 0, i32* %10
br label %30
30: ; preds = %62, %29
%31 = load i32, i32* %10
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %63
34: ; preds = %30
store i32 0, i32* %11
br label %35
35: ; preds = %57, %34
%36 = load i32, i32* %11
%37 = load i32, i32* %5
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = load i32, i32* %10
%41 = load i32, i32* %6
%42 = icmp slt i32 %40, %41
br label %43
43: ; preds = %39, %35
%44 = phi i1 [ false, %35 ], [ %42, %39 ]
br i1 %44, label %45, label %62
45: ; preds = %43
%46 = load double*, double** %7
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %8
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = fadd double %55, %50
store double %56, double* %54
br label %57
57: ; preds = %45
%58 = load i32, i32* %11
%59 = add nsw i32 %58, 1
store i32 %59, i32* %11
%60 = load i32, i32* %10
%61 = add nsw i32 %60, 1
store i32 %61, i32* %10
br label %35
62: ; preds = %43
br label %30
63: ; preds = %30
br label %83
64: ; preds = %25
store i32 0, i32* %12
br label %65
65: ; preds = %79, %64
%66 = load i32, i32* %12
%67 = load i32, i32* %6
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %82
69: ; preds = %65
%70 = load double*, double** %7
%71 = load i32, i32* %12
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = load double*, double** %8
%76 = load i32, i32* %12
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %75, i64 %77
store double %74, double* %78
br label %79
79: ; preds = %69
%80 = load i32, i32* %12
%81 = add nsw i32 %80, 1
store i32 %81, i32* %12
br label %65
82: ; preds = %65
br label %83
83: ; preds = %82, %63
ret void
}

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