// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clippoly4
static int clippoly4(int cx1, int cy1, int cx2, int cy2)
{
	int n, nn, z, zz, x, x1, x2, y, y1, y2, t;

	nn = 0; z = 0;
	do
	{
		zz = ((z+1)&3);
		x1 = nrx1[z]; x2 = nrx1[zz]-x1;

		if ((cx1 <= x1) && (x1 <= cx2))
			nrx2[nn] = x1, nry2[nn] = nry1[z], nn++;

		if (x2 <= 0) x = cx2; else x = cx1;
		t = x-x1;
		if (((t-x2)^t) < 0)
			nrx2[nn] = x, nry2[nn] = nry1[z]+scale(t,nry1[zz]-nry1[z],x2), nn++;

		if (x2 <= 0) x = cx1; else x = cx2;
		t = x-x1;
		if (((t-x2)^t) < 0)
			nrx2[nn] = x, nry2[nn] = nry1[z]+scale(t,nry1[zz]-nry1[z],x2), nn++;

		z = zz;
	} while (z != 0);
	if (nn < 3) return(0);

	n = 0; z = 0;
	do
	{
		zz = z+1; if (zz == nn) zz = 0;
		y1 = nry2[z]; y2 = nry2[zz]-y1;

		if ((cy1 <= y1) && (y1 <= cy2))
			nry1[n] = y1, nrx1[n] = nrx2[z], n++;

		if (y2 <= 0) y = cy2; else y = cy1;
		t = y-y1;
		if (((t-y2)^t) < 0)
			nry1[n] = y, nrx1[n] = nrx2[z]+scale(t,nrx2[zz]-nrx2[z],y2), n++;

		if (y2 <= 0) y = cy1; else y = cy2;
		t = y-y1;
		if (((t-y2)^t) < 0)
			nry1[n] = y, nrx1[n] = nrx2[z]+scale(t,nrx2[zz]-nrx2[z],y2), n++;

		z = zz;
	} while (z != 0);
	return(n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
andl $0x3, %eax
movl %eax, -0x24(%rbp)
movslq -0x20(%rbp), %rcx
leaq 0x547ae7(%rip), %rax    # 0x5a8ae0
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x547ad6(%rip), %rax    # 0x5a8ae0
movl (%rax,%rcx,4), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jg 0x61059
movl -0x2c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jg 0x61059
movl -0x2c(%rbp), %edx
movslq -0x1c(%rbp), %rcx
leaq 0x547acf(%rip), %rax    # 0x5a8b00
movl %edx, (%rax,%rcx,4)
movslq -0x20(%rbp), %rcx
leaq 0x547a81(%rip), %rax    # 0x5a8ac0
movl (%rax,%rcx,4), %edx
movslq -0x1c(%rbp), %rcx
leaq 0x547ad3(%rip), %rax    # 0x5a8b20
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x30(%rbp)
jg 0x61067
movl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x6106d
movl -0x8(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
subl -0x30(%rbp), %eax
xorl -0x40(%rbp), %eax
cmpl $0x0, %eax
jge 0x610e9
movl -0x28(%rbp), %edx
movslq -0x1c(%rbp), %rcx
leaq 0x547a6e(%rip), %rax    # 0x5a8b00
movl %edx, (%rax,%rcx,4)
movslq -0x20(%rbp), %rcx
leaq 0x547a20(%rip), %rax    # 0x5a8ac0
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movl -0x40(%rbp), %edi
movslq -0x24(%rbp), %rcx
leaq 0x547a0c(%rip), %rax    # 0x5a8ac0
movl (%rax,%rcx,4), %esi
movslq -0x20(%rbp), %rcx
leaq 0x5479fe(%rip), %rax    # 0x5a8ac0
subl (%rax,%rcx,4), %esi
movl -0x30(%rbp), %edx
callq 0x37720
movl -0x44(%rbp), %edx
addl %eax, %edx
movslq -0x1c(%rbp), %rcx
leaq 0x547a43(%rip), %rax    # 0x5a8b20
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x30(%rbp)
jg 0x610f7
movl -0x8(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x610fd
movl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
subl -0x30(%rbp), %eax
xorl -0x40(%rbp), %eax
cmpl $0x0, %eax
jge 0x61179
movl -0x28(%rbp), %edx
movslq -0x1c(%rbp), %rcx
leaq 0x5479de(%rip), %rax    # 0x5a8b00
movl %edx, (%rax,%rcx,4)
movslq -0x20(%rbp), %rcx
leaq 0x547990(%rip), %rax    # 0x5a8ac0
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x40(%rbp), %edi
movslq -0x24(%rbp), %rcx
leaq 0x54797c(%rip), %rax    # 0x5a8ac0
movl (%rax,%rcx,4), %esi
movslq -0x20(%rbp), %rcx
leaq 0x54796e(%rip), %rax    # 0x5a8ac0
subl (%rax,%rcx,4), %esi
movl -0x30(%rbp), %edx
callq 0x37720
movl -0x48(%rbp), %edx
addl %eax, %edx
movslq -0x1c(%rbp), %rcx
leaq 0x5479b3(%rip), %rax    # 0x5a8b20
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x60fe2
cmpl $0x3, -0x1c(%rbp)
jge 0x6119b
movl $0x0, -0x4(%rbp)
jmp 0x61362
movl $0x0, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x611c1
movl $0x0, -0x24(%rbp)
movslq -0x20(%rbp), %rcx
leaq 0x547954(%rip), %rax    # 0x5a8b20
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x547943(%rip), %rax    # 0x5a8b20
movl (%rax,%rcx,4), %eax
subl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x38(%rbp), %eax
jg 0x6122c
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x6122c
movl -0x38(%rbp), %edx
movslq -0x18(%rbp), %rcx
leaq 0x5478bc(%rip), %rax    # 0x5a8ac0
movl %edx, (%rax,%rcx,4)
movslq -0x20(%rbp), %rcx
leaq 0x5478ee(%rip), %rax    # 0x5a8b00
movl (%rax,%rcx,4), %edx
movslq -0x18(%rbp), %rcx
leaq 0x5478c0(%rip), %rax    # 0x5a8ae0
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x3c(%rbp)
jg 0x6123a
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x61240
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
subl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
subl -0x3c(%rbp), %eax
xorl -0x40(%rbp), %eax
cmpl $0x0, %eax
jge 0x612bc
movl -0x34(%rbp), %edx
movslq -0x18(%rbp), %rcx
leaq 0x54785b(%rip), %rax    # 0x5a8ac0
movl %edx, (%rax,%rcx,4)
movslq -0x20(%rbp), %rcx
leaq 0x54788d(%rip), %rax    # 0x5a8b00
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x40(%rbp), %edi
movslq -0x24(%rbp), %rcx
leaq 0x547879(%rip), %rax    # 0x5a8b00
movl (%rax,%rcx,4), %esi
movslq -0x20(%rbp), %rcx
leaq 0x54786b(%rip), %rax    # 0x5a8b00
subl (%rax,%rcx,4), %esi
movl -0x3c(%rbp), %edx
callq 0x37720
movl -0x4c(%rbp), %edx
addl %eax, %edx
movslq -0x18(%rbp), %rcx
leaq 0x547830(%rip), %rax    # 0x5a8ae0
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x3c(%rbp)
jg 0x612ca
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x612d0
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
subl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
subl -0x3c(%rbp), %eax
xorl -0x40(%rbp), %eax
cmpl $0x0, %eax
jge 0x6134c
movl -0x34(%rbp), %edx
movslq -0x18(%rbp), %rcx
leaq 0x5477cb(%rip), %rax    # 0x5a8ac0
movl %edx, (%rax,%rcx,4)
movslq -0x20(%rbp), %rcx
leaq 0x5477fd(%rip), %rax    # 0x5a8b00
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movl -0x40(%rbp), %edi
movslq -0x24(%rbp), %rcx
leaq 0x5477e9(%rip), %rax    # 0x5a8b00
movl (%rax,%rcx,4), %esi
movslq -0x20(%rbp), %rcx
leaq 0x5477db(%rip), %rax    # 0x5a8b00
subl (%rax,%rcx,4), %esi
movl -0x3c(%rbp), %edx
callq 0x37720
movl -0x50(%rbp), %edx
addl %eax, %edx
movslq -0x18(%rbp), %rcx
leaq 0x5477a0(%rip), %rax    # 0x5a8ae0
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x611a9
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)