// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: load_weights_upto
void load_weights_upto(network *net, char *filename, int start, int cutoff)
{
    fprintf(stderr, "Loading weights from %s...", filename);
    fflush(stdout);
    FILE *fp = fopen(filename, "rb");
    if(!fp) file_error(filename);

    int major;
    int minor;
    int revision;
    fread(&major, sizeof(int), 1, fp);
    fread(&minor, sizeof(int), 1, fp);
    fread(&revision, sizeof(int), 1, fp);
    if ((major*10 + minor) >= 2 && major < 1000 && minor < 1000){
        fread(net->seen, sizeof(size_t), 1, fp);
    } else {
        int iseen = 0;
        fread(&iseen, sizeof(int), 1, fp);
        *net->seen = iseen;
    }
    int transpose = (major > 1000) || (minor > 1000);

    int i;
    for(i = start; i < net->n && i < cutoff; ++i){
        layer l = net->layers[i];
        if (l.dontload) continue;
        if(l.type == CONVOLUTIONAL || l.type == DECONVOLUTIONAL){
            load_convolutional_weights(l, fp);
        }
        if(l.type == CONNECTED){
            load_connected_weights(l, fp, transpose);
        }
        if(l.type == BATCHNORM){
            load_batchnorm_weights(l, fp);
        }
        if(l.type == CRNN){
            load_convolutional_weights(*(l.input_layer), fp);
            load_convolutional_weights(*(l.self_layer), fp);
            load_convolutional_weights(*(l.output_layer), fp);
        }
        if(l.type == RNN){
            load_connected_weights(*(l.input_layer), fp, transpose);
            load_connected_weights(*(l.self_layer), fp, transpose);
            load_connected_weights(*(l.output_layer), fp, transpose);
        }
        if (l.type == LSTM) {
            load_connected_weights(*(l.wi), fp, transpose);
            load_connected_weights(*(l.wf), fp, transpose);
            load_connected_weights(*(l.wo), fp, transpose);
            load_connected_weights(*(l.wg), fp, transpose);
            load_connected_weights(*(l.ui), fp, transpose);
            load_connected_weights(*(l.uf), fp, transpose);
            load_connected_weights(*(l.uo), fp, transpose);
            load_connected_weights(*(l.ug), fp, transpose);
        }
        if (l.type == GRU) {
            if(1){
                load_connected_weights(*(l.wz), fp, transpose);
                load_connected_weights(*(l.wr), fp, transpose);
                load_connected_weights(*(l.wh), fp, transpose);
                load_connected_weights(*(l.uz), fp, transpose);
                load_connected_weights(*(l.ur), fp, transpose);
                load_connected_weights(*(l.uh), fp, transpose);
            }else{
                load_connected_weights(*(l.reset_layer), fp, transpose);
                load_connected_weights(*(l.update_layer), fp, transpose);
                load_connected_weights(*(l.state_layer), fp, transpose);
            }
        }
        if(l.type == LOCAL){
            int locations = l.out_w*l.out_h;
            int size = l.size*l.size*l.c*l.n*locations;
            fread(l.biases, sizeof(float), l.outputs, fp);
            fread(l.weights, sizeof(float), size, fp);
        }
    }
    fprintf(stderr, "Done!\n");
    fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xad0, %rsp            # imm = 0xAD0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq 0x410c8(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x33045(%rip), %rsi     # 0x74f83
movb $0x0, %al
callq 0x3240
movq 0x41084(%rip), %rax     # 0x82fd0
movq (%rax), %rdi
callq 0x32e0
movq -0x10(%rbp), %rdi
leaq 0x2f15d(%rip), %rsi     # 0x710bc
callq 0x3360
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x41f78
movq -0x10(%rbp), %rdi
callq 0x4110
movq -0x20(%rbp), %rcx
leaq -0x24(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x30a0
movq -0x20(%rbp), %rcx
leaq -0x28(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x30a0
movq -0x20(%rbp), %rcx
leaq -0x2c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x30a0
imull $0xa, -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
cmpl $0x2, %eax
jl 0x41ff8
cmpl $0x3e8, -0x24(%rbp)     # imm = 0x3E8
jge 0x41ff8
cmpl $0x3e8, -0x28(%rbp)     # imm = 0x3E8
jge 0x41ff8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x30a0
jmp 0x42025
movl $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x30a0
movslq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movb $0x1, %al
cmpl $0x3e8, -0x24(%rbp)     # imm = 0x3E8
movb %al, -0x4e1(%rbp)
jg 0x42046
cmpl $0x3e8, -0x28(%rbp)     # imm = 0x3E8
setg %al
movb %al, -0x4e1(%rbp)
movb -0x4e1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %ecx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpl (%rdx), %ecx
movb %al, -0x4e2(%rbp)
jge 0x4207c
movl -0x38(%rbp), %eax
cmpl -0x18(%rbp), %eax
setl %al
movb %al, -0x4e2(%rbp)
movb -0x4e2(%rbp), %al
testb $0x1, %al
jne 0x4208b
jmp 0x42648
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movslq -0x38(%rbp), %rax
imulq $0x4a0, %rax, %rax      # imm = 0x4A0
addq %rax, %rsi
leaq -0x4d8(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
cmpl $0x0, -0x35c(%rbp)
je 0x420c0
jmp 0x4263a
cmpl $0x0, -0x4d8(%rbp)
je 0x420d2
cmpl $0x1, -0x4d8(%rbp)
jne 0x420fb
movq -0x20(%rbp), %rax
movq %rax, -0x4f0(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
leaq -0x4d8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x4f0(%rbp), %rdi
callq 0x41dc0
cmpl $0x2, -0x4d8(%rbp)
jne 0x4213c
movq -0x20(%rbp), %rax
movq %rax, -0x4f8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x4fc(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
leaq -0x4d8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl -0x4fc(%rbp), %esi
movq -0x4f8(%rbp), %rdi
callq 0x41a70
cmpl $0x13, -0x4d8(%rbp)
jne 0x4216e
movq -0x20(%rbp), %rax
movq %rax, -0x508(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
leaq -0x4d8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x508(%rbp), %rdi
callq 0x41b60
cmpl $0x12, -0x4d8(%rbp)
jne 0x421f2
movq -0x148(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x520(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x520(%rbp), %rdi
callq 0x41dc0
movq -0x140(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x518(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x518(%rbp), %rdi
callq 0x41dc0
movq -0x138(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x510(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x510(%rbp), %rdi
callq 0x41dc0
cmpl $0xf, -0x4d8(%rbp)
jne 0x422a7
movq -0x148(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x548(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x54c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x54c(%rbp), %esi
movq -0x548(%rbp), %rdi
callq 0x41a70
movq -0x140(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x538(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x53c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x53c(%rbp), %esi
movq -0x538(%rbp), %rdi
callq 0x41a70
movq -0x138(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x528(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x52c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x52c(%rbp), %esi
movq -0x528(%rbp), %rdi
callq 0x41a70
cmpl $0x11, -0x4d8(%rbp)
jne 0x4245f
movq -0x60(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x5cc(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x5cc(%rbp), %esi
movq -0x5c8(%rbp), %rdi
callq 0x41a70
movq -0x70(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x5b8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x5bc(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x5bc(%rbp), %esi
movq -0x5b8(%rbp), %rdi
callq 0x41a70
movq -0x80(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x5a8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x5ac(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x5ac(%rbp), %esi
movq -0x5a8(%rbp), %rdi
callq 0x41a70
movq -0x50(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x598(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x59c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x59c(%rbp), %esi
movq -0x598(%rbp), %rdi
callq 0x41a70
movq -0x68(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x588(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x58c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x58c(%rbp), %esi
movq -0x588(%rbp), %rdi
callq 0x41a70
movq -0x78(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x578(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x57c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x57c(%rbp), %esi
movq -0x578(%rbp), %rdi
callq 0x41a70
movq -0x88(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x568(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x56c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x56c(%rbp), %esi
movq -0x568(%rbp), %rdi
callq 0x41a70
movq -0x58(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x558(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x55c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x55c(%rbp), %esi
movq -0x558(%rbp), %rdi
callq 0x41a70
cmpl $0x10, -0x4d8(%rbp)
jne 0x425bc
movq -0xb8(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x628(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x62c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x62c(%rbp), %esi
movq -0x628(%rbp), %rdi
callq 0x41a70
movq -0xa8(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x618(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x61c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x61c(%rbp), %esi
movq -0x618(%rbp), %rdi
callq 0x41a70
movq -0x98(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x608(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x60c(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x60c(%rbp), %esi
movq -0x608(%rbp), %rdi
callq 0x41a70
movq -0xb0(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x5f8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x5fc(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x5fc(%rbp), %esi
movq -0x5f8(%rbp), %rdi
callq 0x41a70
movq -0xa0(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x5e8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x5ec(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x5ec(%rbp), %esi
movq -0x5e8(%rbp), %rdi
callq 0x41a70
movq -0x90(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x5d8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x5dc(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
movl -0x5dc(%rbp), %esi
movq -0x5d8(%rbp), %rdi
callq 0x41a70
cmpl $0xc, -0x4d8(%rbp)
jne 0x42638
movl -0x45c(%rbp), %eax
imull -0x460(%rbp), %eax
movl %eax, -0x4dc(%rbp)
movl -0x448(%rbp), %eax
imull -0x448(%rbp), %eax
imull -0x464(%rbp), %eax
imull -0x454(%rbp), %eax
imull -0x4dc(%rbp), %eax
movl %eax, -0x4e0(%rbp)
movq -0x2a8(%rbp), %rdi
movslq -0x480(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x4, %esi
callq 0x30a0
movq -0x288(%rbp), %rdi
movslq -0x4e0(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x4, %esi
callq 0x30a0
jmp 0x4263a
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x4205a
movq 0x409a9(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x32945(%rip), %rsi     # 0x74f9e
movb $0x0, %al
callq 0x3240
movq -0x20(%rbp), %rdi
callq 0x3100
addq $0xad0, %rsp            # imm = 0xAD0
popq %rbp
retq
nopw %cs:(%rax,%rax)