// File: /workspace/github_cpp_makefile_star2_O1/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 0x5440(%rip), %eax      # 0xa228
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cvtsi2sd %ecx, %xmm4
cvtsi2sd %eax, %xmm6
movsd 0x53e7(%rip), %xmm0     # 0xa1e8
subsd 0x53d7(%rip), %xmm0     # 0xa1e0
divsd %xmm0, %xmm6
movsd 0x10(%rbp), %xmm1
movsd 0x18(%rbp), %xmm0
movapd %xmm6, %xmm7
mulsd %xmm1, %xmm7
movl 0x5407(%rip), %eax      # 0xa22c
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cvtsi2sd %ecx, %xmm5
addsd %xmm4, %xmm7
cvtsi2sd %eax, %xmm8
movsd 0x53b5(%rip), %xmm2     # 0xa1f8
subsd 0x53a5(%rip), %xmm2     # 0xa1f0
xorpd 0x24fc(%rip), %xmm8     # 0x7350
divsd %xmm2, %xmm8
movapd %xmm8, %xmm9
mulsd %xmm0, %xmm9
addsd %xmm5, %xmm9
movsd 0x28(%rbp), %xmm3
movsd 0x30(%rbp), %xmm2
mulsd %xmm3, %xmm6
addsd %xmm4, %xmm6
mulsd %xmm2, %xmm8
addsd %xmm5, %xmm8
subsd %xmm7, %xmm6
subsd %xmm9, %xmm8
movapd 0x254b(%rip), %xmm5     # 0x73e0
movapd %xmm6, %xmm4
andpd %xmm5, %xmm4
andpd %xmm8, %xmm5
maxsd %xmm5, %xmm4
cvttsd2si %xmm4, %r14d
testl %r14d, %r14d
jle 0x4faa
leaq 0x28(%rbp), %rax
cvttpd2dq %xmm4, %xmm4
leaq 0x10(%rbp), %rcx
cvtdq2pd %xmm4, %xmm4
subsd %xmm1, %xmm3
subsd %xmm0, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm3
movsd 0x10(%rax), %xmm0
movsd 0x10(%rcx), %xmm5
subsd %xmm5, %xmm0
movapd %xmm3, %xmm10
jne 0x4ef5
movapd %xmm3, %xmm10
jp 0x4ef5
movapd %xmm2, %xmm10
movapd %xmm0, %xmm11
divsd %xmm3, %xmm11
jne 0x4f0c
jp 0x4f0c
divsd %xmm2, %xmm0
movapd %xmm0, %xmm11
movsd %xmm5, -0x28(%rbp)
movsd %xmm11, -0x30(%rbp)
divsd %xmm4, %xmm6
divsd %xmm4, %xmm8
movapd %xmm8, -0x60(%rbp)
divsd %xmm4, %xmm10
movsd %xmm10, -0x20(%rbp)
movapd %xmm9, -0x50(%rbp)
movapd %xmm6, -0x70(%rbp)
movsd %xmm7, -0x38(%rbp)
movsd %xmm1, -0x18(%rbp)
movapd %xmm6, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm7, %xmm0
callq 0x1090
cvttsd2si %xmm0, %ebx
movapd -0x60(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
callq 0x1090
cvttsd2si %xmm0, %esi
movsd -0x20(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movl %ebx, %edi
callq 0x4d3f
movsd -0x18(%rbp), %xmm1
movsd -0x38(%rbp), %xmm7
movapd -0x70(%rbp), %xmm6
addsd 0x208b(%rip), %xmm1     # 0x7030
decl %r14d
jne 0x4f41
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq