// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_net_options
void parse_net_options(list *options, network *net)
{
    net->batch = option_find_int(options, "batch",1);
    net->learning_rate = option_find_float(options, "learning_rate", .001);
    net->momentum = option_find_float(options, "momentum", .9);
    net->decay = option_find_float(options, "decay", .0001);
    int subdivs = option_find_int(options, "subdivisions",1);
    net->time_steps = option_find_int_quiet(options, "time_steps",1);
    net->notruth = option_find_int_quiet(options, "notruth",0);
    net->batch /= subdivs;
    net->batch *= net->time_steps;
    net->subdivisions = subdivs;
    net->random = option_find_int_quiet(options, "random", 0);

    net->adam = option_find_int_quiet(options, "adam", 0);
    if(net->adam){
        net->B1 = option_find_float(options, "B1", .9);
        net->B2 = option_find_float(options, "B2", .999);
        net->eps = option_find_float(options, "eps", .0000001);
    }

    net->h = option_find_int_quiet(options, "height",0);
    net->w = option_find_int_quiet(options, "width",0);
    net->c = option_find_int_quiet(options, "channels",0);
    net->inputs = option_find_int_quiet(options, "inputs", net->h * net->w * net->c);
    net->max_crop = option_find_int_quiet(options, "max_crop",net->w*2);
    net->min_crop = option_find_int_quiet(options, "min_crop",net->w);
    net->max_ratio = option_find_float_quiet(options, "max_ratio", (float) net->max_crop / net->w);
    net->min_ratio = option_find_float_quiet(options, "min_ratio", (float) net->min_crop / net->w);
    net->center = option_find_int_quiet(options, "center",0);
    net->clip = option_find_float_quiet(options, "clip", 0);

    net->angle = option_find_float_quiet(options, "angle", 0);
    net->aspect = option_find_float_quiet(options, "aspect", 1);
    net->saturation = option_find_float_quiet(options, "saturation", 1);
    net->exposure = option_find_float_quiet(options, "exposure", 1);
    net->hue = option_find_float_quiet(options, "hue", 0);

    if(!net->inputs && !(net->h && net->w && net->c)) error("No input parameters supplied");

    char *policy_s = option_find_str(options, "policy", "constant");
    net->policy = get_policy(policy_s);
    net->burn_in = option_find_int_quiet(options, "burn_in", 0);
    net->power = option_find_float_quiet(options, "power", 4);
    if(net->policy == STEP){
        net->step = option_find_int(options, "step", 1);
        net->scale = option_find_float(options, "scale", 1);
    } else if (net->policy == STEPS){
        char *l = option_find(options, "steps");
        char *p = option_find(options, "scales");
        if(!l || !p) error("STEPS policy must have steps and scales in cfg file");

        int len = strlen(l);
        int n = 1;
        int i;
        for(i = 0; i < len; ++i){
            if (l[i] == ',') ++n;
        }
        int *steps = calloc(n, sizeof(int));
        float *scales = calloc(n, sizeof(float));
        for(i = 0; i < n; ++i){
            int step    = atoi(l);
            float scale = atof(p);
            l = strchr(l, ',')+1;
            p = strchr(p, ',')+1;
            steps[i] = step;
            scales[i] = scale;
        }
        net->scales = scales;
        net->steps = steps;
        net->num_steps = n;
    } else if (net->policy == EXP){
        net->gamma = option_find_float(options, "gamma", 1);
    } else if (net->policy == SIG){
        net->gamma = option_find_float(options, "gamma", 1);
        net->step = option_find_int(options, "step", 1);
    } else if (net->policy == POLY || net->policy == RANDOM){
    }
    net->max_batches = option_find_int(options, "max_batches", 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x23801(%rip), %rsi     # 0x57499
movl $0x1, %edx
callq 0x34d9f
movl %eax, 0x4(%rbx)
leaq 0x237f3(%rip), %rsi     # 0x5749f
movss 0x228d0(%rip), %xmm0    # 0x56584
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x34(%rbx)
leaq 0x25705(%rip), %rsi     # 0x593cd
movss 0x22c0c(%rip), %xmm0    # 0x568dc
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x38(%rbx)
leaq 0x237c9(%rip), %rsi     # 0x574ad
movss 0x23178(%rip), %xmm0    # 0x56e64
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x3c(%rbx)
leaq 0x237b3(%rip), %rsi     # 0x574b3
movq %r14, %rdi
movl $0x1, %edx
callq 0x34d9f
movl %eax, %ebp
leaq 0x237aa(%rip), %rsi     # 0x574c0
movq %r14, %rdi
movl $0x1, %edx
callq 0x34e93
movl %eax, 0x4c(%rbx)
leaq 0x2379e(%rip), %rsi     # 0x574cb
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0x8c(%rbx)
movl 0x4(%rbx), %eax
cltd
idivl %ebp
imull 0x4c(%rbx), %eax
movl %eax, 0x4(%rbx)
movl %ebp, 0x1c(%rbx)
leaq 0x234bf(%rip), %rsi     # 0x57213
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0xc4(%rbx)
leaq 0x23768(%rip), %rsi     # 0x574d3
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0x70(%rbx)
testl %eax, %eax
je 0x33dd0
leaq 0x23755(%rip), %rsi     # 0x574d8
movss 0x22b51(%rip), %xmm0    # 0x568dc
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x74(%rbx)
leaq 0x2373c(%rip), %rsi     # 0x574db
movss 0x230c5(%rip), %xmm0    # 0x56e6c
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x78(%rbx)
leaq 0x2370c(%rip), %rsi     # 0x574c7
movss 0x230ad(%rip), %xmm0    # 0x56e70
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x7c(%rbx)
leaq 0x21cc0(%rip), %rsi     # 0x55a97
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0x90(%rbx)
leaq 0x21c48(%rip), %rsi     # 0x55a36
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0x94(%rbx)
leaq 0x236d9(%rip), %rsi     # 0x574de
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0x98(%rbx)
imull 0x90(%rbx), %eax
imull 0x94(%rbx), %eax
leaq 0x23984(%rip), %rsi     # 0x577ae
movq %r14, %rdi
movl %eax, %edx
callq 0x34e93
movl %eax, 0x80(%rbx)
movl 0x94(%rbx), %edx
addl %edx, %edx
leaq 0x2369e(%rip), %rsi     # 0x574e7
movq %r14, %rdi
callq 0x34e93
movl %eax, 0x9c(%rbx)
movl 0x94(%rbx), %edx
leaq 0x2368c(%rip), %rsi     # 0x574f0
movq %r14, %rdi
callq 0x34e93
movl %eax, 0xa0(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl 0x9c(%rbx), %xmm0
cvtsi2ssl 0x94(%rbx), %xmm1
divss %xmm1, %xmm0
leaq 0x23669(%rip), %rsi     # 0x574f9
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0xa4(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl 0xa0(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0x94(%rbx), %xmm1
divss %xmm1, %xmm0
leaq 0x23642(%rip), %rsi     # 0x57503
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0xa8(%rbx)
leaq 0x23635(%rip), %rsi     # 0x5750d
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0xac(%rbx)
leaq 0x23625(%rip), %rsi     # 0x57514
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0x108(%rbx)
leaq 0x2340f(%rip), %rsi     # 0x57318
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0xb0(%rbx)
leaq 0x235f6(%rip), %rsi     # 0x57519
movss 0x1f0dd(%rip), %xmm0    # 0x53008
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0xb4(%rbx)
leaq 0x233dc(%rip), %rsi     # 0x5731e
movq %r14, %rdi
movss 0x1f0bb(%rip), %xmm0    # 0x53008
callq 0x34ead
movss %xmm0, 0xbc(%rbx)
leaq 0x233c8(%rip), %rsi     # 0x57329
movq %r14, %rdi
movss 0x1f09c(%rip), %xmm0    # 0x53008
callq 0x34ead
movss %xmm0, 0xb8(%rbx)
leaq 0x235a0(%rip), %rsi     # 0x57520
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0xc0(%rbx)
cmpl $0x0, 0x80(%rbx)
jne 0x33fc3
cmpl $0x0, 0x90(%rbx)
je 0x33fb7
cmpl $0x0, 0x94(%rbx)
je 0x33fb7
cmpl $0x0, 0x98(%rbx)
jne 0x33fc3
leaq 0x23566(%rip), %rdi     # 0x57524
callq 0xe956
leaq 0x23577(%rip), %rsi     # 0x57541
leaq 0x23480(%rip), %rdx     # 0x57451
movq %r14, %rdi
callq 0x34d5b
movq %rax, %rdi
callq 0x33b9b
movl %eax, 0x30(%rbx)
leaq 0x2355d(%rip), %rsi     # 0x57548
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e93
movl %eax, 0x6c(%rbx)
leaq 0x23551(%rip), %rsi     # 0x57550
movss 0x1f255(%rip), %xmm0    # 0x5325c
movq %r14, %rdi
callq 0x34ead
movss %xmm0, 0x48(%rbx)
movl 0x30(%rbx), %eax
decl %eax
cmpl $0x4, %eax
ja 0x341ee
leaq 0x22e4b(%rip), %rcx     # 0x56e74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x23421(%rip), %rsi     # 0x5745a
movq %r14, %rdi
movl $0x1, %edx
callq 0x34d9f
movl %eax, 0x50(%rbx)
leaq 0x23263(%rip), %rsi     # 0x572b3
movss 0x1efb0(%rip), %xmm0    # 0x53008
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x44(%rbx)
jmp 0x341ee
leaq 0x23454(%rip), %rsi     # 0x574c5
movq %r14, %rdi
callq 0x34e40
movq %rax, %r15
leaq 0x235fb(%rip), %rsi     # 0x5767e
movq %r14, %rdi
callq 0x34e40
movq %rax, %r12
testq %r15, %r15
setne %al
testq %r12, %r12
setne %cl
testb %cl, %al
jne 0x340aa
leaq 0x234b1(%rip), %rdi     # 0x57556
callq 0xe956
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r15, %rdi
callq 0x3150
movl $0x1, %ebp
movl $0x1, %r13d
testl %eax, %eax
jle 0x340e7
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x2c, (%r15,%rcx)
sete %dl
addl %edx, %r13d
incq %rcx
cmpq %rcx, %rax
jne 0x340d2
movslq %r13d, %rbx
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3260
movq %rax, 0x10(%rsp)
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3260
movq %rax, 0x8(%rsp)
cmpl $0x2, %ebx
cmovgel %r13d, %ebp
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x3410
movl %eax, %r14d
movq %r12, %rdi
callq 0x3100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movq %r15, %rdi
movl $0x2c, %esi
callq 0x3160
movq %rax, %r15
incq %r15
movq %r12, %rdi
movl $0x2c, %esi
callq 0x3160
movq %rax, %r12
incq %r12
movq 0x10(%rsp), %rax
movl %r14d, (%rax,%rbx,4)
movq 0x8(%rsp), %rax
movss 0x4(%rsp), %xmm0
movss %xmm0, (%rax,%rbx,4)
incq %rbx
cmpq %rbx, %rbp
jne 0x34117
movq 0x20(%rsp), %rbx
movq 0x8(%rsp), %rax
movq %rax, 0x58(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x60(%rbx)
movl %r13d, 0x68(%rbx)
movq 0x18(%rsp), %r14
jmp 0x341ee
leaq 0x233e6(%rip), %rsi     # 0x5758a
movss 0x1ee5c(%rip), %xmm0    # 0x53008
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x40(%rbx)
jmp 0x341ee
leaq 0x233c8(%rip), %rsi     # 0x5758a
movss 0x1ee3e(%rip), %xmm0    # 0x53008
movq %r14, %rdi
callq 0x34ed2
movss %xmm0, 0x40(%rbx)
leaq 0x2327c(%rip), %rsi     # 0x5745a
movq %r14, %rdi
movl $0x1, %edx
callq 0x34d9f
movl %eax, 0x50(%rbx)
leaq 0x2339b(%rip), %rsi     # 0x57590
movq %r14, %rdi
xorl %edx, %edx
callq 0x34d9f
movl %eax, 0x54(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq