// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpb $0x23, (%rdi)
sete %bl
addq %rdi, %rbx
leaq 0x6261(%rip), %rsi      # 0xcd36
movq %rbx, %rdi
callq 0x2cd8
testl %eax, %eax
sete %al
movl 0x1ef2f(%rip), %r15d    # 0x25a18
testl %r15d, %r15d
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6b50
movl $0x0, 0x7e9c0(%rip)     # 0x854c0
movl 0x7e9be(%rip), %eax     # 0x854c4
testl %eax, %eax
jle 0x6b36
incq %rax
xorl %ecx, %ecx
movl $0x1, %edx
leaq 0x7e9b5(%rip), %rsi     # 0x854d0
orl (%rsi,%rdx,4), %ecx
incq %rdx
cmpq %rdx, %rax
jne 0x6b1b
movl %ecx, 0x7e994(%rip)     # 0x854c0
xorl %ebp, %ebp
testl %ecx, %ecx
jne 0x6edf
addq $0x6, %rbx
leaq 0x5750(%rip), %rdi      # 0xc291
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2e72
jmp 0x6f0f
leaq 0x61e5(%rip), %rsi      # 0xcd3c
movq %rbx, %rdi
callq 0x2cd8
movl %eax, %ebp
leaq 0x61da(%rip), %rsi      # 0xcd42
movq %rbx, %rdi
callq 0x2cd8
movl %eax, %r14d
leaq 0x6240(%rip), %rsi      # 0xcdba
movq %rbx, %rdi
callq 0x2cd8
testl %ebp, %ebp
je 0x6c61
testl %r14d, %r14d
je 0x6c61
testl %eax, %eax
je 0x6c61
leaq 0x6210(%rip), %rsi      # 0xcdb2
movq %rbx, %rdi
callq 0x2cd8
xorl %ebp, %ebp
testl %eax, %eax
jne 0x6de9
movslq 0x7e909(%rip), %rcx     # 0x854c4
leaq 0x7e90e(%rip), %rax     # 0x854d0
xorl %edx, %edx
cmpl $0x0, (%rax,%rcx,4)
sete %dl
movl %edx, (%rax,%rcx,4)
movl $0x0, 0x7e8e8(%rip)     # 0x854c0
testq %rcx, %rcx
jle 0x6bfa
movl %ecx, %ecx
incq %rcx
xorl %edx, %edx
movl $0x1, %esi
orl (%rax,%rsi,4), %edx
incq %rsi
cmpq %rsi, %rcx
jne 0x6be9
movl %edx, 0x7e8c6(%rip)     # 0x854c0
cmpl $0x0, 0x1e15b(%rip)     # 0x24d5c
je 0x6c25
movq 0x1edfe(%rip), %rdi     # 0x25a08
movl 0x1e148(%rip), %edx     # 0x24d58
leaq 0x5653(%rip), %rsi      # 0xc26a
xorl %eax, %eax
callq 0x2210
movl 0x1edf3(%rip), %r15d    # 0x25a18
cmpl $0x0, 0xb58c(%rip)      # 0x121b8
movl $0x1, %ebp
je 0x6de9
testl %r15d, %r15d
jne 0x6de9
movq 0x1edc1(%rip), %rdi     # 0x25a08
leaq 0x5635(%rip), %rsi      # 0xc283
leaq 0x1e24b(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
jmp 0x6de9
movl 0x7e85d(%rip), %eax     # 0x854c4
leal 0x1(%rax), %ecx
movl %ecx, 0x7e854(%rip)     # 0x854c4
cmpl $0x9, %eax
jge 0x6eec
testl %ebp, %ebp
je 0x6caf
testl %r14d, %r14d
je 0x6cd4
addq $0x3, %rbx
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3e17
movq %rax, %rbx
movl (%r14), %eax
cmpl $0xff0000, %eax         # imm = 0xFF0000
sete %cl
testl %eax, %eax
sete %al
orb %cl, %al
jmp 0x6cf7
addq $0x6, %rbx
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3e17
movq %rax, %rbx
cmpl $0xff0000, (%r14)       # imm = 0xFF0000
sete %al
jmp 0x6cf7
addq $0x7, %rbx
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3e17
movq %rax, %rbx
cmpl $0xff0000, (%r14)       # imm = 0xFF0000
setne %al
movzbl %al, %ecx
movslq 0x7e7c3(%rip), %rax     # 0x854c4
leaq 0x7e7c8(%rip), %r14     # 0x854d0
movl %ecx, (%r14,%rax,4)
movl $0x0, 0x7e7aa(%rip)     # 0x854c0
testq %rax, %rax
jle 0x6d39
movl %eax, %ecx
incq %rcx
xorl %edx, %edx
movl $0x1, %esi
orl (%r14,%rsi,4), %edx
incq %rsi
cmpq %rsi, %rcx
jne 0x6d27
movl %edx, 0x7e787(%rip)     # 0x854c0
cmpl $0x0, 0xb478(%rip)      # 0x121b8
je 0x6db2
cmpl $0x0, 0x1eccf(%rip)     # 0x25a18
jne 0x6db2
cmpl $0x0, 0x1e00a(%rip)     # 0x24d5c
je 0x6d75
movq 0x1ecad(%rip), %rdi     # 0x25a08
movl 0x1dff7(%rip), %edx     # 0x24d58
leaq 0x5502(%rip), %rsi      # 0xc26a
xorl %eax, %eax
callq 0x2210
movl 0x7e74f(%rip), %eax     # 0x854c4
cltq
movl (%r14,%rax,4), %edx
movq 0x1ec86(%rip), %rdi     # 0x25a08
testl %edx, %edx
je 0x6d9d
leaq 0x5fe9(%rip), %rsi      # 0xcd76
leaq 0x1e10c(%rip), %rcx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
jmp 0x6db2
leaq 0x5fe5(%rip), %rsi      # 0xcd89
leaq 0x1e0f5(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movq 0x1ec57(%rip), %rdi     # 0x25a10
movl $0x1, %ebp
testq %rdi, %rdi
je 0x6de9
movl 0x1df8f(%rip), %edx     # 0x24d58
movslq 0x7e6f4(%rip), %rax     # 0x854c4
movl (%r14,%rax,4), %ecx
leaq 0x5fc0(%rip), %rsi      # 0xcd9b
leaq 0x1e0be(%rip), %r8      # 0x24ea0
xorl %eax, %eax
callq 0x2210
leaq 0x5fc7(%rip), %rsi      # 0xcdb7
movq %rbx, %rdi
callq 0x2cd8
testl %eax, %eax
jne 0x6edf
movq 0x1ec09(%rip), %rcx     # 0x25a10
testq %rcx, %rcx
je 0x6e22
leaq 0x5faa(%rip), %rdi      # 0xcdbd
movl $0x13, %esi
movl $0x1, %edx
callq 0x2300
decl 0x7e69c(%rip)           # 0x854c4
cmpl $0x0, 0x1df2d(%rip)     # 0x24d5c
je 0x6e4c
movq 0x1ebd0(%rip), %rdi     # 0x25a08
movl 0x1df1a(%rip), %edx     # 0x24d58
leaq 0x5425(%rip), %rsi      # 0xc26a
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0xb365(%rip)      # 0x121b8
je 0x6e7a
cmpl $0x0, 0x1ebbc(%rip)     # 0x25a18
jne 0x6e7a
movq 0x1eba3(%rip), %rdi     # 0x25a08
leaq 0x5417(%rip), %rsi      # 0xc283
leaq 0x1e02d(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movl 0x7e644(%rip), %edx     # 0x854c4
testl %edx, %edx
js 0x6efb
movl $0x0, 0x7e632(%rip)     # 0x854c0
testq %rdx, %rdx
je 0x6eb6
leaq 0x1(%rdx), %rcx
xorl %eax, %eax
movl $0x1, %esi
leaq 0x7e62b(%rip), %rdi     # 0x854d0
orl (%rdi,%rsi,4), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x6ea5
movl %eax, 0x7e60a(%rip)     # 0x854c0
movq 0x1eb53(%rip), %rdi     # 0x25a10
movl $0x1, %ebp
testq %rdi, %rdi
je 0x6edf
leaq 0x7e602(%rip), %rax     # 0x854d0
movl (%rax,%rdx,4), %ecx
leaq 0x5f0b(%rip), %rsi      # 0xcde3
xorl %eax, %eax
callq 0x2210
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
incl 0x1eb3a(%rip)           # 0x25a2c
leaq 0x5e50(%rip), %rdi      # 0xcd49
jmp 0x6f08
incl 0x1eb2b(%rip)           # 0x25a2c
leaq 0x5ec9(%rip), %rdi      # 0xcdd1
xorl %eax, %eax
callq 0x2e72
movl $0x1, %edi
callq 0x22f0