// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movzwl 0xe9c1(%rip), %eax      # 0x1ada8
testw $0xc018, %ax            # imm = 0xC018
je 0xc403
testb $0x1, 0x50(%rbx)
jne 0xc403
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xcc7a
callq 0x711d
movl 0x54(%rbx), %ecx
testl %eax, %eax
je 0xc44b
xorl %eax, %eax
leaq 0x7958(%rip), %rdx      # 0x13d70
movl $0xffffdfef, %esi       # imm = 0xFFFFDFEF
cmpq $0x1f, %rax
ja 0xc44b
cmpl (%rax,%rdx), %ecx
jne 0xc445
movl 0x4(%rax,%rdx), %edi
cmpl $-0x1, %edi
je 0xc537
movl 0x50(%rbx), %r8d
andl %esi, %r8d
cmpl %edi, %r8d
je 0xc537
addq $0x10, %rax
jmp 0xc41d
xorl %eax, %eax
leaq 0x805c(%rip), %rdx      # 0x144b0
movl $0xffffdfef, %esi       # imm = 0xFFFFDFEF
cmpq $0x2f, %rax
ja 0xc487
cmpl (%rax,%rdx), %ecx
jne 0xc481
movl 0x4(%rax,%rdx), %edi
cmpl $-0x1, %edi
je 0xc523
movl 0x50(%rbx), %r8d
andl %esi, %r8d
cmpl %edi, %r8d
je 0xc523
addq $0x18, %rax
jmp 0xc459
cmpl $0x1, %ecx
jne 0xc595
pushq $0x1
popq %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x5130
movq (%r14), %rax
movq %rax, %rcx
subq 0xe975(%rip), %rcx      # 0x1ae20
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
movq 0x8(%r14), %rcx
movq %rcx, %rdx
subq 0xe963(%rip), %rdx      # 0x1ae28
cvtsi2sd %rdx, %xmm1
divsd 0x15ce(%rip), %xmm1     # 0xdaa0
addsd %xmm0, %xmm1
movsd 0x15fa(%rip), %xmm0     # 0xdad8
ucomisd %xmm1, %xmm0
jae 0xc55a
subq 0xe925(%rip), %rax      # 0x1ae10
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
cvtsi2sd %rax, %xmm0
subq 0xe91a(%rip), %rcx      # 0x1ae18
cvtsi2sd %rcx, %xmm1
divsd 0x1595(%rip), %xmm1     # 0xdaa0
addsd %xmm0, %xmm1
movsd 0x15c9(%rip), %xmm0     # 0xdae0
xorl %ebp, %ebp
ucomisd %xmm1, %xmm0
setae %bpl
jmp 0xc55d
leaq (%rax,%rdx), %rdi
addq $0x10, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmpq *0x8(%rax,%rdx)
movq 0x8(%rax,%rdx), %rbx
movq %rbx, %rdi
callq 0x5320
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x67bc
pushq $0x2
popq %rbp
movups 0xe8ac(%rip), %xmm0     # 0x1ae10
movups %xmm0, 0xe8b5(%rip)     # 0x1ae20
movups (%rsp), %xmm0
movups %xmm0, 0xe89a(%rip)     # 0x1ae10
movq %rbx, %rdi
callq 0xcde9
movl %eax, %r14d
movq %rbx, %rdi
callq 0xce0b
movl %r14d, %edi
movl %eax, %esi
movl %ebp, %edx
callq 0x5b86
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq