// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/data.c
// Function: correct_boxes
void correct_boxes(box_label *boxes, int n, float dx, float dy, float sx, float sy, int flip)
{
    int i;
    for(i = 0; i < n; ++i){
        if(boxes[i].x == 0 && boxes[i].y == 0) {
            boxes[i].x = 999999;
            boxes[i].y = 999999;
            boxes[i].w = 999999;
            boxes[i].h = 999999;
            continue;
        }
        boxes[i].left   = boxes[i].left  * sx - dx;
        boxes[i].right  = boxes[i].right * sx - dx;
        boxes[i].top    = boxes[i].top   * sy - dy;
        boxes[i].bottom = boxes[i].bottom* sy - dy;

        if(flip){
            float swap = boxes[i].left;
            boxes[i].left = 1. - boxes[i].right;
            boxes[i].right = 1. - swap;
        }

        boxes[i].left =  constrain(0, 1, boxes[i].left);
        boxes[i].right = constrain(0, 1, boxes[i].right);
        boxes[i].top =   constrain(0, 1, boxes[i].top);
        boxes[i].bottom =   constrain(0, 1, boxes[i].bottom);

        boxes[i].x = (boxes[i].left+boxes[i].right)/2;
        boxes[i].y = (boxes[i].top+boxes[i].bottom)/2;
        boxes[i].w = (boxes[i].right - boxes[i].left);
        boxes[i].h = (boxes[i].bottom - boxes[i].top);

        boxes[i].w = constrain(0, 1, boxes[i].w);
        boxes[i].h = constrain(0, 1, boxes[i].h);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movss %xmm3, 0xc(%rsp)
movss %xmm2, 0x8(%rsp)
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
testl %esi, %esi
jle 0x29fc1
movl %edx, %ebx
movq %rdi, %r14
movaps 0x29391(%rip), %xmm0    # 0x53150
movaps 0x10(%rsp), %xmm1
xorps %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
movaps 0x20(%rsp), %xmm1
xorps %xmm0, %xmm1
movaps %xmm1, 0x20(%rsp)
movl %esi, %eax
shlq $0x2, %rax
leaq (%rax,%rax,8), %r15
xorl %r12d, %r12d
xorps %xmm2, %xmm2
movss 0x29217(%rip), %xmm1    # 0x53008
movss 0x4(%r14,%r12), %xmm0
ucomiss %xmm2, %xmm0
jne 0x29e1f
jp 0x29e1f
movss 0x8(%r14,%r12), %xmm0
ucomiss %xmm2, %xmm0
jne 0x29e1f
jp 0x29e1f
movaps 0x2cacc(%rip), %xmm0    # 0x568e0
movups %xmm0, 0x4(%r14,%r12)
jmp 0x29fb4
movss 0x14(%r14,%r12), %xmm0
movss 0x8(%rsp), %xmm2
mulss %xmm2, %xmm0
movaps 0x10(%rsp), %xmm3
addss %xmm3, %xmm0
movss %xmm0, 0x14(%r14,%r12)
movss 0x18(%r14,%r12), %xmm5
mulss %xmm2, %xmm5
addss %xmm3, %xmm5
movss %xmm5, 0x18(%r14,%r12)
movss 0x1c(%r14,%r12), %xmm2
movss 0xc(%rsp), %xmm3
mulss %xmm3, %xmm2
movaps 0x20(%rsp), %xmm4
addss %xmm4, %xmm2
movss %xmm2, 0x1c(%r14,%r12)
movss 0x20(%r14,%r12), %xmm2
mulss %xmm3, %xmm2
addss %xmm4, %xmm2
movss %xmm2, 0x20(%r14,%r12)
testl %ebx, %ebx
je 0x29ead
movaps %xmm1, %xmm2
subss %xmm5, %xmm2
movss %xmm2, 0x14(%r14,%r12)
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
movss %xmm2, 0x18(%r14,%r12)
movss 0x14(%r14,%r12), %xmm2
xorps %xmm0, %xmm0
callq 0xf008
movss %xmm0, 0x14(%r14,%r12)
movss 0x18(%r14,%r12), %xmm2
xorps %xmm0, %xmm0
movss 0x29133(%rip), %xmm1    # 0x53008
callq 0xf008
movss %xmm0, 0x18(%r14,%r12)
movss 0x1c(%r14,%r12), %xmm2
xorps %xmm0, %xmm0
movss 0x29115(%rip), %xmm1    # 0x53008
callq 0xf008
movss %xmm0, 0x1c(%r14,%r12)
movss 0x20(%r14,%r12), %xmm2
xorps %xmm0, %xmm0
movss 0x290f7(%rip), %xmm1    # 0x53008
callq 0xf008
movss %xmm0, 0x20(%r14,%r12)
movss 0x14(%r14,%r12), %xmm1
movss 0x18(%r14,%r12), %xmm2
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
movss 0x292fa(%rip), %xmm5    # 0x53234
mulss %xmm5, %xmm3
movss %xmm3, 0x4(%r14,%r12)
movss 0x1c(%r14,%r12), %xmm3
movaps %xmm0, %xmm4
addss %xmm3, %xmm4
mulss %xmm5, %xmm4
movss %xmm4, 0x8(%r14,%r12)
subss %xmm1, %xmm2
movss %xmm2, 0xc(%r14,%r12)
subss %xmm3, %xmm0
movss %xmm0, 0x10(%r14,%r12)
xorps %xmm0, %xmm0
movss 0x29089(%rip), %xmm1    # 0x53008
callq 0xf008
movss %xmm0, 0xc(%r14,%r12)
movss 0x10(%r14,%r12), %xmm2
xorps %xmm0, %xmm0
movss 0x2906b(%rip), %xmm1    # 0x53008
callq 0xf008
movss 0x2905e(%rip), %xmm1    # 0x53008
movss %xmm0, 0x10(%r14,%r12)
xorps %xmm2, %xmm2
addq $0x24, %r12
cmpq %r12, %r15
jne 0x29df1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq