// File: /workspace/github_c_makefile_star2_O1/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 0x8c7b(%rip), %rdi      # 0x13480
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa849
movq 0x20(%rbx), %rax
cmpq %rax, (%rdi)
je 0xa826
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
jne 0xa816
xorl %edi, %edi
testq %rdi, %rdi
je 0xa844
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbd4f
callq 0xbd87
movq 0x20(%rbx), %rax
movq 0x8c1c(%rip), %rcx      # 0x13470
cmpq 0x98(%rcx), %rax
jne 0xa8f2
xorl %r14d, %r14d
leaq 0x6905(%rip), %r12      # 0x11170
xorl %ebp, %ebp
cmpl $0x0, 0x8c04(%rip)      # 0x13478
je 0xa882
movl 0x8f94(%rip), %eax      # 0x13810
btl %r14d, %eax
jae 0xa8a2
movq (%r12), %r15
movq %r15, %rdi
callq 0x52c0
movq %r15, %rdi
movl %eax, %esi
callq 0x8277
addl %ebp, %eax
addl 0x8d98(%rip), %eax      # 0x13638
movl %eax, %ebp
movl 0x40(%rbx), %eax
cmpl %ebp, %eax
jb 0xa8bc
incq %r14
addq $0x8, %r12
cmpq $0x9, %r14
jne 0xa86d
movl $0x9, %r14d
cmpl $0x8, %r14d
ja 0xa922
cmpl $0x0, 0x8baf(%rip)      # 0x13478
je 0xa9f1
movl $0x1, %eax
movl %r14d, %ecx
shll %cl, %eax
movl 0x8f31(%rip), %ecx      # 0x13810
xorl %ebp, %ebp
btl %r14d, %ecx
jae 0xa959
movl %eax, (%rsp)
movb $0x1, %r14b
jmp 0xa97b
movq 0x8b6f(%rip), %rcx      # 0x13468
testq %rcx, %rcx
je 0xa933
movq 0x78(%rcx), %r14
testq %r14, %r14
je 0xa919
cmpq %rax, 0x1a8(%r14)
je 0xa936
movq 0x190(%r14), %r14
jmp 0xa902
movq 0x90(%rcx), %rcx
jmp 0xa8f9
addl 0x8eec(%rip), %ebp      # 0x13814
cmpl %ebp, %eax
jae 0xa960
movl $0x1, %ebp
jmp 0xa978
xorl %r14d, %r14d
testq %r14, %r14
je 0xa959
movq 0x1a0(%r14), %rdi
callq 0x9dcd
movq %r14, %rdi
callq 0x9b58
movb $0x1, %r14b
movl $0x4, %ebp
jmp 0xa97b
movl $0x5, %ebp
jmp 0xa978
movq 0x8b09(%rip), %rcx      # 0x13470
cmpl 0xd4(%rcx), %eax
jle 0xaa08
movl $0x2, %ebp
xorl %r14d, %r14d
movl $0x18, %r15d
leaq 0x84e8(%rip), %r12      # 0x12e70
movq %rsp, %r13
cmpl -0x18(%r15,%r12), %ebp
jne 0xa9d5
movq -0x8(%r15,%r12), %rax
testq %rax, %rax
je 0xa9d5
movl -0x10(%r15,%r12), %ecx
cmpl 0x54(%rbx), %ecx
jne 0xa9d5
movl 0x8e6c(%rip), %ecx      # 0x13818
notl %ecx
movl 0x50(%rbx), %edx
xorl -0x14(%r15,%r12), %edx
andl %ecx, %edx
testl $0xfffffffd, %edx       # imm = 0xFFFFFFFD
jne 0xa9d5
testb %r14b, %r14b
je 0xa9cf
cmpl $0x0, (%r15,%r12)
movq %r13, %rdi
je 0xa9d3
leaq (%r12,%r15), %rdi
callq *%rax
addq $0x20, %r15
cmpq $0x1f8, %r15            # imm = 0x1F8
jne 0xa98b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %eax
movl %r14d, %ecx
shll %cl, %eax
movl %eax, (%rsp)
movb $0x1, %r14b
xorl %ebp, %ebp
jmp 0xa97b
movl %eax, (%rsp)
movb $0x1, %r14b
movl $0x3, %ebp
jmp 0xa97b