// File: /workspace/github_c_makefile_star2_O3/Edilbert[P]BS9/bs9.c
// Function: Phase2
void Phase2(void)
{
   int i,l,Eof;

   pc        =   -1;
   EnumValue =   -1;
   ForcedEnd =    0;
   ListOn    =    1;
   CPU       = 6309;
   Scope[0]  =    0;
   ModuleStart =  0;

   for (i=0 ; i < 11 ; ++i) minlab[i] = UNDEF;

   if (IfLevel)
   {
      printf("\n*** Error in conditional assembly ***\n");
      if (IfLevel == 1)
         printf("*** an #endif statement is missing\n");
      else
         printf("*** %d #endif statements are missing\n",IfLevel);
      exit(1);
   }
   rewind(sf);
   LiNo = 0; TotalLiNo = 0;
   fgets(Line,sizeof(Line),sf);
   Eof = feof(sf);
   while (!Eof || IncludeLevel > 0)
   {
      ++LiNo; ++TotalLiNo;
      l = strlen(Line);
      if (l && Line[l-1] == 10) Line[--l] = 0; // Remove linefeed
      if (l && Line[l-1] == 13) Line[--l] = 0; // Remove return
      ParseLine(Line);
      if (MacLev)
      {
         NextMacLine(Line);
         ListOn = MacList;
      }
      else
      {
         fgets(Line,sizeof(Line),sf);
         ListOn = ListGlobal;
      }
      Eof = feof(sf) || ForcedEnd;
      if (Eof && IncludeLevel > 0) Eof = CloseInclude();
      if (GenEnd < pc) GenEnd = pc; // Remember highest assenble address
      if (ErrNum >= ERRMAX)
      {
         printf("\n*** Error count reached maximum of %d ***\n",ErrNum);
         printf("Assembly stopped\n");
         return;
      }
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xa707(%rip)      # 0x14734
movl %eax, 0xa6f1(%rip)      # 0x14724
xorl %eax, %eax
movl %eax, 0x7b475(%rip)     # 0x854b0
movl $0x1, 0x8173(%rip)      # 0x121b8
movl $0x18a5, 0x8161(%rip)   # imm = 0x18A5
movb $0x0, 0x1ad4a(%rip)     # 0x24da0
movl %eax, 0x7b114(%rip)     # 0x85170
movdqa 0x1fcc(%rip), %xmm0     # 0xc030
movdqa 0x1fd4(%rip), %xmm1     # 0xc040
movl $0x3, %eax
movdqa 0x1fd7(%rip), %xmm2     # 0xc050
movdqa 0x1fdf(%rip), %xmm3     # 0xc060
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
leaq 0x7b483(%rip), %rcx     # 0x85510
movdqa 0x1fdb(%rip), %xmm5     # 0xc070
movdqa %xmm1, %xmm6
pxor %xmm2, %xmm6
movdqa %xmm3, %xmm7
pcmpgtd %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pcmpeqd %xmm4, %xmm6
pand %xmm7, %xmm6
movd %xmm6, %edx
testb $0x1, %dl
je 0xa0c3
movl $0xff0000, -0xc(%rcx,%rax,4) # imm = 0xFF0000
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0xa0d5
movl $0xff0000, -0x8(%rcx,%rax,4) # imm = 0xFF0000
movdqa %xmm0, %xmm6
pxor %xmm2, %xmm6
movdqa %xmm3, %xmm7
pcmpgtd %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pcmpeqd %xmm4, %xmm6
pand %xmm7, %xmm6
pextrw $0x0, %xmm6, %edx
testb $0x1, %dl
je 0xa104
movl $0xff0000, -0x4(%rcx,%rax,4) # imm = 0xFF0000
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0xa115
movl $0xff0000, (%rcx,%rax,4) # imm = 0xFF0000
paddq %xmm5, %xmm1
paddq %xmm5, %xmm0
addq $0x4, %rax
cmpq $0xf, %rax
jne 0xa095
cmpl $0x0, 0x7b392(%rip)     # 0x854c4
jne 0xa29f
movq 0x7b039(%rip), %rdi     # 0x85178
callq 0x2140
xorl %eax, %eax
movl %eax, 0x1ac0c(%rip)     # 0x24d58
movl %eax, 0x1ac0e(%rip)     # 0x24d60
movq 0x7b01f(%rip), %rdx     # 0x85178
leaq 0x1ad40(%rip), %rbx     # 0x24ea0
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x21c0
movq 0x7b004(%rip), %rdi     # 0x85178
callq 0x2230
movl 0x1b881(%rip), %ecx     # 0x25a00
leaq 0x802e(%rip), %r14      # 0x121b4
leaq 0xa59b(%rip), %r15      # 0x14728
testl %eax, %eax
je 0xa199
testl %ecx, %ecx
jle 0xa299
incl 0x1abb9(%rip)           # 0x24d58
incl 0x1abbb(%rip)           # 0x24d60
movq %rbx, %rdi
callq 0x2110
testl %eax, %eax
je 0xa1da
movl %eax, %ecx
decl %ecx
movslq %ecx, %rcx
cmpb $0xa, (%rcx,%rbx)
jne 0xa1cc
cltq
movb $0x0, -0x1(%rax,%rbx)
decq %rax
testl %eax, %eax
je 0xa1da
cltq
cmpb $0xd, -0x1(%rax,%rbx)
jne 0xa1da
movb $0x0, -0x1(%rax,%rbx)
movq %rbx, %rdi
callq 0x9696
cmpl $0x0, 0x7d71f(%rip)     # 0x87908
je 0xa1f8
movq %rbx, %rdi
callq 0x9550
movq %r15, %rax
jmp 0xa20f
movq 0x7af79(%rip), %rdx     # 0x85178
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x21c0
movq %r14, %rax
movl (%rax), %eax
movl %eax, 0x7fa1(%rip)      # 0x121b8
movq 0x7af5a(%rip), %rdi     # 0x85178
callq 0x2230
movl %eax, %ecx
xorl %eax, %eax
orl 0x7b283(%rip), %ecx     # 0x854b0
setne %dl
movl 0x1b7ca(%rip), %ecx     # 0x25a00
testl %ecx, %ecx
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xa252
callq 0x9d15
movl 0x1b7b0(%rip), %ecx     # 0x25a00
jmp 0xa254
movb %dl, %al
movl 0xa4da(%rip), %edx      # 0x14734
cmpl %edx, 0x1ab0c(%rip)     # 0x24d6c
jge 0xa268
movl %edx, 0x1ab04(%rip)     # 0x24d6c
movl 0x1b7be(%rip), %esi     # 0x25a2c
cmpl 0xa4ac(%rip), %esi      # 0x14720
jl 0xa18d
leaq 0x33d2(%rip), %rdi      # 0xd653
xorl %eax, %eax
callq 0x2130
leaq 0x37b8(%rip), %rdi      # 0xda47
popq %rbx
popq %r14
popq %r15
jmp 0x20a0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x37b2(%rip), %rdi      # 0xda58
callq 0x20a0
movl 0x7b213(%rip), %esi     # 0x854c4
cmpl $0x1, %esi
jne 0xa2c4
leaq 0x37c2(%rip), %rdi      # 0xda7f
callq 0x20a0
jmp 0xa2d2
leaq 0x3362(%rip), %rdi      # 0xd62d
xorl %eax, %eax
callq 0x2130
movl $0x1, %edi
callq 0x22f0