// File: /workspace/github_c_makefile_star2_O3/YunyiQian[P]multitel3/multisyn.c
// Function: trapezoid
float *trapezoid(float dura, float rise, float dt, int *ns) {
   int i, nr;
   float amp, *src;
   *ns = rint(dura/dt); if (*ns<2) *ns = 2;
   src = malloc((1+*ns)*sizeof(float));
   if (src == NULL) {*ns=0; return src;}
   nr = rint(rise*(*ns)); if (nr<1) nr = 1; if (2*nr>*ns) nr=*ns/2;
   amp = 1./(nr*(*ns-nr));
   for(i=0;i<nr;i++) src[i] = i*amp;
   for(;i<*ns-nr;i++) src[i] = nr*amp;
   for(;i<=*ns;i++)   src[i] = (*ns-i)*amp;
   (*ns)++;
   return src;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movd %xmm1, 0x4(%rsp)
divss %xmm2, %xmm0
callq 0x1170
cvttss2si %xmm0, %eax
cmpl $0x3, %eax
movl $0x2, %r15d
cmovgel %eax, %r15d
leaq 0x4(,%r15,4), %rdi
callq 0x1160
movq %rax, %r14
testq %rax, %rax
je 0x231b
leal 0x1(%r15), %ebp
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
mulss 0x4(%rsp), %xmm0
callq 0x1170
cvttss2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
leal (%rcx,%rcx), %edx
movl %r15d, %eax
shrl %eax
cmpl %r15d, %edx
cmovbel %ecx, %eax
movl %r15d, %ecx
subl %eax, %ecx
movl %ecx, %edx
imull %eax, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd 0x3ff1(%rip), %xmm1     # 0x60c8
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
leal 0x1(%rax), %edx
andl $-0x2, %edx
leaq -0x1(%rax), %rsi
movq %rsi, %xmm1
pshufd $0x44, %xmm1, %xmm2     # xmm2 = xmm1[0,1,0,1]
movdqa 0x3f32(%rip), %xmm3     # 0x6030
xorl %esi, %esi
movdqa 0x3f08(%rip), %xmm1     # 0x6010
pxor %xmm1, %xmm2
pcmpeqd %xmm4, %xmm4
movdqa 0x3f28(%rip), %xmm5     # 0x6040
movdqa %xmm3, %xmm6
pxor %xmm1, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm2, %xmm7
pcmpeqd %xmm2, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x215e
xorps %xmm7, %xmm7
cvtsi2ss %esi, %xmm7
mulss %xmm0, %xmm7
movss %xmm7, (%r14,%rsi,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x2182
leal 0x1(%rsi), %edi
xorps %xmm6, %xmm6
cvtsi2ss %edi, %xmm6
mulss %xmm0, %xmm6
movss %xmm6, 0x4(%r14,%rsi,4)
addq $0x2, %rsi
paddq %xmm5, %xmm3
cmpq %rsi, %rdx
jne 0x2118
cmpl %ecx, %eax
jge 0x21b1
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
mulss %xmm0, %xmm2
movl %eax, %eax
movslq %ecx, %rcx
movss %xmm2, (%r14,%rax,4)
incq %rax
cmpq %rcx, %rax
jl 0x21a3
movl %r15d, %edx
subl %eax, %edx
jb 0x231d
movl %eax, %esi
leaq 0x4(%rdx), %rcx
andq $-0x4, %rcx
movd %eax, %xmm2
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
paddd 0x3e79(%rip), %xmm2     # 0x6050
movq %rdx, %xmm3
pshufd $0x44, %xmm3, %xmm3     # xmm3 = xmm3[0,1,0,1]
movd %r15d, %xmm4
pshufd $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0]
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
leaq (%r14,%rsi,4), %rax
addq $0xc, %rax
xorl %edx, %edx
movdqa 0x3e5f(%rip), %xmm5     # 0x6060
movdqa 0x3e27(%rip), %xmm6     # 0x6030
pxor %xmm1, %xmm3
pcmpeqd %xmm7, %xmm7
movdqa 0x3e56(%rip), %xmm8     # 0x6070
movq %rdx, %xmm9
pshufd $0x44, %xmm9, %xmm10    # xmm10 = xmm9[0,1,0,1]
movdqa %xmm10, %xmm9
por %xmm6, %xmm9
pxor %xmm1, %xmm9
movdqa %xmm9, %xmm11
pcmpgtd %xmm3, %xmm11
pcmpeqd %xmm3, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
pand %xmm11, %xmm9
pshufd $0xf5, %xmm11, %xmm11   # xmm11 = xmm11[1,1,3,3]
por %xmm9, %xmm11
movdqa %xmm4, %xmm9
psubd %xmm2, %xmm9
cvtdq2ps %xmm9, %xmm9
mulps %xmm0, %xmm9
movd %xmm11, %esi
notl %esi
testb $0x1, %sil
je 0x227f
movss %xmm9, -0xc(%rax,%rdx,4)
pxor %xmm7, %xmm11
pextrw $0x4, %xmm11, %esi
testb $0x1, %sil
je 0x22a0
movaps %xmm9, %xmm11
shufps $0x55, %xmm9, %xmm11    # xmm11 = xmm11[1,1],xmm9[1,1]
movss %xmm11, -0x8(%rax,%rdx,4)
por %xmm5, %xmm10
pxor %xmm1, %xmm10
movdqa %xmm10, %xmm11
pcmpgtd %xmm3, %xmm11
pcmpeqd %xmm3, %xmm10
pshufd $0xf5, %xmm10, %xmm12   # xmm12 = xmm10[1,1,3,3]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm11, %xmm10   # xmm10 = xmm11[1,1,3,3]
por %xmm12, %xmm10
pxor %xmm7, %xmm10
pextrw $0x0, %xmm10, %esi
testb $0x1, %sil
je 0x22f0
movaps %xmm9, %xmm11
unpckhpd %xmm9, %xmm11           # xmm11 = xmm11[1],xmm9[1]
movss %xmm11, -0x4(%rax,%rdx,4)
pextrw $0x4, %xmm10, %esi
testb $0x1, %sil
je 0x2307
shufps $0xff, %xmm9, %xmm9     # xmm9 = xmm9[3,3,3,3]
movss %xmm9, (%rax,%rdx,4)
addq $0x4, %rdx
paddd %xmm8, %xmm2
cmpq %rdx, %rcx
jne 0x221a
jmp 0x231d
xorl %ebp, %ebp
movl %ebp, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)