void pluckset(float xlp, float amp, float seed, float c, float *q, float sr) {
  int len, i;
  float x, rrand();
  q[1] = (int)(xlp * sr + 4.5);
  len = q[1] - 1;
  for (i = 4; i < len; i++) {
    x = rrand(1., seed);
    q[i] = amp;
    if (x < 0.)
      q[i] = amp;
  }
  q[0] = q[1];
  q[2] = c;
  q[3] = .99 - q[2];
}


x86 assembly (clang, -O0):
<pluckset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movss  %xmm4,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0xe8f(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11f9 <pluckset+0xe9>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe78(%rip),%xmm0
mov    $0x2,%al
call   1030 <rrand@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11e6 <pluckset+0xd6>
movss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    11eb <pluckset+0xdb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1183 <pluckset+0x73>
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xde3(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0xc(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluckset>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mulss  %xmm4,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xed7(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
mov    %rdi,%r14
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,%xmm4
addss  0xeda(%rip),%xmm4
movss  %xmm0,0x4(%rdi)
cvttss2si %xmm4,%eax
cmp    $0x5,%eax
jl     11a5 <pluckset+0x95>
movss  %xmm3,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %eax,%r15d
mov    $0x4,%ebx
movss  %xmm1,0x4(%rsp)
nopl   0x0(%rax)
movsd  0xe90(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1030 <rrand@plt>
movss  0x4(%rsp),%xmm1
movss  %xmm1,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <pluckset+0x60>
movss  0x4(%r14),%xmm0
movss  (%rsp),%xmm3
movss  %xmm0,(%r14)
movss  %xmm3,0x8(%r14)
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
movsd  0xe51(%rip),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0xc(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pluckset(float %0, float %1, float %2, float %3, float* %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float*
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float* %4, float** %11
store float %5, float* %12
%16 = load float, float* %7
%17 = load float, float* %12
%18 = fmul float %16, %17
%19 = fpext float %18 to double
%20 = fadd double %19, 4.500000e+00
%21 = fptosi double %20 to i32
%22 = sitofp i32 %21 to float
%23 = load float*, float** %11
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %11
%26 = getelementptr inbounds float, float* %25, i64 1
%27 = load float, float* %26
%28 = fsub float %27, 1.000000e+00
%29 = fptosi float %28 to i32
store i32 %29, i32* %13
store i32 4, i32* %14
br label %30
30: ; preds = %53, %6
%31 = load i32, i32* %14
%32 = load i32, i32* %13
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %56
34: ; preds = %30
%35 = load float, float* %9
%36 = fpext float %35 to double
%37 = call float (double, double, ...) bitcast (float (...)* @rrand to float (double, double, ...)*)(double 1.000000e+00, double %36)
store float %37, float* %15
%38 = load float, float* %8
%39 = load float*, float** %11
%40 = load i32, i32* %14
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %39, i64 %41
store float %38, float* %42
%43 = load float, float* %15
%44 = fpext float %43 to double
%45 = fcmp olt double %44, 0.000000e+00
br i1 %45, label %46, label %52
46: ; preds = %34
%47 = load float, float* %8
%48 = load float*, float** %11
%49 = load i32, i32* %14
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds float, float* %48, i64 %50
store float %47, float* %51
br label %52
52: ; preds = %46, %34
br label %53
53: ; preds = %52
%54 = load i32, i32* %14
%55 = add nsw i32 %54, 1
store i32 %55, i32* %14
br label %30
56: ; preds = %30
%57 = load float*, float** %11
%58 = getelementptr inbounds float, float* %57, i64 1
%59 = load float, float* %58
%60 = load float*, float** %11
%61 = getelementptr inbounds float, float* %60, i64 0
store float %59, float* %61
%62 = load float, float* %10
%63 = load float*, float** %11
%64 = getelementptr inbounds float, float* %63, i64 2
store float %62, float* %64
%65 = load float*, float** %11
%66 = getelementptr inbounds float, float* %65, i64 2
%67 = load float, float* %66
%68 = fpext float %67 to double
%69 = fsub double 0x3FEFAE147AE147AE, %68
%70 = fptrunc double %69 to float
%71 = load float*, float** %11
%72 = getelementptr inbounds float, float* %71, i64 3
store float %70, float* %72
ret void
}

LLVM IR (-O2):
define void @pluckset(float %0, float %1, float %2, float %3, float* nocapture %4, float %5) {
%7 = fmul float %0, %5
%8 = fpext float %7 to double
%9 = fadd double %8, 4.500000e+00
%10 = fptosi double %9 to i32
%11 = sitofp i32 %10 to float
%12 = getelementptr inbounds float, float* %4, i64 1
store float %11, float* %12
%13 = fadd float %11, -1.000000e+00
%14 = fptosi float %13 to i32
%15 = icmp sgt i32 %14, 4
br i1 %15, label %16, label %27
16: ; preds = %6
%17 = fpext float %2 to double
%18 = zext i32 %14 to i64
br label %19
19: ; preds = %16, %19
%20 = phi i64 [ 4, %16 ], [ %23, %19 ]
%21 = tail call float (double, double, ...) bitcast (float (...)* @rrand to float (double, double, ...)*)(double 1.000000e+00, double %17)
%22 = getelementptr inbounds float, float* %4, i64 %20
store float %1, float* %22
%23 = add nuw nsw i64 %20, 1
%24 = icmp eq i64 %23, %18
br i1 %24, label %25, label %19
25: ; preds = %19
%26 = load float, float* %12
br label %27
27: ; preds = %25, %6
%28 = phi float [ %26, %25 ], [ %11, %6 ]
store float %28, float* %4
%29 = getelementptr inbounds float, float* %4, i64 2
store float %3, float* %29
%30 = fpext float %3 to double
%31 = fsub double 0x3FEFAE147AE147AE, %30
%32 = fptrunc double %31 to float
%33 = getelementptr inbounds float, float* %4, i64 3
store float %32, float* %33
ret void
}