// File: /workspace/github_c_makefile_star2_O3/mcaimi[P]st/x.c
// Function: bpress
void
bpress(XEvent *e)
{
  int btn = e->xbutton.button;
  struct timespec now;
  MouseShortcut *ms;
  MouseKey *mk;
  int snap;

  if (1 <= btn && btn <= 11)
    buttons |= 1 << (btn-1);

  if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
    mousereport(e);
    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 (mouseaction(e, 0))
    return;

  if (btn == 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
movl 0x54(%rdi), %r14d
leal -0x1(%r14), %ecx
cmpl $0xa, %ecx
ja 0x10250
movl $0x1, %eax
shll %cl, %eax
orl %eax, 0x10c40(%rip)     # 0x20e90
movzwl 0x10add(%rip), %eax     # 0x20d34
testl $0xc018, %eax           # imm = 0xC018
je 0x10273
testb $0x1, 0x50(%rbx)
jne 0x10273
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x10ae1
movl $0x10, %ecx
leaq 0xe091(%rip), %rax      # 0x1e310
movl $0xffff9fef, %edx       # imm = 0xFFFF9FEF
cmpl -0x10(%rcx,%rax), %r14d
jne 0x102a5
movl -0xc(%rcx,%rax), %esi
cmpl $-0x1, %esi
je 0x103e8
movl 0x50(%rbx), %edi
andl %edx, %edi
cmpl %esi, %edi
je 0x103e8
leaq 0x18(%rcx), %rsi
addq $-0x10, %rcx
cmpq $0x18, %rcx
movq %rsi, %rcx
jb 0x10284
movl 0x50(%rbx), %edi
movl %r14d, %esi
xorl %edx, %edx
callq 0x10cdf
cmpl $0x1, %r14d
jne 0x103e0
testl %eax, %eax
jne 0x103e0
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x6150
movq (%r14), %rdx
movq 0x8(%r14), %rax
movq %rdx, %rcx
subq 0x10b18(%rip), %rcx     # 0x20e10
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
movq %rax, %rcx
subq 0x10b0a(%rip), %rcx     # 0x20e18
cvtsi2sd %rcx, %xmm1
divsd 0x1ced(%rip), %xmm1     # 0x12008
addsd %xmm0, %xmm1
movl $0x2, %ecx
movsd 0x6974(%rip), %xmm0     # 0x16ca0
ucomisd %xmm1, %xmm0
jae 0x10374
subq 0x10ac7(%rip), %rdx     # 0x20e00
imulq $0x3e8, %rdx, %rcx      # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
subq 0x10ab9(%rip), %rax     # 0x20e08
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x1ca9(%rip), %xmm1     # 0x12008
addsd %xmm0, %xmm1
movsd 0x693d(%rip), %xmm0     # 0x16ca8
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
setae %cl
movups 0x10a85(%rip), %xmm0    # 0x20e00
movups %xmm0, 0x10a8e(%rip)    # 0x20e10
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x10a72(%rip)    # 0x20e00
movl 0x40(%rbx), %edx
xorl %esi, %esi
subl 0x1098b(%rip), %edx     # 0x20d24
movl $0x0, %eax
js 0x103ad
movl 0x1096a(%rip), %eax     # 0x20d10
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
cltd
idivl 0x10978(%rip)           # 0x20d2c
movl %eax, %edi
movl 0x44(%rbx), %eax
subl 0x10961(%rip), %eax     # 0x20d20
js 0x103ce
movl 0x1094d(%rip), %esi     # 0x20d14
decl %esi
cmpl %esi, %eax
cmovll %eax, %esi
movl %esi, %eax
cltd
idivl 0x10951(%rip)           # 0x20d28
movl %eax, %esi
movl %ecx, %edx
callq 0x72d1
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq (%rax,%rcx), %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmpq *-0x8(%rcx,%rax)