// File: /workspace/github_c_makefile_star2_O3/emmett1[P]st/x.c
// Function: bpress
void
bpress(XEvent *e)
{
	struct timespec now;
	MouseShortcut *ms;
	MouseKey *mk;
	int snap;

	if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
		mousereport(e);
		return;
	}

	if (tisaltscr()) {
		for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
			if (e->xbutton.button == ms->b
					&& match(ms->mask, e->xbutton.state)) {
				ttywrite(ms->s, strlen(ms->s), 1);
				return;
			}
		}
	}

	for (mk = mkeys; mk < mkeys + LEN(mkeys); mk++) {
		if (e->xbutton.button == mk->b
				&& match(mk->mask, e->xbutton.state)) {
			mk->func(&mk->arg);
			return;
		}
	}

	if (e->xbutton.button == Button1) {
		/*
		 * If the user clicks below predefined timeouts specific
		 * snapping behaviour is exposed.
		 */
		clock_gettime(CLOCK_MONOTONIC, &now);
		if (TIMEDIFF(now, xsel.tclick2) <= tripleclicktimeout) {
			snap = SNAP_LINE;
		} else if (TIMEDIFF(now, xsel.tclick1) <= doubleclicktimeout) {
			snap = SNAP_WORD;
		} else {
			snap = 0;
		}
		xsel.tclick2 = xsel.tclick1;
		xsel.tclick1 = now;

		selstart(evcol(e), evrow(e), snap);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movzwl 0xeb32(%rip), %eax      # 0x1bda8
testl $0xc018, %eax           # imm = 0xC018
je 0xd292
testb $0x1, 0x50(%rbx)
jne 0xd292
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xdb84
callq 0x78dc
movl 0x54(%rbx), %ecx
testl %eax, %eax
je 0xd2e0
movb $0x1, %al
xorl %edx, %edx
leaq 0x7ac7(%rip), %rsi      # 0x14d70
movl $0xffffdfef, %edi       # imm = 0xFFFFDFEF
cmpl (%rdx,%rsi), %ecx
jne 0xd2d2
movl 0x4(%rdx,%rsi), %r8d
cmpl $-0x1, %r8d
je 0xd450
movl 0x50(%rbx), %r9d
andl %edi, %r9d
cmpl %r8d, %r9d
je 0xd450
movl $0x10, %edx
testb $0x1, %al
movl $0x0, %eax
jne 0xd2ae
movl $0x10, %edx
leaq 0x81c4(%rip), %rax      # 0x154b0
movl $0xffffdfef, %esi       # imm = 0xFFFFDFEF
cmpl -0x10(%rdx,%rax), %ecx
jne 0xd314
movl -0xc(%rdx,%rax), %edi
cmpl $-0x1, %edi
je 0xd441
movl 0x50(%rbx), %r8d
andl %esi, %r8d
cmpl %edi, %r8d
je 0xd441
leaq 0x18(%rdx), %rdi
addq $-0x10, %rdx
cmpq $0x18, %rdx
movq %rdi, %rdx
jb 0xd2f1
cmpl $0x1, %ecx
jne 0xd439
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x5130
movq (%r14), %rdx
movq 0x8(%r14), %rax
movq %rdx, %rcx
subq 0xeacf(%rip), %rcx      # 0x1be20
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
movq %rax, %rcx
subq 0xeac1(%rip), %rcx      # 0x1be28
cvtsi2sd %rcx, %xmm1
divsd 0x175c(%rip), %xmm1     # 0xead0
addsd %xmm0, %xmm1
movl $0x2, %ecx
movsd 0x1783(%rip), %xmm0     # 0xeb08
ucomisd %xmm1, %xmm0
jae 0xd3cd
subq 0xea7e(%rip), %rdx      # 0x1be10
imulq $0x3e8, %rdx, %rcx      # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
subq 0xea70(%rip), %rax      # 0x1be18
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x1718(%rip), %xmm1     # 0xead0
addsd %xmm0, %xmm1
movsd 0x174c(%rip), %xmm0     # 0xeb10
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
setae %cl
movups 0xea3c(%rip), %xmm0     # 0x1be10
movups %xmm0, 0xea45(%rip)     # 0x1be20
movups 0x8(%rsp), %xmm0
movups %xmm0, 0xea29(%rip)     # 0x1be10
movl 0x40(%rbx), %edx
xorl %esi, %esi
movl $0x0, %eax
cmpl $0xc, %edx
jl 0xd406
addl $-0xc, %edx
movl 0xe991(%rip), %eax      # 0x1bd90
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
cltd
idivl 0xe997(%rip)            # 0x1bda4
movl %eax, %edi
movl 0x44(%rbx), %eax
cmpl $0xc, %eax
jl 0xd427
addl $-0xc, %eax
movl 0xe974(%rip), %esi      # 0x1bd94
decl %esi
cmpl %esi, %eax
cmovll %eax, %esi
movl %esi, %eax
cltd
idivl 0xe970(%rip)            # 0x1bda0
movl %eax, %esi
movl %ecx, %edx
callq 0x5f38
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq (%rax,%rdx), %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmpq *-0x8(%rdx,%rax)
movq 0x8(%rdx,%rsi), %rbx
movq %rbx, %rdi
callq 0x5320
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x6d9b