// File: pfnet-research[P]pml/src/parser.cpp
// Function: parser::simple_type(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
result_t<logic::domain_kind_t> simple_type(std::string const& input, size_t& pos) {
    auto sty_result = expect_token(input, pos, token_t::kind_t::Ident);
    if (sty_result.is_error())
        return sty_result.convert<logic::domain_kind_t>();
    auto sty = sty_result.ok();
    pos = sty.pos + sty.lexime.size();

    if (sty.lexime == "int")
        return result_t<logic::domain_kind_t>::ok(logic::domain_kind_t::Int);
    else if (sty.lexime == "bool")
        return result_t<logic::domain_kind_t>::ok(logic::domain_kind_t::Bool);
    else
        return result_t<logic::domain_kind_t>::error(error_t {
                error_t::kind_t::UnexpectedToken, pos,
                "expected was 'int' or 'bool', but coming is " + sty.lexime
                });
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xe8(%rbp)
movq %rdi, %rax
movq %rax, -0xe0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0x50(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
movl $0xa, %ecx
callq 0x364d0
movq -0xd8(%rbp), %rdi
callq 0x40510
movb %al, -0xc9(%rbp)
jmp 0x3983c
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x39848
jmp 0x39877
movq -0xe8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x40fe0
jmp 0x3985a
movl $0x1, -0x60(%rbp)
jmp 0x39a0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x39a26
leaq -0x50(%rbp), %rdi
callq 0x40630
movq %rax, -0xf0(%rbp)
jmp 0x39889
movq -0xf0(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x406b0
jmp 0x3989e
movq -0x88(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0xa280
movq -0x108(%rbp), %rcx
movq -0x100(%rbp), %rdi
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
leaq 0x6652e(%rip), %rsi     # 0x9fe09
callq 0xbdb0
movb %al, -0xf1(%rbp)
jmp 0x398e8
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x398f4
jmp 0x39930
movq -0xe8(%rbp), %rdi
movl $0x0, -0x94(%rbp)
leaq -0x94(%rbp), %rsi
callq 0x41020
jmp 0x39913
movl $0x1, -0x60(%rbp)
jmp 0x399f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x399ff
leaq -0x80(%rbp), %rdi
leaq 0x66439(%rip), %rsi     # 0x9fd74
callq 0xbdb0
movb %al, -0x109(%rbp)
jmp 0x39948
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x39954
jmp 0x3997c
movq -0xe8(%rbp), %rdi
movl $0x1, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x41020
jmp 0x39973
movl $0x1, -0x60(%rbp)
jmp 0x399f1
movl $0x1, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x80(%rbp), %rdx
leaq 0x63119(%rip), %rsi     # 0x9cabf
callq 0x1dee0
jmp 0x399ad
movq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x410a0
jmp 0x399c2
leaq -0xc8(%rbp), %rdi
callq 0x30020
movl $0x1, -0x60(%rbp)
jmp 0x399f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x30020
jmp 0x399ff
leaq -0x90(%rbp), %rdi
callq 0x404f0
jmp 0x39a0d
leaq -0x90(%rbp), %rdi
callq 0x404f0
jmp 0x39a26
leaq -0x50(%rbp), %rdi
callq 0x407c0
movq -0xe0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x407c0
movq -0x58(%rbp), %rdi
callq 0xa650
nopl (%rax,%rax)