// File: /workspace/github_cpp_makefile_star2_O1/CastellanZhang[P]lambdaFM/lambdafm_train.cpp
// Function: main
int main(int argc, char* argv[])
{
    cin.sync_with_stdio(false);
    cout.sync_with_stdio(false);
    srand(time(NULL));
    trainer_option opt;
    try
    {
        opt.parse_option(argv_to_args(argc, argv));
    }
    catch(const invalid_argument& e)
    {
        cout << "invalid_argument:" << e.what() << endl;
        cout << train_help() << endl;
        return EXIT_FAILURE;
    }

    ftrl_trainer trainer(opt);

    if(opt.b_init) 
    {
        ifstream f_temp(opt.init_m_path.c_str());
        if(!trainer.loadModel(f_temp)) 
        {
            cout << "wrong model" << endl;
            return EXIT_FAILURE;
        }
        f_temp.close();
    }

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

    ofstream f_model(opt.model_path.c_str(), ofstream::out);
    trainer.outputModel(f_model);
    f_model.close();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x3110
xorl %edi, %edi
callq 0x3110
xorl %edi, %edi
callq 0x3290
movl %eax, %edi
callq 0x32b0
leaq 0x8(%rsp), %rdi
callq 0x6dea
leaq 0x168(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x5ea5
leaq 0x8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x6ec4
leaq 0x168(%rsp), %rdi
callq 0x694c
leaq 0xd0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3e80
cmpb $0x1, 0xa1(%rsp)
jne 0x607f
movq 0x28(%rsp), %rsi
leaq 0x168(%rsp), %rdi
movl $0x8, %edx
callq 0x34b0
movq 0xd8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x3d08
movl %eax, %ebp
testb %al, %al
je 0x601e
xorl %ebx, %ebx
leaq 0x168(%rsp), %rdi
callq 0x3080
jmp 0x6069
movq 0xaf9b(%rip), %rbx      # 0x10fc0
leaq 0x6533(%rip), %rsi      # 0xc55f
movl $0xb, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32c0
movsbl %al, %esi
movq 0xaf69(%rip), %rdi      # 0x10fc0
callq 0x3030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x31b0
leaq 0x168(%rsp), %rdi
callq 0x3090
testb %bpl, %bpl
je 0x618c
xorps %xmm0, %xmm0
leaq 0x3e8(%rsp), %r14
movups %xmm0, -0x58(%r14)
movups %xmm0, -0x68(%r14)
movq $0x0, -0x48(%r14)
movups %xmm0, (%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x40(%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x7f08
leaq 0x438(%rsp), %r15
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movl 0x98(%rsp), %edx
leaq 0x370(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movl $0x1388, %ecx           # imm = 0x1388
movl $0x30d40, %r8d          # imm = 0x30D40
callq 0x96bc
leaq 0x370(%rsp), %rdi
callq 0x9c74
movq 0x8(%rsp), %rsi
leaq 0x168(%rsp), %rdi
movl $0x10, %edx
callq 0x3320
movq 0xd8(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x3bec
leaq 0x168(%rsp), %rdi
callq 0x3370
movq 0xae6f(%rip), %rax      # 0x10fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x170(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x168(%rsp,%rcx)
callq 0x3250
leaq 0x260(%rsp), %rdi
callq 0x30d0
movq %r15, %rdi
callq 0x80a8
movq %r14, %rdi
callq 0x80dc
xorl %ebx, %ebx
leaq 0xab85(%rip), %rax      # 0x10d18
movq %rax, 0xd0(%rsp)
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0x61ad
callq 0x32a0
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61c3
callq 0x32a0
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61d9
callq 0x32a0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61ec
callq 0x32a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61ff
callq 0x32a0
movl %ebx, %eax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6216
jmp 0x633c
movq %rax, %rbx
jmp 0x6361
movq %rax, %rbx
jmp 0x636e
movq %rdx, %r14
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x694c
jmp 0x6241
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x636e
movq %rbx, %rdi
callq 0x3100
movq %rax, %rbx
movq 0xad63(%rip), %rdi      # 0x10fc0
leaq 0x62e9(%rip), %rsi      # 0xc54d
movl $0x11, %edx
callq 0x3330
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0xad42(%rip), %rdi      # 0x10fc0
movq %rax, %rsi
callq 0x32d0
movq %rax, %rdi
callq 0x3130
leaq 0x178(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5df6(%rip), %rsi      # 0xc097
leaq 0x62a4(%rip), %rdx      # 0xc54c
leaq 0x168(%rsp), %rdi
callq 0x8394
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
movq 0xacf4(%rip), %rdi      # 0x10fc0
callq 0x3330
movq %rax, %rdi
callq 0x3130
movq 0x168(%rsp), %rdi
cmpq %r14, %rdi
je 0x62eb
callq 0x32a0
movl $0x1, %ebx
callq 0x3410
jmp 0x61c3
jmp 0x621e
jmp 0x6318
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %r14, %rdi
je 0x631b
callq 0x32a0
jmp 0x631b
movq %rax, %rbx
callq 0x3410
jmp 0x636e
movq %rax, %rdi
callq 0x7c5c
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x33b0
jmp 0x633f
movq %rax, %rbx
movq %r15, %rdi
callq 0x80a8
movq %r14, %rdi
callq 0x80dc
jmp 0x6361
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x3090
leaq 0xd0(%rsp), %rdi
callq 0x7c68
leaq 0x8(%rsp), %rdi
callq 0x7c9c
movq %rbx, %rdi
callq 0x3470