// File: CastellanZhang[P]lambdaFM/lambdafm_predict.cpp
// Function: main
int main(int argc, char* argv[])
{
    cin.sync_with_stdio(false);
    cout.sync_with_stdio(false);
    Option opt;
    try
    {
        opt = parse_option(argv_to_args(argc, argv));
    }
    catch(const invalid_argument& e)
    {
        cout << e.what() << endl;
        cout << predict_help() << endl;
        return EXIT_FAILURE;
    }


    ifstream f_model(opt.model_path.c_str());
    ofstream f_predict(opt.predict_path.c_str(), ofstream::out);

    ftrl_predictor predictor(opt.dim, f_model, f_predict);

    pc_frame frame;
    frame.init(predictor, opt.threads_num);
    frame.run();

    f_model.close();
    f_predict.close();
    return 0;
}

// Assembly:
subq $0x648, %rsp            # imm = 0x648
movl $0x0, 0x644(%rsp)
movl %edi, 0x640(%rsp)
movq %rsi, 0x638(%rsp)
xorl %edi, %edi
movl %edi, 0x1c(%rsp)
callq 0x3120
movl 0x1c(%rsp), %edi
callq 0x3120
leaq 0x5f0(%rsp), %rdi
callq 0x6130
movl 0x640(%rsp), %esi
movq 0x638(%rsp), %rdx
leaq 0x590(%rsp), %rdi
callq 0x49c0
jmp 0x4f60
leaq 0x5a8(%rsp), %rdi
leaq 0x590(%rsp), %rsi
callq 0x4ad0
jmp 0x4f77
leaq 0x5f0(%rsp), %rdi
leaq 0x5a8(%rsp), %rsi
callq 0x6210
leaq 0x5a8(%rsp), %rdi
callq 0x61e0
leaq 0x590(%rsp), %rdi
callq 0x5ce0
jmp 0x510f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
jmp 0x4fe2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
leaq 0x590(%rsp), %rdi
callq 0x5ce0
movl 0x584(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x5299
movq 0x588(%rsp), %rdi
callq 0x3100
movq %rax, 0x578(%rsp)
movq 0x578(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0x14f92(%rip), %rdi     # 0x19fb8
callq 0x32f0
movq %rax, 0x10(%rsp)
jmp 0x5032
movq 0x10(%rsp), %rdi
movq 0x14f42(%rip), %rsi     # 0x19f80
callq 0x3320
jmp 0x5045
leaq 0x558(%rsp), %rdi
callq 0x4940
jmp 0x5054
movq 0x14f5d(%rip), %rdi     # 0x19fb8
leaq 0x558(%rsp), %rsi
callq 0x32b0
movq %rax, 0x8(%rsp)
jmp 0x506f
movq 0x8(%rsp), %rdi
movq 0x14f05(%rip), %rsi     # 0x19f80
callq 0x3320
jmp 0x5082
leaq 0x558(%rsp), %rdi
callq 0x3598
movl $0x1, 0x644(%rsp)
movl $0x1, 0x554(%rsp)
callq 0x34a0
jmp 0x50e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
jmp 0x5103
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
leaq 0x558(%rsp), %rdi
callq 0x3598
jmp 0x5103
jmp 0x527d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
jmp 0x5299
callq 0x34a0
jmp 0x510a
jmp 0x5299
leaq 0x5f0(%rsp), %rdi
callq 0x3110
movq %rax, %rsi
leaq 0x348(%rsp), %rdi
movl $0x8, %edx
callq 0x3520
jmp 0x5133
leaq 0x610(%rsp), %rdi
callq 0x3110
movq %rax, %rsi
leaq 0x148(%rsp), %rdi
movl $0x10, %edx
callq 0x3350
jmp 0x5157
cvtsi2sdl 0x634(%rsp), %xmm0
leaq 0x108(%rsp), %rdi
leaq 0x348(%rsp), %rsi
leaq 0x148(%rsp), %rdx
callq 0x4460
jmp 0x517f
leaq 0x20(%rsp), %rdi
callq 0x6270
jmp 0x518b
movl 0x630(%rsp), %edx
leaq 0x20(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movl $0x1388, %ecx           # imm = 0x1388
movl $0x30d40, %r8d          # imm = 0x30D40
callq 0xba90
jmp 0x51b1
leaq 0x20(%rsp), %rdi
callq 0xc1a0
jmp 0x51bd
leaq 0x348(%rsp), %rdi
callq 0x3090
jmp 0x51cc
leaq 0x148(%rsp), %rdi
callq 0x3400
jmp 0x51db
movl $0x0, 0x644(%rsp)
movl $0x1, 0x554(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x62b0
leaq 0x148(%rsp), %rdi
callq 0x3440
leaq 0x348(%rsp), %rdi
callq 0x30a0
jmp 0x527d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
jmp 0x526e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
jmp 0x5261
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x588(%rsp)
movl %eax, 0x584(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x62b0
leaq 0x148(%rsp), %rdi
callq 0x3440
leaq 0x348(%rsp), %rdi
callq 0x30a0
jmp 0x5299
leaq 0x5f0(%rsp), %rdi
callq 0x61e0
movl 0x644(%rsp), %eax
addq $0x648, %rsp            # imm = 0x648
retq
leaq 0x5f0(%rsp), %rdi
callq 0x61e0
movq 0x588(%rsp), %rdi
callq 0x34f0
movq %rax, %rdi
callq 0x6260
nopl (%rax,%rax)