// File: /workspace/github_c_makefile_star2_O1/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 0xeffc(%rip), %eax      # 0x1bdb8
testl $0xc018, %eax           # imm = 0xC018
je 0xcdd8
testb $0x1, 0x50(%rbx)
jne 0xcdd8
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xd6cc
callq 0x76d2
testl %eax, %eax
je 0xce1e
movl 0x54(%rbx), %ecx
xorl %eax, %eax
leaq 0x7f83(%rip), %rdx      # 0x14d70
movl $0xffffdfef, %esi       # imm = 0xFFFFDFEF
cmpl (%rax,%rdx), %ecx
jne 0xce14
movl 0x4(%rax,%rdx), %edi
cmpl $-0x1, %edi
je 0xcf92
movl 0x50(%rbx), %r8d
andl %esi, %r8d
cmpl %edi, %r8d
je 0xcf92
addq $0x10, %rax
cmpq $0x10, %rax
je 0xcdf2
movl 0x54(%rbx), %edx
movl $0x10, %ecx
leaq 0x8693(%rip), %rax      # 0x154c0
movl $0xffffdfef, %esi       # imm = 0xFFFFDFEF
cmpl -0x10(%rcx,%rax), %edx
jne 0xce55
movl -0xc(%rcx,%rax), %edi
cmpl $-0x1, %edi
je 0xcf83
movl 0x50(%rbx), %r8d
andl %esi, %r8d
cmpl %edi, %r8d
je 0xcf83
leaq 0x18(%rcx), %rdi
addq $-0x10, %rcx
cmpq $0x18, %rcx
movq %rdi, %rcx
jb 0xce32
cmpl $0x1, 0x54(%rbx)
jne 0xcf7b
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x5130
movq (%r14), %rdx
movq 0x8(%r14), %rax
movq %rdx, %rcx
subq 0xef9d(%rip), %rcx      # 0x1be30
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
movq %rax, %rcx
subq 0xef8f(%rip), %rcx      # 0x1be38
cvtsi2sd %rcx, %xmm1
divsd 0x1bfa(%rip), %xmm1     # 0xeab0
addsd %xmm0, %xmm1
movl $0x2, %ecx
movsd 0x1c21(%rip), %xmm0     # 0xeae8
ucomisd %xmm1, %xmm0
jae 0xcf0f
subq 0xef4c(%rip), %rdx      # 0x1be20
imulq $0x3e8, %rdx, %rcx      # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
subq 0xef3e(%rip), %rax      # 0x1be28
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x1bb6(%rip), %xmm1     # 0xeab0
addsd %xmm0, %xmm1
movsd 0x1bea(%rip), %xmm0     # 0xeaf0
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
setae %cl
movups 0xef0a(%rip), %xmm0     # 0x1be20
movups %xmm0, 0xef13(%rip)     # 0x1be30
movups 0x8(%rsp), %xmm0
movups %xmm0, 0xeef7(%rip)     # 0x1be20
movl 0x40(%rbx), %edx
xorl %esi, %esi
movl $0x0, %eax
cmpl $0xc, %edx
jl 0xcf48
addl $-0xc, %edx
movl 0xee5f(%rip), %eax      # 0x1bda0
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
cltd
idivl 0xee65(%rip)            # 0x1bdb4
movl %eax, %edi
movl 0x44(%rbx), %eax
cmpl $0xc, %eax
jl 0xcf69
addl $-0xc, %eax
movl 0xee42(%rip), %esi      # 0x1bda4
decl %esi
cmpl %esi, %eax
cmovll %eax, %esi
movl %esi, %eax
cltd
idivl 0xee3e(%rip)            # 0x1bdb0
movl %eax, %esi
movl %ecx, %edx
callq 0x5f48
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq (%rax,%rcx), %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmpq *-0x8(%rcx,%rax)
movq 0x8(%rax,%rdx), %rbx
movq %rbx, %rdi
callq 0x5320
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x6ca2