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


x86 assembly (clang, -O0):
<dyadup_1D_feed_even>:
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
cmp    -0xc(%rbp),%eax
jge    1171 <dyadup_1D_feed_even+0x71>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $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
add    $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_even+0x20>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyadup_1D_feed_even>:
test   %esi,%esi
jle    12bd <dyadup_1D_feed_even+0x1bd>
mov    %esi,%r8d
cmp    $0x4,%esi
jb     112c <dyadup_1D_feed_even+0x2c>
lea    (%rdi,%r8,8),%rax
cmp    %rdx,%rax
jbe    11a6 <dyadup_1D_feed_even+0xa6>
mov    %r8,%rax
shl    $0x4,%rax
add    %rdx,%rax
cmp    %rdi,%rax
jbe    11a6 <dyadup_1D_feed_even+0xa6>
xor    %esi,%esi
mov    %rsi,%rax
not    %rax
test   $0x1,%r8b
je     1159 <dyadup_1D_feed_even+0x59>
mov    %rsi,%r9
shl    $0x4,%r9
movq   $0x0,(%rdx,%r9,1)
movsd  (%rdi,%rsi,8),%xmm0
movsd  %xmm0,0x8(%rdx,%r9,1)
or     $0x1,%rsi
add    %r8,%rax
je     12bd <dyadup_1D_feed_even+0x1bd>
mov    %rsi,%rax
shl    $0x4,%rax
add    %rdx,%rax
add    $0x18,%rax
movq   $0x0,-0x18(%rax)
movsd  (%rdi,%rsi,8),%xmm0
movsd  %xmm0,-0x10(%rax)
movq   $0x0,-0x8(%rax)
movsd  0x8(%rdi,%rsi,8),%xmm0
movsd  %xmm0,(%rax)
add    $0x2,%rsi
add    $0x20,%rax
cmp    %rsi,%r8
jne    1170 <dyadup_1D_feed_even+0x70>
jmp    12bd <dyadup_1D_feed_even+0x1bd>
mov    %r8d,%esi
and    $0xfffffffc,%esi
lea    -0x4(%rsi),%rax
mov    %rax,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rax,%rax
je     12ca <dyadup_1D_feed_even+0x1ca>
mov    %r9,%r10
and    $0xfffffffffffffffe,%r10
lea    0x60(%rdx),%rax
xor    %r11d,%r11d
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
movupd (%rdi,%r11,8),%xmm1
movupd 0x10(%rdi,%r11,8),%xmm2
xorpd  %xmm3,%xmm3
unpcklpd %xmm1,%xmm3
movsd  %xmm0,%xmm1
movupd %xmm1,-0x50(%rax)
movupd %xmm3,-0x60(%rax)
xorpd  %xmm1,%xmm1
unpcklpd %xmm2,%xmm1
movsd  %xmm0,%xmm2
movupd %xmm2,-0x30(%rax)
movupd %xmm1,-0x40(%rax)
movupd 0x20(%rdi,%r11,8),%xmm1
movupd 0x30(%rdi,%r11,8),%xmm2
xorpd  %xmm3,%xmm3
unpcklpd %xmm1,%xmm3
movsd  %xmm0,%xmm1
movupd %xmm1,-0x10(%rax)
movupd %xmm3,-0x20(%rax)
xorpd  %xmm1,%xmm1
unpcklpd %xmm2,%xmm1
movsd  %xmm0,%xmm2
movupd %xmm2,0x10(%rax)
movupd %xmm1,(%rax)
add    $0x8,%r11
sub    $0xffffffffffffff80,%rax
add    $0xfffffffffffffffe,%r10
jne    11e0 <dyadup_1D_feed_even+0xe0>
test   $0x1,%r9b
je     12b4 <dyadup_1D_feed_even+0x1b4>
movupd (%rdi,%r11,8),%xmm0
movupd 0x10(%rdi,%r11,8),%xmm1
shl    $0x4,%r11
mov    %r11,%rax
or     $0x28,%rax
xorpd  %xmm2,%xmm2
xorpd  %xmm3,%xmm3
unpcklpd %xmm0,%xmm3
movsd  %xmm2,%xmm0
movupd %xmm0,0x10(%rdx,%r11,1)
movupd %xmm3,(%rdx,%r11,1)
xorpd  %xmm0,%xmm0
unpcklpd %xmm1,%xmm0
shufpd $0x2,%xmm1,%xmm2
movupd %xmm2,0x8(%rdx,%rax,1)
movupd %xmm0,-0x8(%rdx,%rax,1)
cmp    %r8,%rsi
jne    112e <dyadup_1D_feed_even+0x2e>
movslq %ecx,%rax
movq   $0x0,-0x8(%rdx,%rax,8)
ret
xor    %r11d,%r11d
test   $0x1,%r9b
jne    1266 <dyadup_1D_feed_even+0x166>
jmp    12b4 <dyadup_1D_feed_even+0x1b4>

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

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