// File: /workspace/github_cpp_makefile_star2_O1/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 0x15480
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x2f6e4
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x341fb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xf380
movq %r14, 0x592be(%rip)     # 0x8d4c0
leaq 0x35bd9(%rip), %rsi     # 0x69de2
movq %r15, %rdi
callq 0xf440
leaq 0x592d0(%rip), %r12     # 0x8d4e8
movq %rax, (%r12)
testq %rax, %rax
je 0x34298
callq 0x37734
movl %eax, %ebp
movq (%r12), %rdi
callq 0xf360
testl %ebp, %ebp
jne 0x3424b
movq %r14, %rdi
callq 0x2f274
cmpl $0x0, 0x358(%r14)
je 0x34329
movq 0x58d96(%rip), %rbx     # 0x8cfe8
leaq 0x2e8cb(%rip), %rsi     # 0x62b24
movl $0x12, %edx
movq %rbx, %rdi
callq 0xf420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq 0x58d64(%rip), %rdi     # 0x8cfe8
callq 0xf040
movl $0x2, %ebx
movq %rax, %rdi
callq 0xf260
jmp 0x34317
movq 0x58d49(%rip), %rbx     # 0x8cfe8
leaq 0x2e847(%rip), %rsi     # 0x62aed
movl $0x19, %edx
movq %rbx, %rdi
callq 0xf420
testq %r15, %r15
je 0x342d4
movq %r15, %rdi
callq 0xf190
movq 0x58d21(%rip), %rdi     # 0x8cfe8
movq %r15, %rsi
movq %rax, %rdx
callq 0xf420
jmp 0x342eb
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0xf6c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xf340
movsbl %al, %esi
movq %rbx, %rdi
callq 0xf040
movq %rax, %rdi
callq 0xf260
movl $0x2, %ebx
movl %ebx, %eax
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movl $0x10, %edx
callq 0xf3f0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
jne 0x343a0
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x28716
leaq 0x28(%rsp), %rdi
callq 0xf560
movq 0x58c37(%rip), %rax     # 0x8cfa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0xf2f0
leaq 0x120(%rsp), %rdi
callq 0xf150
xorl %ebx, %ebx
callq 0x47ad5
jmp 0x34317
leaq 0x228(%rsp), %rdi
callq 0xf530
leaq 0x2e753(%rip), %rsi     # 0x62b07
leaq 0x228(%rsp), %rdi
movl $0x1c, %edx
callq 0xf420
leaq 0x228(%rsp), %rdi
movq %rbx, %rsi
callq 0xf350
movl $0x20, %edi
callq 0xf1b0
movq %rax, %r15
leaq 0x230(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xf640
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x117dc
xorl %ebp, %ebp
leaq 0x560a2(%rip), %rsi     # 0x8a4b0
leaq -0x22bf5(%rip), %rdx    # 0x11820
movq %r15, %rdi
callq 0xf6d0
movq %rdx, %r14
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34449
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xf380
jmp 0x34449
movq %rdx, %r14
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3445e
movq %r15, %rdi
callq 0xf290
jmp 0x3445e
movq %rdx, %r14
movq %rax, %rbx
movq 0x58b53(%rip), %rsi     # 0x8cfb8
leaq 0x228(%rsp), %rdi
callq 0xf1e0
leaq 0x298(%rsp), %rdi
callq 0xf150
jmp 0x3448b
jmp 0x34485
jmp 0x344c2
movq %rdx, %r14
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xf5a0
jmp 0x344c8
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x344ba
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xf380
jmp 0x344ba
movq %rax, %rbx
movq %rbx, %rdi
callq 0xf730
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x344ba
movq %rbx, %rdi
callq 0xf180
movq %rax, %rbx
movq 0x58b08(%rip), %rdi     # 0x8cfe8
leaq 0x2e650(%rip), %rsi     # 0x62b37
movl $0x15, %edx
callq 0xf420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x58ae9(%rip), %rdi     # 0x8cfe8
callq 0xf420
movq %rax, %rdi
callq 0xf1a0
callq 0xf680
jmp 0x34312
movq %rax, %rbx
callq 0xf680
jmp 0x344ba
movq %rax, %rdi
callq 0x13ad1