// File: jstaursky[P]hutch/src/hutch.cpp
// Function: Hutch::preconfigure(int)
void Hutch::preconfigure (int4 cpu_arch)
{
    this->arch = cpu_arch;
    switch (cpu_arch) {
    case IA32:
        docname    = "../../processors/x86/languages/x86.sla";
        cpucontext = { { "addrsize", 1 }, { "opsize", 1 } };

        break;
    default:
        // IA32 is default.
        cpucontext = { { "addrsize", 1 }, { "opsize", 1 } };
        break;
    }

    Element* ast_root = docstorage.openDocument (this->docname)->getRoot ();
    docstorage.registerTag (ast_root);
}

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x190(%rsp)
movl %esi, 0x18c(%rsp)
movq 0x190(%rsp), %rax
movq %rax, 0x88(%rsp)
movl 0x18c(%rsp), %ecx
movl %ecx, 0x20(%rax)
movl 0x18c(%rsp), %eax
testl %eax, %eax
jne 0x170c87
jmp 0x170ad1
movq 0x88(%rsp), %rdi
leaq 0x1982d(%rip), %rsi     # 0x18a30d
callq 0xdc010
leaq 0x128(%rsp), %rdi
movq %rdi, 0x120(%rsp)
movl $0x1, 0x11c(%rsp)
leaq 0x1982d(%rip), %rsi     # 0x18a334
leaq 0x11c(%rsp), %rdx
callq 0xd3860
jmp 0x170b16
leaq 0x150(%rsp), %rdi
movq %rdi, 0x120(%rsp)
movl $0x1, 0x108(%rsp)
leaq 0x19805(%rip), %rsi     # 0x18a33d
leaq 0x108(%rsp), %rdx
callq 0xdd760
jmp 0x170b47
movq 0x88(%rsp), %rdi
leaq 0x128(%rsp), %rax
movq %rax, 0x178(%rsp)
movq $0x2, 0x180(%rsp)
addq $0x150, %rdi            # imm = 0x150
movq 0x178(%rsp), %rsi
movq 0x180(%rsp), %rdx
callq 0xd9640
jmp 0x170b89
leaq 0x128(%rsp), %rax
movq %rax, 0x78(%rsp)
addq $0x50, %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x70(%rsp)
callq 0xd4f90
movq 0x78(%rsp), %rcx
movq 0x70(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x80(%rsp)
jne 0x170ba2
jmp 0x170e1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
movq 0x120(%rsp), %rax
leaq 0x128(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x68(%rsp)
je 0x170c2c
movq 0x68(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x60(%rsp)
callq 0xd4f90
movq 0x60(%rsp), %rax
leaq 0x128(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x68(%rsp)
jne 0x170c02
jmp 0x170e62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x128(%rsp), %rax
movq %rax, 0x50(%rsp)
addq $0x50, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x48(%rsp)
callq 0xd4f90
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x58(%rsp)
jne 0x170c5b
jmp 0x170e62
leaq 0xa8(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
movl $0x1, 0x9c(%rsp)
leaq 0x1968b(%rip), %rsi     # 0x18a334
leaq 0x9c(%rsp), %rdx
callq 0xd3860
jmp 0x170cb8
leaq 0xd0(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
movl $0x1, 0x98(%rsp)
leaq 0x19663(%rip), %rsi     # 0x18a33d
leaq 0x98(%rsp), %rdx
callq 0xdd760
jmp 0x170ce9
movq 0x88(%rsp), %rdi
leaq 0xa8(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq $0x2, 0x100(%rsp)
addq $0x150, %rdi            # imm = 0x150
movq 0xf8(%rsp), %rsi
movq 0x100(%rsp), %rdx
callq 0xd9640
jmp 0x170d2b
leaq 0xa8(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x50, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x30(%rsp)
callq 0xd4f90
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0x170d41
jmp 0x170e1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
movq 0xa0(%rsp), %rax
leaq 0xa8(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x170dc5
movq 0x28(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x20(%rsp)
callq 0xd4f90
movq 0x20(%rsp), %rax
leaq 0xa8(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x170d9b
jmp 0x170e62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x50, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x8(%rsp)
callq 0xd4f90
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x170df4
jmp 0x170e62
movq 0x88(%rsp), %rsi
movq %rsi, %rdi
addq $0x28, %rdi
callq 0xd9650
movq %rax, %rdi
callq 0xdd420
movq 0x88(%rsp), %rdi
movq %rax, 0x90(%rsp)
addq $0x28, %rdi
movq 0x90(%rsp), %rsi
callq 0xd6d30
addq $0x198, %rsp            # imm = 0x198
retq
movq 0x110(%rsp), %rdi
callq 0xe0be0
nop