void dyadup_1D_feed_odd(double *sigIn, int sigInLength, double *sigOut,
                        int sigOutLength) {
  int count = 0;
  for (count = 0; count < sigInLength - 1; count++) {
    sigOut[count * 2 + 1] = 0;
    sigOut[count * 2] = sigIn[count];
  }
  sigOut[sigOutLength - 1] = sigIn[sigInLength - 1];
  return;
}


x86 assembly (clang, -O0):
<dyadup_1D_feed_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1176 <dyadup_1D_feed_odd+0x76>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1120 <dyadup_1D_feed_odd+0x20>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyadup_1D_feed_odd>:
push   %rbx
lea    -0x1(%rsi),%r8d
cmp    $0x2,%esi
jl     12ab <dyadup_1D_feed_odd+0x1ab>
mov    %r8d,%r9d
cmp    $0x4,%r8d
jb     1137 <dyadup_1D_feed_odd+0x37>
lea    (%rdi,%r9,8),%rax
cmp    %rdx,%rax
jbe    11b6 <dyadup_1D_feed_odd+0xb6>
mov    %r9,%rax
shl    $0x4,%rax
add    %rdx,%rax
cmp    %rdi,%rax
jbe    11b6 <dyadup_1D_feed_odd+0xb6>
xor    %esi,%esi
mov    %rsi,%rax
not    %rax
test   $0x1,%r9b
je     1163 <dyadup_1D_feed_odd+0x63>
mov    %rsi,%rbx
shl    $0x4,%rbx
movq   $0x0,0x8(%rdx,%rbx,1)
movq   (%rdi,%rsi,8),%xmm0
movq   %xmm0,(%rdx,%rbx,1)
or     $0x1,%rsi
add    %r9,%rax
je     12ab <dyadup_1D_feed_odd+0x1ab>
mov    %rsi,%rax
shl    $0x4,%rax
add    %rdx,%rax
add    $0x18,%rax
nopw   0x0(%rax,%rax,1)
movq   $0x0,-0x10(%rax)
movsd  (%rdi,%rsi,8),%xmm0
movsd  %xmm0,-0x18(%rax)
movq   $0x0,(%rax)
movq   0x8(%rdi,%rsi,8),%xmm0
movq   %xmm0,-0x8(%rax)
add    $0x2,%rsi
add    $0x20,%rax
cmp    %rsi,%r9
jne    1180 <dyadup_1D_feed_odd+0x80>
jmp    12ab <dyadup_1D_feed_odd+0x1ab>
mov    %r9d,%esi
and    $0xfffffffc,%esi
lea    -0x4(%rsi),%rax
mov    %rax,%r10
shr    $0x2,%r10
add    $0x1,%r10
test   %rax,%rax
je     12be <dyadup_1D_feed_odd+0x1be>
mov    %r10,%r11
and    $0xfffffffffffffffe,%r11
lea    0x60(%rdx),%rbx
xor    %eax,%eax
pxor   %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movdqu (%rdi,%rax,8),%xmm1
movdqu 0x10(%rdi,%rax,8),%xmm2
movq   %xmm1,%xmm3
punpckhqdq %xmm0,%xmm1
movdqu %xmm1,-0x50(%rbx)
movdqu %xmm3,-0x60(%rbx)
movq   %xmm2,%xmm1
punpckhqdq %xmm0,%xmm2
movdqu %xmm2,-0x30(%rbx)
movdqu %xmm1,-0x40(%rbx)
movdqu 0x20(%rdi,%rax,8),%xmm1
movdqu 0x30(%rdi,%rax,8),%xmm2
movq   %xmm1,%xmm3
punpckhqdq %xmm0,%xmm1
movdqu %xmm1,-0x10(%rbx)
movdqu %xmm3,-0x20(%rbx)
movq   %xmm2,%xmm1
punpckhqdq %xmm0,%xmm2
movdqu %xmm2,0x10(%rbx)
movdqu %xmm1,(%rbx)
add    $0x8,%rax
sub    $0xffffffffffffff80,%rbx
add    $0xfffffffffffffffe,%r11
jne    11f0 <dyadup_1D_feed_odd+0xf0>
test   $0x1,%r10b
je     12a2 <dyadup_1D_feed_odd+0x1a2>
movdqu (%rdi,%rax,8),%xmm0
movdqu 0x10(%rdi,%rax,8),%xmm1
shl    $0x4,%rax
mov    %rax,%rbx
or     $0x20,%rbx
movq   %xmm0,%xmm2
pxor   %xmm3,%xmm3
punpckhqdq %xmm3,%xmm0
movdqu %xmm0,0x10(%rdx,%rax,1)
movdqu %xmm2,(%rdx,%rax,1)
movq   %xmm1,%xmm0
punpckhqdq %xmm3,%xmm1
movdqu %xmm1,0x10(%rdx,%rbx,1)
movdqu %xmm0,(%rdx,%rbx,1)
cmp    %r9,%rsi
jne    1139 <dyadup_1D_feed_odd+0x39>
movslq %r8d,%rax
movsd  (%rdi,%rax,8),%xmm0
movslq %ecx,%rax
movsd  %xmm0,-0x8(%rdx,%rax,8)
pop    %rbx
ret
xor    %eax,%eax
test   $0x1,%r10b
jne    1262 <dyadup_1D_feed_odd+0x162>
jmp    12a2 <dyadup_1D_feed_odd+0x1a2>

