// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/parser.c
// Function: parse_convolutional
convolutional_layer parse_convolutional(list *options, size_params params)
{
    int n = option_find_int(options, "filters",1);
    int size = option_find_int(options, "size",1);
    int stride = option_find_int(options, "stride",1);
    int pad = option_find_int_quiet(options, "pad",0);
    int padding = option_find_int_quiet(options, "padding",0);
    int groups = option_find_int_quiet(options, "groups", 1);
    if(pad) padding = size/2;

    char *activation_s = option_find_str(options, "activation", "logistic");
    ACTIVATION activation = get_activation(activation_s);

    int batch,h,w,c;
    h = params.h;
    w = params.w;
    c = params.c;
    batch=params.batch;
    if(!(h && w && c)) error("Layer before convolutional layer must output image.");
    int batch_normalize = option_find_int_quiet(options, "batch_normalize", 0);
    int binary = option_find_int_quiet(options, "binary", 0);
    int xnor = option_find_int_quiet(options, "xnor", 0);

    convolutional_layer layer = make_convolutional_layer(batch,h,w,c,n,groups,size,stride,padding,activation, batch_normalize, binary, xnor, params.net->adam);
    layer.flipped = option_find_int_quiet(options, "flipped", 0);
    layer.dot = option_find_float_quiet(options, "dot", 0);

    return layer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
leaq 0x70(%rsp), %r15
leaq 0x2adc6(%rip), %rsi     # 0x501bc
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %ebx, %edx
callq 0x2977d
movl %eax, 0x14(%rsp)
leaq 0x2c1cc(%rip), %rsi     # 0x515da
movq %r14, %rdi
movl %ebx, %edx
callq 0x2977d
movl %eax, %r13d
leaq 0x2acac(%rip), %rsi     # 0x500ce
movq %r14, %rdi
movl %ebx, %edx
callq 0x2977d
movq %rax, 0x28(%rsp)
leaq 0x2ac9d(%rip), %rsi     # 0x500d5
movq %r14, %rdi
xorl %edx, %edx
callq 0x29884
movl %eax, (%rsp)
leaq 0x2acff(%rip), %rsi     # 0x5014b
movq %r14, %rdi
xorl %edx, %edx
callq 0x29884
movl %eax, %r12d
leaq 0x2acf3(%rip), %rsi     # 0x50153
movq %r14, %rdi
movl %ebx, %edx
callq 0x29884
movq %rax, 0x20(%rsp)
leaq 0x2a7cc(%rip), %rsi     # 0x4fc42
leaq 0x2a23b(%rip), %rdx     # 0x4f6b8
movq %r14, %rdi
callq 0x29737
movq %rax, %rdi
callq 0x1a016
movq %rax, 0x18(%rsp)
movl (%r15), %eax
movl %eax, 0xc(%rsp)
movl 0x8(%r15), %ebp
movl 0xc(%r15), %ecx
movl 0x10(%r15), %r15d
testl %ebp, %ebp
setne %al
movl %ecx, 0x10(%rsp)
testl %ecx, %ecx
setne %cl
andb %al, %cl
testl %r15d, %r15d
setne %al
testb %al, %cl
jne 0x254cb
leaq 0x2ac94(%rip), %rdi     # 0x5015a
callq 0x43df
pushq $0x2
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
movl %eax, %ebx
cmpl $0x0, (%rsp)
cmovel %r12d, %ebx
leaq 0x2ac56(%rip), %rsi     # 0x5013b
movq %r14, %rdi
xorl %edx, %edx
callq 0x29884
movq %rax, (%rsp)
leaq 0x2ac94(%rip), %rsi     # 0x5018e
movq %r14, %rdi
xorl %edx, %edx
callq 0x29884
movl %eax, %r12d
leaq 0x2ac87(%rip), %rsi     # 0x50195
movq %r14, %rdi
xorl %edx, %edx
callq 0x29884
leaq 0x70(%rsp), %rcx
movq 0x20(%rcx), %rcx
movl 0x70(%rcx), %r10d
subq $0x8, %rsp
movq %r13, %r11
movq 0x38(%rsp), %r13
movq %r13, %rdi
movl 0x14(%rsp), %esi
movl %ebp, %edx
movl 0x18(%rsp), %ecx
movl %r15d, %r8d
movl 0x1c(%rsp), %r9d
pushq %r10
pushq %rax
pushq %r12
pushq 0x20(%rsp)
pushq 0x40(%rsp)
pushq %rbx
pushq 0x60(%rsp)
pushq %r11
pushq 0x68(%rsp)
callq 0x5dce
addq $0x50, %rsp
leaq 0x2ac2c(%rip), %rsi     # 0x5019a
movq %r14, %rdi
xorl %edx, %edx
callq 0x29884
movl %eax, 0x50(%r13)
leaq 0x2ac1f(%rip), %rsi     # 0x501a2
xorps %xmm0, %xmm0
movq %r14, %rdi
callq 0x2989e
movss %xmm0, 0xd0(%r13)
movq %r13, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq