void achtsd(v1, v2, npix, direction, hasscale, dirale, bzero) short *v1;
double *v2;
int npix;
int direction;
int hasscale;
double dirale;
double bzero;
{
  if (hasscale) {
    if (direction) {
      while (npix--)
        v1[npix] = v2[npix] * dirale + bzero;
    } else {
      while (npix--)
        v1[npix] = (v2[npix] - bzero) / dirale;
    }
  } else {
    while (npix--)
      v1[npix] = v2[npix];
  }
}


x86 assembly (clang, -O0):
<achtsd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11e3 <achtsd+0xe3>
cmpl   $0x0,-0x18(%rbp)
je     1189 <achtsd+0x89>
jmp    1139 <achtsd+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1184 <achtsd+0x84>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    1139 <achtsd+0x39>
jmp    11de <achtsd+0xde>
jmp    118e <achtsd+0x8e>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11d9 <achtsd+0xd9>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    118e <achtsd+0x8e>
jmp    11de <achtsd+0xde>
jmp    1226 <achtsd+0x126>
jmp    11e8 <achtsd+0xe8>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1221 <achtsd+0x121>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    11e8 <achtsd+0xe8>
jmp    1226 <achtsd+0x126>
pop    %rbp
ret

x86 assembly (clang, -O2):
<achtsd>:
push   %rbx
test   %r8d,%r8d
je     112d <achtsd+0x2d>
test   %ecx,%ecx
je     127b <achtsd+0x17b>
test   %edx,%edx
je     1462 <achtsd+0x362>
movslq %edx,%rcx
add    $0xffffffff,%edx
cmp    $0x3,%edx
jae    13a7 <achtsd+0x2a7>
mov    %rcx,%rax
jmp    1440 <achtsd+0x340>
test   %edx,%edx
je     1462 <achtsd+0x362>
movslq %edx,%rax
add    $0xffffffff,%edx
cmp    $0x3,%edx
jb     1260 <achtsd+0x160>
add    $0x1,%rdx
mov    %rdx,%r8
and    $0xfffffffffffffffc,%r8
lea    -0x4(%r8),%rcx
mov    %rcx,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rcx,%rcx
je     1464 <achtsd+0x364>
mov    %r9,%r10
and    $0xfffffffffffffffe,%r10
lea    (%rdi,%rax,2),%r11
add    $0xfffffffffffffffc,%r11
lea    (%rsi,%rax,8),%rbx
add    $0xfffffffffffffff0,%rbx
mov    $0xfffffffffffffffe,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
movupd (%rbx,%rcx,8),%xmm0
movupd 0x10(%rbx,%rcx,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvttpd2dq %xmm1,%xmm1
cvttpd2dq %xmm0,%xmm0
pshuflw $0xe2,%xmm1,%xmm1
movd   %xmm1,0x4(%r11,%rcx,2)
pshuflw $0xe2,%xmm0,%xmm0
movd   %xmm0,(%r11,%rcx,2)
movupd -0x20(%rbx,%rcx,8),%xmm0
movupd -0x10(%rbx,%rcx,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvttpd2dq %xmm1,%xmm1
cvttpd2dq %xmm0,%xmm0
pshuflw $0xe2,%xmm1,%xmm1
movd   %xmm1,-0x4(%r11,%rcx,2)
pshuflw $0xe2,%xmm0,%xmm0
movd   %xmm0,-0x8(%r11,%rcx,2)
add    $0xfffffffffffffff8,%rcx
add    $0xfffffffffffffffe,%r10
jne    1190 <achtsd+0x90>
add    $0x1,%rcx
test   $0x1,%r9b
je     1245 <achtsd+0x145>
add    %rax,%rcx
movupd -0x18(%rsi,%rcx,8),%xmm0
movupd -0x8(%rsi,%rcx,8),%xmm1
shufpd $0x1,%xmm1,%xmm1
shufpd $0x1,%xmm0,%xmm0
cvttpd2dq %xmm1,%xmm1
cvttpd2dq %xmm0,%xmm0
pshuflw $0xe2,%xmm1,%xmm1
movd   %xmm1,-0x2(%rdi,%rcx,2)
pshuflw $0xe2,%xmm0,%xmm0
movd   %xmm0,-0x6(%rdi,%rcx,2)
cmp    %r8,%rdx
je     1462 <achtsd+0x362>
sub    %r8,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cvttsd2si -0x8(%rsi,%rax,8),%ecx
mov    %cx,-0x2(%rdi,%rax,2)
lea    -0x1(%rax),%rcx
mov    %rcx,%rax
test   %ecx,%ecx
jne    1260 <achtsd+0x160>
jmp    1462 <achtsd+0x362>
test   %edx,%edx
je     1462 <achtsd+0x362>
movslq %edx,%rax
add    $0xffffffff,%edx
je     1380 <achtsd+0x280>
add    $0x1,%rdx
movabs $0x1fffffffc,%r8
or     $0x2,%r8
and    %rdx,%r8
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
movapd %xmm0,%xmm3
unpcklpd %xmm0,%xmm3
lea    -0x2(%r8),%rcx
mov    %rcx,%r9
shr    %r9
add    $0x1,%r9
test   %rcx,%rcx
je     147a <achtsd+0x37a>
mov    %r9,%rbx
and    $0xfffffffffffffffe,%rbx
lea    (%rdi,%rax,2),%r10
lea    (%rsi,%rax,8),%r11
mov    $0xfffffffffffffffe,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movupd (%r11,%rcx,8),%xmm4
shufpd $0x1,%xmm4,%xmm4
subpd  %xmm2,%xmm4
divpd  %xmm3,%xmm4
cvttpd2dq %xmm4,%xmm4
pshuflw $0xe2,%xmm4,%xmm4
movd   %xmm4,(%r10,%rcx,2)
movupd -0x10(%r11,%rcx,8),%xmm4
shufpd $0x1,%xmm4,%xmm4
subpd  %xmm2,%xmm4
divpd  %xmm3,%xmm4
cvttpd2dq %xmm4,%xmm4
pshuflw $0xe2,%xmm4,%xmm4
movd   %xmm4,-0x4(%r10,%rcx,2)
add    $0xfffffffffffffffc,%rcx
add    $0xfffffffffffffffe,%rbx
jne    12f0 <achtsd+0x1f0>
add    $0x1,%rcx
test   $0x1,%r9b
je     136f <achtsd+0x26f>
add    %rax,%rcx
movupd -0x8(%rsi,%rcx,8),%xmm4
shufpd $0x1,%xmm4,%xmm4
subpd  %xmm2,%xmm4
divpd  %xmm3,%xmm4
cvttpd2dq %xmm4,%xmm2
pshuflw $0xe2,%xmm2,%xmm2
movd   %xmm2,-0x2(%rdi,%rcx,2)
cmp    %r8,%rdx
je     1462 <achtsd+0x362>
sub    %r8,%rax
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rsi,%rax,8),%xmm2
subsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
cvttsd2si %xmm2,%ecx
mov    %cx,-0x2(%rdi,%rax,2)
lea    -0x1(%rax),%rcx
mov    %rcx,%rax
test   %ecx,%ecx
jne    1380 <achtsd+0x280>
jmp    1462 <achtsd+0x362>
add    $0x1,%rdx
mov    %rdx,%r8
and    $0xfffffffffffffffc,%r8
mov    %rcx,%rax
sub    %r8,%rax
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
lea    (%rsi,%rcx,8),%r10
add    $0xfffffffffffffff0,%r10
lea    (%rdi,%rcx,2),%rcx
add    $0xfffffffffffffffc,%rcx
mov    %r8,%r9
neg    %r9
xor    %ebx,%ebx
movupd -0x10(%r10,%rbx,8),%xmm4
movupd (%r10,%rbx,8),%xmm5
shufpd $0x1,%xmm5,%xmm5
shufpd $0x1,%xmm4,%xmm4
mulpd  %xmm2,%xmm5
addpd  %xmm3,%xmm5
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
cvttpd2dq %xmm5,%xmm5
cvttpd2dq %xmm4,%xmm4
pshuflw $0xe2,%xmm5,%xmm5
movd   %xmm5,(%rcx,%rbx,2)
pshuflw $0xe2,%xmm4,%xmm4
movd   %xmm4,-0x4(%rcx,%rbx,2)
add    $0xfffffffffffffffc,%rbx
cmp    %rbx,%r9
jne    13e0 <achtsd+0x2e0>
cmp    %r8,%rdx
je     1462 <achtsd+0x362>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  -0x8(%rsi,%rax,8),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%ecx
mov    %cx,-0x2(%rdi,%rax,2)
lea    -0x1(%rax),%rcx
mov    %rcx,%rax
test   %ecx,%ecx
jne    1440 <achtsd+0x340>
pop    %rbx
ret
mov    $0xffffffffffffffff,%rcx
test   $0x1,%r9b
jne    120e <achtsd+0x10e>
jmp    1245 <achtsd+0x145>
mov    $0xffffffffffffffff,%rcx
test   $0x1,%r9b
jne    134a <achtsd+0x24a>
jmp    136f <achtsd+0x26f>

LLVM IR (-O0):
define void @achtsd(i16* %0, double* %1, i32 %2, i32 %3, i32 %4, double %5, double %6) {
%8 = alloca i16*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
store i16* %0, i16** %8
store double* %1, double** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double %5, double* %13
store double %6, double* %14
%15 = load i32, i32* %12
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %62
17: ; preds = %7
%18 = load i32, i32* %11
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %40
20: ; preds = %17
br label %21
21: ; preds = %25, %20
%22 = load i32, i32* %10
%23 = add nsw i32 %22, -1
store i32 %23, i32* %10
%24 = icmp ne i32 %22, 0
br i1 %24, label %25, label %39
25: ; preds = %21
%26 = load double*, double** %9
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = load double, double* %13
%32 = load double, double* %14
%33 = call double @llvm.fmuladd.f64(double %30, double %31, double %32)
%34 = fptosi double %33 to i16
%35 = load i16*, i16** %8
%36 = load i32, i32* %10
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i16, i16* %35, i64 %37
store i16 %34, i16* %38
br label %21
39: ; preds = %21
br label %61
40: ; preds = %17
br label %41
41: ; preds = %45, %40
%42 = load i32, i32* %10
%43 = add nsw i32 %42, -1
store i32 %43, i32* %10
%44 = icmp ne i32 %42, 0
br i1 %44, label %45, label %60
45: ; preds = %41
%46 = load double*, double** %9
%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* %14
%52 = fsub double %50, %51
%53 = load double, double* %13
%54 = fdiv double %52, %53
%55 = fptosi double %54 to i16
%56 = load i16*, i16** %8
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i16, i16* %56, i64 %58
store i16 %55, i16* %59
br label %41
60: ; preds = %41
br label %61
61: ; preds = %60, %39
br label %79
62: ; preds = %7
br label %63
63: ; preds = %67, %62
%64 = load i32, i32* %10
%65 = add nsw i32 %64, -1
store i32 %65, i32* %10
%66 = icmp ne i32 %64, 0
br i1 %66, label %67, label %78
67: ; preds = %63
%68 = load double*, double** %9
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
%72 = load double, double* %71
%73 = fptosi double %72 to i16
%74 = load i16*, i16** %8
%75 = load i32, i32* %10
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i16, i16* %74, i64 %76
store i16 %73, i16* %77
br label %63
78: ; preds = %63
br label %79
79: ; preds = %78, %61
ret void
}

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