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

{
  ifstream s(filein);
  Document *doc;
  string specfileout;
  string specfilein;

  try {
    doc = xml_tree(s);
  }
  catch(XmlError &err) {
    cerr << "Unable to parse single input file as XML spec: " << filein << endl;
    exit(1);
  }
  s.close();

  Element *el = doc->getRoot();
  for(;;) {
    const List &list(el->getChildren());
    List::const_iterator iter;
    for(iter=list.begin();iter!=list.end();++iter) {
      el = *iter;
      if (el->getName() == "processorfile") {
	specfileout = el->getContent();
	int4 num = el->getNumAttributes();
	for(int4 i=0;i<num;++i) {
	  if (el->getAttributeName(i)=="slaspec")
	    specfilein = el->getAttributeValue(i);
	  else {
	    compiler.setPreprocValue(el->getAttributeName(i),el->getAttributeValue(i));
	  }
	}
      }
      else if (el->getName() == "language_spec")
	break;
      else if (el->getName() == "language_description")
	break;
    }
    if (iter==list.end()) break;
  }
  delete doc;

  if (specfilein.size() == 0) {
    cerr << "Input slaspec file was not specified in " << filein << endl;
    exit(1);
  }
  if (specfileout.size() == 0) {
    cerr << "Output sla file was not specified in " << filein << endl;
    exit(1);
  }
  return run_compilation(specfilein.c_str(),specfileout.c_str(),compiler);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
movl $0x8, %edx
callq 0x118f0
leaq -0x240(%rbp), %rdi
callq 0x11700
leaq -0x260(%rbp), %rdi
callq 0x11700
movq -0x2c0(%rbp), %rdi
callq 0xcfb90
movq %rax, -0x2b8(%rbp)
jmp 0x69a6c
movq -0x2b8(%rbp), %rax
movq %rax, -0x220(%rbp)
jmp 0x69b29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
movl -0x26c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x69fc9
movq -0x268(%rbp), %rdi
callq 0x111e0
movq %rax, -0x278(%rbp)
movq 0xc852a(%rip), %rdi     # 0x131fe8
leaq 0x702a0(%rip), %rsi     # 0xd9d65
callq 0x11420
movq %rax, -0x2c8(%rbp)
jmp 0x69ad3
movq -0x2c8(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x11420
movq %rax, -0x2d0(%rbp)
jmp 0x69aec
movq -0x2d0(%rbp), %rdi
movq 0xc84a6(%rip), %rsi     # 0x131fa0
callq 0x114a0
jmp 0x69b01
movl $0x1, %edi
callq 0x115b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
callq 0x11810
jmp 0x69b24
jmp 0x69fc9
leaq -0x218(%rbp), %rdi
callq 0x110e0
jmp 0x69b37
movq -0x220(%rbp), %rdi
callq 0x71f80
movq %rax, -0x2d8(%rbp)
jmp 0x69b4c
movq -0x2d8(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rdi
callq 0x14cf0
movq %rax, -0x2e0(%rbp)
jmp 0x69b6f
movq -0x2e0(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x14d10
movq -0x288(%rbp), %rdi
callq 0x14d30
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x288(%rbp), %rdi
callq 0x14da0
movq %rax, -0x2a0(%rbp)
leaq -0x290(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x14d60
testb $0x1, %al
jne 0x69bd9
jmp 0x69e2c
leaq -0x290(%rbp), %rdi
callq 0x14dd0
movq (%rax), %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rdi
callq 0x28c60
movq %rax, -0x2e8(%rbp)
jmp 0x69c04
movq -0x2e8(%rbp), %rdi
leaq 0x70183(%rip), %rsi     # 0xd9d95
callq 0x14500
movb %al, -0x2e9(%rbp)
jmp 0x69c1f
movb -0x2e9(%rbp), %al
testb $0x1, %al
jne 0x69c2e
jmp 0x69d99
movq -0x280(%rbp), %rdi
callq 0x71fb0
movq %rax, -0x2f8(%rbp)
jmp 0x69c43
movq -0x2f8(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0x11050
jmp 0x69c58
movq -0x280(%rbp), %rdi
callq 0x144e0
movl %eax, -0x2fc(%rbp)
jmp 0x69c6c
movl -0x2fc(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movl $0x0, -0x2a8(%rbp)
movl -0x2a8(%rbp), %eax
cmpl -0x2a4(%rbp), %eax
jge 0x69d94
movq -0x280(%rbp), %rdi
movl -0x2a8(%rbp), %esi
callq 0x14530
movq %rax, -0x308(%rbp)
jmp 0x69caf
movq -0x308(%rbp), %rdi
leaq 0x6ffbd(%rip), %rsi     # 0xd9c7a
callq 0x14500
movb %al, -0x309(%rbp)
jmp 0x69cca
movb -0x309(%rbp), %al
testb $0x1, %al
jne 0x69cd6
jmp 0x69d1f
movq -0x280(%rbp), %rdi
movl -0x2a8(%rbp), %esi
callq 0x14560
movq %rax, -0x318(%rbp)
jmp 0x69cf1
movq -0x318(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x11050
jmp 0x69d06
jmp 0x69d7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
jmp 0x69fc9
movq -0x10(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x280(%rbp), %rdi
movl -0x2a8(%rbp), %esi
callq 0x14530
movq %rax, -0x320(%rbp)
jmp 0x69d45
movq -0x280(%rbp), %rdi
movl -0x2a8(%rbp), %esi
callq 0x14560
movq %rax, -0x330(%rbp)
jmp 0x69d60
movq -0x330(%rbp), %rdx
movq -0x320(%rbp), %rsi
movq -0x328(%rbp), %rdi
callq 0x63ac0
jmp 0x69d7c
jmp 0x69d7e
jmp 0x69d80
movl -0x2a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a8(%rbp)
jmp 0x69c82
jmp 0x69e19
movq -0x280(%rbp), %rdi
callq 0x28c60
movq %rax, -0x338(%rbp)
jmp 0x69dae
movq -0x338(%rbp), %rdi
leaq 0x6ffe7(%rip), %rsi     # 0xd9da3
callq 0x14500
movb %al, -0x339(%rbp)
jmp 0x69dc9
movb -0x339(%rbp), %al
testb $0x1, %al
jne 0x69dd5
jmp 0x69dd7
jmp 0x69e2c
movq -0x280(%rbp), %rdi
callq 0x28c60
movq %rax, -0x348(%rbp)
jmp 0x69dec
movq -0x348(%rbp), %rdi
leaq 0x6ffb7(%rip), %rsi     # 0xd9db1
callq 0x14500
movb %al, -0x349(%rbp)
jmp 0x69e07
movb -0x349(%rbp), %al
testb $0x1, %al
jne 0x69e13
jmp 0x69e15
jmp 0x69e2c
jmp 0x69e17
jmp 0x69e19
jmp 0x69e1b
leaq -0x290(%rbp), %rdi
callq 0x14e50
jmp 0x69baa
movq -0x288(%rbp), %rdi
callq 0x14da0
movq %rax, -0x2b0(%rbp)
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x71fd0
testb $0x1, %al
jne 0x69e58
jmp 0x69e5a
jmp 0x69e5f
jmp 0x69b5a
movq -0x220(%rbp), %rax
movq %rax, -0x358(%rbp)
cmpq $0x0, %rax
je 0x69e90
movq -0x358(%rbp), %rdi
callq 0x72010
movq -0x358(%rbp), %rdi
movl $0x90, %esi
callq 0x11450
leaq -0x260(%rbp), %rdi
callq 0x11340
cmpq $0x0, %rax
jne 0x69ef6
movq 0xc813f(%rip), %rdi     # 0x131fe8
leaq 0x6ff16(%rip), %rsi     # 0xd9dc6
callq 0x11420
movq %rax, -0x360(%rbp)
jmp 0x69ebe
movq -0x360(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x11420
movq %rax, -0x368(%rbp)
jmp 0x69ed7
movq -0x368(%rbp), %rdi
movq 0xc80bb(%rip), %rsi     # 0x131fa0
callq 0x114a0
jmp 0x69eec
movl $0x1, %edi
callq 0x115b0
leaq -0x240(%rbp), %rdi
callq 0x11340
cmpq $0x0, %rax
jne 0x69f5c
movq 0xc80d9(%rip), %rdi     # 0x131fe8
leaq 0x6fed9(%rip), %rsi     # 0xd9def
callq 0x11420
movq %rax, -0x370(%rbp)
jmp 0x69f24
movq -0x370(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x11420
movq %rax, -0x378(%rbp)
jmp 0x69f3d
movq -0x378(%rbp), %rdi
movq 0xc8055(%rip), %rsi     # 0x131fa0
callq 0x114a0
jmp 0x69f52
movl $0x1, %edi
callq 0x115b0
leaq -0x260(%rbp), %rdi
callq 0x111f0
movq %rax, -0x388(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x111f0
movq -0x388(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
callq 0x695f0
movl %eax, -0x37c(%rbp)
jmp 0x69f96
leaq -0x260(%rbp), %rdi
callq 0x11300
leaq -0x240(%rbp), %rdi
callq 0x11300
leaq -0x218(%rbp), %rdi
callq 0x11130
movl -0x37c(%rbp), %eax
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
leaq -0x260(%rbp), %rdi
callq 0x11300
leaq -0x240(%rbp), %rdi
callq 0x11300
leaq -0x218(%rbp), %rdi
callq 0x11130
movq -0x268(%rbp), %rdi
callq 0x118b0
movq %rax, %rdi
callq 0x15590
nopw %cs:(%rax,%rax)