// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl 0x10216(%rip), %eax     # 0x203d8
andl $0xc018, %eax           # imm = 0xC018
cmpl $0x0, %eax
je 0x101ec
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
andl 0x9b27(%rip), %eax      # 0x19d00
cmpl $0x0, %eax
jne 0x101ec
movq -0x8(%rbp), %rdi
callq 0x110b0
jmp 0x1040f
callq 0x7d90
cmpl $0x0, %eax
je 0x1027e
leaq 0x9b0f(%rip), %rax      # 0x19d10
movq %rax, -0x20(%rbp)
leaq 0x9b04(%rip), %rax      # 0x19d10
addq $0x20, %rax
cmpq %rax, -0x20(%rbp)
jae 0x1027c
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x1026c
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x10c90
cmpl $0x0, %eax
je 0x1026c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5320
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x7020
jmp 0x1040f
jmp 0x1026e
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
jmp 0x10205
jmp 0x1027e
leaq 0x746b(%rip), %rax      # 0x176f0
movq %rax, -0x28(%rbp)
leaq 0x7460(%rip), %rax      # 0x176f0
addq $0x30, %rax
cmpq %rax, -0x28(%rbp)
jae 0x102e8
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x102d8
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x10c90
cmpl $0x0, %eax
je 0x102d8
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
callq *%rax
jmp 0x1040f
jmp 0x102da
movq -0x28(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x28(%rbp)
jmp 0x10289
movq -0x8(%rbp), %rax
cmpl $0x1, 0x54(%rax)
jne 0x1040f
movl $0x1, %edi
leaq -0x18(%rbp), %rsi
callq 0x5130
movq 0x10155(%rip), %rdx     # 0x20460
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rdx, %rcx
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm1
movq 0x1013f(%rip), %rcx     # 0x20468
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x2a9f(%rip), %xmm2     # 0x12dd8
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movl 0x99e9(%rip), %eax      # 0x19d30
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1035b
movl $0x2, -0x2c(%rbp)
jmp 0x103bb
movq 0x100ee(%rip), %rdx     # 0x20450
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rdx, %rcx
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm1
movq 0x100d8(%rip), %rcx     # 0x20458
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x2a48(%rip), %xmm2     # 0x12dd8
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movl 0x9996(%rip), %eax      # 0x19d34
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jb 0x103b2
movl $0x1, -0x2c(%rbp)
jmp 0x103b9
movl $0x0, -0x2c(%rbp)
jmp 0x103bb
movq 0x1008e(%rip), %rax     # 0x20450
movq %rax, 0x10097(%rip)     # 0x20460
movq 0x10088(%rip), %rax     # 0x20458
movq %rax, 0x10091(%rip)     # 0x20468
movq -0x18(%rbp), %rax
movq %rax, 0x1006e(%rip)     # 0x20450
movq -0x10(%rbp), %rax
movq %rax, 0x1006b(%rip)     # 0x20458
movq -0x8(%rbp), %rdi
callq 0x11320
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x11390
movl -0x3c(%rbp), %edi
movl %eax, %esi
movl -0x2c(%rbp), %edx
callq 0x5d00
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)