// File: /workspace/github_c_makefile_star2_O0/mincebert[P]maketzx/maketzx.c
// Function: WriteDecryptWaves
void WriteDecryptWaves(word wavnum)
{
  if (hifi)
     {
       if (tzxhead[9]<0x0a)
	  {
	    byte count1,count2;
	    for (count1=0; count1<wavnum; count1++)
		{
		  for (count2=0; count2<243; count2++)
		      {
			pulseseq[count2]=3500000/(samprate/((samprate/1000)-count2*.1345));
		      }
		  WriteTZXPulseSequence(243);
		}
	  }
       else {
	      byte count;
	      WriteTZXLoopStart(wavnum);
	      for (count=0; count<243; count++)
		  {
		    pulseseq[count]=3500000/(samprate/((samprate/1000)-count*.1345));
		  }
	      WriteTZXPulseSequence(243);
	      WriteTZXLoopEnd();
	    }
     }
  else {
	 double totsamp=0;
	 byte count;
	 for (count=0; count<243; count++) totsamp+=(samprate/1000)-count*.1345;
	 totsamp*=wavnum;
	 WriteTZXTone(bit1.tstates,(totsamp/bit1.samples)*2);
       }
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
cmpb $0x0, 0xa591(%rip)      # 0x130d0
je 0x8c98
movzbl 0xa5eb(%rip), %eax      # 0x13137
cmpl $0xa, %eax
jge 0x8c01
movb $0x0, 0x13(%rsp)
movzbl 0x13(%rsp), %eax
cmpl 0x14(%rsp), %eax
jae 0x8bfc
movb $0x0, 0x12(%rsp)
movzbl 0x12(%rsp), %eax
cmpl $0xf3, %eax
jge 0x8be3
movss 0xa64e(%rip), %xmm0     # 0x131d0
cvtss2sd %xmm0, %xmm1
movss 0x6fb6(%rip), %xmm2     # 0xfb44
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movzbl 0x12(%rsp), %eax
cvtsi2sd %eax, %xmm2
movsd 0x6f11(%rip), %xmm3     # 0xfab8
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movsd 0x6e05(%rip), %xmm0     # 0xf9c0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %edx
movzbl 0x12(%rsp), %eax
movl %eax, %ecx
leaq 0x16bcc(%rip), %rax     # 0x1f7a0
movl %edx, (%rax,%rcx,4)
movb 0x12(%rsp), %al
addb $0x1, %al
movb %al, 0x12(%rsp)
jmp 0x8b6e
movl $0xf3, %edi
callq 0x4520
movb 0x13(%rsp), %al
addb $0x1, %al
movb %al, 0x13(%rsp)
jmp 0x8b5a
jmp 0x8c93
movl 0x14(%rsp), %edi
callq 0x45f0
movb $0x0, 0x11(%rsp)
movzbl 0x11(%rsp), %eax
cmpl $0xf3, %eax
jge 0x8c84
movss 0xa5ad(%rip), %xmm0     # 0x131d0
cvtss2sd %xmm0, %xmm1
movss 0x6f15(%rip), %xmm2     # 0xfb44
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movzbl 0x11(%rsp), %eax
cvtsi2sd %eax, %xmm2
movsd 0x6e70(%rip), %xmm3     # 0xfab8
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movsd 0x6d64(%rip), %xmm0     # 0xf9c0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %edx
movzbl 0x11(%rsp), %eax
movl %eax, %ecx
leaq 0x16b2b(%rip), %rax     # 0x1f7a0
movl %edx, (%rax,%rcx,4)
movb 0x11(%rsp), %al
addb $0x1, %al
movb %al, 0x11(%rsp)
jmp 0x8c0f
movl $0xf3, %edi
callq 0x4520
callq 0x4660
jmp 0x8d53
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movb $0x0, 0x7(%rsp)
movzbl 0x7(%rsp), %eax
cmpl $0xf3, %eax
jge 0x8d12
movss 0xa516(%rip), %xmm0     # 0x131d0
movss 0x6e82(%rip), %xmm1     # 0xfb44
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movzbl 0x7(%rsp), %eax
cvtsi2sd %eax, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x6dbe(%rip), %xmm2     # 0xfab0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movb 0x7(%rsp), %al
addb $0x1, %al
movb %al, 0x7(%rsp)
jmp 0x8ca6
movl 0x14(%rsp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movl 0x16a5f(%rip), %edi     # 0x1f790
movsd 0x8(%rsp), %xmm0
movsd 0x16a49(%rip), %xmm1    # 0x1f788
divsd %xmm1, %xmm0
addsd %xmm0, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %esi
callq 0x4480
addq $0x18, %rsp
retq
nopl (%rax,%rax)