// File: /workspace/github_c_makefile_star2_O2/Cloudef[P]dwm-fork/dwm.c
// Function: manage
void
manage(Window w, XWindowAttributes *wa) {
   Client *c, *t = NULL;
   Window trans = None;
   XWindowChanges wc;
   char kdetmp[6];
   int borderwidth = 0;
   if( gettextprop(w, netatom[KdeWMSysTrayWindow], kdetmp, 6) )
   {
      systray_add(w);
      systray_update();
      return;
   }

   if(!(c = calloc(1, sizeof(Client))))
      die("fatal: could not malloc() %u bytes\n", sizeof(Client));
   c->win = w;
   updatetitle(c);
   if(XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
      c->mon  = t->mon;
      c->tags = t->tags;
   }
   else {
      c->mon = selmon;
      applyrules(c);
   }
   /* geometry */
   c->x = c->oldx = wa->x;
   c->y = c->oldy = wa->y;
   c->w = c->oldw = wa->width;
   c->h = c->oldh = wa->height;
   c->fw = wa->width;
   c->fh = wa->height;
   c->oldbw = wa->border_width;

   if(c->isborder) borderwidth = borderpx;
   else            borderwidth = 0;

   if((c->w == c->mon->mw && c->h == c->mon->mh)) {
      c->isfloating = True; // regression with flash, XXXX
      c->x = c->mon->mx;
      c->y = c->mon->my;
      c->bw = 0;
   }
   else {
      if(c->x + WIDTH(c) > c->mon->mx + c->mon->mw)
         c->x = c->mon->mx + c->mon->mw - WIDTH(c);
      if(c->y + HEIGHT(c) > c->mon->my + c->mon->mh)
         c->y = c->mon->my + c->mon->mh - HEIGHT(c);
      c->x = MAX(c->x, c->mon->mx);
      /* only fix client y-offset, if the client center might cover the bar */
      c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= c->mon->wx)
               && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
      if(!c->iswidget)
         c->bw = borderwidth;
   }
   wc.border_width = c->bw;

   XConfigureWindow(dpy, w, CWBorderWidth, &wc);
   XSetWindowBorder(dpy, w, dc.colors[0][ColBorder]);
   configure(c); /* propagates border_width, if size doesn't change */
   updatesizehints(c);
   updatewmhints(c);

   XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
   grabbuttons(c, False);
   if(!c->isfloating)
      c->isfloating = c->oldstate = trans != None || c->isfixed;

   if(c->isfloating || c->isabove)
      XRaiseWindow(dpy, c->win);
   else if(c->isbelow)
      XLowerWindow(dpy, c->win);

   attach(c);
   attachstack(c);

   /* some windows require this */
   setclientstate(c, NormalState);
   //XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h);
   XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);

   XMapWindow(dpy, c->win);

   if(!c->iszombie)
   {
      if(selmon)
         if(selmon->sel && !selmon->sel->isfullscreen)
            focus(c);
   }
   arrange(c->mon);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r12
