// File: /workspace/github_c_makefile_star2_O0/42Bastian[P]lyxass/lyxass.c
// Function: mainloop
int mainloop(int pass2)
{
  Current.ifFlag = 1;
  Current.switchFlag = 1;

  Current.pass2 = pass2;

  for ( ; GetLine() ; killLine(),doReference() ) {

    Global.OldPC = Global.pc;
    Global.Lines++;

    code.OldPtr = code.Ptr;

    Current.Line++;
    Current.varModifier = 0;
    Current.LabelPtr = 0;
    Current.doRef = 0;
    Current.needsReloc = 0;

    error = 0;

    if ( !Current.pass2 && Current.ifFlag && Current.switchFlag && verbose){
      if ( verbose > 2 || (!Current.Macro.Processing && verbose > 1) )
        printf("%4d:$%04"PRIx32": <%s>\n",Current.Line,Global.pc,srcLine);
    }

    if ( !atom ) continue;

    if ( atom == ' ' ){

      if ( GetCmd() )  continue; // empty line
      if ( checkCode(Current.Cmd,0) >= 0) continue;

      Error(UNKNOWN_ERR,Current.Cmd);
      continue;
    }

    if ( GetLabel( & Current.Label ) ){
      Error(LABEL_ERR,"");
      continue;
    }

    if ( (Current.Label.type & UNSURE) ){

      if ( checkCode(Current.Label.name,1 ) >= 0){
        //      Warning("Opcode/Macro in first column !");
        continue;
      }
      Current.Label.type = NORMAL;
    }

    if ( Current.Label.len &&
         !Current.pass2 &&
         !Current.Macro.Define &&
         Current.ifFlag &&
         Current.switchFlag){

      if ( Global.genesis ){
        Current.Label.type |= CODELABEL;
      }
      Current.Label.value = Global.pc;
      Current.LabelPtr = DefineLabel( &Current.Label , &Current.doRef);
    }
    //
    // we have a line-label, so store command elsewhere
    //

    if ( GetCmd() ) {
      if ( Current.Label.type & REGISTER ){
        return Error(SYNTAX_ERR,"REG label used as code label");
      }
      continue;
    }
    if ( checkCode( Current.Cmd,0 ) >= 0 ){
      // XXX: Must check if label is still a code label
      continue;
    }

    Error(UNKNOWN_ERR,Current.Cmd);

  }

  //  printf("Mainloop:%d\n",count--);

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl $0x1, 0x13deb(%rip)     # 0x186f0
movl $0x1, 0x13e71(%rip)     # 0x18780
movl -0x8(%rbp), %eax
movl %eax, 0x13dc4(%rip)     # 0x186dc
movb $0x0, %al
callq 0x5640
cmpl $0x0, %eax
je 0x4ba9
movl 0x13a72(%rip), %eax     # 0x183a0
movl %eax, 0x13a70(%rip)     # 0x183a4
movl 0x13a6e(%rip), %eax     # 0x183a8
addl $0x1, %eax
movl %eax, 0x13a65(%rip)     # 0x183a8
movq 0x13c86(%rip), %rax     # 0x185d0
movq %rax, 0x13c87(%rip)     # 0x185d8
movl 0x13ca1(%rip), %eax     # 0x185f8
addl $0x1, %eax
movl %eax, 0x13c98(%rip)     # 0x185f8
movl $0x0, 0x13d76(%rip)     # 0x186e0
movq $0x0, 0x13d0b(%rip) # 0x18680
movl $0x0, 0x13d65(%rip)     # 0x186e4
movl $0x0, 0x13e2b(%rip)     # 0x187b4
movl $0x0, 0x1c141(%rip)     # 0x20ad4
cmpl $0x0, 0x13d42(%rip)     # 0x186dc
jne 0x49f5
cmpl $0x0, 0x13d4d(%rip)     # 0x186f0
je 0x49f5
cmpl $0x0, 0x13dd4(%rip)     # 0x18780
je 0x49f5
cmpl $0x0, 0x139b7(%rip)     # 0x1836c
je 0x49f5
cmpl $0x2, 0x139ae(%rip)     # 0x1836c
jg 0x49d2
cmpl $0x0, 0x13c39(%rip)     # 0x18600
jne 0x49f3
cmpl $0x1, 0x1399c(%rip)     # 0x1836c
jle 0x49f3
movl 0x13c20(%rip), %esi     # 0x185f8
movl 0x139c2(%rip), %edx     # 0x183a0
leaq 0xc74d(%rip), %rdi      # 0x11132
leaq 0x1c424(%rip), %rcx     # 0x20e10
movb $0x0, %al
callq 0x30b0
jmp 0x49f5
leaq 0x1c524(%rip), %rax     # 0x20f20
cmpl $0x0, (%rax)
jne 0x4a06
jmp 0x4b9a
leaq 0x1c513(%rip), %rax     # 0x20f20
cmpl $0x20, (%rax)
jne 0x4a5d
callq 0x6430
cmpl $0x0, %eax
je 0x4a21
jmp 0x4b9a
leaq 0x13bd0(%rip), %rdi     # 0x185f8
addq $0x94, %rdi
xorl %esi, %esi
callq 0x4fe0
cmpl $0x0, %eax
jl 0x4a40
jmp 0x4b9a
movl $0xf, %edi
leaq 0x13bac(%rip), %rsi     # 0x185f8
addq $0x94, %rsi
callq 0xd130
jmp 0x4b9a
leaq 0x13b94(%rip), %rdi     # 0x185f8
addq $0x28, %rdi
callq 0x5de0
cmpl $0x0, %eax
je 0x4a88
movl $0x3, %edi
leaq 0xc5df(%rip), %rsi      # 0x1105d
callq 0xd130
jmp 0x4b9a
movl 0x13b96(%rip), %eax     # 0x18624
andl $0x20, %eax
cmpl $0x0, %eax
je 0x4ac3
leaq 0x13b5b(%rip), %rdi     # 0x185f8
addq $0x28, %rdi
addq $0x38, %rdi
movl $0x1, %esi
callq 0x4fe0
cmpl $0x0, %eax
jl 0x4ab9
jmp 0x4b9a
movl $0x1, 0x13b61(%rip)     # 0x18624
cmpl $0x0, 0x13b56(%rip)     # 0x18620
je 0x4b36
cmpl $0x0, 0x13c09(%rip)     # 0x186dc
jne 0x4b36
cmpl $0x0, 0x13b28(%rip)     # 0x18604
jne 0x4b36
cmpl $0x0, 0x13c0b(%rip)     # 0x186f0
je 0x4b36
cmpl $0x0, 0x13c92(%rip)     # 0x18780
je 0x4b36
cmpl $0x0, 0x138bd(%rip)     # 0x183b4
je 0x4b08
movl 0x13b25(%rip), %eax     # 0x18624
orl $0x0, %eax
movl %eax, 0x13b1c(%rip)     # 0x18624
movl 0x13892(%rip), %eax     # 0x183a0
movq %rax, 0x13b13(%rip)     # 0x18628
leaq 0x13adc(%rip), %rsi     # 0x185f8
movq %rsi, %rdi
addq $0x28, %rdi
addq $0xec, %rsi
callq 0x6810
movq %rax, 0x13b4a(%rip)     # 0x18680
callq 0x6430
cmpl $0x0, %eax
je 0x4b66
movl 0x13ade(%rip), %eax     # 0x18624
andl $0x40, %eax
cmpl $0x0, %eax
je 0x4b64
movl $0x12, %edi
leaq 0xc5e9(%rip), %rsi      # 0x11143
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0x4bb2
jmp 0x4b9a
leaq 0x13a8b(%rip), %rdi     # 0x185f8
addq $0x94, %rdi
xorl %esi, %esi
callq 0x4fe0
cmpl $0x0, %eax
jl 0x4b82
jmp 0x4b9a
movl $0xf, %edi
leaq 0x13a6a(%rip), %rsi     # 0x185f8
addq $0x94, %rsi
callq 0xd130
callq 0x5bd0
callq 0x4d30
jmp 0x4918
movl 0x1bf25(%rip), %eax     # 0x20ad4
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)