// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/region_layer.c
// Function: make_region_layer
layer make_region_layer(int batch, int w, int h, int n, int classes, int coords)
{
    layer l = {0};
    l.type = REGION;

    l.n = n;
    l.batch = batch;
    l.h = h;
    l.w = w;
    l.c = n*(classes + coords + 1);
    l.out_w = l.w;
    l.out_h = l.h;
    l.out_c = l.c;
    l.classes = classes;
    l.coords = coords;
    l.cost = calloc(1, sizeof(float));
    l.biases = calloc(n*2, sizeof(float));
    l.bias_updates = calloc(n*2, sizeof(float));
    l.outputs = h*w*n*(classes + coords + 1);
    l.inputs = l.outputs;
    l.truths = 30*(l.coords + 1);
    l.delta = calloc(batch*l.outputs, sizeof(float));
    l.output = calloc(batch*l.outputs, sizeof(float));
    int i;
    for(i = 0; i < n*2; ++i){
        l.biases[i] = .5;
    }

    l.forward = forward_region_layer;
    l.backward = backward_region_layer;

    fprintf(stderr, "detection\n");
    srand(0);

    return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x20(%rbp)
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movl 0x10(%rbp), %eax
movl %esi, -0x4(%rbp)
movl %edx, -0x8(%rbp)
movl %ecx, -0xc(%rbp)
movl %r8d, -0x10(%rbp)
movl %r9d, -0x14(%rbp)
xorl %esi, %esi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3190
movq -0x20(%rbp), %rdi
movl $0x16, (%rdi)
movl -0x10(%rbp), %eax
movl %eax, 0x84(%rdi)
movl -0x4(%rbp), %eax
movl %eax, 0x48(%rdi)
movl -0xc(%rbp), %eax
movl %eax, 0x6c(%rdi)
movl -0x8(%rbp), %eax
movl %eax, 0x70(%rdi)
movl -0x10(%rbp), %eax
movl -0x14(%rbp), %ecx
addl 0x10(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl %eax, 0x74(%rdi)
movl 0x70(%rdi), %eax
movl %eax, 0x7c(%rdi)
movl 0x6c(%rdi), %eax
movl %eax, 0x78(%rdi)
movl 0x74(%rdi), %eax
movl %eax, 0x80(%rdi)
movl -0x14(%rbp), %eax
movl %eax, 0xfc(%rdi)
movl 0x10(%rbp), %eax
movl %eax, 0x100(%rdi)
movl $0x1, %edi
movl $0x4, %esi
callq 0x3220
movq -0x20(%rbp), %rdi
movq %rax, 0x1d8(%rdi)
movl -0x10(%rbp), %eax
shll %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x20(%rbp), %rdi
movq %rax, 0x230(%rdi)
movl -0x10(%rbp), %eax
shll %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x20(%rbp), %rdi
movq %rax, 0x238(%rdi)
movl -0xc(%rbp), %eax
imull -0x8(%rbp), %eax
imull -0x10(%rbp), %eax
movl -0x14(%rbp), %ecx
addl 0x10(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl %eax, 0x58(%rdi)
movl 0x58(%rdi), %eax
movl %eax, 0x54(%rdi)
movl 0x100(%rdi), %eax
addl $0x1, %eax
imull $0x1e, %eax, %eax
movl %eax, 0x68(%rdi)
movl -0x4(%rbp), %eax
imull 0x58(%rdi), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x20(%rbp), %rdi
movq %rax, 0x260(%rdi)
movl -0x4(%rbp), %eax
imull 0x58(%rdi), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x20(%rbp), %rdi
movq %rax, 0x268(%rdi)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x10(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x4bd8c
movq -0x20(%rbp), %rax
movq 0x230(%rax), %rax
movslq -0x18(%rbp), %rcx
movss 0x25470(%rip), %xmm0    # 0x711ec
movss %xmm0, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4bd59
movq -0x20(%rbp), %rax
leaq 0x39(%rip), %rcx        # 0x4bdd0
movq %rcx, 0x10(%rax)
leaq 0x15ae(%rip), %rcx      # 0x4d350
movq %rcx, 0x18(%rax)
movq 0x3724b(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x297e9(%rip), %rsi     # 0x755a0
movb $0x0, %al
callq 0x3240
xorl %edi, %edi
callq 0x31e0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop