// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x8e5c
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x7dce(%rip), %rsi      # 0x10c36
callq 0x2e80
cmpl $0x0, %eax
jne 0x8eb7
cmpl $0x0, 0x1fb7f(%rip)     # 0x289f8
je 0x8eb7
callq 0x8de0
cmpl $0x0, 0x7f619(%rip)     # 0x884a0
je 0x8e96
movl $0x0, 0x24(%rsp)
jmp 0x9298
movq 0x18(%rsp), %rsi
addq $0x6, %rsi
leaq 0x72e6(%rip), %rdi      # 0x1018c
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
movq 0x18(%rsp), %rdi
leaq 0x7d79(%rip), %rsi      # 0x10c3c
callq 0x2e80
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x7d5d(%rip), %rsi      # 0x10c42
callq 0x2e80
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x7db3(%rip), %rsi      # 0x10cba
callq 0x2e80
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x8f36
cmpl $0x0, 0x8(%rsp)
jne 0x8f36
cmpl $0x0, 0x4(%rsp)
je 0x9119
movl $0x1, 0x14(%rsp)
movl 0x7f560(%rip), %eax     # 0x884a4
addl $0x1, %eax
movl %eax, 0x7f557(%rip)     # 0x884a4
cmpl $0x9, 0x7f550(%rip)     # 0x884a4
jle 0x8f7d
movl 0x1fab0(%rip), %eax     # 0x28a0c
addl $0x1, %eax
movl %eax, 0x1faa7(%rip)     # 0x28a0c
leaq 0x7cdd(%rip), %rdi      # 0x10c49
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
cmpl $0x0, 0xc(%rsp)
je 0x8fc4
movq 0x18(%rsp), %rdi
addq $0x6, %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x4740
movq %rax, 0x18(%rsp)
cmpl $0xff0000, 0x10(%rsp)   # imm = 0xFF0000
sete %al
andb $0x1, %al
movzbl %al, %edx
movslq 0x7f4ef(%rip), %rcx     # 0x884a4
leaq 0x7f4f4(%rip), %rax     # 0x884b0
movl %edx, (%rax,%rcx,4)
jmp 0x905a
cmpl $0x0, 0x8(%rsp)
je 0x9008
movq 0x18(%rsp), %rdi
addq $0x7, %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x4740
movq %rax, 0x18(%rsp)
cmpl $0xff0000, 0x10(%rsp)   # imm = 0xFF0000
setne %al
andb $0x1, %al
movzbl %al, %edx
movslq 0x7f4a8(%rip), %rcx     # 0x884a4
leaq 0x7f4ad(%rip), %rax     # 0x884b0
movl %edx, (%rax,%rcx,4)
jmp 0x9058
movq 0x18(%rsp), %rdi
addq $0x3, %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x4740
movq %rax, 0x18(%rsp)
movb $0x1, %al
cmpl $0xff0000, 0x10(%rsp)   # imm = 0xFF0000
movb %al, 0x3(%rsp)
je 0x903e
cmpl $0x0, 0x10(%rsp)
sete %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
andb $0x1, %al
movzbl %al, %edx
movslq 0x7f456(%rip), %rcx     # 0x884a4
leaq 0x7f45b(%rip), %rax     # 0x884b0
movl %edx, (%rax,%rcx,4)
jmp 0x905a
callq 0x8de0
cmpl $0x0, 0xc132(%rip)      # 0x15198
je 0x90d7
cmpl $0x0, 0x1f989(%rip)     # 0x289f8
jne 0x90d7
callq 0x3320
movslq 0x7f427(%rip), %rcx     # 0x884a4
leaq 0x7f42c(%rip), %rax     # 0x884b0
cmpl $0x0, (%rax,%rcx,4)
je 0x90b9
movq 0x1f957(%rip), %rdi     # 0x289e8
movslq 0x7f40c(%rip), %rcx     # 0x884a4
leaq 0x7f411(%rip), %rax     # 0x884b0
movl (%rax,%rcx,4), %edx
leaq 0x7bcd(%rip), %rsi      # 0x10c76
leaq 0x1edd0(%rip), %rcx     # 0x27e80
movb $0x0, %al
callq 0x21e0
jmp 0x90d5
movq 0x1f928(%rip), %rdi     # 0x289e8
leaq 0x7bc2(%rip), %rsi      # 0x10c89
leaq 0x1edb2(%rip), %rdx     # 0x27e80
movb $0x0, %al
callq 0x21e0
jmp 0x90d7
cmpq $0x0, 0x1f911(%rip)     # 0x289f0
je 0x9114
movq 0x1f908(%rip), %rdi     # 0x289f0
movl 0x1ec4a(%rip), %edx     # 0x27d38
movslq 0x7f3af(%rip), %rcx     # 0x884a4
leaq 0x7f3b4(%rip), %rax     # 0x884b0
movl (%rax,%rcx,4), %ecx
leaq 0x7b95(%rip), %rsi      # 0x10c9b
leaq 0x1ed73(%rip), %r8      # 0x27e80
movb $0x0, %al
callq 0x21e0
jmp 0x91a0
movq 0x18(%rsp), %rdi
leaq 0x7b8d(%rip), %rsi      # 0x10cb2
callq 0x2e80
cmpl $0x0, %eax
jne 0x919e
movl $0x1, 0x14(%rsp)
movslq 0x7f366(%rip), %rcx     # 0x884a4
leaq 0x7f36b(%rip), %rax     # 0x884b0
cmpl $0x0, (%rax,%rcx,4)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movslq 0x7f34a(%rip), %rcx     # 0x884a4
leaq 0x7f34f(%rip), %rax     # 0x884b0
movl %edx, (%rax,%rcx,4)
callq 0x8de0
callq 0x3320
cmpl $0x0, 0xc023(%rip)      # 0x15198
je 0x919c
cmpl $0x0, 0x1f87a(%rip)     # 0x289f8
jne 0x919c
movq 0x1f861(%rip), %rdi     # 0x289e8
leaq 0x6ff0(%rip), %rsi      # 0x1017e
leaq 0x1eceb(%rip), %rdx     # 0x27e80
movb $0x0, %al
callq 0x21e0
jmp 0x919e
jmp 0x91a0
movq 0x18(%rsp), %rdi
leaq 0x7b0b(%rip), %rsi      # 0x10cb7
callq 0x2e80
cmpl $0x0, %eax
jne 0x9290
cmpq $0x0, 0x1f82e(%rip)     # 0x289f0
je 0x91d9
movq 0x1f825(%rip), %rdi     # 0x289f0
leaq 0x7aeb(%rip), %rsi      # 0x10cbd
movb $0x0, %al
callq 0x21e0
movl $0x1, 0x14(%rsp)
movl 0x7f2bd(%rip), %eax     # 0x884a4
addl $-0x1, %eax
movl %eax, 0x7f2b4(%rip)     # 0x884a4
callq 0x3320
cmpl $0x0, 0xbf9c(%rip)      # 0x15198
je 0x9223
cmpl $0x0, 0x1f7f3(%rip)     # 0x289f8
jne 0x9223
movq 0x1f7da(%rip), %rdi     # 0x289e8
leaq 0x6f69(%rip), %rsi      # 0x1017e
leaq 0x1ec64(%rip), %rdx     # 0x27e80
movb $0x0, %al
callq 0x21e0
cmpl $0x0, 0x7f27a(%rip)     # 0x884a4
jge 0x9253
movl 0x1f7da(%rip), %eax     # 0x28a0c
addl $0x1, %eax
movl %eax, 0x1f7d1(%rip)     # 0x28a0c
leaq 0x7a8f(%rip), %rdi      # 0x10cd1
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
callq 0x8de0
cmpq $0x0, 0x1f790(%rip)     # 0x289f0
je 0x928e
movq 0x1f787(%rip), %rdi     # 0x289f0
movl 0x7f235(%rip), %edx     # 0x884a4
movslq 0x7f22e(%rip), %rcx     # 0x884a4
leaq 0x7f233(%rip), %rax     # 0x884b0
movl (%rax,%rcx,4), %ecx
leaq 0x7a5c(%rip), %rsi      # 0x10ce3
movb $0x0, %al
callq 0x21e0
jmp 0x9290
movl 0x14(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)