// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/go.c
// Function: run_go
void run_go(int argc, char **argv)
{
    //boards_go();
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    char *gpu_list = find_char_arg(argc, argv, "-gpus", 0);
    int *gpus = 0;
    int gpu = 0;
    int ngpus = 0;
    if(gpu_list){
        printf("%s\n", gpu_list);
        int len = strlen(gpu_list);
        ngpus = 1;
        int i;
        for(i = 0; i < len; ++i){
            if (gpu_list[i] == ',') ++ngpus;
        }
        gpus = calloc(ngpus, sizeof(int));
        for(i = 0; i < ngpus; ++i){
            gpus[i] = atoi(gpu_list);
            gpu_list = strchr(gpu_list, ',')+1;
        }
    } else {
        gpu = gpu_index;
        gpus = &gpu;
        ngpus = 1;
    }
    int clear = find_arg(argc, argv, "-clear");

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    char *c2 = (argc > 5) ? argv[5] : 0;
    char *w2 = (argc > 6) ? argv[6] : 0;
    int multi = find_arg(argc, argv, "-multi");
    int anon = find_arg(argc, argv, "-anon");
    int iters = find_int_arg(argc, argv, "-iters", 500);
    int resign = find_int_arg(argc, argv, "-resign", 175);
    float cpuct = find_float_arg(argc, argv, "-cpuct", 5);
    float temp = find_float_arg(argc, argv, "-temp", .1);
    float time = find_float_arg(argc, argv, "-time", 0);
    if(0==strcmp(argv[2], "train")) train_go(cfg, weights, c2, gpus, ngpus, clear);
    else if(0==strcmp(argv[2], "valid")) valid_go(cfg, weights, multi, c2);
    else if(0==strcmp(argv[2], "self")) self_go(cfg, weights, c2, w2, multi);
    else if(0==strcmp(argv[2], "test")) test_go(cfg, weights, multi);
    else if(0==strcmp(argv[2], "engine")) engine_go(cfg, weights, iters, time, temp, cpuct, anon, resign);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
cmpl $0x3, %edi
jle 0x3d2a4
movl %edi, %ebp
leaq 0x14883(%rip), %rdx     # 0x518cc
xorl %r12d, %r12d
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x4151
testq %rax, %rax
je 0x3d09a
movq %rax, %r14
movq %rax, %rdi
callq 0x30b0
movq %r14, %rdi
callq 0x3140
testl %eax, %eax
cmovlel %r12d, %eax
pushq $0x1
popq %r15
cmpq %r12, %rax
je 0x3d08f
xorl %ecx, %ecx
cmpb $0x2c, (%r14,%r12)
sete %cl
addl %ecx, %r15d
incq %r12
jmp 0x3d078
movl %r15d, %eax
subq $0x1, %rax
jae 0x3d092
jmp 0x3d09e
pushq $0x1
popq %r15
leaq 0x13fb0(%rip), %rdx     # 0x51055
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3fdd
movl %eax, %r14d
cmpl $0x4, %ebp
jne 0x3d0c5
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
jmp 0x3d0e7
movq 0x20(%rbx), %rax
cmpl $0x6, %ebp
movq %rax, 0x8(%rsp)
jl 0x3d0e4
movq 0x28(%rbx), %r12
je 0x3d0e7
movq 0x30(%rbx), %rax
movq %rax, 0x18(%rsp)
jmp 0x3d0f0
xorl %r12d, %r12d
movq $0x0, 0x18(%rsp)
movq 0x18(%rbx), %r13
leaq 0x147d7(%rip), %rdx     # 0x518d2
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3fdd
movl %eax, 0x14(%rsp)
leaq 0x147c9(%rip), %rdx     # 0x518d9
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3fdd
movl %eax, 0x34(%rsp)
leaq 0x147ba(%rip), %rdx     # 0x518df
movl %ebp, %edi
movq %rbx, %rsi
movl $0x1f4, %ecx            # imm = 0x1F4
callq 0x4041
movl %eax, 0x30(%rsp)
leaq 0x147a7(%rip), %rdx     # 0x518e6
movl %ebp, %edi
movq %rbx, %rsi
movl $0xaf, %ecx
callq 0x4041
movl %eax, 0x2c(%rsp)
leaq 0x14795(%rip), %rdx     # 0x518ee
movss 0xf0df(%rip), %xmm0     # 0x4c240
movl %ebp, %edi
movq %rbx, %rsi
callq 0x40c0
movss %xmm0, 0x28(%rsp)
leaq 0x1477d(%rip), %rdx     # 0x518f5
movss 0xf0e8(%rip), %xmm0     # 0x4c268
movl %ebp, %edi
movq %rbx, %rsi
callq 0x40c0
movss %xmm0, 0x24(%rsp)
leaq 0x14764(%rip), %rdx     # 0x518fb
xorps %xmm0, %xmm0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x40c0
movss %xmm0, 0x20(%rsp)
movq 0x10(%rbx), %rbx
leaq 0x1415f(%rip), %rsi     # 0x51314
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x3d224
leaq 0x11dbc(%rip), %rsi     # 0x4ef84
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x3d248
leaq 0x14726(%rip), %rsi     # 0x51901
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x3d2d1
leaq 0x14f23(%rip), %rsi     # 0x52115
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x3d2e6
leaq 0x146fd(%rip), %rsi     # 0x51906
movq %rbx, %rdi
callq 0x3260
testl %eax, %eax
je 0x3d26a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movl %r15d, %r8d
movl %r14d, %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x39c45
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movl 0x14(%rsp), %edx
movq %r12, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b4ba
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movl 0x30(%rsp), %edx
movss 0x20(%rsp), %xmm0
movss 0x24(%rsp), %xmm1
movss 0x28(%rsp), %xmm2
movl 0x34(%rsp), %ecx
movl 0x2c(%rsp), %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b87d
movq 0x26d4d(%rip), %rax     # 0x63ff8
movq (%rax), %rdi
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
leaq 0x13d1e(%rip), %rsi     # 0x50fda
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3270
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
callq 0x3ccff
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0x3c7cd