// File: /workspace/github_c_makefile_star2_O3/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 $0x88, %rsp
movq %rsi, %r14
movq %rdi, %r12
movq $0x0, (%rsp)
movq 0x7640(%rip), %rsi      # 0x134e8
leaq 0x3a(%rsp), %rdx
movl $0x6, %ecx
callq 0x770a
testl %eax, %eax
je 0xbecd
movq %r12, %rdi
callq 0xc4ac
callq 0x990f
jmp 0xc440
movl $0x1, %edi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x55a0
testq %rax, %rax
je 0xc499
movq %rax, %r13
movq %rax, %rbx
movq %r12, 0x1a8(%r13)
movq %r13, %rdi
callq 0xc585
movq 0x7587(%rip), %rdi      # 0x13488
movq %rsp, %rdx
movq %r12, %rsi
callq 0x56a0
testl %eax, %eax
je 0xbf4b
movq 0x7551(%rip), %rax      # 0x13468
testq %rax, %rax
je 0xbf4b
movq (%rsp), %rcx
movq 0x78(%rax), %rdx
testq %rdx, %rdx
je 0xbf3f
cmpq %rcx, 0x1a8(%rdx)
je 0xc10c
movq 0x190(%rdx), %rdx
jmp 0xbf24
movq 0x90(%rax), %rax
testq %rax, %rax
jne 0xbf20
movq 0x751e(%rip), %rax      # 0x13470
movq %rax, 0x1a0(%rbx)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movups %xmm0, 0x170(%rbx)
movl $0x0, 0x180(%rbx)
movq $0x0, 0x15c(%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x168(%rbx)
movq 0x74f0(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5370
testl %eax, %eax
je 0xc0ef
movq %r14, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq 0x48(%rsp), %r13
testq %r13, %r13
leaq 0x2116(%rip), %rcx      # 0xe0e0
movq %r13, 0x8(%rsp)
cmoveq %rcx, %r13
movq 0x40(%rsp), %rax
testq %rax, %rax
movq %rax, 0x10(%rsp)
cmovneq %rax, %rcx
movq %rcx, 0x30(%rsp)
movq 0x7478(%rip), %r15      # 0x13468
xorl %ebp, %ebp
leaq 0x52e7(%rip), %r14      # 0x112e0
movq %rbp, %r12
shlq $0x6, %r12
movq 0x10(%r12,%r14), %rsi
testq %rsi, %rsi
je 0xc01b
movq %rbx, %rdi
callq 0x53d0
testq %rax, %rax
je 0xc0ad
addq %r14, %r12
movq (%r12), %rsi
testq %rsi, %rsi
je 0xc034
movq %r13, %rdi
callq 0x53d0
testq %rax, %rax
je 0xc0ad
movq 0x8(%r12), %rsi
testq %rsi, %rsi
je 0xc04d
movq 0x30(%rsp), %rdi
callq 0x53d0
testq %rax, %rax
je 0xc0ad
movl 0x18(%r12), %eax
movl 0x1c(%r12), %ecx
orl %eax, 0x15c(%rbx)
movl %ecx, 0x168(%rbx)
movaps 0x20(%r12), %xmm0
movups %xmm0, 0x170(%rbx)
movl 0x30(%r12), %eax
movl %eax, 0x180(%rbx)
movl 0x34(%r12), %eax
movl %eax, 0x16c(%rbx)
testq %r15, %r15
je 0xc0ad
movl 0x38(%r12), %ecx
movq %r15, %rax
cmpl %ecx, 0x14(%rax)
je 0xc0a6
movq 0x90(%rax), %rax
testq %rax, %rax
jne 0xc093
jmp 0xc0ad
movq %rax, 0x1a0(%rbx)
incq %rbp
cmpq $0xb, %rbp
jne 0xbff9
movq 0x8(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %rdi
je 0xc0d6
movq %rax, %rdi
callq 0x5070
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x28(%rsp), %r12
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %r14
je 0xc0ef
callq 0x5070
movl $0x1ff, %ecx            # imm = 0x1FF
movq 0x1a0(%rbx), %rax
andl 0x15c(%rbx), %ecx
jne 0xc120
movl 0x58(%rax), %ecx
movl 0x60(%rax,%rcx,4), %ecx
jmp 0xc120
movq 0x1a0(%rdx), %rax
movq %rax, 0x1a0(%rbx)
movl 0x15c(%rdx), %ecx
movl %ecx, 0x15c(%rbx)
movl (%r14), %r9d
movl %r9d, 0x118(%rbx)
movq 0x4(%r14), %rcx
movq %rcx, %xmm0
movq %rcx, 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), %ecx
movl %ecx, 0x154(%rbx)
xorl %ecx, %ecx
cmpl $0x0, 0x16c(%rbx)
movd %xmm1, %r8d
setne %dl
movl 0x30(%rax), %r14d
cmpl %r14d, %r8d
jne 0xc1c2
cmpl 0x34(%rax), %r10d
jne 0xc1c2
movl $0x1, 0x168(%rbx)
movq 0x28(%rax), %rax
movq %rax, 0x108(%rbx)
movl $0x0, 0x150(%rbx)
xorl %esi, %esi
jmp 0xc266
addq $0x10c, %r13            # imm = 0x10C
movl 0x150(%rbx), %esi
leal (%r8,%rsi,2), %r15d
movl 0x28(%rax), %edi
movl 0x34(%rax), %ebp
addl %edi, %r14d
movl %r14d, %r11d
subl %r15d, %r11d
addl %r9d, %r15d
cmpl %r14d, %r15d
cmovlel %r9d, %r11d
leal (%r10,%rsi,2), %r9d
movd %xmm0, %r10d
leal (%r9,%r10), %r14d
addl 0x2c(%rax), %ebp
cmpl %ebp, %r14d
jle 0xc20b
subl %r9d, %ebp
movl %ebp, (%r13)
movl %ebp, %r10d
cmpl %edi, %r11d
cmovgl %r11d, %edi
leaq 0x2c(%rax), %r9
movl %edi, 0x108(%rbx)
cmpl $0x0, 0x1c(%rax)
jne 0xc23f
movl %r8d, %r11d
shrl $0x1f, %r11d
addl %r8d, %r11d
sarl %r11d
addl %r11d, %edi
movl 0x38(%rax), %r8d
cmpl %r8d, %edi
jge 0xc2f1
cmpl (%r9), %r10d
jg 0xc247
movq %r9, %r13
movl (%r13), %eax
movl %eax, 0x10c(%rbx)
cmpl $0x0, 0x170(%rbx)
jne 0xc266
movb %dl, %cl
addl %ecx, %ecx
movl %ecx, 0x150(%rbx)
movl %ecx, %esi
leaq 0x40(%rsp), %rcx
movl %esi, 0x10(%rcx)
movq 0x7213(%rip), %rdi      # 0x13488
movq %r12, %rsi
movl $0x10, %edx
callq 0x50d0
movq 0x71ff(%rip), %rdi      # 0x13488
movq 0x7270(%rip), %rdx      # 0x13500
movq %r12, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x766f
movq %rbx, %rdi
callq 0xc5f3
movq %rbx, %rdi
callq 0xc74c
movq 0x71d1(%rip), %rdi      # 0x13488
movl $0x620010, %edx         # imm = 0x620010
movq %r12, %rsi
callq 0x5490
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9e2a
cmpl $0x0, 0x168(%rbx)
jne 0xc33a
cmpq $0x0, (%rsp)
je 0xc313
movl $0x1, %eax
movl %eax, 0x188(%rbx)
movl %eax, 0x168(%rbx)
jmp 0xc33a
movl 0x40(%rax), %r11d
addl %r8d, %r11d
cmpl %r11d, %edi
jge 0xc452
cmpl 0x736c(%rip), %r10d     # 0x13674
jg 0xc247
jmp 0xc45b
xorl %eax, %eax
cmpl $0x0, 0x164(%rbx)
setne %al
movl %eax, 0x188(%rbx)
movl %eax, 0x168(%rbx)
jne 0xc33a
cmpl $0x0, 0x178(%rbx)
je 0xc474
movq 0x7147(%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)
movq 0x1a8(%rbx), %rsi
leaq 0x70(%rsp), %rax
movq $0x1, (%rax)
movq $0x0, 0x8(%rax)
movq 0x70ee(%rip), %rdi      # 0x13488
movq 0x710f(%rip), %rcx      # 0x134b0
movq %rcx, %rdx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x2
pushq %rax
callq 0x5650
addq $0x10, %rsp
movq 0x70c8(%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 0x709b(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5420
cmpl $0x0, 0x17c(%rbx)
sete %cl
movq 0x7066(%rip), %rax      # 0x13470
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xc434
movq 0x80(%rax), %rax
testq %rax, %rax
je 0xc434
cmpl $0x0, 0x160(%rax)
jne 0xc434
movq %rbx, %rdi
callq 0x9b07
movq 0x1a0(%rbx), %rdi
callq 0x98a3
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl (%r9), %r10d
jg 0xc247
addl 0x40(%rax), %r8d
cmpl %r8d, %edi
jge 0xc244
leaq 0x7205(%rip), %r13      # 0x13674
jmp 0xc247
cmpl $0x0, 0x174(%rbx)
je 0xc34d
movq 0x7000(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x53e0
jmp 0xc34d
leaq 0xd95(%rip), %rdi       # 0xd235
movl $0x1b0, %esi            # imm = 0x1B0
xorl %eax, %eax
callq 0x6408