// File: /workspace/github_c_makefile_star2_O3/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 0x23949(%rip), %rsi     # 0x59599
movl $0x1, %edx
callq 0x36eed
movl %eax, 0x4(%rbx)
leaq 0x2393b(%rip), %rsi     # 0x5959f
movss 0x229e8(%rip), %xmm0    # 0x58654
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x34(%rbx)
leaq 0x258ad(%rip), %rsi     # 0x5b52d
movss 0x22d24(%rip), %xmm0    # 0x589ac
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x38(%rbx)
leaq 0x23911(%rip), %rsi     # 0x595ad
movss 0x232c0(%rip), %xmm0    # 0x58f64
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x3c(%rbx)
leaq 0x238fb(%rip), %rsi     # 0x595b3
movq %r14, %rdi
movl $0x1, %edx
callq 0x36eed
movl %eax, %ebp
leaq 0x238f2(%rip), %rsi     # 0x595c0
movq %r14, %rdi
movl $0x1, %edx
callq 0x37008
movl %eax, 0x4c(%rbx)
leaq 0x238e6(%rip), %rsi     # 0x595cb
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0x8c(%rbx)
movl 0x4(%rbx), %eax
cltd
idivl %ebp
imull 0x4c(%rbx), %eax
movl %eax, 0x4(%rbx)
movl %ebp, 0x1c(%rbx)
leaq 0x23607(%rip), %rsi     # 0x59313
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0xc4(%rbx)
leaq 0x238b0(%rip), %rsi     # 0x595d3
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0x70(%rbx)
testl %eax, %eax
je 0x35d88
leaq 0x2389d(%rip), %rsi     # 0x595d8
movss 0x22c69(%rip), %xmm0    # 0x589ac
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x74(%rbx)
leaq 0x23884(%rip), %rsi     # 0x595db
movss 0x2320d(%rip), %xmm0    # 0x58f6c
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x78(%rbx)
leaq 0x23854(%rip), %rsi     # 0x595c7
movss 0x231f5(%rip), %xmm0    # 0x58f70
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x7c(%rbx)
leaq 0x21de0(%rip), %rsi     # 0x57b6f
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0x90(%rbx)
leaq 0x21d68(%rip), %rsi     # 0x57b0e
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0x94(%rbx)
leaq 0x23821(%rip), %rsi     # 0x595de
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0x98(%rbx)
imull 0x90(%rbx), %eax
imull 0x94(%rbx), %eax
leaq 0x23ad4(%rip), %rsi     # 0x598b6
movq %r14, %rdi
movl %eax, %edx
callq 0x37008
movl %eax, 0x80(%rbx)
movl 0x94(%rbx), %edx
addl %edx, %edx
leaq 0x237e6(%rip), %rsi     # 0x595e7
movq %r14, %rdi
callq 0x37008
movl %eax, 0x9c(%rbx)
movl 0x94(%rbx), %edx
leaq 0x237d4(%rip), %rsi     # 0x595f0
movq %r14, %rdi
callq 0x37008
movl %eax, 0xa0(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl 0x9c(%rbx), %xmm0
cvtsi2ssl 0x94(%rbx), %xmm1
divss %xmm1, %xmm0
leaq 0x237b1(%rip), %rsi     # 0x595f9
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0xa4(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl 0xa0(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0x94(%rbx), %xmm1
divss %xmm1, %xmm0
leaq 0x2378a(%rip), %rsi     # 0x59603
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0xa8(%rbx)
leaq 0x2377d(%rip), %rsi     # 0x5960d
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0xac(%rbx)
leaq 0x2376d(%rip), %rsi     # 0x59614
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0x108(%rbx)
leaq 0x23557(%rip), %rsi     # 0x59418
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0xb0(%rbx)
leaq 0x2373e(%rip), %rsi     # 0x59619
movss 0x1f125(%rip), %xmm0    # 0x55008
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0xb4(%rbx)
leaq 0x23524(%rip), %rsi     # 0x5941e
movq %r14, %rdi
movss 0x1f103(%rip), %xmm0    # 0x55008
callq 0x37065
movss %xmm0, 0xbc(%rbx)
leaq 0x23510(%rip), %rsi     # 0x59429
movq %r14, %rdi
movss 0x1f0e4(%rip), %xmm0    # 0x55008
callq 0x37065
movss %xmm0, 0xb8(%rbx)
leaq 0x236e8(%rip), %rsi     # 0x59620
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0xc0(%rbx)
cmpl $0x0, 0x80(%rbx)
jne 0x35f7b
cmpl $0x0, 0x90(%rbx)
je 0x35f6f
cmpl $0x0, 0x94(%rbx)
je 0x35f6f
cmpl $0x0, 0x98(%rbx)
jne 0x35f7b
leaq 0x236ae(%rip), %rdi     # 0x59624
callq 0xf141
leaq 0x236bf(%rip), %rsi     # 0x59641
leaq 0x235c8(%rip), %rdx     # 0x59551
movq %r14, %rdi
callq 0x36e77
movq %rax, %rdi
callq 0x35b53
movl %eax, 0x30(%rbx)
leaq 0x236a5(%rip), %rsi     # 0x59648
movq %r14, %rdi
xorl %edx, %edx
callq 0x37008
movl %eax, 0x6c(%rbx)
leaq 0x23699(%rip), %rsi     # 0x59650
movss 0x1f2c9(%rip), %xmm0    # 0x55288
movq %r14, %rdi
callq 0x37065
movss %xmm0, 0x48(%rbx)
movl 0x30(%rbx), %eax
decl %eax
cmpl $0x4, %eax
ja 0x361a6
leaq 0x22f93(%rip), %rcx     # 0x58f74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x23569(%rip), %rsi     # 0x5955a
movq %r14, %rdi
movl $0x1, %edx
callq 0x36eed
movl %eax, 0x50(%rbx)
leaq 0x233ab(%rip), %rsi     # 0x593b3
movss 0x1eff8(%rip), %xmm0    # 0x55008
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x44(%rbx)
jmp 0x361a6
leaq 0x2359c(%rip), %rsi     # 0x595c5
movq %r14, %rdi
callq 0x36fbf
movq %rax, %r15
leaq 0x23743(%rip), %rsi     # 0x5977e
movq %r14, %rdi
callq 0x36fbf
movq %rax, %r12
testq %r15, %r15
setne %al
testq %r12, %r12
setne %cl
testb %cl, %al
jne 0x36062
leaq 0x235f9(%rip), %rdi     # 0x59656
callq 0xf141
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r15, %rdi
callq 0x3140
movl $0x1, %ebp
movl $0x1, %r13d
testl %eax, %eax
jle 0x3609f
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 0x3608a
movslq %r13d, %rbx
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3250
movq %rax, 0x10(%rsp)
movl $0x4, %esi
movq %rbx, %rdi
callq 0x3250
movq %rax, 0x8(%rsp)
cmpl $0x2, %ebx
cmovgel %r13d, %ebp
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x3400
movl %eax, %r14d
movq %r12, %rdi
callq 0x30f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movq %r15, %rdi
movl $0x2c, %esi
callq 0x3150
movq %rax, %r15
incq %r15
movq %r12, %rdi
movl $0x2c, %esi
callq 0x3150
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 0x360cf
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 0x361a6
leaq 0x2352e(%rip), %rsi     # 0x5968a
movss 0x1eea4(%rip), %xmm0    # 0x55008
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x40(%rbx)
jmp 0x361a6
leaq 0x23510(%rip), %rsi     # 0x5968a
movss 0x1ee86(%rip), %xmm0    # 0x55008
movq %r14, %rdi
callq 0x370c5
movss %xmm0, 0x40(%rbx)
leaq 0x233c4(%rip), %rsi     # 0x5955a
movq %r14, %rdi
movl $0x1, %edx
callq 0x36eed
movl %eax, 0x50(%rbx)
leaq 0x234e3(%rip), %rsi     # 0x59690
movq %r14, %rdi
xorl %edx, %edx
callq 0x36eed
movl %eax, 0x54(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq