// File: /workspace/github_c_makefile_star2_O3/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 0x1c4b5(%rip), %xmm1    # 0x55264
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 0x38dd9
xorps %xmm10, %xmm10
jmp 0x38de2
movss 0x1c4b2(%rip), %xmm10   # 0x55294
movaps %xmm1, %xmm11
ja 0x38dec
xorps %xmm11, %xmm11
addss %xmm0, %xmm6
addss %xmm2, %xmm8
ucomiss %xmm6, %xmm8
jbe 0x38e0d
addss 0x1c204(%rip), %xmm10   # 0x55008
addss 0x1c457(%rip), %xmm11   # 0x55264
ucomiss %xmm8, %xmm4
movss 0x1c47b(%rip), %xmm4    # 0x55294
movaps %xmm4, %xmm9
ja 0x38e23
movaps %xmm10, %xmm9
xorps %xmm8, %xmm8
xorps %xmm10, %xmm10
ja 0x38e31
movaps %xmm11, %xmm10
ucomiss %xmm6, %xmm7
ja 0x38e3c
movaps %xmm10, %xmm8
jmp 0x38e45
movss 0x1c1c3(%rip), %xmm9    # 0x55008
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 0x38e76
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 0x38ec7
movaps %xmm4, %xmm3
shufps $0x55, %xmm4, %xmm3     # xmm3 = xmm3[1,1],xmm4[1,1]
addss 0x1c164(%rip), %xmm3    # 0x55008
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 0x1c3aa(%rip), %xmm5    # 0x55264
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 0x38eee
movss 0x1c3bd(%rip), %xmm3    # 0x55294
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 0x38f0f
movss 0x1c10d(%rip), %xmm0    # 0x55008
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