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

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

	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;
		}
	}

	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 0xb3cc(%rip), %eax      # 0x17eb8
testl $0xc018, %eax           # imm = 0xC018
je 0xcb08
testb $0x1, 0x50(%rbx)
jne 0xcb08
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xd38d
movl 0x54(%rbx), %eax
movb $0x1, %cl
xorl %edx, %edx
leaq 0x826a(%rip), %rsi      # 0x14d80
movl $0xffffdfef, %edi       # imm = 0xFFFFDFEF
cmpl (%rdx,%rsi), %eax
jne 0xcb3f
movl 0x4(%rdx,%rsi), %r8d
cmpl $-0x1, %r8d
je 0xcc6a
movl 0x50(%rbx), %r9d
andl %edi, %r9d
cmpl %r8d, %r9d
je 0xcc6a
movl $0x10, %edx
testb $0x1, %cl
movl $0x0, %ecx
jne 0xcb1b
cmpl $0x1, %eax
jne 0xcc62
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x5130
movq (%r14), %rdx
movq 0x8(%r14), %rax
movq %rdx, %rcx
subq 0xb3b6(%rip), %rcx      # 0x17f30
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
movq %rax, %rcx
subq 0xb3a8(%rip), %rcx      # 0x17f38
cvtsi2sd %rcx, %xmm1
divsd 0x1f5b(%rip), %xmm1     # 0xeaf8
addsd %xmm0, %xmm1
movl $0x2, %ecx
movsd 0x1f82(%rip), %xmm0     # 0xeb30
ucomisd %xmm1, %xmm0
jae 0xcbf6
subq 0xb365(%rip), %rdx      # 0x17f20
imulq $0x3e8, %rdx, %rcx      # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
subq 0xb357(%rip), %rax      # 0x17f28
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x1f17(%rip), %xmm1     # 0xeaf8
addsd %xmm0, %xmm1
movsd 0x1f4b(%rip), %xmm0     # 0xeb38
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
setae %cl
movups 0xb323(%rip), %xmm0     # 0x17f20
movups %xmm0, 0xb32c(%rip)     # 0x17f30
movups 0x8(%rsp), %xmm0
movups %xmm0, 0xb310(%rip)     # 0x17f20
movl 0x40(%rbx), %edx
xorl %esi, %esi
movl $0x0, %eax
cmpl $0x2, %edx
jl 0xcc2f
addl $-0x2, %edx
movl 0xb278(%rip), %eax      # 0x17ea0
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
cltd
idivl 0xb27e(%rip)            # 0x17eb4
movl %eax, %edi
movl 0x44(%rbx), %eax
cmpl $0x2, %eax
jl 0xcc50
addl $-0x2, %eax
movl 0xb25b(%rip), %esi      # 0x17ea4
decl %esi
cmpl %esi, %eax
cmovll %eax, %esi
movl %esi, %eax
cltd
idivl 0xb257(%rip)            # 0x17eb0
movl %eax, %esi
movl %ecx, %edx
callq 0x5f88
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rdx,%rsi), %rbx
movq %rbx, %rdi
callq 0x5340
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x6c39