// File: /workspace/github_c_makefile_star2_O2/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 0x20e0f(%rip), %xmm1    # 0x4c234
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 0x2b44f
xorps %xmm10, %xmm10
jmp 0x2b458
movss 0x20e0c(%rip), %xmm10   # 0x4c264
movaps %xmm1, %xmm11
ja 0x2b462
xorps %xmm11, %xmm11
addss %xmm0, %xmm6
addss %xmm2, %xmm8
ucomiss %xmm6, %xmm8
jbe 0x2b483
addss 0x20b8e(%rip), %xmm10   # 0x4c008
addss 0x20db1(%rip), %xmm11   # 0x4c234
ucomiss %xmm8, %xmm4
movss 0x20dd5(%rip), %xmm4    # 0x4c264
movaps %xmm4, %xmm9
ja 0x2b499
movaps %xmm10, %xmm9
xorps %xmm8, %xmm8
xorps %xmm10, %xmm10
ja 0x2b4a7
movaps %xmm11, %xmm10
ucomiss %xmm6, %xmm7
ja 0x2b4b2
movaps %xmm10, %xmm8
jmp 0x2b4bb
movss 0x20b4d(%rip), %xmm9    # 0x4c008
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 0x2b4ec
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 0x2b53d
movaps %xmm4, %xmm3
shufps $0x55, %xmm4, %xmm3     # xmm3 = xmm3[1,1],xmm4[1,1]
addss 0x20aee(%rip), %xmm3    # 0x4c008
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 0x20d04(%rip), %xmm5    # 0x4c234
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 0x2b564
movss 0x20d17(%rip), %xmm3    # 0x4c264
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 0x2b585
movss 0x20a97(%rip), %xmm0    # 0x4c008
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