// File: /workspace/github_cpp_makefile_star2_O3/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 $0x70, %rsp
movl 0x554c(%rip), %eax      # 0xa228
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cvtsi2sd %ecx, %xmm4
cvtsi2sd %eax, %xmm6
movsd 0x54f3(%rip), %xmm0     # 0xa1e8
subsd 0x54e3(%rip), %xmm0     # 0xa1e0
divsd %xmm0, %xmm6
movsd 0x10(%rbp), %xmm1
movsd 0x18(%rbp), %xmm0
movapd %xmm6, %xmm7
mulsd %xmm1, %xmm7
movl 0x5513(%rip), %eax      # 0xa22c
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cvtsi2sd %ecx, %xmm5
addsd %xmm4, %xmm7
cvtsi2sd %eax, %xmm8
movsd 0x54c1(%rip), %xmm2     # 0xa1f8
subsd 0x54b1(%rip), %xmm2     # 0xa1f0
xorpd 0x2608(%rip), %xmm8     # 0x7350
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
subsd %xmm7, %xmm6
movapd %xmm9, -0x80(%rbp)
subsd %xmm9, %xmm8
movapd 0x2651(%rip), %xmm5     # 0x73e0
movapd %xmm6, -0x40(%rbp)
movapd %xmm6, %xmm4
andpd %xmm5, %xmm4
movapd %xmm8, -0x30(%rbp)
andpd %xmm8, %xmm5
maxsd %xmm5, %xmm4
cvttsd2si %xmm4, %r14d
testl %r14d, %r14d
jle 0x4e95
leaq 0x28(%rbp), %rax
leaq 0x10(%rbp), %rcx
cvttpd2dq %xmm4, %xmm4
cvtdq2pd %xmm4, %xmm4
movapd -0x40(%rbp), %xmm5
divsd %xmm4, %xmm5
movapd %xmm5, -0x40(%rbp)
movapd -0x30(%rbp), %xmm5
divsd %xmm4, %xmm5
movapd %xmm5, -0x30(%rbp)
subsd %xmm1, %xmm2
subsd %xmm0, %xmm3
movsd 0x10(%rax), %xmm0
movsd 0x10(%rcx), %xmm1
movsd %xmm1, -0x48(%rbp)
subsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
movapd %xmm2, %xmm5
cmpneqsd %xmm1, %xmm5
andpd %xmm5, %xmm2
andnpd %xmm3, %xmm5
orpd %xmm2, %xmm5
divsd %xmm5, %xmm0
movsd %xmm0, -0x50(%rbp)
divsd %xmm4, %xmm5
movapd %xmm5, -0x70(%rbp)
movsd %xmm7, -0x58(%rbp)
movsd %xmm1, -0x18(%rbp)
movapd -0x40(%rbp), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm7, %xmm0
callq 0x1090
cvttsd2si %xmm0, %ebx
movapd -0x30(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
addsd -0x80(%rbp), %xmm0
callq 0x1090
cvttsd2si %xmm0, %esi
movapd -0x70(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
addsd -0x48(%rbp), %xmm0
movl %ebx, %edi
callq 0x4c33
movsd -0x18(%rbp), %xmm1
movsd -0x58(%rbp), %xmm7
addsd 0x21a0(%rip), %xmm1     # 0x7030
decl %r14d
jne 0x4e30
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq