// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq $0x0, 0x8(%rsp)
movq 0x7591(%rip), %rsi      # 0x134e8
leaq 0x3a(%rsp), %rdx
movl $0x6, %ecx
callq 0x7731
testl %eax, %eax
je 0xbf7c
movq %r15, %rdi
callq 0xc560
callq 0x996a
jmp 0xc516
movl $0x1, %edi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x55b0
testq %rax, %rax
je 0xc54d
movq %rax, %r12
movq %rax, %rbx
movq %r15, 0x1a8(%r12)
movq %r12, %rdi
callq 0xc639
movq 0x74d7(%rip), %rdi      # 0x13488
leaq 0x8(%rsp), %rdx
movq %r15, %rsi
callq 0x56b0
testl %eax, %eax
je 0xc01a
movq 0x749f(%rip), %rcx      # 0x13468
testq %rcx, %rcx
je 0xbffa
movq 0x8(%rsp), %rdx
movq 0x78(%rcx), %rax
testq %rax, %rax
je 0xbfee
cmpq %rdx, 0x1a8(%rax)
je 0xbffc
movq 0x190(%rax), %rax
jmp 0xbfd7
movq 0x90(%rcx), %rcx
testq %rcx, %rcx
jne 0xbfd3
xorl %eax, %eax
testq %rax, %rax
je 0xc01a
movq 0x1a0(%rax), %rcx
movq %rcx, 0x1a0(%rbx)
movl 0x15c(%rax), %eax
jmp 0xc1c5
movq 0x744f(%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 0x7421(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5370
testl %eax, %eax
je 0xc1aa
movq %r14, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq 0x48(%rsp), %rbp
testq %rbp, %rbp
leaq 0x2037(%rip), %rax      # 0xe0d0
movq %rbp, 0x10(%rsp)
cmoveq %rax, %rbp
movq 0x40(%rsp), %rcx
testq %rcx, %rcx
cmoveq %rax, %rcx
movq %rcx, 0x30(%rsp)
movq 0x73ae(%rip), %r15      # 0x13468
xorl %r13d, %r13d
leaq 0x521c(%rip), %r12      # 0x112e0
movq %r13, %r14
shlq $0x6, %r14
movq 0x10(%r14,%r12), %rsi
testq %rsi, %rsi
je 0xc0e6
movq %rbx, %rdi
callq 0x53d0
testq %rax, %rax
je 0xc170
addq %r12, %r14
movq (%r14), %rsi
testq %rsi, %rsi
je 0xc0fe
movq %rbp, %rdi
callq 0x53d0
testq %rax, %rax
je 0xc170
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0xc116
movq 0x30(%rsp), %rdi
callq 0x53d0
testq %rax, %rax
je 0xc170
movl 0x18(%r14), %eax
movl 0x1c(%r14), %ecx
orl %eax, 0x15c(%rbx)
movl %ecx, 0x168(%rbx)
movaps 0x20(%r14), %xmm0
movups %xmm0, 0x170(%rbx)
movl 0x30(%r14), %eax
movl %eax, 0x180(%rbx)
movl 0x34(%r14), %eax
movl %eax, 0x16c(%rbx)
testq %r15, %r15
je 0xc170
movl 0x38(%r14), %ecx
movq %r15, %rax
cmpl %ecx, 0x14(%rax)
je 0xc169
movq 0x90(%rax), %rax
testq %rax, %rax
jne 0xc156
jmp 0xc170
movq %rax, 0x1a0(%rbx)
incq %r13
cmpq $0xb, %r13
jne 0xc0c4
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc18c
callq 0x5070
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x28(%rsp), %r15
movq 0x20(%rsp), %r12
movq 0x18(%rsp), %r14
je 0xc1aa
callq 0x5070
movl $0x1ff, %eax            # imm = 0x1FF
andl 0x15c(%rbx), %eax
jne 0xc1c5
movq 0x1a0(%rbx), %rax
movl 0x58(%rax), %ecx
movl 0x60(%rax,%rcx,4), %eax
movl %eax, 0x15c(%rbx)
movl (%r14), %r10d
movl %r10d, 0x118(%rbx)
movl %r10d, 0x108(%rbx)
movl 0x4(%r14), %r8d
movl %r8d, 0x11c(%rbx)
movl %r8d, 0x10c(%rbx)
movl 0x8(%r14), %esi
movl %esi, 0x120(%rbx)
movl %esi, 0x110(%rbx)
movl 0xc(%r14), %r9d
movl %r9d, 0x124(%rbx)
movl %r9d, 0x114(%rbx)
movl %esi, 0x128(%rbx)
movl %r9d, 0x12c(%rbx)
movl 0x10(%r14), %eax
movl %eax, 0x154(%rbx)
xorl %eax, %eax
cmpl $0x0, 0x16c(%rbx)
setne %cl
movq 0x1a0(%rbx), %rdx
movl 0x30(%rdx), %ebp
cmpl %ebp, %esi
jne 0xc272
cmpl 0x34(%rdx), %r9d
jne 0xc272
movl $0x1, 0x168(%rbx)
movl 0x28(%rdx), %eax
movl %eax, 0x108(%rbx)
movl 0x2c(%rdx), %eax
movl %eax, 0x10c(%rbx)
movl $0x0, 0x150(%rbx)
jmp 0xc35e
movl 0x150(%rbx), %edi
leal (%rsi,%rdi,2), %r14d
movl %edi, %r11d
addl %edi, %r11d
addl %r14d, %r10d
movl 0x28(%rdx), %edi
addl %edi, %ebp
cmpl %ebp, %r10d
jle 0xc298
subl %r14d, %ebp
movl %ebp, 0x108(%rbx)
addq $0x10c, %r12            # imm = 0x10C
addl %r9d, %r11d
addl %r11d, %r8d
movl 0x34(%rdx), %r9d
addl 0x2c(%rdx), %r9d
cmpl %r9d, %r8d
jle 0xc2b9
subl %r11d, %r9d
movl %r9d, (%r12)
leaq 0x2c(%rdx), %r8
movl 0x108(%rbx), %r9d
cmpl %edi, %r9d
cmovgl %r9d, %edi
movl 0x10c(%rbx), %r10d
movl %edi, 0x108(%rbx)
movl 0x1c(%rdx), %r9d
testl %r9d, %r9d
jne 0xc30a
movl %esi, %r11d
shrl $0x1f, %r11d
addl %esi, %r11d
sarl %r11d
addl %edi, %r11d
movl 0x38(%rdx), %ebp
cmpl %ebp, %r11d
jl 0xc30a
addl 0x40(%rdx), %ebp
cmpl %ebp, %r11d
jge 0xc30a
leaq 0x736c(%rip), %r11      # 0x13674
jmp 0xc30d
movq %r8, %r11
cmpl (%r11), %r10d
jg 0xc341
testl %r9d, %r9d
jne 0xc33e
movl %esi, %r9d
shrl $0x1f, %r9d
addl %esi, %r9d
sarl %r9d
addl %r9d, %edi
movl 0x38(%rdx), %esi
cmpl %esi, %edi
jl 0xc33e
addl 0x40(%rdx), %esi
cmpl %esi, %edi
jge 0xc33e
leaq 0x7338(%rip), %r12      # 0x13674
jmp 0xc341
movq %r8, %r12
movl (%r12), %edx
movl %edx, 0x10c(%rbx)
cmpl $0x0, 0x170(%rbx)
jne 0xc35e
movb %cl, %al
addl %eax, %eax
movl %eax, 0x150(%rbx)
movl 0x150(%rbx), %eax
leaq 0x40(%rsp), %rcx
movl %eax, 0x10(%rcx)
movq 0x7115(%rip), %rdi      # 0x13488
movq %r15, %rsi
movl $0x10, %edx
callq 0x50d0
movq 0x7101(%rip), %rdi      # 0x13488
movq 0x7172(%rip), %rdx      # 0x13500
movq %r15, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x767a
movq %rbx, %rdi
callq 0xc6a7
movq %rbx, %rdi
callq 0xc830
movq 0x70d3(%rip), %rdi      # 0x13488
movl $0x620010, %edx         # imm = 0x620010
movq %r15, %rsi
callq 0x5490
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9e79
cmpl $0x0, 0x168(%rbx)
jne 0xc3fa
movl $0x1, %eax
cmpq $0x0, 0x8(%rsp)
jne 0xc3ee
xorl %eax, %eax
cmpl $0x0, 0x164(%rbx)
setne %al
movl %eax, 0x188(%rbx)
movl %eax, 0x168(%rbx)
cmpl $0x0, 0x168(%rbx)
jne 0xc410
cmpl $0x0, 0x178(%rbx)
je 0xc528
movq 0x7071(%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)
leaq 0x70(%rsp), %rax
movq $0x1, (%rax)
movq $0x0, 0x8(%rax)
movq 0x701f(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
movq 0x7039(%rip), %rcx      # 0x134b0
movq %rcx, %rdx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x2
pushq %rax
callq 0x5660
addq $0x10, %rsp
movq 0x6ff2(%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 0x6fc5(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x5420
cmpl $0x0, 0x17c(%rbx)
sete %cl
movq 0x6f90(%rip), %rax      # 0x13470
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xc50a
movq 0x80(%rax), %rax
testq %rax, %rax
je 0xc50a
cmpl $0x0, 0x160(%rax)
jne 0xc50a
movq %rbx, %rdi
callq 0x9b58
movq 0x1a0(%rbx), %rdi
callq 0x98ef
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x174(%rbx)
je 0xc423
movq 0x6f4c(%rip), %rdi      # 0x13488
movq 0x1a8(%rbx), %rsi
callq 0x53e0
jmp 0xc423
leaq 0xcd4(%rip), %rdi       # 0xd228
movl $0x1b0, %esi            # imm = 0x1B0
xorl %eax, %eax
callq 0x644f