// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x5c(%rbp)
movq -0x8(%rbp), %rdi
movq 0x8c43(%rip), %rsi      # 0x18678
leaq -0x56(%rbp), %rdx
movl $0x6, %ecx
callq 0x89c0
cmpl $0x0, %eax
je 0xfa5b
movq -0x8(%rbp), %rdi
callq 0x10150
callq 0xbfe0
jmp 0x10147
movl $0x1, %edi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x55c0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0xfa87
leaq 0x29ac(%rip), %rdi      # 0x12427
movl $0x1b0, %esi            # imm = 0x1B0
movb $0x0, %al
callq 0x5ab0
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x1a8(%rax)
movq -0x18(%rbp), %rdi
callq 0x10280
movq 0x8b72(%rip), %rdi      # 0x18618
movq -0x8(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x56c0
cmpl $0x0, %eax
je 0xfaf7
movq -0x28(%rbp), %rdi
callq 0x8940
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xfaf7
movq -0x20(%rbp), %rax
movq 0x1a0(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x1a0(%rax)
movq -0x20(%rbp), %rax
movl 0x15c(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x15c(%rax)
jmp 0xfb12
movq 0x8b02(%rip), %rcx      # 0x18600
movq -0x18(%rbp), %rax
movq %rcx, 0x1a0(%rax)
movq -0x18(%rbp), %rdi
callq 0x10320
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x118(%rax)
movq -0x18(%rbp), %rax
movl %ecx, 0x108(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x11c(%rax)
movq -0x18(%rbp), %rax
movl %ecx, 0x10c(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x120(%rax)
movq -0x18(%rbp), %rax
movl %ecx, 0x110(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x124(%rax)
movq -0x18(%rbp), %rax
movl %ecx, 0x114(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x128(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x12c(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x154(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x16c(%rax)
je 0xfbc6
movl $0x2, -0x5c(%rbp)
jmp 0xfbcd
movl $0x0, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movl 0x110(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
cmpl 0x30(%rcx), %eax
jne 0xfc52
movq -0x18(%rbp), %rax
movl 0x114(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
cmpl 0x34(%rcx), %eax
jne 0xfc52
movq -0x18(%rbp), %rax
movl $0x1, 0x168(%rax)
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x108(%rax)
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x150(%rax)
jmp 0xff53
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movq -0x18(%rbp), %rcx
movl 0x110(%rcx), %ecx
movq -0x18(%rbp), %rdx
movl 0x150(%rdx), %edx
shll %edx
addl %edx, %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
movl 0x28(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x1a0(%rdx), %rdx
addl 0x30(%rdx), %ecx
cmpl %ecx, %eax
jle 0xfcd6
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
addl 0x30(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x110(%rax), %eax
movq -0x18(%rbp), %rdx
movl 0x150(%rdx), %edx
shll %edx
addl %edx, %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x108(%rax)
movq -0x18(%rbp), %rax
movl 0x10c(%rax), %eax
movq -0x18(%rbp), %rcx
movl 0x114(%rcx), %ecx
movq -0x18(%rbp), %rdx
movl 0x150(%rdx), %edx
shll %edx
addl %edx, %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
movl 0x2c(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x1a0(%rdx), %rdx
addl 0x34(%rdx), %ecx
cmpl %ecx, %eax
jle 0xfd5a
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x114(%rax), %eax
movq -0x18(%rbp), %rdx
movl 0x150(%rdx), %edx
shll %edx
addl %edx, %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10c(%rax)
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
cmpl 0x28(%rcx), %eax
jle 0xfd83
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movl %eax, -0x60(%rbp)
jmp 0xfd94
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x28(%rax), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x108(%rax)
movq -0x18(%rbp), %rax
movl 0x10c(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
cmpl $0x0, 0x1c(%rax)
jne 0xfe4a
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movl 0x110(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x68(%rbp), %eax
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
cmpl 0x38(%rcx), %eax
jl 0xfe4a
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x18(%rbp), %rax
movl 0x110(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x6c(%rbp), %eax
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
movl 0x38(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x1a0(%rdx), %rdx
addl 0x40(%rdx), %ecx
cmpl %ecx, %eax
jge 0xfe4a
movl 0x89bf(%rip), %eax      # 0x18804
movl %eax, -0x70(%rbp)
jmp 0xfe5b
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x70(%rbp)
movl -0x64(%rbp), %eax
movl -0x70(%rbp), %ecx
cmpl %ecx, %eax
jle 0xfe77
movq -0x18(%rbp), %rax
movl 0x10c(%rax), %eax
movl %eax, -0x74(%rbp)
jmp 0xff2a
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
cmpl $0x0, 0x1c(%rax)
jne 0xff13
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movl 0x110(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x78(%rbp), %eax
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
cmpl 0x38(%rcx), %eax
jl 0xff13
movq -0x18(%rbp), %rax
movl 0x108(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x18(%rbp), %rax
movl 0x110(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x7c(%rbp), %eax
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x1a0(%rcx), %rcx
movl 0x38(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x1a0(%rdx), %rdx
addl 0x40(%rdx), %ecx
cmpl %ecx, %eax
jge 0xff13
movl 0x88f6(%rip), %eax      # 0x18804
movl %eax, -0x80(%rbp)
jmp 0xff24
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10c(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x170(%rax)
jne 0xff51
movl -0x5c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x150(%rax)
jmp 0xff53
movq -0x18(%rbp), %rax
movl 0x150(%rax), %eax
movl %eax, -0x40(%rbp)
movq 0x86b1(%rip), %rdi      # 0x18618
movq -0x8(%rbp), %rsi
movl $0x10, %edx
leaq -0x50(%rbp), %rcx
callq 0x50e0
movq 0x8698(%rip), %rdi      # 0x18618
movq -0x8(%rbp), %rsi
movq 0x8705(%rip), %rdx      # 0x18690
callq 0x52f0
movq -0x18(%rbp), %rdi
callq 0x87a0
movq -0x18(%rbp), %rdi
callq 0x10640
movq -0x18(%rbp), %rdi
callq 0x108f0
movq 0x8666(%rip), %rdi      # 0x18618
movq -0x8(%rbp), %rsi
movl $0x620010, %edx         # imm = 0x620010
callq 0x54a0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xc860
movq -0x18(%rbp), %rax
cmpl $0x0, 0x168(%rax)
jne 0x1001a
movb $0x1, %al
cmpq $0x0, -0x28(%rbp)
movb %al, -0x81(%rbp)
jne 0xfffb
movq -0x18(%rbp), %rax
cmpl $0x0, 0x164(%rax)
setne %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x188(%rax)
movq -0x18(%rbp), %rax
movl %ecx, 0x168(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x168(%rax)
jne 0x10034
movq -0x18(%rbp), %rax
cmpl $0x0, 0x178(%rax)
je 0x1004d
movq 0x85dd(%rip), %rdi      # 0x18618
movq -0x18(%rbp), %rax
movq 0x1a8(%rax), %rsi
callq 0x5180
jmp 0x10073
movq -0x18(%rbp), %rax
cmpl $0x0, 0x174(%rax)
je 0x10071
movq 0x85b7(%rip), %rdi      # 0x18618
movq -0x18(%rbp), %rax
movq 0x1a8(%rax), %rsi
callq 0x53f0
jmp 0x10073
movq -0x18(%rbp), %rdi
callq 0x109b0
movq -0x18(%rbp), %rdi
callq 0xc820
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xf990
movq 0x857e(%rip), %rdi      # 0x18618
movq -0x18(%rbp), %rax
movq 0x1a8(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x108(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x10c(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x110(%rax), %r8d
movq -0x18(%rbp), %rax
movl 0x114(%rax), %r9d
callq 0x53b0
movq 0x853d(%rip), %rdi      # 0x18618
movq -0x18(%rbp), %rax
movq 0x1a8(%rax), %rsi
callq 0x5430
movq -0x18(%rbp), %rax
cmpl $0x0, 0x17c(%rax)
jne 0x10137
cmpq $0x0, 0x8500(%rip)      # 0x18600
je 0x10135
movq 0x84f7(%rip), %rax      # 0x18600
cmpq $0x0, 0x80(%rax)
je 0x10133
movq 0x84e6(%rip), %rax      # 0x18600
movq 0x80(%rax), %rax
cmpl $0x0, 0x160(%rax)
jne 0x10133
movq -0x18(%rbp), %rdi
callq 0xc2d0
jmp 0x10135
jmp 0x10137
movq -0x18(%rbp), %rax
movq 0x1a0(%rax), %rdi
callq 0xbf30
addq $0x90, %rsp
popq %rbp
retq