// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/lstm_layer.c
// Function: forward_lstm_layer
void forward_lstm_layer(layer l, network state)
{
    network s = { 0 };
    s.train = state.train;
    int i;
    layer wf = *(l.wf);
    layer wi = *(l.wi);
    layer wg = *(l.wg);
    layer wo = *(l.wo);

    layer uf = *(l.uf);
    layer ui = *(l.ui);
    layer ug = *(l.ug);
    layer uo = *(l.uo);

    fill_cpu(l.outputs * l.batch * l.steps, 0, wf.delta, 1);
    fill_cpu(l.outputs * l.batch * l.steps, 0, wi.delta, 1);
    fill_cpu(l.outputs * l.batch * l.steps, 0, wg.delta, 1);
    fill_cpu(l.outputs * l.batch * l.steps, 0, wo.delta, 1);

    fill_cpu(l.outputs * l.batch * l.steps, 0, uf.delta, 1);
    fill_cpu(l.outputs * l.batch * l.steps, 0, ui.delta, 1);
    fill_cpu(l.outputs * l.batch * l.steps, 0, ug.delta, 1);
    fill_cpu(l.outputs * l.batch * l.steps, 0, uo.delta, 1);
    if (state.train) {
        fill_cpu(l.outputs * l.batch * l.steps, 0, l.delta, 1);
    }

    for (i = 0; i < l.steps; ++i) {
        s.input = l.h_cpu;
        forward_connected_layer(wf, s);							
        forward_connected_layer(wi, s);							
        forward_connected_layer(wg, s);							
        forward_connected_layer(wo, s);							

        s.input = state.input;
        forward_connected_layer(uf, s);							
        forward_connected_layer(ui, s);							
        forward_connected_layer(ug, s);							
        forward_connected_layer(uo, s);							

        copy_cpu(l.outputs*l.batch, wf.output, 1, l.f_cpu, 1);
        axpy_cpu(l.outputs*l.batch, 1, uf.output, 1, l.f_cpu, 1);

        copy_cpu(l.outputs*l.batch, wi.output, 1, l.i_cpu, 1);	
        axpy_cpu(l.outputs*l.batch, 1, ui.output, 1, l.i_cpu, 1);	

        copy_cpu(l.outputs*l.batch, wg.output, 1, l.g_cpu, 1);	
        axpy_cpu(l.outputs*l.batch, 1, ug.output, 1, l.g_cpu, 1);	

        copy_cpu(l.outputs*l.batch, wo.output, 1, l.o_cpu, 1);	
        axpy_cpu(l.outputs*l.batch, 1, uo.output, 1, l.o_cpu, 1);	

        activate_array(l.f_cpu, l.outputs*l.batch, LOGISTIC);		
        activate_array(l.i_cpu, l.outputs*l.batch, LOGISTIC);		
        activate_array(l.g_cpu, l.outputs*l.batch, TANH);			
        activate_array(l.o_cpu, l.outputs*l.batch, LOGISTIC);		

        copy_cpu(l.outputs*l.batch, l.i_cpu, 1, l.temp_cpu, 1);		
        mul_cpu(l.outputs*l.batch, l.g_cpu, 1, l.temp_cpu, 1);		
        mul_cpu(l.outputs*l.batch, l.f_cpu, 1, l.c_cpu, 1);			
        axpy_cpu(l.outputs*l.batch, 1, l.temp_cpu, 1, l.c_cpu, 1);	

        copy_cpu(l.outputs*l.batch, l.c_cpu, 1, l.h_cpu, 1);			
        activate_array(l.h_cpu, l.outputs*l.batch, TANH);		
        mul_cpu(l.outputs*l.batch, l.o_cpu, 1, l.h_cpu, 1);	

        copy_cpu(l.outputs*l.batch, l.c_cpu, 1, l.cell_cpu, 1);		
        copy_cpu(l.outputs*l.batch, l.h_cpu, 1, l.output, 1);

        state.input += l.inputs*l.batch;
        l.output    += l.outputs*l.batch;
        l.cell_cpu      += l.outputs*l.batch;

        increment_layer(&wf, 1);
        increment_layer(&wi, 1);
        increment_layer(&wg, 1);
        increment_layer(&wo, 1);

        increment_layer(&uf, 1);
        increment_layer(&ui, 1);
        increment_layer(&ug, 1);
        increment_layer(&uo, 1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c20, %rsp           # imm = 0x2C20
leaq 0x4b0(%rbp), %rax
movq %rax, -0x2620(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x2628(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x110, %edx            # imm = 0x110
callq 0x3190
movq -0x2628(%rbp), %rax
movq -0x2620(%rbp), %rcx
movl 0xf8(%rcx), %ecx
movl %ecx, -0x18(%rbp)
movq 0x468(%rax), %rsi
leaq -0x5b8(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x478(%rax), %rsi
leaq -0xa58(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x488(%rax), %rsi
leaq -0xef8(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x458(%rax), %rsi
leaq -0x1398(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x460(%rax), %rsi
leaq -0x1838(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x470(%rax), %rsi
leaq -0x1cd8(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x480(%rax), %rsi
leaq -0x2178(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movq 0x450(%rax), %rsi
leaq -0x2618(%rbp), %rdi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x358(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x7f8(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0xc98(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x1138(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x15d8(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x1a78(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x1f18(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq -0x23b8(%rbp), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movq -0x2620(%rbp), %rax
cmpl $0x0, 0xf8(%rax)
je 0x4ff50
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
imull 0xc0(%rax), %edi
movq 0x260(%rax), %rsi
xorps %xmm0, %xmm0
movl $0x1, %edx
callq 0x2f740
movl $0x0, -0x114(%rbp)
movq -0x2628(%rbp), %rcx
movl -0x114(%rbp), %eax
cmpl 0xc0(%rcx), %eax
jge 0x505d0
movq -0x2628(%rbp), %rax
movq 0x310(%rax), %rax
movq %rax, -0x38(%rbp)
movq %rsp, %rdi
movq %rdi, -0x2668(%rbp)
movl $0x94, %ecx
leaq -0x5b8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2668(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq %rsp, %rdi
movq %rdi, -0x2660(%rbp)
movl $0x94, %ecx
leaq -0xa58(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2660(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq %rsp, %rdi
movq %rdi, -0x2658(%rbp)
movl $0x94, %ecx
leaq -0xef8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2658(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq %rsp, %rdi
movq %rdi, -0x2650(%rbp)
movl $0x94, %ecx
leaq -0x1398(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2650(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq -0x2620(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x38(%rbp)
movq %rsp, %rdi
movq %rdi, -0x2648(%rbp)
movl $0x94, %ecx
leaq -0x1838(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2648(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq %rsp, %rdi
movq %rdi, -0x2640(%rbp)
movl $0x94, %ecx
leaq -0x1cd8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2640(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq %rsp, %rdi
movq %rdi, -0x2638(%rbp)
movl $0x94, %ecx
leaq -0x2178(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2638(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq %rsp, %rdi
movq %rdi, -0x2630(%rbp)
movl $0x94, %ecx
leaq -0x2618(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x2630(%rbp), %rdi
addq $0x4a0, %rdi            # imm = 0x4A0
movl $0x22, %ecx
leaq -0x110(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x3c6d0
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x350(%rbp), %rsi
movq 0x358(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x15d0(%rbp), %rsi
movq 0x358(%rax), %rcx
movss 0x20e4f(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x7f0(%rbp), %rsi
movq 0x360(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x1a70(%rbp), %rsi
movq 0x360(%rax), %rcx
movss 0x20df3(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0xc90(%rbp), %rsi
movq 0x368(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x1f10(%rbp), %rsi
movq 0x368(%rax), %rcx
movss 0x20d97(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x1130(%rbp), %rsi
movq 0x370(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq -0x23b0(%rbp), %rsi
movq 0x370(%rax), %rcx
movss 0x20d3b(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x2628(%rbp), %rax
movq 0x358(%rax), %rdi
movl 0x58(%rax), %esi
imull 0x48(%rax), %esi
xorl %edx, %edx
callq 0x2dfa0
movq -0x2628(%rbp), %rax
movq 0x360(%rax), %rdi
movl 0x58(%rax), %esi
imull 0x48(%rax), %esi
xorl %edx, %edx
callq 0x2dfa0
movq -0x2628(%rbp), %rax
movq 0x368(%rax), %rdi
movl 0x58(%rax), %esi
imull 0x48(%rax), %esi
movl $0x5, %edx
callq 0x2dfa0
movq -0x2628(%rbp), %rax
movq 0x370(%rax), %rdi
movl 0x58(%rax), %esi
imull 0x48(%rax), %esi
xorl %edx, %edx
callq 0x2dfa0
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x360(%rax), %rsi
movq 0x320(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x368(%rax), %rsi
movq 0x320(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f5a0
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x358(%rax), %rsi
movq 0x378(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f5a0
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x320(%rax), %rsi
movq 0x378(%rax), %rcx
movss 0x20c18(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x378(%rax), %rsi
movq 0x310(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movq 0x310(%rax), %rdi
movl 0x58(%rax), %esi
imull 0x48(%rax), %esi
movl $0x5, %edx
callq 0x2dfa0
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x370(%rax), %rsi
movq 0x310(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f5a0
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x378(%rax), %rsi
movq 0x350(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2628(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x310(%rax), %rsi
movq 0x268(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x2620(%rbp), %rcx
movq -0x2628(%rbp), %rax
movl 0x54(%rax), %esi
imull 0x48(%rax), %esi
movq 0xd8(%rcx), %rdx
movslq %esi, %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movq %rdx, 0xd8(%rcx)
movl 0x58(%rax), %edx
imull 0x48(%rax), %edx
movq 0x268(%rax), %rcx
movslq %edx, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movq %rcx, 0x268(%rax)
movl 0x58(%rax), %edx
imull 0x48(%rax), %edx
movq 0x350(%rax), %rcx
movslq %edx, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movq %rcx, 0x350(%rax)
leaq -0x5b8(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0xa58(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0xef8(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0x1398(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0x1838(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0x1cd8(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0x2178(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
leaq -0x2618(%rbp), %rdi
movl $0x1, %esi
callq 0x50810
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x4ff5a
addq $0x2c20, %rsp           # imm = 0x2C20
popq %rbp
retq
nopl (%rax)