// File: /workspace/github_cpp_makefile_star2_O2/jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: run_compilation(char const*, char const*, SleighCompile&)
static int4 run_compilation(const char *filein,const char *fileout,SleighCompile &compiler)

{
  compiler.parseFromNewFile(filein);
  slgh = &compiler;		// Set global pointer up for parser
  yyin = fopen(filein,"r");	// Open the file for the lexer
  if (yyin == (FILE *)0) {
    cerr << "Unable to open specfile: " << filein << endl;
    return 2;
  }

  try {
    int4 parseres = yyparse();	// Try to parse
    fclose(yyin);
    if (parseres==0)
      compiler.process();	// Do all the post-processing
    if ((parseres==0)&&(compiler.numErrors()==0)) { // If no errors
      ofstream s(fileout);
      if (!s) {
	ostringstream errs;
	errs << "Unable to open output file: " << fileout;
	throw SleighError(errs.str());
      }
      compiler.saveXml(s);	// Dump output xml
      s.close();
    }
    else {
      cerr << "No output produced" <<endl;
      return 2;
    }
    yylex_destroy();		// Make sure lexer is reset so we can parse multiple files
  } catch(LowlevelError &err) {
    cerr << "Unrecoverable error: " << err.explain << endl;
    return 2;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x28(%rsp), %rdi
leaq 0x228(%rsp), %rdx
movq %r15, %rsi
callq 0x10c3a
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x2ae86
leaq 0x28(%rsp), %rdi
callq 0xf1a0
movq %r14, 0x59d7f(%rip)     # 0x884c0
leaq 0x3066a(%rip), %rsi     # 0x5edb2
movq %r15, %rdi
callq 0xf420
leaq 0x59d91(%rip), %r12     # 0x884e8
movq %rax, (%r12)
testq %rax, %rax
je 0x2e7a3
callq 0x32464
movl %eax, %ebp
movq (%r12), %rdi
callq 0xf360
testl %ebp, %ebp
jne 0x2e786
movq %r14, %rdi
callq 0x2aaf2
cmpl $0x0, 0x358(%r14)
je 0x2e7de
movq 0x59863(%rip), %rdi     # 0x87ff0
leaq 0x293b0(%rip), %rsi     # 0x57b44
callq 0xf350
movq %rax, %rdi
callq 0xf1c0
jmp 0x2e7c9
movq 0x59846(%rip), %rdi     # 0x87ff0
leaq 0x2935c(%rip), %rsi     # 0x57b0d
callq 0xf350
movq %rax, %rdi
movq %r15, %rsi
callq 0xf350
movq %rax, %rdi
callq 0xf1c0
pushq $0x2
popq %rbx
movl %ebx, %eax
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%rsp), %rdi
pushq $0x10
popq %rdx
movq %rbx, %rsi
callq 0xf3e0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
jne 0x2e828
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x25742
leaq 0x28(%rsp), %rdi
callq 0xf560
leaq 0x28(%rsp), %rdi
callq 0xf590
xorl %ebx, %ebx
callq 0x40071
jmp 0x2e7cc
leaq 0x228(%rsp), %rdi
callq 0xf520
leaq 0x292eb(%rip), %rsi     # 0x57b27
leaq 0x228(%rsp), %rdi
callq 0xf350
movq %rax, %rdi
movq %rbx, %rsi
callq 0xf350
pushq $0x20
popq %rdi
callq 0xf1d0
movq %rax, %r15
leaq 0x230(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xf610
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x10d48
xorl %ebp, %ebp
leaq 0x56b86(%rip), %rsi     # 0x85410
leaq -0x1db11(%rip), %rdx    # 0x10d80
movq %r15, %rdi
callq 0xf690
movq %rdx, %r14
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xf1a0
testb %bpl, %bpl
jne 0x2e8b6
jmp 0x2e8c6
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0xf2a0
jmp 0x2e8c6
movq %rdx, %r14
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0xf0e0
jmp 0x2e8df
jmp 0x2e8d9
jmp 0x2e905
movq %rdx, %r14
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xf590
jmp 0x2e90b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xf1a0
jmp 0x2e8fd
movq %rax, %rbx
movq %rbx, %rdi
callq 0xf6e0
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x2e8fd
movq %rbx, %rdi
callq 0xf170
movq %rax, %rbx
movq 0x596cd(%rip), %rdi     # 0x87ff0
leaq 0x2922d(%rip), %rsi     # 0x57b57
callq 0xf350
movq %rax, %rdi
movq %rbx, %rsi
callq 0xf320
movq %rax, %rdi
callq 0xf1c0
callq 0xf650
jmp 0x2e7c9
movq %rax, %rbx
callq 0xf650
jmp 0x2e8fd
movq %rax, %rdi
callq 0x1178d