// File: /workspace/github_c_makefile_star2_O1/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, 0xa79b(%rip)      # 0x14734
movl %eax, 0xa785(%rip)      # 0x14724
xorl %eax, %eax
movl %eax, 0x7b509(%rip)     # 0x854b0
movl $0x1, 0x8207(%rip)      # 0x121b8
movl $0x18a5, 0x81f5(%rip)   # imm = 0x18A5
movb $0x0, 0x1adde(%rip)     # 0x24da0
movl %eax, 0x7b1a8(%rip)     # 0x85170
movdqa 0x2060(%rip), %xmm0     # 0xc030
movdqa 0x2068(%rip), %xmm1     # 0xc040
movl $0x3, %eax
movdqa 0x206b(%rip), %xmm2     # 0xc050
movdqa 0x2073(%rip), %xmm3     # 0xc060
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
leaq 0x7b517(%rip), %rcx     # 0x85510
movdqa 0x206f(%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 0xa02f
movl $0xff0000, -0xc(%rcx,%rax,4) # imm = 0xFF0000
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0xa041
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 0xa070
movl $0xff0000, -0x4(%rcx,%rax,4) # imm = 0xFF0000
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0xa081
movl $0xff0000, (%rcx,%rax,4) # imm = 0xFF0000
paddq %xmm5, %xmm1
paddq %xmm5, %xmm0
addq $0x4, %rax
cmpq $0xf, %rax
jne 0xa001
cmpl $0x0, 0x7b426(%rip)     # 0x854c4
jne 0xa1fa
movq 0x7b0cd(%rip), %rdi     # 0x85178
callq 0x2140
xorl %eax, %eax
movl %eax, 0x1aca0(%rip)     # 0x24d58
movl %eax, 0x1aca2(%rip)     # 0x24d60
movq 0x7b0b3(%rip), %rdx     # 0x85178
leaq 0x1add4(%rip), %rbx     # 0x24ea0
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x21c0
movq 0x7b098(%rip), %rdi     # 0x85178
callq 0x2230
leaq 0x80c8(%rip), %r14      # 0x121b4
leaq 0xa635(%rip), %r15      # 0x14728
testl %eax, %eax
je 0xa104
cmpl $0x0, 0x1b902(%rip)     # 0x25a00
jle 0xa1f4
incl 0x1ac4e(%rip)           # 0x24d58
incl 0x1ac50(%rip)           # 0x24d60
movq %rbx, %rdi
callq 0x2110
testl %eax, %eax
je 0xa135
movl %eax, %ecx
decl %ecx
movslq %ecx, %rcx
cmpb $0xa, (%rcx,%rbx)
jne 0xa137
cltq
movb $0x0, -0x1(%rax,%rbx)
decq %rax
jmp 0xa137
xorl %eax, %eax
testl %eax, %eax
je 0xa149
cltq
cmpb $0xd, -0x1(%rax,%rbx)
jne 0xa149
movb $0x0, -0x1(%rax,%rbx)
movq %rbx, %rdi
callq 0x95ef
cmpl $0x0, 0x7d7b0(%rip)     # 0x87908
je 0xa167
movq %rbx, %rdi
callq 0x94d3
movq %r15, %rax
jmp 0xa17e
movq 0x7b00a(%rip), %rdx     # 0x85178
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x21c0
movq %r14, %rax
movl (%rax), %eax
movl %eax, 0x8032(%rip)      # 0x121b8
movq 0x7afeb(%rip), %rdi     # 0x85178
callq 0x2230
movl %eax, %ecx
xorl %eax, %eax
orl 0x7b314(%rip), %ecx     # 0x854b0
setne %al
je 0xa1af
cmpl $0x0, 0x1b858(%rip)     # 0x25a00
jle 0xa1af
callq 0x9c85
movl 0xa57f(%rip), %ecx      # 0x14734
cmpl %ecx, 0x1abb1(%rip)     # 0x24d6c
jge 0xa1c3
movl %ecx, 0x1aba9(%rip)     # 0x24d6c
movl 0x1b863(%rip), %esi     # 0x25a2c
cmpl 0xa551(%rip), %esi      # 0x14720
jl 0xa0f3
leaq 0x3491(%rip), %rdi      # 0xd66d
xorl %eax, %eax
callq 0x2130
leaq 0x389b(%rip), %rdi      # 0xda85
popq %rbx
popq %r14
popq %r15
jmp 0x20a0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3895(%rip), %rdi      # 0xda96
callq 0x20a0
movl 0x7b2b8(%rip), %esi     # 0x854c4
cmpl $0x1, %esi
jne 0xa21f
leaq 0x38a5(%rip), %rdi      # 0xdabd
callq 0x20a0
jmp 0xa22d
leaq 0x3421(%rip), %rdi      # 0xd647
xorl %eax, %eax
callq 0x2130
movl $0x1, %edi
callq 0x22f0