// File: CastellanZhang[P]lambdaFM/lambdafm_predict.cpp
// Function: parse_option(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
Option parse_option(const vector<string>& args)
{
    int argc = args.size();
    if(0 == argc) 
        throw invalid_argument("invalid command\n");
    Option opt;

    for(int i = 0; i < argc; ++i) 
    {
        if(args[i].compare("-m") == 0) 
        {
            if(i == argc - 1)
                throw invalid_argument("invalid command\n");
            opt.model_path = args[++i];
        }
        else if(args[i].compare("-dim") == 0)
        {
            if(i == argc - 1)
                throw invalid_argument("invalid command\n");
            opt.dim = stoi(args[++i]);
        }
        else if(args[i].compare("-core") == 0)
        {
            if(i == argc - 1)
                throw invalid_argument("invalid command\n");
            opt.threads_num = stoi(args[++i]);
        }
        else if(args[i].compare("-out") == 0)
        {
            if(i == argc - 1)
                throw invalid_argument("invalid command\n");
            opt.predict_path = args[++i];
        }
        else
        {
            break;
        }
    }
    return opt;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x38(%rsp)
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x5a20
movl %eax, 0x64(%rsp)
xorl %eax, %eax
cmpl 0x64(%rsp), %eax
jne 0x4b59
movl $0x10, %edi
callq 0x3170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x30(%rsp)
leaq 0xd60a(%rip), %rsi      # 0x12127
callq 0x3530
jmp 0x4b24
movq 0x30(%rsp), %rdi
movq 0x154a8(%rip), %rsi     # 0x19fd8
movq 0x15491(%rip), %rdx     # 0x19fc8
callq 0x34d0
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x3220
jmp 0x4ef0
movq 0x38(%rsp), %rdi
movb $0x0, 0x53(%rsp)
callq 0x6130
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
cmpl 0x64(%rsp), %eax
jge 0x4ec6
movq 0x68(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x6170
movq %rax, %rdi
leaq 0xd5a1(%rip), %rsi      # 0x12138
callq 0x30d0
cmpl $0x0, %eax
jne 0x4c4f
movl 0x4c(%rsp), %eax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4c24
movl $0x10, %edi
callq 0x3170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
leaq 0xd557(%rip), %rsi      # 0x12127
callq 0x3530
jmp 0x4bd7
movq 0x28(%rsp), %rdi
movq 0x153f5(%rip), %rsi     # 0x19fd8
movq 0x153de(%rip), %rdx     # 0x19fc8
callq 0x34d0
jmp 0x4efa
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x3220
jmp 0x4ee6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0x4ee6
movq 0x68(%rsp), %rdi
movl 0x4c(%rsp), %eax
incl %eax
movl %eax, 0x4c(%rsp)
movslq %eax, %rsi
callq 0x6170
movq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x3040
jmp 0x4c4a
jmp 0x4eb4
movq 0x68(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x6170
movq %rax, %rdi
leaq 0xd4d3(%rip), %rsi      # 0x1213b
callq 0x30d0
cmpl $0x0, %eax
jne 0x4d21
movl 0x4c(%rsp), %eax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4ce2
movl $0x10, %edi
callq 0x3170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x20(%rsp)
leaq 0xd486(%rip), %rsi      # 0x12127
callq 0x3530
jmp 0x4ca8
movq 0x20(%rsp), %rdi
movq 0x15324(%rip), %rsi     # 0x19fd8
movq 0x1530d(%rip), %rdx     # 0x19fc8
callq 0x34d0
jmp 0x4efa
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x3220
jmp 0x4ee6
movq 0x68(%rsp), %rdi
movl 0x4c(%rsp), %eax
incl %eax
movl %eax, 0x4c(%rsp)
movslq %eax, %rsi
callq 0x6170
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x6190
movl %eax, 0x1c(%rsp)
jmp 0x4d10
movq 0x38(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, 0x44(%rax)
jmp 0x4eb2
movq 0x68(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x6170
movq %rax, %rdi
leaq 0xd406(%rip), %rsi      # 0x12140
callq 0x30d0
cmpl $0x0, %eax
jne 0x4df3
movl 0x4c(%rsp), %eax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4db4
movl $0x10, %edi
callq 0x3170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0xd3b4(%rip), %rsi      # 0x12127
callq 0x3530
jmp 0x4d7a
movq 0x10(%rsp), %rdi
movq 0x15252(%rip), %rsi     # 0x19fd8
movq 0x1523b(%rip), %rdx     # 0x19fc8
callq 0x34d0
jmp 0x4efa
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x3220
jmp 0x4ee6
movq 0x68(%rsp), %rdi
movl 0x4c(%rsp), %eax
incl %eax
movl %eax, 0x4c(%rsp)
movslq %eax, %rsi
callq 0x6170
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x6190
movl %eax, 0xc(%rsp)
jmp 0x4de2
movq 0x38(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, 0x40(%rax)
jmp 0x4eb0
movq 0x68(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x6170
movq %rax, %rdi
leaq 0xd33a(%rip), %rsi      # 0x12146
callq 0x30d0
cmpl $0x0, %eax
jne 0x4eac
movl 0x4c(%rsp), %eax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4e80
movl $0x10, %edi
callq 0x3170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
leaq 0xd2e3(%rip), %rsi      # 0x12127
callq 0x3530
jmp 0x4e4b
movq (%rsp), %rdi
movq 0x15182(%rip), %rsi     # 0x19fd8
movq 0x1516b(%rip), %rdx     # 0x19fc8
callq 0x34d0
jmp 0x4efa
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x3220
jmp 0x4ee6
movq 0x68(%rsp), %rdi
movl 0x4c(%rsp), %eax
incl %eax
movl %eax, 0x4c(%rsp)
movslq %eax, %rsi
callq 0x6170
movq 0x38(%rsp), %rdi
movq %rax, %rsi
addq $0x20, %rdi
callq 0x3040
jmp 0x4eaa
jmp 0x4eae
jmp 0x4ec6
jmp 0x4eb0
jmp 0x4eb2
jmp 0x4eb4
jmp 0x4eb6
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x4b70
movb $0x1, 0x53(%rsp)
testb $0x1, 0x53(%rsp)
jne 0x4edc
movq 0x38(%rsp), %rdi
callq 0x61e0
movq 0x40(%rsp), %rax
addq $0x78, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x61e0
movq 0x58(%rsp), %rdi
callq 0x34f0
nopw (%rax,%rax)