// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/crnn_layer.c
// Function: make_crnn_layer
layer make_crnn_layer(int batch, int h, int w, int c, int hidden_filters, int output_filters, int steps, ACTIVATION activation, int batch_normalize)
{
    fprintf(stderr, "CRNN Layer: %d x %d x %d image, %d filters\n", h,w,c,output_filters);
    batch = batch / steps;
    layer l = {0};
    l.batch = batch;
    l.type = CRNN;
    l.steps = steps;
    l.h = h;
    l.w = w;
    l.c = c;
    l.out_h = h;
    l.out_w = w;
    l.out_c = output_filters;
    l.inputs = h*w*c;
    l.hidden = h * w * hidden_filters;
    l.outputs = l.out_h * l.out_w * l.out_c;

    l.state = calloc(l.hidden*batch*(steps+1), sizeof(float));

    l.input_layer = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.input_layer) = make_convolutional_layer(batch*steps, h, w, c, hidden_filters, 1, 3, 1, 1,  activation, batch_normalize, 0, 0, 0);
    l.input_layer->batch = batch;

    l.self_layer = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.self_layer) = make_convolutional_layer(batch*steps, h, w, hidden_filters, hidden_filters, 1, 3, 1, 1,  activation, batch_normalize, 0, 0, 0);
    l.self_layer->batch = batch;

    l.output_layer = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.output_layer) = make_convolutional_layer(batch*steps, h, w, hidden_filters, output_filters, 1, 3, 1, 1,  activation, batch_normalize, 0, 0, 0);
    l.output_layer->batch = batch;

    l.output = l.output_layer->output;
    l.delta = l.output_layer->delta;

    l.forward = forward_crnn_layer;
    l.backward = backward_crnn_layer;
    l.update = update_crnn_layer;


    return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe70, %rsp            # imm = 0xE70
movq %rdi, -0xe08(%rbp)
movq %rdi, -0xe00(%rbp)
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movl %esi, -0x4(%rbp)
movl %edx, -0x8(%rbp)
movl %ecx, -0xc(%rbp)
movl %r8d, -0x10(%rbp)
movl %r9d, -0x14(%rbp)
movq 0x38d2b(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
movl 0x10(%rbp), %r9d
leaq 0x2b1f4(%rip), %rsi     # 0x754d9
movb $0x0, %al
callq 0x3240
movq -0xe08(%rbp), %rdi
movl -0x4(%rbp), %eax
cltd
idivl 0x18(%rbp)
movl %eax, -0x4(%rbp)
xorl %esi, %esi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3190
movq -0xe08(%rbp), %rdi
movl -0x4(%rbp), %eax
movl %eax, 0x48(%rdi)
movl $0x12, (%rdi)
movl 0x18(%rbp), %eax
movl %eax, 0xc0(%rdi)
movl -0x8(%rbp), %eax
movl %eax, 0x6c(%rdi)
movl -0xc(%rbp), %eax
movl %eax, 0x70(%rdi)
movl -0x10(%rbp), %eax
movl %eax, 0x74(%rdi)
movl -0x8(%rbp), %eax
movl %eax, 0x78(%rdi)
movl -0xc(%rbp), %eax
movl %eax, 0x7c(%rdi)
movl 0x10(%rbp), %eax
movl %eax, 0x80(%rdi)
movl -0x8(%rbp), %eax
imull -0xc(%rbp), %eax
imull -0x10(%rbp), %eax
movl %eax, 0x54(%rdi)
movl -0x8(%rbp), %eax
imull -0xc(%rbp), %eax
imull -0x14(%rbp), %eax
movl %eax, 0xc4(%rdi)
movl 0x78(%rdi), %eax
imull 0x7c(%rdi), %eax
imull 0x80(%rdi), %eax
movl %eax, 0x58(%rdi)
movl 0xc4(%rdi), %eax
imull -0x4(%rbp), %eax
movl 0x18(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0xe08(%rbp), %rdi
movq %rax, 0x1e0(%rdi)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0xe08(%rbp), %rdi
movq %rax, 0x390(%rdi)
movq 0x38c2f(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x2b0e1(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0xe08(%rbp), %rdi
movq 0x390(%rdi), %rax
movq %rax, -0xe20(%rbp)
movl -0x4(%rbp), %esi
imull 0x18(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
movl -0x14(%rbp), %r9d
movl 0x20(%rbp), %r10d
movl 0x28(%rbp), %eax
leaq -0x4b8(%rbp), %rdi
xorl %r11d, %r11d
movl $0x1, (%rsp)
movl $0x3, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x0, 0x40(%rsp)
callq 0x7560
movq -0xe20(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0xe08(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x390(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0xe08(%rbp), %rdi
movq %rax, 0x398(%rdi)
movq 0x38b53(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x2b005(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0xe08(%rbp), %rdi
movq 0x398(%rdi), %rax
movq %rax, -0xe18(%rbp)
movl -0x4(%rbp), %esi
imull 0x18(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r8d
movl -0x14(%rbp), %r9d
movl 0x20(%rbp), %r10d
movl 0x28(%rbp), %eax
leaq -0x958(%rbp), %rdi
xorl %r11d, %r11d
movl $0x1, (%rsp)
movl $0x3, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x0, 0x40(%rsp)
callq 0x7560
movq -0xe18(%rbp), %rdi
leaq -0x958(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0xe08(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x398(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0xe08(%rbp), %rdi
movq %rax, 0x3a0(%rdi)
movq 0x38a77(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x2af29(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0xe08(%rbp), %rdi
movq 0x3a0(%rdi), %rax
movq %rax, -0xe10(%rbp)
movl -0x4(%rbp), %esi
imull 0x18(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r8d
movl 0x10(%rbp), %r9d
movl 0x20(%rbp), %r10d
movl 0x28(%rbp), %eax
leaq -0xdf8(%rbp), %rdi
xorl %r11d, %r11d
movl $0x1, (%rsp)
movl $0x3, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x0, 0x40(%rsp)
callq 0x7560
movq -0xe10(%rbp), %rdi
leaq -0xdf8(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0xe08(%rbp), %rdi
movq -0xe00(%rbp), %rax
movl -0x4(%rbp), %edx
movq 0x3a0(%rdi), %rcx
movl %edx, 0x48(%rcx)
movq 0x3a0(%rdi), %rcx
movq 0x268(%rcx), %rcx
movq %rcx, 0x268(%rdi)
movq 0x3a0(%rdi), %rcx
movq 0x260(%rcx), %rcx
movq %rcx, 0x260(%rdi)
leaq 0x2a(%rip), %rcx        # 0x4a6a0
movq %rcx, 0x10(%rdi)
leaq 0x41f(%rip), %rcx       # 0x4aaa0
movq %rcx, 0x18(%rdi)
leaq 0x844(%rip), %rcx       # 0x4aed0
movq %rcx, 0x20(%rdi)
addq $0xe70, %rsp            # imm = 0xE70
popq %rbp
retq
nopl (%rax)