andq $0x0, 0x8(%rsp)
movq 0x7bf4(%rip), %rsi      # 0x134e8
leaq 0x3a(%rsp), %rdx
pushq $0x6
popq %rcx
callq 0x75b7
testl %eax, %eax
je 0xb917
movq %r12, %rdi
callq 0xbe75
callq 0x960f
jmp 0xbe0d
pushq $0x1
popq %rdi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x55a0
testq %rax, %rax
je 0xbe62
movq %rax, %r13
movq %rax, %rbx
movq %r12, 0x1a8(%r13)
movq %r13, %rdi
callq 0xbf3b
movq 0x7b3f(%rip), %rdi      # 0x13488
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
callq 0x56a0
testl %eax, %eax
je 0xb982
movq 0x8(%rsp), %rdi
callq 0x757f
testq %rax, %rax
je 0xb982
movq 0x1a0(%rax), %rcx
movq %rcx, 0x1a0(%rbx)
movl 0x15c(%rax), %eax
jmp 0xbb2c
movq 0x7ae7(%rip), %rax      # 0x13470
movq %rax, 0x1a0(%rbx)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
andl $0x0, 0x180(%rbx)
movups %xmm0, 0x170(%rbx)
andq $0x0, 0x15c(%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x168(%rbx)
movq 0x7abf(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5370
testl %eax, %eax
je 0xbb11
movq %r14, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq 0x48(%rsp), %r13
testq %r13, %r13
leaq 0x26f5(%rip), %rbp      # 0xe0f0
movq %r13, 0x10(%rsp)
cmoveq %rbp, %r13
movq 0x40(%rsp), %rax
testq %rax, %rax
movq %rax, 0x18(%rsp)
cmovneq %rax, %rbp
xorl %r14d, %r14d
leaq 0x58c1(%rip), %r12      # 0x112e0
cmpq $0xb, %r14
je 0xbadc
movq %r14, %r15
shlq $0x6, %r15
movq 0x10(%r15,%r12), %rsi
testq %rsi, %rsi
je 0xba4b
movq %rbx, %rdi
callq 0x53d0
testq %rax, %rax
je 0xbad4
addq %r12, %r15
movq (%r15), %rsi
testq %rsi, %rsi
je 0xba63
movq %r13, %rdi
callq 0x53d0
testq %rax, %rax
je 0xbad4
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0xba79
movq %rbp, %rdi
callq 0x53d0
testq %rax, %rax
je 0xbad4
movl 0x18(%r15), %eax
movl 0x1c(%r15), %ecx
movl %ecx, 0x168(%rbx)
movaps 0x20(%r15), %xmm0
movups %xmm0, 0x170(%rbx)
movl 0x30(%r15), %ecx
movl %ecx, 0x180(%rbx)
movl 0x34(%r15), %ecx
movl %ecx, 0x16c(%rbx)
orl %eax, 0x15c(%rbx)
leaq 0x79b4(%rip), %rax      # 0x13468
movq (%rax), %rax
testq %rax, %rax
je 0xbad4
movl 0x14(%rax), %ecx
cmpl 0x38(%r15), %ecx
je 0xbacd
addq $0x90, %rax
jmp 0xbab4
movq %rax, 0x1a0(%rbx)
incq %r14
jmp 0xba1f
movq 0x10(%rsp), %rax
testq %rax, %rax
movq 0x18(%rsp), %rdi
je 0xbaf8
movq %rax, %rdi
callq 0x5070
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x30(%rsp), %r12
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %r14
je 0xbb11
callq 0x5070
movl $0x1ff, %eax            # imm = 0x1FF
movq 0x1a0(%rbx), %rcx
andl 0x15c(%rbx), %eax
jne 0xbb2c
movl 0x58(%rcx), %eax
movl 0x60(%rcx,%rax,4), %eax
movl %eax, 0x15c(%rbx)
movl (%r14), %edx
movl %edx, 0x118(%rbx)
movq 0x4(%r14), %rax
movq %rax, %xmm0
movq %rax, 0x10c(%rbx)
movl 0xc(%r14), %r10d
movd %r10d, %xmm1
shufps $0x30, %xmm0, %xmm1     # xmm1 = xmm1[0,0],xmm0[3,0]
movaps %xmm0, %xmm2
shufps $0x84, %xmm1, %xmm2     # xmm2 = xmm2[0,1],xmm1[0,2]
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movl %r10d, 0x114(%rbx)
shufps $0x64, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,1]
movups %xmm2, 0x11c(%rbx)
movl %r10d, 0x12c(%rbx)
movl 0x10(%r14), %eax
movl %eax, 0x154(%rbx)
xorl %esi, %esi
cmpl $0x0, 0x16c(%rbx)
movd %xmm1, %eax
setne %dil
movl 0x30(%rcx), %r11d
cmpl %r11d, %eax
jne 0xbbcb
cmpl 0x34(%rcx), %r10d
jne 0xbbcb
movl $0x1, 0x168(%rbx)
movq 0x28(%rcx), %rax
movq %rax, 0x108(%rbx)
andl $0x0, 0x150(%rbx)
xorl %r8d, %r8d
jmp 0xbc6d
addq $0x10c, %r13            # imm = 0x10C
movl 0x150(%rbx), %r8d
leal (%rax,%r8,2), %r15d
movl 0x28(%rcx), %r9d
movl 0x34(%rcx), %r14d
addl %r9d, %r11d
movl %r11d, %ebp
subl %r15d, %ebp
addl %edx, %r15d
cmpl %r11d, %r15d
cmovlel %edx, %ebp
leal (%r10,%r8,2), %edx
movd %xmm0, %r11d
leal (%rdx,%r11), %r10d
addl 0x2c(%rcx), %r14d
cmpl %r14d, %r10d
jle 0xbc17
subl %edx, %r14d
movl %r14d, (%r13)
movl %r14d, %r11d
cmpl %r9d, %ebp
cmovgl %ebp, %r9d
leaq 0x2c(%rcx), %r10
movl %r9d, 0x108(%rbx)
cmpl $0x0, 0x1c(%rcx)
jne 0xbc44
pushq $0x2
popq %rbp
cltd
idivl %ebp
addl %eax, %r9d
movl 0x38(%rcx), %eax
cmpl %eax, %r9d
jge 0xbcf6
cmpl (%r10), %r11d
jg 0xbc4c
movq %r10, %r13
movl (%r13), %eax
movl %eax, 0x10c(%rbx)
cmpl $0x0, 0x170(%rbx)
jne 0xbc6d
movb %dil, %sil
addl %esi, %esi
movl %esi, 0x150(%rbx)
movl %esi, %r8d
leaq 0x40(%rsp), %rcx
movl %r8d, 0x10(%rcx)
movq 0x780b(%rip), %rdi      # 0x13488
pushq $0x10
popq %rdx
movq %r12, %rsi
callq 0x50d0
movq 0x77f9(%rip), %rdi      # 0x13488
movq 0x786a(%rip), %rdx      # 0x13500
movq %r12, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x74ab
movq %rbx, %rdi
callq 0xbfa7
movq %rbx, %rdi
callq 0xc0f8
movq 0x77cb(%rip), %rdi      # 0x13488
movl $0x620010, %edx         # imm = 0x620010
movq %r12, %rsi
callq 0x5490
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9ae1
cmpl $0x0, 0x168(%rbx)
jne 0xbd3d
cmpq $0x0, 0x8(%rsp)
je 0xbd16
pushq $0x1
popq %rax
movl %eax, 0x188(%rbx)
movl %eax, 0x168(%rbx)
jmp 0xbd3d
movl 0x40(%rcx), %edx
addl %eax, %edx
cmpl %edx, %r9d
jge 0xbe1c
cmpl 0x7969(%rip), %r11d     # 0x13674
jg 0xbc4c
jmp 0xbe25
xorl %eax, %eax
cmpl $0x0, 0x164(%rbx)
setne %al
movl %eax, 0x188(%rbx)
movl %eax, 0x168(%rbx)
jne 0xbd3d
cmpl $0x0, 0x178(%rbx)
je 0xbe3d
movq 0x7744(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5170
movq 0x1a0(%rbx), %rax
movq 0x78(%rax), %rcx
movq %rcx, 0x190(%rbx)
movq %rbx, 0x78(%rax)
movq 0x88(%rax), %rcx
movq %rcx, 0x198(%rbx)
movq %rbx, 0x88(%rax)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xb894
movq 0x76fb(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
movl 0x108(%rbx), %edx
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %r8d
movl 0x114(%rbx), %r9d
callq 0x53a0
movq 0x76ce(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5420
cmpl $0x0, 0x17c(%rbx)
sete %cl
movq 0x7699(%rip), %rax      # 0x13470
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xbe01
movq 0x80(%rax), %rax
testq %rax, %rax
je 0xbe01
cmpl $0x0, 0x160(%rax)
jne 0xbe01
movq %rbx, %rdi
callq 0x97fb
movq 0x1a0(%rbx), %rdi
callq 0x958e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl (%r10), %r11d
jg 0xbc4c
addl 0x40(%rcx), %eax
cmpl %eax, %r9d
jge 0xbc49
leaq 0x783c(%rip), %r13      # 0x13674
jmp 0xbc4c
cmpl $0x0, 0x174(%rbx)
je 0xbd50
movq 0x7637(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x53e0
jmp 0xbd50
leaq 0x13dc(%rip), %rdi      # 0xd245
movl $0x1b0, %esi            # imm = 0x1B0
xorl %eax, %eax
callq 0x62ae