// File: /workspace/github_c_makefile_star2_O1/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 0xb90d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movq 0x7fc9(%rip), %rax      # 0x13620
movq %rax, 0x20(%rsp)
movl 0x7e96(%rip), %eax      # 0x134f8
movl %eax, 0x18(%rsp)
movl 0x7e90(%rip), %eax      # 0x134fc
movl %eax, 0x14(%rsp)
movl 0x7e7a(%rip), %eax      # 0x134f0
movl %eax, 0x10(%rsp)
movl 0x7e74(%rip), %eax      # 0x134f4
movl %eax, 0xc(%rsp)
movl 0x38(%rdi), %eax
movl %eax, 0x1c(%rsp)
movq 0x18(%rdi), %rax
movq %rax, 0x7f8a(%rip)      # 0x13620
movq $0x0, 0x7e4f(%rip) # 0x134f0
movl 0x10(%rdi), %eax
movl %eax, 0x7e4e(%rip)      # 0x134f8
movq 0x30(%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xb838
movl %edx, %ebp
movl %esi, %r14d
movl $0x20, %r13d
xorl %r15d, %r15d
leaq 0x28(%rsp), %r12
testl %r14d, %r14d
jle 0xb6f5
cmpl %r14d, 0x10(%rbx)
jle 0xb6f5
movl 0x7e16(%rip), %eax      # 0x134f4
cmpl %ebp, %eax
jge 0xb6f5
addl 0x7f50(%rip), %eax      # 0x13638
cmpl %ebp, %eax
jle 0xb6f5
cmpb $0x0, (%rdi)
je 0xb6f5
movl %r15d, 0x38(%rbx)
movslq 0x38(%rbx), %rax
movl $0xa, %esi
cmpq %rax, %r15
jne 0xb711
movl 0x7deb(%rip), %eax      # 0x134f4
movl %eax, 0x3c(%rbx)
movl $0x9, %esi
cmpb $0x0, (%rdi)
je 0xb72e
movl 0x7f1c(%rip), %eax      # 0x13638
movl %eax, 0x7dda(%rip)      # 0x134fc
xorl %edx, %edx
callq 0x8316
jmp 0xb814
movl $0x4, 0x7dc4(%rip)      # 0x134fc
movzwl 0x7db1(%rip), %eax      # 0x134f0
movw %ax, 0x4(%rsp)
movzwl 0x7da9(%rip), %eax      # 0x134f4
movw %ax, 0x6(%rsp)
movzwl 0x7da1(%rip), %eax      # 0x134f8
movw %ax, 0x8(%rsp)
movw $0x4, 0xa(%rsp)
movq 0x7d1e(%rip), %rdi      # 0x13488
movq 0x7eb7(%rip), %rsi      # 0x13628
movq 0x7ea0(%rip), %rdx      # 0x13618
callq 0x5330
movq 0x7d04(%rip), %rdi      # 0x13488
movq 0x7e95(%rip), %rsi      # 0x13620
movq 0x7e96(%rip), %rdx      # 0x13628
leaq 0x4(%rsp), %rcx
movl $0x1, %r8d
callq 0x5310
movq 0x7e67(%rip), %rax      # 0x13610
movq %rax, 0x38(%rsp)
movq 0x7cd3(%rip), %rdi      # 0x13488
movq 0x7e6c(%rip), %rsi      # 0x13628
movl $0x4, %edx
movq %r12, %rcx
callq 0x5500
movq 0x7cb8(%rip), %rdi      # 0x13488
movq 0x7e49(%rip), %rsi      # 0x13620
movq 0x7e4a(%rip), %rdx      # 0x13628
movl 0x7d0c(%rip), %ecx      # 0x134f0
movl 0x7d12(%rip), %eax      # 0x134fc
movl %eax, %r8d
shrl $0x1f, %r8d
addl %eax, %r8d
sarl %r8d
addl 0x7cf6(%rip), %r8d      # 0x134f4
movl 0x7cf3(%rip), %r9d      # 0x134f8
subq $0x8, %rsp
pushq %r8
callq 0x52d0
addq $0x10, %rsp
movl 0x7ce2(%rip), %eax      # 0x134fc
addl %eax, 0x7cd4(%rip)      # 0x134f4
incq %r15
movq 0x30(%rbx), %rax
movq (%rax,%r13), %rdi
addq $0x20, %r13
testq %rdi, %rdi
jne 0xb6cd
movq 0x7c49(%rip), %rdi      # 0x13488
movq 0x7dda(%rip), %rsi      # 0x13620
movq (%rbx), %rdx
movq 0x7dd8(%rip), %rcx      # 0x13628
movl 0x10(%rbx), %eax
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 0x7c11(%rip), %rdi      # 0x13488
xorl %esi, %esi
callq 0x54c0
movl 0x18(%rsp), %eax
movl %eax, 0x7c70(%rip)      # 0x134f8
movl 0x14(%rsp), %eax
movl %eax, 0x7c6a(%rip)      # 0x134fc
movl 0x10(%rsp), %eax
movl %eax, 0x7c54(%rip)      # 0x134f0
movl 0xc(%rsp), %eax
movl %eax, 0x7c4e(%rip)      # 0x134f4
movq 0x20(%rsp), %rax
movq %rax, 0x7d6e(%rip)      # 0x13620
movl 0x1c(%rsp), %eax
cmpl %eax, 0x38(%rbx)
je 0xb8fc
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xb8d1
callq 0xb90e
movq $0x0, 0x28(%rbx)
movq 0x30(%rbx), %rax
movslq 0x38(%rbx), %rcx
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %rdi
testq %rdi, %rdi
je 0xb8fc
movl 0x10(%rbx), %esi
movl 0x3c(%rbx), %edx
addl 0x8(%rbx), %esi
addl 0xc(%rbx), %edx
callq 0xb9f4
movq %rax, 0x28(%rbx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq