// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%rsp)
movq %rdi, %rbx
cmpl $0x1, 0x54(%rdi)
jne 0xa405
cmpq $0x0, 0x90ac(%rip)      # 0x13480
je 0xa405
movq 0x20(%rbx), %rdi
callq 0x58ac
testq %rax, %rax
je 0xa400
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb6a2
callq 0xb6da
movq 0x20(%rbx), %rdi
movq 0x9060(%rip), %rax      # 0x13470
cmpq 0x98(%rax), %rdi
jne 0xa480
xorl %r14d, %r14d
leaq 0x6d4d(%rip), %r12      # 0x11170
xorl %ebp, %ebp
cmpl $0x0, 0x904c(%rip)      # 0x13478
je 0xa43a
movl 0x93dc(%rip), %eax      # 0x13810
btl %r14d, %eax
jae 0xa45a
movq (%r12), %r15
movq %r15, %rdi
callq 0x52c0
movq %r15, %rdi
movl %eax, %esi
callq 0x8039
addl %ebp, %eax
addl 0x91e0(%rip), %eax      # 0x13638
movl %eax, %ebp
movl 0x40(%rbx), %eax
cmpl %ebp, %eax
jb 0xa4a9
incq %r14
addq $0x8, %r12
cmpq $0x9, %r14
jne 0xa425
addl 0x93a0(%rip), %ebp      # 0x13814
cmpl %ebp, %eax
jae 0xa550
pushq $0x1
jmp 0xa4d6
callq 0x757f
testq %rax, %rax
je 0xa4d4
movq %rax, %r14
movq 0x1a0(%rax), %rdi
callq 0x9a34
movq %r14, %rdi
callq 0x97fb
movb $0x1, %r14b
pushq $0x4
popq %rbp
jmp 0xa4da
cmpl $0x0, 0x8fc8(%rip)      # 0x13478
je 0xa566
pushq $0x1
popq %rax
movl %r14d, %ecx
shll %cl, %eax
movl 0x934c(%rip), %ecx      # 0x13810
xorl %ebp, %ebp
btl %r14d, %ecx
jae 0xa4d4
movl %eax, (%rsp)
movb $0x1, %r14b
jmp 0xa4da
pushq $0x5
popq %rbp
xorl %r14d, %r14d
pushq $0x18
popq %r15
leaq 0x898b(%rip), %r12      # 0x12e70
movq %rsp, %r13
cmpq $0x1f8, %r15            # imm = 0x1F8
je 0xa541
cmpl -0x18(%r15,%r12), %ebp
jne 0xa53b
movq -0x8(%r15,%r12), %rax
testq %rax, %rax
je 0xa53b
movl -0x10(%r15,%r12), %ecx
cmpl 0x54(%rbx), %ecx
jne 0xa53b
movl 0x9306(%rip), %ecx      # 0x13818
notl %ecx
movl 0x50(%rbx), %edx
xorl -0x14(%r15,%r12), %edx
andl %ecx, %edx
testl $0xfffffffd, %edx       # imm = 0xFFFFFFFD
jne 0xa53b
testb %r14b, %r14b
je 0xa535
cmpl $0x0, (%r15,%r12)
movq %r13, %rdi
je 0xa539
leaq (%r12,%r15), %rdi
callq *%rax
addq $0x20, %r15
jmp 0xa4e8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8f19(%rip), %rcx      # 0x13470
cmpl 0xd4(%rcx), %eax
jle 0xa57b
pushq $0x2
jmp 0xa4d6
pushq $0x1
popq %rax
movl %r14d, %ecx
shll %cl, %eax
movl %eax, (%rsp)
movb $0x1, %r14b
xorl %ebp, %ebp
jmp 0xa4da
movl %eax, (%rsp)
movb $0x1, %r14b
pushq $0x3
jmp 0xa4a6