// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0xc(%rbp)
movl $0x1, %eax
cmpl -0xc(%rbp), %eax
jg 0x13a5f
cmpl $0xb, -0xc(%rbp)
jg 0x13a5f
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
orl 0x111db(%rip), %eax     # 0x24c34
movl %eax, 0x111d5(%rip)     # 0x24c34
movl 0x1108b(%rip), %eax     # 0x24af0
andl $0xc018, %eax           # imm = 0xC018
cmpl $0x0, %eax
je 0x13a8f
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
andl 0xe8c4(%rip), %eax      # 0x22340
cmpl $0x0, %eax
jne 0x13a8f
movq -0x8(%rbp), %rdi
callq 0x14880
jmp 0x13c31
leaq 0xcaaa(%rip), %rax      # 0x20540
movq %rax, -0x30(%rbp)
leaq 0xca9f(%rip), %rax      # 0x20540
addq $0x30, %rax
cmpq %rax, -0x30(%rbp)
jae 0x13af9
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x13ae9
movq -0x30(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x14540
cmpl $0x0, %eax
je 0x13ae9
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
callq *%rax
jmp 0x13c31
jmp 0x13aeb
movq -0x30(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x30(%rbp)
jmp 0x13a9a
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x14b50
cmpl $0x0, %eax
je 0x13b0e
jmp 0x13c31
cmpl $0x1, -0xc(%rbp)
jne 0x13c31
movl $0x1, %edi
leaq -0x20(%rbp), %rsi
callq 0x6150
movq 0x1108b(%rip), %rdx     # 0x24bb8
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rdx, %rcx
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm1
movq 0x11075(%rip), %rcx     # 0x24bc0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x24ad(%rip), %xmm2     # 0x16008
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movl 0xe7db(%rip), %eax      # 0x22344
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jb 0x13b7d
movl $0x2, -0x34(%rbp)
jmp 0x13bdd
movq 0x11024(%rip), %rdx     # 0x24ba8
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rdx, %rcx
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
cvtsi2sd %rcx, %xmm1
movq 0x1100e(%rip), %rcx     # 0x24bb0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x2456(%rip), %xmm2     # 0x16008
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movl 0xe788(%rip), %eax      # 0x22348
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jb 0x13bd4
movl $0x1, -0x34(%rbp)
jmp 0x13bdb
movl $0x0, -0x34(%rbp)
jmp 0x13bdd
movq 0x10fc4(%rip), %rax     # 0x24ba8
movq %rax, 0x10fcd(%rip)     # 0x24bb8
movq 0x10fbe(%rip), %rax     # 0x24bb0
movq %rax, 0x10fc7(%rip)     # 0x24bc0
movq -0x20(%rbp), %rax
movq %rax, 0x10fa4(%rip)     # 0x24ba8
movq -0x18(%rbp), %rax
movq %rax, 0x10fa1(%rip)     # 0x24bb0
movq -0x8(%rbp), %rdi
callq 0x14c30
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x14ca0
movl -0x38(%rbp), %edi
movl %eax, %esi
movl -0x34(%rbp), %edx
callq 0x6f40
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)