// File: /workspace/github_c_makefile_star2_O1/Edilbert[P]BS9/bs9.c
// Function: CheckCondition
int CheckCondition(char *p)
{
   int r,v,Ifdef,Ifndef,Ifval;
   r = 0;
   if (*p == '#') ++p; // old syntax #if, #endif, etc.
   if (!strcmpword(p,"error") && Pass)
   {
      CheckSkip();
      if (Skipping) return 0;     // Include line in listing
      ErrorMsg("%s\n",p+6);
      exit(1);
   }
   Ifdef  = !strcmpword(p,"ifdef");
   Ifndef = !strcmpword(p,"ifndef");
   Ifval  = !strcmpword(p,"if");
   if (Ifdef || Ifndef || Ifval)
   {
      r = 1;
      IfLevel++;
      if (IfLevel > 9)
      {
         ++ErrNum;
         ErrorMsg("More than 10  IF or IFDEF conditions nested\n");
         exit(1);
      }
      if (Ifdef)
      {
         p = EvalOperand(p+6,&v,0);
         SkipLine[IfLevel] = v == UNDEF;
      }
      else if (Ifndef)
      {
         p = EvalOperand(p+7,&v,0);
         SkipLine[IfLevel] = v != UNDEF;
      }
      else // if (Ifval)
      {
         p = EvalOperand(p+3,&v,0);
         SkipLine[IfLevel] = v == UNDEF || v == 0;
      }
      CheckSkip();
      if (ListOn && !Pass)
      {
         PrintLiNo();
         if (SkipLine[IfLevel])
            fprintf(lf,"%4.4x FALSE    %s\n",SkipLine[IfLevel],Line);
         else
            fprintf(lf,"0000 TRUE     %s\n",Line);
      }
      if (df) fprintf(df,"%5d %4.4x          %s\n",LiNo,SkipLine[IfLevel],Line);
   }
   else if (!strcmpword(p,"else"))
   {
      r = 1;
      SkipLine[IfLevel] = !SkipLine[IfLevel];
      CheckSkip();
      PrintLiNo();
      if (ListOn && !Pass) fprintf(lf,"              %s\n",Line);
   }
   if (!strcmpword(p,"endif"))
   {
   if (df) fprintf(df,"inside Check endif\n");
      r = 1;
      IfLevel--;
      PrintLiNo();
      if (ListOn && !Pass) fprintf(lf,"              %s\n",Line);
      if (IfLevel < 0)
      {
         ++ErrNum;
         ErrorMsg("endif without if\n");
         exit(1);
      }
      CheckSkip();
      if (df) fprintf(df,"ENDIF SkipLevel[%d]=%d\n",IfLevel,SkipLine[IfLevel]);
   }
   return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
cmpb $0x23, (%rdi)
sete %bl
addq %rdi, %rbx
leaq 0x6367(%rip), %rsi      # 0xcd4a
movq %rbx, %rdi
callq 0x2cc9
testl %eax, %eax
jne 0x6a57
cmpl $0x0, 0x1f022(%rip)     # 0x25a18
je 0x6a57
movl $0x0, 0x7eabe(%rip)     # 0x854c0
movl 0x7eabc(%rip), %eax     # 0x854c4
testl %eax, %eax
jle 0x6a2e
incq %rax
xorl %ecx, %ecx
movl $0x1, %edx
leaq 0x7eab3(%rip), %rsi     # 0x854d0
orl (%rsi,%rdx,4), %ecx
incq %rdx
cmpq %rdx, %rax
jne 0x6a1d
movl %ecx, 0x7ea92(%rip)     # 0x854c0
xorl %ebp, %ebp
cmpl $0x0, 0x7ea89(%rip)     # 0x854c0
jne 0x6de2
addq $0x6, %rbx
leaq 0x585d(%rip), %rdi      # 0xc2a5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2e63
jmp 0x6e10
leaq 0x62f2(%rip), %rsi      # 0xcd50
movq %rbx, %rdi
callq 0x2cc9
movl %eax, %ebp
leaq 0x62e7(%rip), %rsi      # 0xcd56
movq %rbx, %rdi
callq 0x2cc9
movl %eax, %r14d
leaq 0x634d(%rip), %rsi      # 0xcdce
movq %rbx, %rdi
callq 0x2cc9
testl %ebp, %ebp
je 0x6b65
testl %r14d, %r14d
je 0x6b65
testl %eax, %eax
je 0x6b65
leaq 0x631d(%rip), %rsi      # 0xcdc6
movq %rbx, %rdi
callq 0x2cc9
xorl %ebp, %ebp
testl %eax, %eax
jne 0x6cec
movslq 0x7ea02(%rip), %rcx     # 0x854c4
leaq 0x7ea07(%rip), %rax     # 0x854d0
xorl %edx, %edx
cmpl $0x0, (%rax,%rcx,4)
sete %dl
movl %edx, (%rax,%rcx,4)
movl $0x0, 0x7e9e1(%rip)     # 0x854c0
testq %rcx, %rcx
jle 0x6b01
movl %ecx, %ecx
incq %rcx
xorl %edx, %edx
movl $0x1, %esi
orl (%rax,%rsi,4), %edx
incq %rsi
cmpq %rsi, %rcx
jne 0x6af0
movl %edx, 0x7e9bf(%rip)     # 0x854c0
cmpl $0x0, 0x1e254(%rip)     # 0x24d5c
je 0x6b25
movq 0x1eef7(%rip), %rdi     # 0x25a08
movl 0x1e241(%rip), %edx     # 0x24d58
leaq 0x5760(%rip), %rsi      # 0xc27e
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0xb68c(%rip)      # 0x121b8
movl $0x1, %ebp
je 0x6cec
cmpl $0x0, 0x1eeda(%rip)     # 0x25a18
jne 0x6cec
movq 0x1eebd(%rip), %rdi     # 0x25a08
leaq 0x5745(%rip), %rsi      # 0xc297
leaq 0x1e347(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
jmp 0x6cec
movl 0x7e959(%rip), %eax     # 0x854c4
leal 0x1(%rax), %ecx
movl %ecx, 0x7e950(%rip)     # 0x854c4
cmpl $0x9, %eax
jge 0x6ded
testl %ebp, %ebp
je 0x6bb3
testl %r14d, %r14d
je 0x6bd8
addq $0x3, %rbx
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3daa
movq %rax, %rbx
movl (%r14), %eax
cmpl $0xff0000, %eax         # imm = 0xFF0000
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
jmp 0x6bfb
addq $0x6, %rbx
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3daa
movq %rax, %rbx
cmpl $0xff0000, (%r14)       # imm = 0xFF0000
sete %al
jmp 0x6bfb
addq $0x7, %rbx
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3daa
movq %rax, %rbx
cmpl $0xff0000, (%r14)       # imm = 0xFF0000
setne %al
movzbl %al, %ecx
movslq 0x7e8bf(%rip), %rax     # 0x854c4
leaq 0x7e8c4(%rip), %r14     # 0x854d0
movl %ecx, (%r14,%rax,4)
movl $0x0, 0x7e8a6(%rip)     # 0x854c0
testq %rax, %rax
jle 0x6c3d
movl %eax, %eax
incq %rax
xorl %ecx, %ecx
movl $0x1, %edx
orl (%r14,%rdx,4), %ecx
incq %rdx
cmpq %rdx, %rax
jne 0x6c2b
movl %ecx, 0x7e883(%rip)     # 0x854c0
cmpl $0x0, 0xb574(%rip)      # 0x121b8
je 0x6cb5
cmpl $0x0, 0x1edcb(%rip)     # 0x25a18
jne 0x6cb5
cmpl $0x0, 0x1e106(%rip)     # 0x24d5c
je 0x6c73
movq 0x1eda9(%rip), %rdi     # 0x25a08
movl 0x1e0f3(%rip), %edx     # 0x24d58
leaq 0x5612(%rip), %rsi      # 0xc27e
xorl %eax, %eax
callq 0x2210
movslq 0x7e84a(%rip), %rax     # 0x854c4
movl (%r14,%rax,4), %edx
movq 0x1ed83(%rip), %rdi     # 0x25a08
testl %edx, %edx
je 0x6ca0
leaq 0x60fa(%rip), %rsi      # 0xcd8a
leaq 0x1e209(%rip), %rcx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
jmp 0x6cb5
leaq 0x60f6(%rip), %rsi      # 0xcd9d
leaq 0x1e1f2(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movq 0x1ed54(%rip), %rdi     # 0x25a10
movl $0x1, %ebp
testq %rdi, %rdi
je 0x6cec
movl 0x1e08c(%rip), %edx     # 0x24d58
movslq 0x7e7f1(%rip), %rax     # 0x854c4
movl (%r14,%rax,4), %ecx
leaq 0x60d1(%rip), %rsi      # 0xcdaf
leaq 0x1e1bb(%rip), %r8      # 0x24ea0
xorl %eax, %eax
callq 0x2210
leaq 0x60d8(%rip), %rsi      # 0xcdcb
movq %rbx, %rdi
callq 0x2cc9
testl %eax, %eax
jne 0x6de2
movq 0x1ed06(%rip), %rcx     # 0x25a10
testq %rcx, %rcx
je 0x6d25
leaq 0x60bb(%rip), %rdi      # 0xcdd1
movl $0x13, %esi
movl $0x1, %edx
callq 0x2300
decl 0x7e799(%rip)           # 0x854c4
cmpl $0x0, 0x1e02a(%rip)     # 0x24d5c
je 0x6d4f
movq 0x1eccd(%rip), %rdi     # 0x25a08
movl 0x1e017(%rip), %edx     # 0x24d58
leaq 0x5536(%rip), %rsi      # 0xc27e
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0xb462(%rip)      # 0x121b8
je 0x6d7d
cmpl $0x0, 0x1ecb9(%rip)     # 0x25a18
jne 0x6d7d
movq 0x1eca0(%rip), %rdi     # 0x25a08
leaq 0x5528(%rip), %rsi      # 0xc297
leaq 0x1e12a(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movl 0x7e741(%rip), %edx     # 0x854c4
testl %edx, %edx
js 0x6dfc
movl $0x0, 0x7e72f(%rip)     # 0x854c0
testq %rdx, %rdx
je 0x6db9
leaq 0x1(%rdx), %rcx
xorl %eax, %eax
movl $0x1, %esi
leaq 0x7e728(%rip), %rdi     # 0x854d0
orl (%rdi,%rsi,4), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x6da8
movl %eax, 0x7e707(%rip)     # 0x854c0
movq 0x1ec50(%rip), %rdi     # 0x25a10
movl $0x1, %ebp
testq %rdi, %rdi
je 0x6de2
leaq 0x7e6ff(%rip), %rax     # 0x854d0
movl (%rax,%rdx,4), %ecx
leaq 0x601c(%rip), %rsi      # 0xcdf7
xorl %eax, %eax
callq 0x2210
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
incl 0x1ec39(%rip)           # 0x25a2c
leaq 0x5f63(%rip), %rdi      # 0xcd5d
jmp 0x6e09
incl 0x1ec2a(%rip)           # 0x25a2c
leaq 0x5fdc(%rip), %rdi      # 0xcde5
xorl %eax, %eax
callq 0x2e63
movl $0x1, %edi
callq 0x22f0