// File: /workspace/github_c_makefile_star2_O1/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 0xfc62
movl $0x1, %eax
shll %cl, %eax
orl %eax, 0x1122e(%rip)     # 0x20e90
movzwl 0x110cb(%rip), %eax     # 0x20d34
testl $0xc018, %eax           # imm = 0xC018
je 0xfc85
testb $0x1, 0x50(%rbx)
jne 0xfc85
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x104ea
movl $0x10, %ecx
leaq 0xe67f(%rip), %rax      # 0x1e310
movl $0xffff9fef, %edx       # imm = 0xFFFF9FEF
cmpl -0x10(%rcx,%rax), %r14d
jne 0xfcb7
movl -0xc(%rcx,%rax), %esi
cmpl $-0x1, %esi
je 0xfdf7
movl 0x50(%rbx), %edi
andl %edx, %edi
cmpl %esi, %edi
je 0xfdf7
leaq 0x18(%rcx), %rsi
addq $-0x10, %rcx
cmpq $0x18, %rcx
movq %rsi, %rcx
jb 0xfc96
movq %rbx, %rdi
xorl %esi, %esi
callq 0x106c4
cmpl $0x1, %r14d
jne 0xfdef
testl %eax, %eax
jne 0xfdef
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x6150
movq (%r14), %rdx
movq 0x8(%r14), %rax
movq %rdx, %rcx
subq 0x11109(%rip), %rcx     # 0x20e10
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
movq %rax, %rcx
subq 0x110fb(%rip), %rcx     # 0x20e18
cvtsi2sd %rcx, %xmm1
divsd 0x22de(%rip), %xmm1     # 0x12008
addsd %xmm0, %xmm1
movl $0x2, %ecx
movsd 0x6f4d(%rip), %xmm0     # 0x16c88
ucomisd %xmm1, %xmm0
jae 0xfd83
subq 0x110b8(%rip), %rdx     # 0x20e00
imulq $0x3e8, %rdx, %rcx      # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
subq 0x110aa(%rip), %rax     # 0x20e08
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x229a(%rip), %xmm1     # 0x12008
addsd %xmm0, %xmm1
movsd 0x6f16(%rip), %xmm0     # 0x16c90
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
setae %cl
movups 0x11076(%rip), %xmm0    # 0x20e00
movups %xmm0, 0x1107f(%rip)    # 0x20e10
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x11063(%rip)    # 0x20e00
movl 0x40(%rbx), %edx
xorl %esi, %esi
subl 0x10f7c(%rip), %edx     # 0x20d24
movl $0x0, %eax
js 0xfdbc
movl 0x10f5b(%rip), %eax     # 0x20d10
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
cltd
idivl 0x10f69(%rip)           # 0x20d2c
movl %eax, %edi
movl 0x44(%rbx), %eax
subl 0x10f52(%rip), %eax     # 0x20d20
js 0xfddd
movl 0x10f3e(%rip), %esi     # 0x20d14
decl %esi
cmpl %esi, %eax
cmovll %eax, %esi
movl %esi, %eax
cltd
idivl 0x10f42(%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)