// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/lstm_layer.c
// Function: make_lstm_layer
layer make_lstm_layer(int batch, int inputs, int outputs, int steps, int batch_normalize, int adam)
{
    fprintf(stderr, "LSTM Layer: %d inputs, %d outputs\n", inputs, outputs);
    batch = batch / steps;
    layer l = { 0 };
    l.batch = batch;
    l.type = LSTM;
    l.steps = steps;
    l.inputs = inputs;

    l.uf = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.uf) = make_connected_layer(batch*steps, inputs, outputs, LINEAR, batch_normalize, adam);
    l.uf->batch = batch;

    l.ui = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.ui) = make_connected_layer(batch*steps, inputs, outputs, LINEAR, batch_normalize, adam);
    l.ui->batch = batch;

    l.ug = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.ug) = make_connected_layer(batch*steps, inputs, outputs, LINEAR, batch_normalize, adam);
    l.ug->batch = batch;

    l.uo = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.uo) = make_connected_layer(batch*steps, inputs, outputs, LINEAR, batch_normalize, adam);
    l.uo->batch = batch;

    l.wf = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.wf) = make_connected_layer(batch*steps, outputs, outputs, LINEAR, batch_normalize, adam);
    l.wf->batch = batch;

    l.wi = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.wi) = make_connected_layer(batch*steps, outputs, outputs, LINEAR, batch_normalize, adam);
    l.wi->batch = batch;

    l.wg = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.wg) = make_connected_layer(batch*steps, outputs, outputs, LINEAR, batch_normalize, adam);
    l.wg->batch = batch;

    l.wo = malloc(sizeof(layer));
    fprintf(stderr, "\t\t");
    *(l.wo) = make_connected_layer(batch*steps, outputs, outputs, LINEAR, batch_normalize, adam);
    l.wo->batch = batch;

    l.batch_normalize = batch_normalize;
    l.outputs = outputs;

    l.output = calloc(outputs*batch*steps, sizeof(float));
    l.state = calloc(outputs*batch, sizeof(float));

    l.forward = forward_lstm_layer;
    l.update = update_lstm_layer;

    l.prev_state_cpu =  calloc(batch*outputs, sizeof(float));
    l.prev_cell_cpu =   calloc(batch*outputs, sizeof(float));
    l.cell_cpu =        calloc(batch*outputs*steps, sizeof(float));

    l.f_cpu =           calloc(batch*outputs, sizeof(float));
    l.i_cpu =           calloc(batch*outputs, sizeof(float));
    l.g_cpu =           calloc(batch*outputs, sizeof(float));
    l.o_cpu =           calloc(batch*outputs, sizeof(float));
    l.c_cpu =           calloc(batch*outputs, sizeof(float));
    l.h_cpu =           calloc(batch*outputs, sizeof(float));
    l.temp_cpu =        calloc(batch*outputs, sizeof(float));
    l.temp2_cpu =       calloc(batch*outputs, sizeof(float));
    l.temp3_cpu =       calloc(batch*outputs, sizeof(float));
    l.dc_cpu =          calloc(batch*outputs, sizeof(float));
    l.dh_cpu =          calloc(batch*outputs, sizeof(float));


    return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2570, %rsp           # imm = 0x2570
movq %rdi, -0x2528(%rbp)
movq %rdi, -0x2520(%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)
movq 0x33af4(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
leaq 0x2615d(%rip), %rsi     # 0x75671
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %eax
cltd
idivl -0x10(%rbp)
movl %eax, -0x4(%rbp)
xorl %esi, %esi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3190
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %eax
movl %eax, 0x48(%rdi)
movl $0x11, (%rdi)
movl -0x10(%rbp), %eax
movl %eax, 0xc0(%rdi)
movl -0x8(%rbp), %eax
movl %eax, 0x54(%rdi)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x460(%rdi)
movq 0x33a7f(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25f31(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x460(%rdi), %rax
movq %rax, -0x2568(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x4b8(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2568(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x460(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x470(%rdi)
movq 0x339e5(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25e97(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x470(%rdi), %rax
movq %rax, -0x2560(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x958(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2560(%rbp), %rdi
leaq -0x958(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x470(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x480(%rdi)
movq 0x3394b(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25dfd(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x480(%rdi), %rax
movq %rax, -0x2558(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0xdf8(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2558(%rbp), %rdi
leaq -0xdf8(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x480(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x450(%rdi)
movq 0x338b1(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25d63(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x450(%rdi), %rax
movq %rax, -0x2550(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x1298(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2550(%rbp), %rdi
leaq -0x1298(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x450(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x468(%rdi)
movq 0x33817(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25cc9(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x468(%rdi), %rax
movq %rax, -0x2548(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x1738(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2548(%rbp), %rdi
leaq -0x1738(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x468(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x478(%rdi)
movq 0x3377d(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25c2f(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x478(%rdi), %rax
movq %rax, -0x2540(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x1bd8(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2540(%rbp), %rdi
leaq -0x1bd8(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x478(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x488(%rdi)
movq 0x336e3(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25b95(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x488(%rdi), %rax
movq %rax, -0x2538(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x2078(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2538(%rbp), %rdi
leaq -0x2078(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x488(%rdi), %rax
movl %ecx, 0x48(%rax)
movl $0x4a0, %edi            # imm = 0x4A0
callq 0x32d0
movq -0x2528(%rbp), %rdi
movq %rax, 0x458(%rdi)
movq 0x33649(%rip), %rax     # 0x82ff8
movq (%rax), %rdi
leaq 0x25afb(%rip), %rsi     # 0x754b4
movb $0x0, %al
callq 0x3240
movq -0x2528(%rbp), %rdi
movq 0x458(%rdi), %rax
movq %rax, -0x2530(%rbp)
movl -0x4(%rbp), %esi
imull -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %r9d
movl 0x10(%rbp), %eax
leaq -0x2518(%rbp), %rdi
movl $0x3, %r8d
movl %eax, (%rsp)
callq 0x3c260
movq -0x2530(%rbp), %rdi
leaq -0x2518(%rbp), %rsi
movl $0x4a0, %edx            # imm = 0x4A0
callq 0x3280
movq -0x2528(%rbp), %rdi
movl -0x4(%rbp), %ecx
movq 0x458(%rdi), %rax
movl %ecx, 0x48(%rax)
movl -0x14(%rbp), %eax
movl %eax, 0x40(%rdi)
movl -0xc(%rbp), %eax
movl %eax, 0x58(%rdi)
movl -0xc(%rbp), %eax
imull -0x4(%rbp), %eax
imull -0x10(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x268(%rdi)
movl -0xc(%rbp), %eax
imull -0x4(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x1e0(%rdi)
leaq 0x20b(%rip), %rax       # 0x4fc90
movq %rax, 0x10(%rdi)
leaq 0xb50(%rip), %rax       # 0x505e0
movq %rax, 0x20(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x318(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x348(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
imull -0x10(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x350(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x358(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x360(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x368(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x370(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x378(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x310(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x320(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x328(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x330(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, 0x380(%rdi)
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3220
movq -0x2528(%rbp), %rdi
movq %rax, %rcx
movq -0x2520(%rbp), %rax
movq %rcx, 0x338(%rdi)
addq $0x2570, %rsp           # imm = 0x2570
popq %rbp
retq
nopw (%rax,%rax)