// File: /workspace/github_cpp_makefile_star2_O2/XuhuiSun95[P]My-OpenGL/primitive.cpp
// Function: lineCheck(pixel, pixel)
void lineCheck(pixel p1, pixel p2){
    int px, py;
    double zDepth;
    double px1 = dimx / 2 + dimx / (frustumRight - frustumLeft) * p1.x;
    double py1 = dimy / 2 - dimy / (frustumTop - frustumBottom) * p1.y;
    double px2 = dimx / 2 + dimx / (frustumRight - frustumLeft) * p2.x;
    double py2 = dimy / 2 - dimy / (frustumTop - frustumBottom) * p2.y;
    double dpx = px2 - px1;
    double dpy = py2 - py1;
    int steps = (fabs(dpx) > fabs(dpy))? fabs(dpx):fabs(dpy);
    double pxInc = dpx / steps;
    double pyInc = dpy / steps;
    double xInc = (p2.x - p1.x) / steps;
    double yInc = (p2.y - p1.y) / steps;
    for(int i = 0; i < steps; i++){
        px = round(px1 + pxInc * i);
        py = round(py1 + pyInc * i);
        if((p2.x - p1.x) != 0)
            zDepth = (p2.zDepth - p1.zDepth) / (p2.x - p1.x) * (xInc * i) + p1.zDepth;
        else
            zDepth = (p2.zDepth - p1.zDepth) / (p2.y - p1.y) * (yInc * i) + p1.zDepth;
        inputBuffer(px, py, zDepth);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movl 0x4810(%rip), %ecx      # 0x9228
pushq $0x2
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
cvtsi2sd %eax, %xmm4
cvtsi2sd %ecx, %xmm6
movsd 0x47b8(%rip), %xmm0     # 0x91e8
subsd 0x47a8(%rip), %xmm0     # 0x91e0
divsd %xmm0, %xmm6
movsd 0x10(%rbp), %xmm1
movsd 0x18(%rbp), %xmm0
movapd %xmm6, %xmm7
movl 0x47dc(%rip), %ecx      # 0x922c
movl %ecx, %eax
cltd
idivl %esi
cvtsi2sd %eax, %xmm5
mulsd %xmm1, %xmm7
cvtsi2sd %ecx, %xmm8
movsd 0x478e(%rip), %xmm2     # 0x91f8
subsd 0x477e(%rip), %xmm2     # 0x91f0
xorpd 0x18d5(%rip), %xmm8     # 0x6350
addsd %xmm4, %xmm7
divsd %xmm2, %xmm8
movapd %xmm8, %xmm9
mulsd %xmm0, %xmm9
addsd %xmm5, %xmm9
movsd 0x28(%rbp), %xmm2
movsd 0x30(%rbp), %xmm3
mulsd %xmm2, %xmm6
addsd %xmm4, %xmm6
mulsd %xmm3, %xmm8
addsd %xmm5, %xmm8
movsd %xmm7, -0x30(%rbp)
subsd %xmm7, %xmm6
movapd %xmm9, -0x50(%rbp)
subsd %xmm9, %xmm8
movapd 0x1915(%rip), %xmm4     # 0x63e0
movapd %xmm6, %xmm5
andpd %xmm4, %xmm5
andpd %xmm8, %xmm4
maxsd %xmm4, %xmm5
cvttsd2si %xmm5, %eax
cvttpd2dq %xmm5, %xmm4
cvtdq2pd %xmm4, %xmm4
divsd %xmm4, %xmm6
movapd %xmm6, -0x70(%rbp)
divsd %xmm4, %xmm8
movapd %xmm8, -0x60(%rbp)
subsd %xmm1, %xmm2
subsd %xmm0, %xmm3
movsd 0x38(%rbp), %xmm0
movsd 0x20(%rbp), %xmm1
movsd %xmm1, -0x20(%rbp)
subsd %xmm1, %xmm0
xorl %r14d, %r14d
testl %eax, %eax
cmovgl %eax, %r14d
xorpd %xmm1, %xmm1
movapd %xmm2, %xmm5
cmpneqsd %xmm1, %xmm5
andpd %xmm5, %xmm2
andnpd %xmm3, %xmm5
orpd %xmm2, %xmm5
divsd %xmm5, %xmm0
movsd %xmm0, -0x28(%rbp)
divsd %xmm4, %xmm5
movapd %xmm5, -0x40(%rbp)
subl $0x1, %r14d
jb 0x4baf
movapd -0x70(%rbp), %xmm0
mulsd %xmm1, %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm1, -0x18(%rbp)
callq 0x1090
cvttsd2si %xmm0, %ebx
movapd -0x60(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
callq 0x1090
cvttsd2si %xmm0, %esi
movapd -0x40(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
addsd -0x20(%rbp), %xmm0
movl %ebx, %edi
callq 0x4972
movsd -0x18(%rbp), %xmm1
addsd 0x1483(%rip), %xmm1     # 0x6030
jmp 0x4b4b
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq