// File: /workspace/github_c_makefile_star2_O0/mincebert[P]maketzx/maketzx.c
// Function: FindEdge2
dword FindEdge2(void)
{
  byte good=0;
  dword hp1=0,hp2=0,total=0;

  if (FindingPause)
     {
       hp1=FindEdge1();
       if (!blocktype)
          {
            if (!FindingPause && hp1>(int)(samprate/500))
	       {
	         mspause=(hp1/samprate)*1000;
	         hp2=hp1=0;
	         EndBlock=1;
	         return hp2;
	       }
            else return hp1;
          }
       hp2=FindEdge1();
       if (!FindingPause && hp2>(int)(samprate/500))
	  {
	    mspause=((hp2-hp1)/samprate)*1000;
	    hp2=hp1;
	    EndBlock=1;
	  }
     }
  else {
	 do {
	      hp1+=FindEdge1();
	      //
	      if (!blocktype)
	         {
	           if (!FindingPause && hp1>(int)(samprate/500))
		      {
		        mspause=(hp1/samprate)*1000;
		        hp2=hp1=0;
		        EndBlock=1;
		        return hp2;
		      }
	           else return hp1;
	         }
	      //
	      if (currpulse<2 && bit0.samples>3)
		 {
		   PushFilePointers();
		   FindEdge1();
		   if (currpulse<2) { RemoveFilePointers(); good=0; }
		   else {
			  PopFilePointers();
			  lseek(inpfile.handle,filepos,SEEK_SET);
			  inpfile.bufpoint=0;
			  good=1;
			}
		 }
	      else good=1;
	    }
	 while (!good && blocktype);
	 do {
	      hp2+=FindEdge1();
	      //
	      if (!FindingPause && hp2>(int)(samprate/500))
		 {
		   mspause=((hp2-hp1)/samprate)*1000;
		   hp2=hp1;
		   EndBlock=1;
		 }
	      //
	      if (currpulse<2 && bit0.samples>3)
		 {
		   PushFilePointers();
		   FindEdge1();
		   if (currpulse<2) { RemoveFilePointers(); good=0; }
		   else {
			  PopFilePointers();
			  lseek(inpfile.handle,filepos,SEEK_SET);
			  inpfile.bufpoint=0;
			  good=1;
			}
		 }
	      else good=1;
	    }
	  while (!good && blocktype);

       }
  total=(hp1+hp2);
  return total;
}

