// File: /workspace/github_c_makefile_star2_O3/halcy[P]quasi_crystals_bot/Graphics/DrawingLines.c
// Function: DrawLine
void DrawLine(Bitmap *bitmap,int x1,int y1,int x2,int y2,Pixel c)
{
	if(x1>=0 && y1>=0 && x1<bitmap->width && y1<bitmap->height &&
	x2>=0 && y2>=0 && x2<bitmap->width && y2<bitmap->height)
	{
		DrawLineNoClip(bitmap,x1,y1,x2,y2,c);
		return;
	}

	if(x1<0&&x2<0) return;
	if(y1<0&&y2<0) return;
	if(x1>=bitmap->width && x2>=bitmap->width) return;
	if(y1>=bitmap->height && y2>=bitmap->height) return;

	GenericDrawLine(bitmap,x1,y1,x2,y2,c,NULL,DrawPixelFunction,DrawHorizontalLineFunction,DrawVerticalLineFunction);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq -0x18(%rsp), %rsp
movl %edx, %eax
movl %r9d, %ebx
movl %r8d, %ebp
orl %esi, %edx
movq %rdi, %r14
js 0x68a4
movswl (%r14), %edi
cmpl %esi, %edi
jle 0x68a4
movswl 0x2(%r14), %edx
cmpl %ebp, %edx
jle 0x68a4
cmpl %ecx, %edi
jle 0x68a4
movl %ebp, %edi
orl %ecx, %edi
js 0x68a4
cmpl %eax, %edx
jle 0x68a4
movq %r14, %rdi
movl %eax, %edx
movl %ebp, %r8d
movl %ebx, %r9d
leaq 0x18(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6a4d
movl %ecx, %edx
movl %ebp, %edi
andl %esi, %edx
andl %eax, %edi
orl %edx, %edi
js 0x6a3d
movswl (%r14), %edx
cmpl %esi, %edx
setle %dil
cmpl %ecx, %edx
setle %dl
testb %dl, %dil
jne 0x6a3d
movswl 0x2(%r14), %edx
cmpl %eax, %edx
setle %dil
cmpl %ebp, %edx
setle %dl
testb %dl, %dil
jne 0x6a3d
movl %ecx, %r8d
subl %esi, %r8d
jne 0x68fc
movl %ebp, %ecx
subl %eax, %ecx
jle 0x6934
incl %ecx
movq %r14, %rdi
movl %eax, %edx
jmp 0x693f
movl %ebp, %r9d
subl %eax, %r9d
jne 0x6956
movl %ecx, %r8d
subl %esi, %r8d
jg 0x6912
movl %esi, %r8d
subl %ecx, %r8d
incl %r8d
movq %r14, %rdi
movl %eax, %edx
movl %r8d, %ecx
movl %ebx, %r8d
leaq 0x18(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x95f0
subl %ebp, %eax
movq %r14, %rdi
movl %ebp, %edx
incl %eax
movl %eax, %ecx
movl %ebx, %r8d
leaq 0x18(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x96e3
movl %r9d, %edx
movl %r8d, %edi
negl %edx
cmovsl %r9d, %edx
negl %edi
cmovsl %r8d, %edi
cmpl %edi, %edx
jbe 0x6974
movl %ecx, %r15d
movl %esi, %r8d
jmp 0x697e
movl %ebp, %r15d
movl %eax, %r8d
movl %ecx, %ebp
movl %esi, %eax
cmpl %ebp, %eax
jle 0x698b
movl %r8d, %ecx
movl %eax, 0xc(%rsp)
jmp 0x6997
movl %r15d, %ecx
movl %ebp, 0xc(%rsp)
movl %r8d, %r15d
movl %eax, %ebp
movl 0xc(%rsp), %r13d
xorl %eax, %eax
movl %r15d, %esi
subl %ebp, %r13d
subl %ecx, %esi
movl %r13d, 0x14(%rsp)
movl %esi, %r12d
setl %al
negl %r12d
leal -0x1(%rax,%rax), %eax
cmovsl %esi, %r12d
sarl %r13d
movl %eax, 0x10(%rsp)
cmpl %edi, %edx
jbe 0x6a03
cmpl %ebp, 0xc(%rsp)
jl 0x6a3d
incl 0xc(%rsp)
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x847c
subl %r12d, %r13d
incl %ebp
movl %r13d, %eax
sarl $0x1f, %eax
movl %eax, %ecx
andl 0x10(%rsp), %eax
andl 0x14(%rsp), %ecx
addl %eax, %r15d
addl %ecx, %r13d
cmpl %ebp, 0xc(%rsp)
jne 0x69d1
jmp 0x6a3d
cmpl %ebp, 0xc(%rsp)
jl 0x6a3d
incl 0xc(%rsp)
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x847c
subl %r12d, %r13d
incl %ebp
movl %r13d, %eax
sarl $0x1f, %eax
movl %eax, %ecx
andl 0x10(%rsp), %eax
andl 0x14(%rsp), %ecx
addl %eax, %r15d
addl %ecx, %r13d
cmpl %ebp, 0xc(%rsp)
jne 0x6a0d
leaq 0x18(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq