// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/detector.c
// Function: run_detector
void run_detector(int argc, char **argv)
{
    char *prefix = find_char_arg(argc, argv, "-prefix", 0);
    float thresh = find_float_arg(argc, argv, "-thresh", .5);
    float hier_thresh = find_float_arg(argc, argv, "-hier", .5);
    int cam_index = find_int_arg(argc, argv, "-c", 0);
    int frame_skip = find_int_arg(argc, argv, "-s", 0);
    int avg = find_int_arg(argc, argv, "-avg", 3);
    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);
    char *outfile = find_char_arg(argc, argv, "-out", 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");
    int fullscreen = find_arg(argc, argv, "-fullscreen");
    int width = find_int_arg(argc, argv, "-w", 0);
    int height = find_int_arg(argc, argv, "-h", 0);
    int fps = find_int_arg(argc, argv, "-fps", 0);
    //int class = find_int_arg(argc, argv, "-class", 0);

    char *datacfg = argv[3];
    char *cfg = argv[4];
    char *weights = (argc > 5) ? argv[5] : 0;
    char *filename = (argc > 6) ? argv[6]: 0;
    if(0==strcmp(argv[2], "test")) test_detector(datacfg, cfg, weights, filename, thresh, hier_thresh, outfile, fullscreen);
    else if(0==strcmp(argv[2], "train")) train_detector(datacfg, cfg, weights, gpus, ngpus, clear);
    else if(0==strcmp(argv[2], "valid")) validate_detector(datacfg, cfg, weights, outfile);
    else if(0==strcmp(argv[2], "valid2")) validate_detector_flip(datacfg, cfg, weights, outfile);
    else if(0==strcmp(argv[2], "recall")) validate_detector_recall(cfg, weights);
    else if(0==strcmp(argv[2], "demo")) {
        list *options = read_data_cfg(datacfg);
        int classes = option_find_int(options, "classes", 20);
        char *name_list = option_find_str(options, "names", "data/names.list");
        char **names = get_labels(name_list);
        demo(cfg, weights, thresh, cam_index, filename, names, classes, frame_skip, prefix, avg, hier_thresh, width, height, fps, fullscreen);
    }
    //else if(0==strcmp(argv[2], "extract")) extract_detector(datacfg, cfg, weights, cam_index, filename, class, thresh, frame_skip);
    //else if(0==strcmp(argv[2], "censor")) censor_detector(datacfg, cfg, weights, cam_index, filename, class, thresh, frame_skip);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %edi, -0x24(%rbp)
movq %rsi, -0x30(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xab04(%rip), %rdx      # 0x7689b
xorl %eax, %eax
movl %eax, %ecx
callq 0x47a0
movq %rax, -0x38(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaaf1(%rip), %rdx      # 0x768a3
movss 0x5432(%rip), %xmm0     # 0x711ec
callq 0x46e0
movss %xmm0, -0x3c(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xac81(%rip), %rdx      # 0x76a53
movss 0x5412(%rip), %xmm0     # 0x711ec
callq 0x46e0
movss %xmm0, -0x40(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0x9bfd(%rip), %rdx      # 0x759ef
xorl %ecx, %ecx
callq 0x4630
movl %eax, -0x44(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaaa1(%rip), %rdx      # 0x768ab
xorl %ecx, %ecx
callq 0x4630
movl %eax, -0x48(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaa8c(%rip), %rdx      # 0x768ae
movl $0x3, %ecx
callq 0x4630
movl %eax, -0x4c(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x6be61
movq 0x171bc(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x9a3b(%rip), %rsi      # 0x75890
movb $0x0, %al
callq 0x3240
jmp 0x6c2d7
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xa2f7(%rip), %rdx      # 0x76166
xorl %eax, %eax
movl %eax, %ecx
callq 0x47a0
movq %rax, -0x58(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xabcf(%rip), %rdx      # 0x76a59
xorl %eax, %eax
movl %eax, %ecx
callq 0x47a0
movq %rax, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x6bf6d
movq -0x58(%rbp), %rsi
leaq 0x84da(%rip), %rdi      # 0x7439d
movb $0x0, %al
callq 0x3130
movq -0x58(%rbp), %rdi
callq 0x3110
movl %eax, -0x74(%rbp)
movl $0x1, -0x70(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0x6bf13
movq -0x58(%rbp), %rax
movslq -0x78(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x6bf06
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x6bf08
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x6bee4
movslq -0x70(%rbp), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x68(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0x6bf6b
movq -0x58(%rbp), %rdi
callq 0x33d0
movl %eax, %edx
movq -0x68(%rbp), %rax
movslq -0x78(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rdi
movl $0x2c, %esi
callq 0x3120
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x6bf2c
jmp 0x6bf88
leaq 0x17ecc(%rip), %rax     # 0x83e40
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
leaq -0x6c(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x1, -0x70(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0x996f(%rip), %rdx      # 0x75905
callq 0x45a0
movl %eax, -0x7c(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaab2(%rip), %rdx      # 0x76a5e
callq 0x45a0
movl %eax, -0x80(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaaa8(%rip), %rdx      # 0x76a6a
xorl %ecx, %ecx
callq 0x4630
movl %eax, -0x84(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaa90(%rip), %rdx      # 0x76a6d
xorl %ecx, %ecx
callq 0x4630
movl %eax, -0x88(%rbp)
movl -0x24(%rbp), %edi
movq -0x30(%rbp), %rsi
leaq 0xaa78(%rip), %rdx      # 0x76a70
xorl %ecx, %ecx
callq 0x4630
movl %eax, -0x8c(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xa0(%rbp)
cmpl $0x5, -0x24(%rbp)
jle 0x6c03a
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xd8(%rbp)
jmp 0x6c045
xorl %eax, %eax
movq %rax, -0xd8(%rbp)
jmp 0x6c045
movq -0xd8(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpl $0x6, -0x24(%rbp)
jle 0x6c06a
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0xe0(%rbp)
jmp 0x6c075
xorl %eax, %eax
movq %rax, -0xe0(%rbp)
jmp 0x6c075
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xa907(%rip), %rsi      # 0x76999
callq 0x3230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c0d7
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movss -0x3c(%rbp), %xmm0
movss -0x40(%rbp), %xmm1
movq -0x60(%rbp), %r8
movl -0x80(%rbp), %r9d
callq 0x6b9d0
jmp 0x6c2d7
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x9ad6(%rip), %rsi      # 0x75bbc
callq 0x3230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c11e
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl -0x70(%rbp), %r8d
movl -0x7c(%rbp), %r9d
callq 0x68dc0
jmp 0x6c2d5
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x7846(%rip), %rsi      # 0x73973
callq 0x3230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c15d
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x6a8a0
jmp 0x6c2d3
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xa909(%rip), %rsi      # 0x76a75
callq 0x3230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c19c
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x699e0
jmp 0x6c2d1
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xa708(%rip), %rsi      # 0x768b3
callq 0x3230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c1d0
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x6b390
jmp 0x6c2cf
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xa208(%rip), %rsi      # 0x763e7
callq 0x3230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c2cd
movq -0x98(%rbp), %rdi
callq 0x426b0
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
leaq 0x8846(%rip), %rsi      # 0x74a57
movl $0x14, %edx
callq 0x42990
movl %eax, -0xbc(%rbp)
movq -0xb8(%rbp), %rdi
leaq 0x8d76(%rip), %rsi      # 0x74fa5
leaq 0xa7ba(%rip), %rdx      # 0x769f0
callq 0x42920
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x343c0
movq %rax, -0xd0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movss -0x3c(%rbp), %xmm0
movl -0x44(%rbp), %edx
movq -0xb0(%rbp), %rcx
movq -0xd0(%rbp), %r8
movl -0xbc(%rbp), %r9d
movl -0x48(%rbp), %r12d
movq -0x38(%rbp), %r15
movl -0x4c(%rbp), %r14d
movss -0x40(%rbp), %xmm1
movl -0x84(%rbp), %ebx
movl -0x88(%rbp), %r11d
movl -0x8c(%rbp), %r10d
movl -0x80(%rbp), %eax
movl %r12d, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x28(%rsp)
movl %eax, 0x30(%rsp)
callq 0x4b060
jmp 0x6c2cf
jmp 0x6c2d1
jmp 0x6c2d3
jmp 0x6c2d5
jmp 0x6c2d7
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)