// File: /workspace/github_c_makefile_star2_O3/Cloudef[P]dwm-fork/dwm.c
// Function: updatemenu
static void
updatemenu( menu_t *m, int x, int y ) {
   Drawable dble = dc.drawable;
   int ow = dc.w, oh = dc.h, ox = dc.x, oy = dc.y;
   size_t col;

   if(!m) return;
   const int osel = m->sel;

   dc.drawable = m->drawable;
#ifdef XFT
   XftDrawChange(dc.xftdrawable, dc.drawable);
#endif
   size_t i;
   dc.x = 0; dc.y = 0;
   dc.w = m->w;

   for(i = 0; m->ctx[i].title; ++i)
   {
      if (x > 0    && x < m->w &&
          y > dc.y && y < dc.y + dc.font.height &&
          strlen(m->ctx[i].title))
         m->sel = i;

      /* this check cause there is keyboard input too */
      if(m->sel == i) { col = 9; m->sely = dc.y; }
      else col = 10;

      if(strlen(m->ctx[i].title))
      {
         dc.h = dc.font.height;
         drawtext(m->ctx[i].title, col, False);

      }
      else { dc.h = 4; drawhline(11); }
      dc.y += dc.h;
   }

   XCopyArea(dpy, dc.drawable, m->win, dc.gc, 0, 0, m->w, m->h, 0, 0);
   XSync(dpy, False);

   dc.w = ow; dc.h = oh; dc.x = ox; dc.y = oy;
   dc.drawable = dble;
#ifdef XFT
   XftDrawChange(dc.xftdrawable, dc.drawable);
#endif

   /* only for mouse */
   if(m->sel != osel)
   {
      if(m->child) { closemenu(m->child); m->child = NULL; }
      if(m->ctx[m->sel].ctx != NULL)
         m->child = openmenupos( m->ctx[m->sel].ctx, m->x + m->w, m->y + m->sely );
   }
}

// Assembly:
testq %rdi, %rdi
je 0xb868
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x803a(%rip), %r15      # 0x13620
movaps 0x7f03(%rip), %xmm0     # 0x134f0
movaps %xmm0, 0x20(%rsp)
movl 0x38(%rdi), %r12d
movq 0x18(%rdi), %rsi
movq %rsi, 0x801f(%rip)      # 0x13620
movq $0x0, 0x7ee4(%rip) # 0x134f0
movl 0x10(%rdi), %eax
movl %eax, 0x7ee3(%rip)      # 0x134f8
movq 0x30(%rdi), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0xb7be
movl %edx, %ebp
movl %r12d, 0x14(%rsp)
movq %r15, 0x18(%rsp)
xorl %eax, %eax
movl $0x20, %r13d
leaq 0x38(%rsp), %r12
xorl %r15d, %r15d
testl %r14d, %r14d
jle 0xb66e
cmpl %r14d, 0x10(%rbx)
setg %cl
cmpl %ebp, %eax
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xb66e
movl 0x7fd9(%rip), %ecx      # 0x13638
addl %eax, %ecx
cmpl %ebp, %ecx
jle 0xb66e
cmpb $0x0, (%rdi)
je 0xb66e
movl %r15d, 0x38(%rbx)
movslq 0x38(%rbx), %rcx
movl $0xa, %esi
cmpq %rcx, %r15
jne 0xb684
movl %eax, 0x3c(%rbx)
movl $0x9, %esi
cmpb $0x0, (%rdi)
je 0xb6a1
movl 0x7fa9(%rip), %eax      # 0x13638
movl %eax, 0x7e67(%rip)      # 0x134fc
xorl %edx, %edx
callq 0x82d4
jmp 0xb780
movl $0x4, 0x7e51(%rip)      # 0x134fc
movzwl 0x7e3e(%rip), %ecx      # 0x134f0
movw %cx, 0xc(%rsp)
movw %ax, 0xe(%rsp)
movzwl 0x7e35(%rip), %eax      # 0x134f8
movw %ax, 0x10(%rsp)
movw $0x4, 0x12(%rsp)
movq 0x7db2(%rip), %rdi      # 0x13488
movq 0x7f4b(%rip), %rsi      # 0x13628
movq 0x7f34(%rip), %rdx      # 0x13618
callq 0x5330
movq 0x7d98(%rip), %rdi      # 0x13488
movq 0x7f29(%rip), %rsi      # 0x13620
movq 0x7f2a(%rip), %rdx      # 0x13628
leaq 0xc(%rsp), %rcx
movl $0x1, %r8d
callq 0x5310
movq 0x7efb(%rip), %rax      # 0x13610
movq %rax, 0x48(%rsp)
movq 0x7d67(%rip), %rdi      # 0x13488
movq 0x7f00(%rip), %rsi      # 0x13628
movl $0x4, %edx
movq %r12, %rcx
callq 0x5500
movq 0x7d4c(%rip), %rdi      # 0x13488
movq 0x7edd(%rip), %rsi      # 0x13620
movq 0x7ede(%rip), %rdx      # 0x13628
movl 0x7da0(%rip), %ecx      # 0x134f0
movl 0x7da6(%rip), %eax      # 0x134fc
movl %eax, %r8d
shrl $0x1f, %r8d
addl %eax, %r8d
sarl %r8d
addl 0x7d8a(%rip), %r8d      # 0x134f4
movl 0x7d87(%rip), %r9d      # 0x134f8
subq $0x8, %rsp
pushq %r8
callq 0x52d0
addq $0x10, %rsp
movl 0x7d6e(%rip), %eax      # 0x134f4
addl 0x7d70(%rip), %eax      # 0x134fc
movl %eax, 0x7d62(%rip)      # 0x134f4
incq %r15
movq 0x30(%rbx), %rcx
movq (%rcx,%r13), %rdi
addq $0x20, %r13
testq %rdi, %rdi
jne 0xb641
movq 0x7e6f(%rip), %rsi      # 0x13620
movl 0x10(%rbx), %eax
movq 0x18(%rsp), %r15
movl 0x14(%rsp), %r12d
movq 0x7cc3(%rip), %rdi      # 0x13488
movq (%rbx), %rdx
movq 0x7e59(%rip), %rcx      # 0x13628
movl 0x14(%rbx), %r10d
xorl %r11d, %r11d
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r11
pushq %r11
pushq %r10
pushq %rax
callq 0x52b0
addq $0x20, %rsp
movq 0x7c95(%rip), %rdi      # 0x13488
xorl %esi, %esi
callq 0x54c0
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x7cea(%rip)     # 0x134f0
movq %r15, 0x7e13(%rip)      # 0x13620
movl 0x38(%rbx), %eax
cmpl %r12d, %eax
je 0xb857
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xb82e
callq 0xb869
movq $0x0, 0x28(%rbx)
movl 0x38(%rbx), %eax
movq 0x30(%rbx), %rcx
cltq
shlq $0x5, %rax
movq 0x8(%rcx,%rax), %rdi
testq %rdi, %rdi
je 0xb857
movl 0x10(%rbx), %esi
movl 0x3c(%rbx), %edx
addl 0x8(%rbx), %esi
addl 0xc(%rbx), %edx
callq 0xb94f
movq %rax, 0x28(%rbx)
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq