// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/crop_layer.c
// Function: forward_crop_layer
void forward_crop_layer(const crop_layer l, network net)
{
    int i,j,c,b,row,col;
    int index;
    int count = 0;
    int flip = (l.flip && rand()%2);
    int dh = rand()%(l.h - l.out_h + 1);
    int dw = rand()%(l.w - l.out_w + 1);
    float scale = 2;
    float trans = -1;
    if(l.noadjust){
        scale = 1;
        trans = 0;
    }
    if(!net.train){
        flip = 0;
        dh = (l.h - l.out_h)/2;
        dw = (l.w - l.out_w)/2;
    }
    for(b = 0; b < l.batch; ++b){
        for(c = 0; c < l.c; ++c){
            for(i = 0; i < l.out_h; ++i){
                for(j = 0; j < l.out_w; ++j){
                    if(flip){
                        col = l.w - dw - j - 1;    
                    }else{
                        col = j + dw;
                    }
                    row = i + dh;
                    index = col+l.w*(row+l.h*(c + l.c*b)); 
                    l.output[count++] = net.input[index]*scale + trans;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x4b0(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0x10(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movl $0x0, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, 0xb0(%rcx)
movb %al, -0x35(%rbp)
je 0x30486
callq 0x34b0
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
setne %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
callq 0x34b0
movq -0x40(%rbp), %rdx
movl 0x6c(%rdx), %ecx
subl 0x78(%rdx), %ecx
addl $0x1, %ecx
cltd
idivl %ecx
movl %edx, -0x28(%rbp)
callq 0x34b0
movq -0x40(%rbp), %rdx
movl 0x70(%rdx), %ecx
subl 0x7c(%rdx), %ecx
addl $0x1, %ecx
cltd
idivl %ecx
movq -0x40(%rbp), %rax
movl %edx, -0x2c(%rbp)
movss 0x40d43(%rip), %xmm0    # 0x71210
movss %xmm0, -0x30(%rbp)
movss 0x43c02(%rip), %xmm0    # 0x740dc
movss %xmm0, -0x34(%rbp)
cmpl $0x0, 0x114(%rax)
je 0x304fd
movss 0x40b1c(%rip), %xmm0    # 0x7100c
movss %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0xf8(%rax)
jne 0x30537
movq -0x40(%rbp), %rcx
movl $0x0, -0x24(%rbp)
movl 0x6c(%rcx), %eax
subl 0x78(%rcx), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, -0x28(%rbp)
movl 0x70(%rcx), %eax
subl 0x7c(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x40(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x48(%rcx), %eax
jge 0x3066e
movl $0x0, -0xc(%rbp)
movq -0x40(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x74(%rcx), %eax
jge 0x3065e
movl $0x0, -0x4(%rbp)
movq -0x40(%rbp), %rcx
movl -0x4(%rbp), %eax
cmpl 0x78(%rcx), %eax
jge 0x3064e
movl $0x0, -0x8(%rbp)
movq -0x40(%rbp), %rcx
movl -0x8(%rbp), %eax
cmpl 0x7c(%rcx), %eax
jge 0x3063e
cmpl $0x0, -0x24(%rbp)
je 0x305ae
movq -0x40(%rbp), %rax
movl 0x70(%rax), %eax
subl -0x2c(%rbp), %eax
subl -0x8(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x305b7
movl -0x8(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movl -0x4(%rbp), %edx
addl -0x28(%rbp), %edx
movl %edx, -0x14(%rbp)
movl -0x18(%rbp), %edx
movl 0x70(%rax), %esi
movl -0x14(%rbp), %edi
movl 0x6c(%rax), %r8d
movl -0xc(%rbp), %r9d
movl 0x74(%rax), %r10d
imull -0x10(%rbp), %r10d
addl %r10d, %r9d
imull %r9d, %r8d
addl %r8d, %edi
imull %edi, %esi
addl %esi, %edx
movl %edx, -0x1c(%rbp)
movq 0xd8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movss -0x30(%rbp), %xmm2
movss -0x34(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x268(%rax), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x30583
jmp 0x30640
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3056c
jmp 0x30650
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x30555
jmp 0x30660
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3053e
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)