LLVM IR (-O0):
define void @dyadup_1D_feed_odd(double* %0, i32 %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %9
store i32 0, i32* %9
br label %10
10: ; preds = %32, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %35
15: ; preds = %10
%16 = load double*, double** %7
%17 = load i32, i32* %9
%18 = mul nsw i32 %17, 2
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %16, i64 %20
store double 0.000000e+00, double* %21
%22 = load double*, double** %5
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
%26 = load double, double* %25
%27 = load double*, double** %7
%28 = load i32, i32* %9
%29 = mul nsw i32 %28, 2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %27, i64 %30
store double %26, double* %31
br label %32
32: ; preds = %15
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %10
35: ; preds = %10
%36 = load double*, double** %5
%37 = load i32, i32* %6
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %36, i64 %39
%41 = load double, double* %40
%42 = load double*, double** %7
%43 = load i32, i32* %8
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %42, i64 %45
store double %41, double* %46
ret void
}

LLVM IR (-O2):
define void @dyadup_1D_feed_odd(double* nocapture %0, i32 %1, double* nocapture writeonly %2, i32 %3) {
%5 = add i32 %1, -1
%6 = icmp sgt i32 %1, 1
br i1 %6, label %7, label %118
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = icmp ult i32 %5, 4
br i1 %9, label %84, label %10
10: ; preds = %7
%11 = shl nuw nsw i64 %8, 1
%12 = getelementptr double, double* %2, i64 %11
%13 = getelementptr double, double* %0, i64 %8
%14 = icmp ugt double* %13, %2
%15 = icmp ugt double* %12, %0
%16 = and i1 %14, %15
br i1 %16, label %84, label %17
17: ; preds = %10
%18 = and i64 %8, 4294967292
%19 = add nsw i64 %18, -4
%20 = lshr exact i64 %19, 2
%21 = add nuw nsw i64 %20, 1
%22 = and i64 %21, 1
%23 = icmp eq i64 %19, 0
br i1 %23, label %63, label %24
24: ; preds = %17
%25 = and i64 %21, 9223372036854775806
br label %26
26: ; preds = %26, %24
%27 = phi i64 [ 0, %24 ], [ %60, %26 ]
%28 = phi i64 [ 0, %24 ], [ %61, %26 ]
%29 = shl nuw nsw i64 %27, 1
%30 = shl i64 %27, 1
%31 = or i64 %30, 4
%32 = getelementptr inbounds double, double* %0, i64 %27
%33 = bitcast double* %32 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = getelementptr inbounds double, double* %32, i64 2
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = getelementptr inbounds double, double* %2, i64 %29
%39 = getelementptr inbounds double, double* %2, i64 %31
%40 = bitcast double* %38 to <4 x double>*
%41 = bitcast double* %39 to <4 x double>*
%42 = shufflevector <2 x double> %34, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %42, <4 x double>* %40
%43 = shufflevector <2 x double> %37, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %43, <4 x double>* %41
%44 = or i64 %27, 4
%45 = shl nuw nsw i64 %44, 1
%46 = shl i64 %44, 1
%47 = or i64 %46, 4
%48 = getelementptr inbounds double, double* %0, i64 %44
%49 = bitcast double* %48 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = getelementptr inbounds double, double* %48, i64 2
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = getelementptr inbounds double, double* %2, i64 %45
%55 = getelementptr inbounds double, double* %2, i64 %47
%56 = bitcast double* %54 to <4 x double>*
%57 = bitcast double* %55 to <4 x double>*
%58 = shufflevector <2 x double> %50, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %58, <4 x double>* %56
%59 = shufflevector <2 x double> %53, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %59, <4 x double>* %57
%60 = add nuw i64 %27, 8
%61 = add i64 %28, 2
%62 = icmp eq i64 %61, %25
br i1 %62, label %63, label %26
63: ; preds = %26, %17
%64 = phi i64 [ 0, %17 ], [ %60, %26 ]
%65 = icmp eq i64 %22, 0
br i1 %65, label %82, label %66
66: ; preds = %63
%67 = shl nuw nsw i64 %64, 1
%68 = shl i64 %64, 1
%69 = or i64 %68, 4
%70 = getelementptr inbounds double, double* %0, i64 %64
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = getelementptr inbounds double, double* %70, i64 2
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %2, i64 %67
%77 = getelementptr inbounds double, double* %2, i64 %69
%78 = bitcast double* %76 to <4 x double>*
%79 = bitcast double* %77 to <4 x double>*
%80 = shufflevector <2 x double> %72, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %80, <4 x double>* %78
%81 = shufflevector <2 x double> %75, <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %81, <4 x double>* %79
br label %82
82: ; preds = %63, %66
%83 = icmp eq i64 %18, %8
br i1 %83, label %118, label %84
84: ; preds = %10, %7, %82
%85 = phi i64 [ 0, %10 ], [ 0, %7 ], [ %18, %82 ]
%86 = xor i64 %85, -1
%87 = and i64 %8, 1
%88 = icmp eq i64 %87, 0
br i1 %88, label %97, label %89
89: ; preds = %84
%90 = shl nuw nsw i64 %85, 1
%91 = or i64 %90, 1
%92 = getelementptr inbounds double, double* %2, i64 %91
store double 0.000000e+00, double* %92
%93 = getelementptr inbounds double, double* %0, i64 %85
%94 = load double, double* %93
%95 = getelementptr inbounds double, double* %2, i64 %90
store double %94, double* %95
%96 = or i64 %85, 1
br label %97
97: ; preds = %89, %84
%98 = phi i64 [ %85, %84 ], [ %96, %89 ]
%99 = sub nsw i64 0, %8
%100 = icmp eq i64 %86, %99
br i1 %100, label %118, label %101
101: ; preds = %97, %101
%102 = phi i64 [ %116, %101 ], [ %98, %97 ]
%103 = shl nuw nsw i64 %102, 1
%104 = or i64 %103, 1
%105 = getelementptr inbounds double, double* %2, i64 %104
store double 0.000000e+00, double* %105
%106 = getelementptr inbounds double, double* %0, i64 %102
%107 = load double, double* %106
%108 = getelementptr inbounds double, double* %2, i64 %103
store double %107, double* %108
%109 = add nuw nsw i64 %102, 1
%110 = shl nuw nsw i64 %109, 1
%111 = or i64 %110, 1
%112 = getelementptr inbounds double, double* %2, i64 %111
store double 0.000000e+00, double* %112
%113 = getelementptr inbounds double, double* %0, i64 %109
%114 = load double, double* %113
%115 = getelementptr inbounds double, double* %2, i64 %110
store double %114, double* %115
%116 = add nuw nsw i64 %102, 2
%117 = icmp eq i64 %116, %8
br i1 %117, label %118, label %101
118: ; preds = %97, %101, %82, %4
%119 = sext i32 %5 to i64
%120 = getelementptr inbounds double, double* %0, i64 %119
%121 = load double, double* %120
%122 = add nsw i32 %3, -1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %2, i64 %123
store double %121, double* %124
ret void
}