// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/box.c
// Function: derivative
dbox derivative(box a, box b)
{
    dbox d;
    d.dx = 0;
    d.dw = 0;
    float l1 = a.x - a.w/2;
    float l2 = b.x - b.w/2;
    if (l1 > l2){
        d.dx -= 1;
        d.dw += .5;
    }
    float r1 = a.x + a.w/2;
    float r2 = b.x + b.w/2;
    if(r1 < r2){
        d.dx += 1;
        d.dw += .5;
    }
    if (l1 > r2) {
        d.dx = -1;
        d.dw = 0;
    }
    if (r1 < l2){
        d.dx = 1;
        d.dw = 0;
    }

    d.dy = 0;
    d.dh = 0;
    float t1 = a.y - a.h/2;
    float t2 = b.y - b.h/2;
    if (t1 > t2){
        d.dy -= 1;
        d.dh += .5;
    }
    float b1 = a.y + a.h/2;
    float b2 = b.y + b.h/2;
    if(b1 < b2){
        d.dy += 1;
        d.dh += .5;
    }
    if (t1 > b2) {
        d.dy = -1;
        d.dh = 0;
    }
    if (b1 < t2){
        d.dy = 1;
        d.dh = 0;
    }
    return d;
}

// Assembly:
movaps %xmm1, %xmm5
movss 0x1c7ba(%rip), %xmm1    # 0x53234
movaps %xmm5, %xmm6
mulss %xmm1, %xmm6
movaps %xmm0, %xmm4
subss %xmm6, %xmm4
movaps %xmm3, %xmm8
mulss %xmm1, %xmm8
movaps %xmm2, %xmm7
subss %xmm8, %xmm7
ucomiss %xmm7, %xmm4
ja 0x36aa4
xorps %xmm10, %xmm10
jmp 0x36aad
movss 0x1c7bb(%rip), %xmm10   # 0x53268
movaps %xmm1, %xmm11
ja 0x36ab7
xorps %xmm11, %xmm11
addss %xmm0, %xmm6
addss %xmm2, %xmm8
ucomiss %xmm6, %xmm8
jbe 0x36ad8
addss 0x1c539(%rip), %xmm10   # 0x53008
addss 0x1c75c(%rip), %xmm11   # 0x53234
ucomiss %xmm8, %xmm4
movss 0x1c784(%rip), %xmm4    # 0x53268
movaps %xmm4, %xmm9
ja 0x36aee
movaps %xmm10, %xmm9
xorps %xmm8, %xmm8
xorps %xmm10, %xmm10
ja 0x36afc
movaps %xmm11, %xmm10
ucomiss %xmm6, %xmm7
ja 0x36b07
movaps %xmm10, %xmm8
jmp 0x36b10
movss 0x1c4f8(%rip), %xmm9    # 0x53008
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
mulss %xmm1, %xmm5
movaps %xmm0, %xmm7
subss %xmm5, %xmm7
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
mulss %xmm1, %xmm3
movaps %xmm2, %xmm6
subss %xmm3, %xmm6
ucomiss %xmm6, %xmm7
ja 0x36b41
xorps %xmm1, %xmm1
xorps %xmm4, %xmm4
movlhps %xmm9, %xmm4            # xmm4 = xmm4[0],xmm9[0]
shufps $0xe2, %xmm9, %xmm4     # xmm4 = xmm4[2,0],xmm9[2,3]
movlhps %xmm8, %xmm1            # xmm1 = xmm1[0],xmm8[0]
shufps $0xe2, %xmm8, %xmm1     # xmm1 = xmm1[2,0],xmm8[2,3]
addss %xmm5, %xmm0
addss %xmm3, %xmm2
ucomiss %xmm0, %xmm2
jbe 0x36b92
movaps %xmm4, %xmm3
shufps $0x55, %xmm4, %xmm3     # xmm3 = xmm3[1,1],xmm4[1,1]
addss 0x1c499(%rip), %xmm3    # 0x53008
movlhps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
shufps $0xe2, %xmm4, %xmm3     # xmm3 = xmm3[2,0],xmm4[2,3]
movaps %xmm1, %xmm5
shufps $0x55, %xmm1, %xmm5     # xmm5 = xmm5[1,1],xmm1[1,1]
addss 0x1c6af(%rip), %xmm5    # 0x53234
movlhps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm5     # xmm5 = xmm5[2,0],xmm1[2,3]
movaps %xmm3, %xmm4
movaps %xmm5, %xmm1
ucomiss %xmm2, %xmm7
xorps %xmm2, %xmm2
jbe 0x36bb9
movss 0x1c6c6(%rip), %xmm3    # 0x53268
movlhps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
shufps $0xe2, %xmm4, %xmm3     # xmm3 = xmm3[2,0],xmm4[2,3]
xorps %xmm5, %xmm5
movlhps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm5     # xmm5 = xmm5[2,0],xmm1[2,3]
movaps %xmm3, %xmm4
movaps %xmm5, %xmm1
ucomiss %xmm0, %xmm6
jbe 0x36bda
movss 0x1c442(%rip), %xmm0    # 0x53008
movlhps %xmm4, %xmm0            # xmm0 = xmm0[0],xmm4[0]
shufps $0xe2, %xmm4, %xmm0     # xmm0 = xmm0[2,0],xmm4[2,3]
movlhps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm2     # xmm2 = xmm2[2,0],xmm1[2,3]
movaps %xmm0, %xmm4
movaps %xmm2, %xmm1
movaps %xmm4, %xmm0
retq