// File: /workspace/github_c_makefile_star2_O1/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 0x46f0c
movl %edi, %ebp
leaq 0x11c18(%rip), %rdx     # 0x588bc
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0xe64d
testq %rax, %rax
je 0x46d01
movq %rax, %r14
movq %rax, %rdi
callq 0x30c0
movq %r14, %rdi
callq 0x3150
movl $0x1, %ecx
movl $0x1, %r15d
testl %eax, %eax
jle 0x46cf2
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
xorl %esi, %esi
cmpb $0x2c, (%r14,%rdx)
sete %sil
addl %esi, %r15d
incq %rdx
cmpq %rdx, %rax
jne 0x46cdc
cmpl $0x2, %r15d
cmovgel %r15d, %ecx
decq %rcx
jne 0x46cfa
jmp 0x46d07
movl $0x1, %r15d
leaq 0x1130f(%rip), %rdx     # 0x5801d
movl %ebp, %edi
movq %rbx, %rsi
callq 0xe439
movl %eax, %r14d
cmpl $0x4, %ebp
jne 0x46d2b
movq $0x0, 0x8(%rsp)
jmp 0x46d34
movq 0x20(%rbx), %rax
movq %rax, 0x8(%rsp)
cmpl $0x6, %ebp
jl 0x46d3f
movq 0x28(%rbx), %r13
jmp 0x46d42
xorl %r13d, %r13d
cmpl $0x7, %ebp
jl 0x46d52
movq 0x30(%rbx), %rax
movq %rax, 0x30(%rsp)
jmp 0x46d5b
movq $0x0, 0x30(%rsp)
movq 0x18(%rbx), %r12
leaq 0x11b5c(%rip), %rdx     # 0x588c2
movl %ebp, %edi
movq %rbx, %rsi
callq 0xe439
movl %eax, 0x14(%rsp)
leaq 0x11b4e(%rip), %rdx     # 0x588c9
movl %ebp, %edi
movq %rbx, %rsi
callq 0xe439
movl %eax, 0x2c(%rsp)
leaq 0x11b3f(%rip), %rdx     # 0x588cf
movl %ebp, %edi
movq %rbx, %rsi
movl $0x1f4, %ecx            # imm = 0x1F4
callq 0xe4b3
movl %eax, 0x28(%rsp)
leaq 0x11b2c(%rip), %rdx     # 0x588d6
movl %ebp, %edi
movq %rbx, %rsi
movl $0xaf, %ecx
callq 0xe4b3
movl %eax, 0x24(%rsp)
leaq 0x11b1a(%rip), %rdx     # 0x588de
movss 0xc474(%rip), %xmm0     # 0x53240
movl %ebp, %edi
movq %rbx, %rsi
callq 0xe57a
movss %xmm0, 0x20(%rsp)
leaq 0x11b02(%rip), %rdx     # 0x588e5
movss 0xc481(%rip), %xmm0     # 0x5326c
movl %ebp, %edi
movq %rbx, %rsi
callq 0xe57a
movss %xmm0, 0x1c(%rsp)
leaq 0x11ae9(%rip), %rdx     # 0x588eb
xorps %xmm0, %xmm0
movl %ebp, %edi
movq %rbx, %rsi
callq 0xe57a
movss %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rbx
leaq 0x114bc(%rip), %rsi     # 0x582dc
movq %rbx, %rdi
callq 0x3270
testl %eax, %eax
je 0x46ec6
leaq 0xf155(%rip), %rsi      # 0x55f8c
movq %rbx, %rdi
callq 0x3270
testl %eax, %eax
je 0x46eea
leaq 0x11aa3(%rip), %rsi     # 0x588f1
movq %rbx, %rdi
callq 0x3270
testl %eax, %eax
je 0x46f23
leaq 0x12298(%rip), %rsi     # 0x590fd
movq %rbx, %rdi
callq 0x3270
testl %eax, %eax
je 0x46f38
leaq 0x11a7a(%rip), %rsi     # 0x588f6
movq %rbx, %rdi
callq 0x3270
testl %eax, %eax
jne 0x46f14
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movl 0x28(%rsp), %edx
movss 0x18(%rsp), %xmm0
movss 0x1c(%rsp), %xmm1
movss 0x20(%rsp), %xmm2
movl 0x2c(%rsp), %ecx
movl 0x24(%rsp), %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4516e
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movl %r15d, %r8d
movl %r14d, %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4359c
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movl 0x14(%rsp), %edx
movq %r13, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x44e45
movq %rbx, %rdi
callq 0x9e52
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movq 0x30(%rsp), %rcx
callq 0x46810
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0x46269