// Assembly:
subq $0x58, %rsp
movb $0x0, 0x4f(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
cmpb $0x0, 0x1001f(%rip)     # 0x1319a
je 0x3327
callq 0x2e80
movq %rax, 0x40(%rsp)
cmpb $0x0, 0x1c50f(%rip)     # 0x1f6a1
jne 0x3269
cmpb $0x0, 0xfffb(%rip)      # 0x1319a
jne 0x325a
movq 0x40(%rsp), %rax
movss 0x1001e(%rip), %xmm0    # 0x131d0
movss 0xc986(%rip), %xmm1     # 0xfb40
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x325a
movq 0x40(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x28(%rsp)
testq %rax, %rax
movss %xmm0, 0x2c(%rsp)
js 0x320c
movss 0x28(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
divss 0xffb6(%rip), %xmm0     # 0x131d0
movss 0xc922(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xffce(%rip)     # 0x13200
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x1, 0x1c54d(%rip)     # 0x1f798
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x3629
movq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x3629
callq 0x2e80
movq %rax, 0x38(%rsp)
cmpb $0x0, 0xff20(%rip)      # 0x1319a
jne 0x3322
movq 0x38(%rsp), %rax
movss 0xff43(%rip), %xmm0     # 0x131d0
movss 0xc8ab(%rip), %xmm1     # 0xfb40
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x3322
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rcx, %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x20(%rsp)
testq %rax, %rax
movss %xmm0, 0x24(%rsp)
js 0x32eb
movss 0x20(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm0
divss 0xfed7(%rip), %xmm0     # 0x131d0
movss 0xc843(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xfeef(%rip)     # 0x13200
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movb $0x1, 0x1c476(%rip)     # 0x1f798
jmp 0x3610
jmp 0x3329
callq 0x2e80
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpb $0x0, 0x1c362(%rip)     # 0x1f6a1
jne 0x3416
cmpb $0x0, 0xfe4e(%rip)      # 0x1319a
jne 0x3407
movq 0x40(%rsp), %rax
movss 0xfe71(%rip), %xmm0     # 0x131d0
movss 0xc7d9(%rip), %xmm1     # 0xfb40
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x3407
movq 0x40(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x18(%rsp)
testq %rax, %rax
movss %xmm0, 0x1c(%rsp)
js 0x33b9
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
divss 0xfe09(%rip), %xmm0     # 0x131d0
movss 0xc775(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xfe21(%rip)     # 0x13200
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x1, 0x1c3a0(%rip)     # 0x1f798
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x3629
movq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x3629
cmpq $0x2, 0x1c29a(%rip)     # 0x1f6b8
jae 0x3481
movsd 0x1c340(%rip), %xmm0    # 0x1f768
movsd 0xc598(%rip), %xmm1     # 0xf9c8
ucomisd %xmm1, %xmm0
jbe 0x3481
callq 0x18e0
callq 0x2e80
cmpq $0x2, 0x1c270(%rip)     # 0x1f6b8
jae 0x3456
callq 0x1b30
movb $0x0, 0x4f(%rsp)
jmp 0x347f
callq 0x1a10
movzbl 0xfdfe(%rip), %edi      # 0x13260
movq 0xfd5f(%rip), %rsi      # 0x131c8
xorl %edx, %edx
callq 0x10b0
movl $0x0, 0xfee6(%rip)      # 0x13360
movb $0x1, 0x4f(%rsp)
jmp 0x3486
movb $0x1, 0x4f(%rsp)
jmp 0x3488
xorl %eax, %eax
cmpb $0x0, 0x4f(%rsp)
movb %al, 0x17(%rsp)
jne 0x34a6
movzbl 0x1c205(%rip), %eax     # 0x1f6a1
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x3329
jmp 0x34b4
callq 0x2e80
addq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpb $0x0, 0xfcd0(%rip)      # 0x1319a
jne 0x3572
movq 0x38(%rsp), %rax
movss 0xfcf3(%rip), %xmm0     # 0x131d0
movss 0xc65b(%rip), %xmm1     # 0xfb40
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x3572
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rcx, %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0xc(%rsp)
testq %rax, %rax
movss %xmm0, 0x10(%rsp)
js 0x353b
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x10(%rsp), %xmm0
divss 0xfc87(%rip), %xmm0     # 0x131d0
movss 0xc5f3(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xfc9f(%rip)     # 0x13200
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movb $0x1, 0x1c226(%rip)     # 0x1f798
cmpq $0x2, 0x1c13e(%rip)     # 0x1f6b8
jae 0x35dd
movsd 0x1c1e4(%rip), %xmm0    # 0x1f768
movsd 0xc43c(%rip), %xmm1     # 0xf9c8
ucomisd %xmm1, %xmm0
jbe 0x35dd
callq 0x18e0
callq 0x2e80
cmpq $0x2, 0x1c114(%rip)     # 0x1f6b8
jae 0x35b2
callq 0x1b30
movb $0x0, 0x4f(%rsp)
jmp 0x35db
callq 0x1a10
movzbl 0xfca2(%rip), %edi      # 0x13260
movq 0xfc03(%rip), %rsi      # 0x131c8
xorl %edx, %edx
callq 0x10b0
movl $0x0, 0xfd8a(%rip)      # 0x13360
movb $0x1, 0x4f(%rsp)
jmp 0x35e2
movb $0x1, 0x4f(%rsp)
jmp 0x35e4
xorl %eax, %eax
cmpb $0x0, 0x4f(%rsp)
movb %al, 0xb(%rsp)
jne 0x3602
movzbl 0x1c0a9(%rip), %eax     # 0x1f6a1
cmpl $0x0, %eax
setne %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x34b4
jmp 0x3610
movq 0x40(%rsp), %rax
addq 0x38(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)