// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: buttonpress
void
buttonpress(XEvent *e) {
   unsigned int i, x, click;
   Arg arg = {0};
   Client *c = NULL;
   Monitor *m;
   menu_t *mm;
   XButtonPressedEvent *ev = &e->xbutton;

   click = ClkRootWin;

   if(ev->button == Button1)
   {
      if(menu)
      {
         if(!(mm = wintomenu(ev->window)))
         {
            closemenus();
         } else
         { buttonmenu(mm, ev->x, ev->y); return; }
      }
   }

   if(!autofocusmonitor)
   {
      // focus monitor if necessary
      if((m = wintomon(ev->window)) && m != selmon) {
         unfocus(selmon->sel, True);
         focusmon(m);
      }
   }

   if(ev->window == selmon->barwin) {
      i = x = 0;
      do {
         if(autohide) {
            if((occ & 1 << i ) || (m->tagset[m->seltags] & 1 << i))
               x += TEXTW(tags[i]);
         }
         else
            x += TEXTW(tags[i]);
      } while(ev->x >= x && ++i < LENGTH(tags));

      if(i < LENGTH(tags)) {
         if(autohide) {
            if((occ & 1 << i ) || (m->tagset[m->seltags] & 1 << i))
            {
               click  = ClkTagBar;
               arg.ui = 1 << i;
            }
         }
         else {
            click  = ClkTagBar;
            arg.ui = 1 << i;
         }
      }
      else if(ev->x < x + blw)
         click = ClkLtSymbol;
      else if(ev->x > selmon->titlebarend)
         click = ClkStatusText;
      else{
         arg.ui = ev->x;
         click = ClkWinTitle;
      }
   }
   else if((c = wintoclient(ev->window))) {
      if(clicktofocus)
      {
         focusmon(c->mon);
         focus(c);
      }
      click = ClkClientWin;
   }

   for(i = 0; i < LENGTH(buttons); i++)
      if(click                              == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
            && CLEANMASK(buttons[i].mask)   == CLEANMASK(ev->state))
         buttons[i].func((click             == ClkTagBar || click == ClkWinTitle || click == ClkClientWin) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, (%rsp)
cmpl $0x1, 0x54(%rdi)
sete %al
movq 0x8cd4(%rip), %rdi      # 0x13480
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa7d4
movq 0x20(%rbx), %rax
cmpq %rax, (%rdi)
je 0xa89d
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
jne 0xa7bd
callq 0xbcd9
movq 0x20(%rbx), %rax
movq 0x8c91(%rip), %rcx      # 0x13470
cmpq 0x98(%rcx), %rax
jne 0xa859
xorl %r14d, %r14d
leaq 0x697e(%rip), %r12      # 0x11170
xorl %ebp, %ebp
cmpl $0x0, 0x8c7d(%rip)      # 0x13478
je 0xa809
movl 0x900d(%rip), %eax      # 0x13810
btl %r14d, %eax
jae 0xa829
movq (%r12), %r15
movq %r15, %rdi
callq 0x52c0
movq %r15, %rdi
movl %eax, %esi
callq 0x8235
addl %ebp, %eax
addl 0x8e11(%rip), %eax      # 0x13638
movl %eax, %ebp
movl 0x40(%rbx), %eax
cmpl %ebp, %eax
jb 0xa8d4
incq %r14
addq $0x8, %r12
cmpq $0x9, %r14
jne 0xa7f4
addl 0x8fcd(%rip), %ebp      # 0x13814
cmpl %ebp, %eax
jae 0xa8fd
movl $0x1, %ebp
jmp 0xa939
movq 0x8c08(%rip), %rcx      # 0x13468
movl $0x5, %ebp
testq %rcx, %rcx
je 0xa939
movq 0x78(%rcx), %r14
testq %r14, %r14
je 0xa889
cmpq %rax, 0x1a8(%r14)
je 0xa8b6
movq 0x190(%r14), %r14
jmp 0xa872
movq 0x90(%rcx), %rcx
xorl %r14d, %r14d
testq %rcx, %rcx
jne 0xa86e
jmp 0xa93c
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbca1
movq 0x1a0(%r14), %rdi
callq 0x9d7c
movq %r14, %rdi
callq 0x9b07
movb $0x1, %r14b
movl $0x4, %ebp
jmp 0xa93c
cmpl $0x0, 0x8b9d(%rip)      # 0x13478
je 0xa913
movl $0x1, %eax
movl %r14d, %ecx
shll %cl, %eax
movl 0x8f23(%rip), %ecx      # 0x13810
xorl %ebp, %ebp
btl %r14d, %ecx
jae 0xa934
movl %eax, (%rsp)
movb $0x1, %r14b
jmp 0xa93c
movq 0x8b6c(%rip), %rcx      # 0x13470
cmpl 0xd4(%rcx), %eax
jle 0xa927
movl $0x2, %ebp
jmp 0xa939
movl $0x1, %eax
movl %r14d, %ecx
shll %cl, %eax
movl %eax, (%rsp)
movb $0x1, %r14b
xorl %ebp, %ebp
jmp 0xa93c
movl %eax, (%rsp)
movb $0x1, %r14b
movl $0x3, %ebp
jmp 0xa93c
movl $0x5, %ebp
xorl %r14d, %r14d
movl $0x18, %r15d
leaq 0x8527(%rip), %r12      # 0x12e70
movq %rsp, %r13
cmpl -0x18(%r15,%r12), %ebp
jne 0xa996
movq -0x8(%r15,%r12), %rax
testq %rax, %rax
je 0xa996
movl -0x10(%r15,%r12), %ecx
cmpl 0x54(%rbx), %ecx
jne 0xa996
movl 0x8eab(%rip), %ecx      # 0x13818
notl %ecx
movl 0x50(%rbx), %edx
xorl -0x14(%r15,%r12), %edx
andl %ecx, %edx
testl $0xfffffffd, %edx       # imm = 0xFFFFFFFD
jne 0xa996
testb %r14b, %r14b
je 0xa990
cmpl $0x0, (%r15,%r12)
movq %r13, %rdi
je 0xa994
leaq (%r12,%r15), %rdi
callq *%rax
addq $0x20, %r15
cmpq $0x1f8, %r15            # imm = 0x1F8
jne 0xa94c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq