// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/error.c
// Function: Error
int Error(int err_num,const char *s)
{
  int fatal = 0;

  if ( err_num < 0 ){
    fatal = 1;
    err_num = -err_num;
  }
  ++error;

  ++cntError;

  if ( fatal ){
    fprintf(stderr,"Fatal Error %d!\n",err_num);
  }

  if (Current.File >= 0){
    if ( Current.Macro.Line && err_num != FAIL_ERR ){
      fprintf(my_stderr,"ERROR: %s:%d:Macro-Line %5d:<%s>: '%s'\n",
	      file_list[Current.File].name,Current.Line,
	      Current.Macro.Line,file_list[Current.Macro.File].name,
              srcLine);
    } else if ( err_num != FAIL_ERR ) {
      fprintf(my_stderr,"ERROR: %s:%5d: '%s'\n",
              file_list[Current.File].name,Current.Line, srcLine);
    }
  }
  switch (err_num) {
  case  INCLUDE_ERR:
    fprintf(my_stderr,"To many includes\n");
    break;
  case FILE_ERR:
    fprintf(my_stderr,"Can't open file <%s>\n",s);
    break;
  case LABEL_ERR:
    fprintf(my_stderr,"Wrong character in label\n");
    break;
  case MLABEL_ERR:
    fprintf(my_stderr,"Macro-label outside macro\n");
    break;
  case NOMEM_ERR:
    fprintf(my_stderr,"No more memory available\n");
    break;
  case REDEF_ERR:
    fprintf(my_stderr,"Label redefined ! First use here: %5d : <%s>\n",
	    ((label_t *)s)->line,file_list[ ((label_t *)s)->file ].name );
    break;
  case LREDEF_ERR:
    fprintf(my_stderr,"Local label redefined ! First use here: %5d : <%s>\n",
	    ((label_t *)s)->line,file_list[ ((label_t *)s)->file ].name );
    break;
  case LMREDEF_ERR:
    fprintf(my_stderr,"Local macro label redefined ! First use here: %5d : <%s>\n",
	    ((label_t *)s)->line,file_list[ ((label_t *)s)->file ].name );
    break;
  case MREDEF_ERR:
    fprintf(my_stderr,"Macro-name redefined ! First use here: %5d : <%s>\n",
	    ((label_t *)s)->line,file_list[ ((label_t *)s)->file ].name );
    break;
  case TOOMANY_ERR:
    fprintf(my_stderr,"Global symbol memory exhausted\n");
    break;
  case LTOOMANY_ERR:
    fprintf(my_stderr,"Local symbol memory exhausted\n");
    break;
  case LMTOOMANY_ERR:
    fprintf(my_stderr,"Local-macro symbol memory exhausted\n");
    break;
  case MTOOMANY_ERR:
    fprintf(my_stderr,"Macro-name memory exhausted\n");
    break;
  case UNKNOWN_ERR:
    fprintf(my_stderr,"Unknown opcode : (%s)\n",s);
    break;
  case TOOBIG_ERR:
    fprintf(my_stderr,"Constant to big\n");
    break;
  case EXPR_ERR:
    fprintf(my_stderr,"Error in expression\n");
    break;
  case SYNTAX_ERR:
    if ( s ){
      fprintf(my_stderr,"Syntax Error:%s\n",s);
    } else {
      fprintf(my_stderr,"Syntax Error\n");
    }
    break;
  case NEEDCONST_ERR:
    fprintf(my_stderr,"%s needs constant expression\n",s);
    break;
  case MLABEL2_ERR:
    fprintf(my_stderr,"Only .\\label allowed inside a macro\n");
    break;
  case CODEMEM_ERR:
    fprintf(my_stderr,"Code-memory exhausted. Code > %dK\n",MAX_CODE_SIZE/1024);
    break;
  case DISTANCE_ERR:
    fprintf(my_stderr,"Relative distance to large\n");
    break;
  case NOREFMEM_ERR:
    fprintf(my_stderr,"No more reference-memory\n");
    break;
  case GARBAGE_ERR:
    fprintf(my_stderr,"Garbage at the end of line:'%s'\n",s);
    break;
  case MACRONESTED_ERR:
    fprintf(my_stderr,"Macro-definition nested to deep (max. 2)\n");
    break;
  case BYTE_ERR:
    fprintf(my_stderr,"Byte value out of range\n");
    break;
  case WORD_ERR:
    fprintf(my_stderr,"Word value out of range\n");
    break;
  case TYPE_ERR:
    fprintf(my_stderr,"Label-type mismatch\n");
    break;
  case UNSOLVED_ERR:
    fprintf(my_stderr,"Unsolved %s labels\n",s);
    break;
  case TOOMANYIF_ERR:
    fprintf(my_stderr,"To many nested IF\n");
    break;
  case ENDIF1_ERR:
    fprintf(my_stderr,"ENDIF without IF\n");
    break;
  case FAIL_ERR:
    break;
  case SWITCH_ERR:
    fprintf(my_stderr,"Nested SWITCH\n");
    break;
  case CASE_ERR:
    fprintf(my_stderr,"CASE without SWITCH\n");
    break;
  case DEFAULT_ERR:
    fprintf(my_stderr,"DEFAULT/ELSES without SWITCH\n");
    break;
  case ENDS_ERR:
    fprintf(my_stderr,"ENDS without SWITCH\n");
    break;
  case REPT1_ERR:
    fprintf(my_stderr,"Nested REPT\n");
    break;
  case REPT2_ERR:
    fprintf(my_stderr,"ENDR without REPT\n");
    break;
  case ISYMS_ERR:
    fprintf(my_stderr,"ISYMS only supported in the original Atari version!\n");
    break;
  case CMD_ERR:
    fprintf(my_stderr,"Error in command-line\n");
    break;
  case WRITE_ERR:
    fprintf(my_stderr,"Could not write :%s\n",s);
    break;
  case LOAD_ERR:
    fprintf(my_stderr,"LoadBuffer not big enough for :%s\n",s);
    break;
  case IMM_ERR:
    fprintf(my_stderr,"Quick immediate value out of range (%s)!\n",s);
    break;
  case REG_ERR:
    if ( s ) {
      fprintf(my_stderr,"Missing Register:%s\n",s);
    } else {
      fprintf(my_stderr,"Missing Register\n");
    }
    break;
  case REG1_ERR:
    fprintf(my_stderr,"Redefining register-symbol\n");
    break;
  case MISC_ERR:
    fprintf(my_stderr,"%s\n",s);
    break;
  }

  if ( !verbose) verbose=1;
  killLine();

  if ( fatal ){
    fprintf(stderr,"leaving ...\n");
    exit(1);
  }
  return err_num;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl %edi, %edx
negl %edx
movl %edi, %r15d
cmovnsl %edx, %r15d
leaq 0x133f8(%rip), %rax     # 0x1cae4
incl (%rax)
leaq 0xac9b(%rip), %rax      # 0x14390
incl (%rax)
testl %edi, %edi
js 0x97f1
leaq 0xaf02(%rip), %rax      # 0x14608
movslq 0x4(%rax), %rcx
testq %rcx, %rcx
js 0x97be
movl 0x10(%rax), %r8d
testl %r8d, %r8d
setne %dl
cmpl $0x20, %r15d
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x977e
leaq 0xaec3(%rip), %rdx      # 0x145f8
movq (%rdx), %rdi
imulq $0x204, %rcx, %rcx      # imm = 0x204
leaq 0xb09a(%rip), %rsi      # 0x147e0
leaq (%rsi,%rcx), %rdx
addq $0x4, %rdx
movl (%rax), %ecx
movslq 0x14(%rax), %rax
imulq $0x204, %rax, %rax      # imm = 0x204
leaq (%rsi,%rax), %r9
addq $0x4, %r9
leaq 0x136b6(%rip), %rax     # 0x1ce20
movq %rax, (%rsp)
leaq 0x2e54(%rip), %rsi      # 0xc5c9
xorl %eax, %eax
callq 0x3130
jmp 0x97be
cmpl $0x20, %r15d
je 0x9c82
leaq 0xae69(%rip), %rdx      # 0x145f8
movq (%rdx), %rdi
imulq $0x204, %rcx, %rcx      # imm = 0x204
leaq 0xb040(%rip), %rdx      # 0x147e0
addq %rcx, %rdx
addq $0x4, %rdx
movl (%rax), %ecx
leaq 0x2e41(%rip), %rsi      # 0xc5f1
leaq 0x13669(%rip), %r8      # 0x1ce20
xorl %eax, %eax
callq 0x3130
decl %r15d
cmpl $0x2d, %r15d
ja 0x9c82
leaq 0x2d2e(%rip), %rax      # 0xc500
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xae16(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2e1a(%rip), %rdi      # 0xc606
jmp 0x9c77
movq 0x97f8(%rip), %rax      # 0x12ff0
movq (%rax), %rdi
leaq 0x2db6(%rip), %rsi      # 0xc5b8
xorl %eax, %eax
callq 0x3130
jmp 0x96ff
leaq 0xade3(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x3245(%rip), %rsi      # 0xca64
jmp 0x9c4f
leaq 0xadcd(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x319d(%rip), %rdi      # 0xc9d2
jmp 0x9bc5
leaq 0xadb7(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x321d(%rip), %rsi      # 0xca68
jmp 0x9c4f
leaq 0xada1(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x31f2(%rip), %rsi      # 0xca53
jmp 0x9c4f
leaq 0xad8b(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x3190(%rip), %rdi      # 0xca07
pushq $0x34
jmp 0x9c79
leaq 0xad73(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x30b3(%rip), %rdi      # 0xc942
jmp 0x9bc5
leaq 0xad5d(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2fa2(%rip), %rdi      # 0xc847
jmp 0x998e
leaq 0xad47(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2e91(%rip), %rdi      # 0xc74c
pushq $0x1f
jmp 0x9c79
leaq 0xad2f(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x3114(%rip), %rdi      # 0xc9e7
pushq $0xc
jmp 0x9c79
leaq 0xad17(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2fc0(%rip), %rdi      # 0xc8ab
jmp 0x9b4d
leaq 0xad01(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x2ecc(%rip), %rsi      # 0xc7cd
jmp 0x9c4f
leaq 0xaceb(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x3012(%rip), %rdi      # 0xc929
jmp 0x9b65
leaq 0xacd5(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2fb9(%rip), %rdi      # 0xc8e6
pushq $0x29
jmp 0x9c79
leaq 0xacbd(%rip), %rax      # 0x145f8
movq (%rax), %rdi
movl 0x10(%r14), %edx
movslq 0x14(%r14), %rax
imulq $0x204, %rax, %rax      # imm = 0x204
leaq 0xae8c(%rip), %rcx      # 0x147e0
addq %rax, %rcx
addq $0x4, %rcx
leaq 0x2d49(%rip), %rsi      # 0xc6ab
jmp 0x9a39
leaq 0xac8a(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x3113(%rip), %rsi      # 0xca8b
jmp 0x9c4f
leaq 0xac74(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2dfd(%rip), %rdi      # 0xc78b
pushq $0x24
jmp 0x9c79
leaq 0xac5c(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2fc5(%rip), %rdi      # 0xc96b
jmp 0x9bdd
leaq 0xac46(%rip), %rax      # 0x145f8
movq (%rax), %rdi
movl 0x10(%r14), %edx
movslq 0x14(%r14), %rax
imulq $0x204, %rax, %rax      # imm = 0x204
leaq 0xae15(%rip), %rcx      # 0x147e0
addq %rax, %rcx
addq $0x4, %rcx
leaq 0x2d40(%rip), %rsi      # 0xc719
jmp 0x9a39
leaq 0xac16(%rip), %rax      # 0x145f8
movq (%rax), %rdi
movl 0x10(%r14), %edx
movslq 0x14(%r14), %rax
imulq $0x204, %rax, %rax      # imm = 0x204
leaq 0xade5(%rip), %rcx      # 0x147e0
addq %rax, %rcx
addq $0x4, %rcx
leaq 0x2c74(%rip), %rsi      # 0xc67d
jmp 0x9a39
leaq 0xabe6(%rip), %rax      # 0x145f8
movq (%rax), %rdi
movl 0x10(%r14), %edx
movslq 0x14(%r14), %rax
imulq $0x204, %rax, %rax      # imm = 0x204
leaq 0xadb5(%rip), %rcx      # 0x147e0
addq %rax, %rcx
addq $0x4, %rcx
leaq 0x2ca6(%rip), %rsi      # 0xc6df
xorl %eax, %eax
callq 0x3130
jmp 0x9c82
leaq 0xabac(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2bf2(%rip), %rdi      # 0xc648
pushq $0x1a
jmp 0x9c79
leaq 0xab94(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2f10(%rip), %rdi      # 0xc97e
jmp 0x9c77
leaq 0xab7e(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2f1b(%rip), %rdi      # 0xc99f
jmp 0x9bc5
leaq 0xab68(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x2e2b(%rip), %rsi      # 0xc8c5
jmp 0x9c4f
leaq 0xab52(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2bb3(%rip), %rdi      # 0xc663
jmp 0x9b4d
leaq 0xab3c(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2cea(%rip), %rdi      # 0xc7b0
pushq $0x1c
jmp 0x9c79
leaq 0xab24(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x2d8e(%rip), %rsi      # 0xc86c
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x3130
jmp 0x9c82
leaq 0xab02(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2c6c(%rip), %rdi      # 0xc76c
pushq $0x1e
jmp 0x9c79
leaq 0xaaea(%rip), %rax      # 0x145f8
movq (%rax), %rcx
testq %r14, %r14
je 0x9c70
leaq 0x2f94(%rip), %rsi      # 0xcab5
jmp 0x9c11
leaq 0xaacb(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x2ae1(%rip), %rsi      # 0xc618
jmp 0x9c4f
leaq 0xaab5(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2ae1(%rip), %rdi      # 0xc62e
pushq $0x19
jmp 0x9c79
leaq 0xaa9d(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2dab(%rip), %rdi      # 0xc910
pushq $0x18
jmp 0x9c79
leaq 0xaa85(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2ebf(%rip), %rdi      # 0xca3c
pushq $0x16
jmp 0x9c79
leaq 0xaa6d(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2dfb(%rip), %rdi      # 0xc990
pushq $0xe
jmp 0x9c79
leaq 0xaa55(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2c37(%rip), %rdi      # 0xc7e4
pushq $0x10
jmp 0x9c79
leaq 0xaa3d(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2c30(%rip), %rdi      # 0xc7f5
pushq $0x14
jmp 0x9c79
leaq 0xaa25(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2e17(%rip), %rdi      # 0xc9f4
pushq $0x12
jmp 0x9c79
leaq 0xaa0d(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x2c34(%rip), %rsi      # 0xc829
jmp 0x9c4f
leaq 0xa9fa(%rip), %rax      # 0x145f8
movq (%rax), %rcx
testq %r14, %r14
je 0x9ca9
leaq 0x2bf9(%rip), %rsi      # 0xc80a
movq %rcx, %rdi
jmp 0x9c4f
leaq 0xa9db(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2eb5(%rip), %rdi      # 0xcadc
jmp 0x9c3a
leaq 0xa9c8(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2c55(%rip), %rdi      # 0xc88f
pushq $0x1b
jmp 0x9c79
leaq 0xa9b3(%rip), %rax      # 0x145f8
movq (%rax), %rdi
leaq 0x2d08(%rip), %rsi      # 0xc957
movq %r14, %rdx
xorl %eax, %eax
callq 0x3130
jmp 0x9c82
leaq 0xa996(%rip), %rax      # 0x145f8
movq (%rax), %rcx
leaq 0x2d48(%rip), %rdi      # 0xc9b4
pushq $0x1d
jmp 0x9c79
leaq 0x2e53(%rip), %rdi      # 0xcaca
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x31d0
leaq 0xa6f3(%rip), %rax      # 0x1437c
cmpl $0x0, (%rax)
jne 0x9c94
movl $0x1, (%rax)
callq 0x4e3f
testl %ebx, %ebx
js 0x9cb4
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2b6b(%rip), %rdi      # 0xc81b
pushq $0xd
jmp 0x9c79
movq 0x9335(%rip), %rax      # 0x12ff0
movq (%rax), %rcx
leaq 0x2e33(%rip), %rdi      # 0xcaf8
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
callq 0x31d0
pushq $0x1
popq %rdi
callq 0x31c0