// File: /workspace/github_c_makefile_star2_O0/Cloudef[P]dwm-fork/dwm.c
// Function: setup
void
setup(void) {
   XSetWindowAttributes wa;

   /* clean up any zombies immediately */
   sigchld(0);

   /* init screen */
   screen = DefaultScreen(dpy);
   root = RootWindow(dpy, screen);
   initfont(font);
   sw = DisplayWidth(dpy, screen);
   sh = DisplayHeight(dpy, screen);
   int fh = dc.font.height;
   if(fh < status_height)
      bh = dc.h = status_height;
   else
      bh = dc.h = fh + 2;
   updategeom();
   /* init atoms */
   wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
   wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
   wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
   netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
   netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
   netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
   netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
   netatom[KdeWMSysTrayWindow] = XInternAtom(dpy, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False);

   /* Sys tray atom */
   char systray_atom[48];
   int primarymon = 0;
#ifdef PRIMARY_MONITOR
   primarymon = PRIMARY_MONITOR;
#endif
   snprintf(systray_atom, sizeof(systray_atom), "_NET_SYSTEM_TRAY_S%d", primarymon );
   netatom[NetSystemTray] = ATOM(systray_atom);

   /* init cursors */
   cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
   cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
   cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
   /* init appearance */
#ifndef XFT
   for(int i=0; i<MAXCOLORS; i++) {
      dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder] );
      dc.colors[i][ColFG] = getcolor( colors[i][ColFG] );
      dc.colors[i][ColBG] = getcolor( colors[i][ColBG] );
   }
#else
   for(int i=0; i<MAXCOLORS; i++) {
      dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder], &dc.xftcolors[i][ColBorder] );
      dc.colors[i][ColFG] = getcolor( colors[i][ColFG], &dc.xftcolors[i][ColFG] );
      dc.colors[i][ColBG] = getcolor( colors[i][ColBG], &dc.xftcolors[i][ColBG] );
   }
#endif
   dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
   dc.gc = XCreateGC(dpy, root, 0, NULL);
   XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
#ifndef XFT
   if(!dc.font.set)
      XSetFont(dpy, dc.gc, dc.font.xfont->fid);
#else
   dc.xftdrawable = XftDrawCreate(dpy, dc.drawable, DefaultVisual(dpy,screen), DefaultColormap(dpy,screen));
   if(!dc.xftdrawable)
      printf("error, cannot create drawable\n");
#endif
   /* init bars */
   updatebars();
   updatestatus();
   systray_acquire();

   /* EWMH support per view */
   XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
         PropModeReplace, (unsigned char *) netatom, NetLast);
   /* select for events */
   wa.cursor     = cursor[CurNormal];
   if(autofocusmonitor)
      wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask
         |EnterWindowMask|LeaveWindowMask|StructureNotifyMask
         |PropertyChangeMask|PointerMotionMask;
   else
      wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask
         |EnterWindowMask|LeaveWindowMask|StructureNotifyMask
         |PropertyChangeMask;

   XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
   XSelectInput(dpy, root, wa.event_mask);
   grabkeys();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
xorl %edi, %edi
callq 0x66b0
movq 0x129ff(%rip), %rax     # 0x18618
movl 0xe0(%rax), %eax
movl %eax, 0x12bd3(%rip)     # 0x187f8
movq 0x129ec(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x12bbe(%rip), %rcx     # 0x187f8
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, 0x12b94(%rip)     # 0x187e0
leaq 0xc47d(%rip), %rdi      # 0x120d0
callq 0x6710
movq 0x129b9(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x12b8b(%rip), %rcx     # 0x187f8
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, 0x12b7f(%rip)     # 0x187fc
movq 0x12994(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x12b66(%rip), %rcx     # 0x187f8
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, 0x12b5e(%rip)     # 0x18800
movl 0x12b20(%rip), %eax     # 0x187c8
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0x5cc7
movl $0x0, 0x129d1(%rip)     # 0x1868c
movl $0x0, 0x12b3f(%rip)     # 0x18804
jmp 0x5cd9
movl -0x74(%rbp), %eax
addl $0x2, %eax
movl %eax, 0x129b9(%rip)     # 0x1868c
movl %eax, 0x12b2b(%rip)     # 0x18804
callq 0x6910
movq 0x12933(%rip), %rdi     # 0x18618
leaq 0xc645(%rip), %rsi      # 0x12331
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x12936(%rip)     # 0x18630
movq 0x12917(%rip), %rdi     # 0x18618
leaq 0xc636(%rip), %rsi      # 0x1233e
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x12922(%rip)     # 0x18638
movq 0x128fb(%rip), %rdi     # 0x18618
leaq 0xc64c(%rip), %rsi      # 0x12370
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x1290e(%rip)     # 0x18640
movq 0x128df(%rip), %rdi     # 0x18618
leaq 0xc60f(%rip), %rsi      # 0x1234f
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x12902(%rip)     # 0x18650
movq 0x128c3(%rip), %rdi     # 0x18618
leaq 0xc602(%rip), %rsi      # 0x1235e
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x128ee(%rip)     # 0x18658
movq 0x128a7(%rip), %rdi     # 0x18618
leaq 0xc5f3(%rip), %rsi      # 0x1236b
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x128da(%rip)     # 0x18660
movq 0x1288b(%rip), %rdi     # 0x18618
leaq 0xc5e5(%rip), %rsi      # 0x12379
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x128c6(%rip)     # 0x18668
movq 0x1286f(%rip), %rdi     # 0x18618
leaq 0xc5e2(%rip), %rsi      # 0x12392
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x128ba(%rip)     # 0x18678
movl $0x0, -0xb4(%rbp)
movl $0x0, -0xb4(%rbp)
leaq -0xb0(%rbp), %rdi
movl -0xb4(%rbp), %ecx
movl $0x30, %esi
leaq 0xc5ca(%rip), %rdx      # 0x123b5
movb $0x0, %al
callq 0x50b0
movq 0x1281f(%rip), %rdi     # 0x18618
leaq -0xb0(%rbp), %rsi
xorl %edx, %edx
callq 0x55f0
movq %rax, 0x12862(%rip)     # 0x18670
movq 0x12803(%rip), %rdi     # 0x18618
movl $0x44, %esi
callq 0x5060
movq %rax, 0x129ea(%rip)     # 0x18810
movq 0x127eb(%rip), %rdi     # 0x18618
movl $0x78, %esi
callq 0x5060
movq %rax, 0x129da(%rip)     # 0x18818
movq 0x127d3(%rip), %rdi     # 0x18618
movl $0x34, %esi
callq 0x5060
movq %rax, 0x129ca(%rip)     # 0x18820
movl $0x0, -0xb8(%rbp)
cmpl $0xc, -0xb8(%rbp)
jge 0x5f36
movslq -0xb8(%rbp), %rax
leaq 0xc285(%rip), %rdi      # 0x12100
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x6b60
movq %rax, %rcx
movslq -0xb8(%rbp), %rdx
leaq 0x127e8(%rip), %rax     # 0x18680
addq $0x10, %rax
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movslq -0xb8(%rbp), %rax
leaq 0xc24c(%rip), %rdi      # 0x12100
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
callq 0x6b60
movq %rax, %rcx
movslq -0xb8(%rbp), %rdx
leaq 0x127ab(%rip), %rax     # 0x18680
addq $0x10, %rax
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movslq -0xb8(%rbp), %rax
leaq 0xc20e(%rip), %rdi      # 0x12100
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x10, %rdi
callq 0x6b60
movq %rax, %rcx
movslq -0xb8(%rbp), %rdx
leaq 0x1276d(%rip), %rax     # 0x18680
addq $0x10, %rax
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x5e60
movq 0x126db(%rip), %rdi     # 0x18618
movq 0x1289c(%rip), %rsi     # 0x187e0
movq 0x126cd(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x1289f(%rip), %rcx     # 0x187f8
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %edx
movl 0x1289b(%rip), %ecx     # 0x18804
movq 0x126a8(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x1287a(%rip), %r8      # 0x187f8
shlq $0x7, %r8
addq %r8, %rax
movl 0x38(%rax), %r8d
callq 0x5710
movq %rax, 0x1281b(%rip)     # 0x187b0
movq 0x1267c(%rip), %rdi     # 0x18618
movq 0x1283d(%rip), %rsi     # 0x187e0
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x5480
movq %rax, 0x12802(%rip)     # 0x187b8
movq 0x1265b(%rip), %rdi     # 0x18618
movq 0x127f4(%rip), %rsi     # 0x187b8
movl $0x1, %r8d
xorl %r9d, %r9d
movl %r8d, %edx
movl %r9d, %ecx
callq 0x5400
cmpq $0x0, 0x127f0(%rip)     # 0x187d0
jne 0x6000
movq 0x1262f(%rip), %rdi     # 0x18618
movq 0x127c8(%rip), %rsi     # 0x187b8
movq 0x127e1(%rip), %rax     # 0x187d8
movq 0x8(%rax), %rdx
callq 0x51c0
callq 0x6bd0
callq 0x6d20
callq 0x6d60
movq 0x12602(%rip), %rdi     # 0x18618
movq 0x127c3(%rip), %rsi     # 0x187e0
movq 0x1262c(%rip), %rdx     # 0x18650
movl $0x4, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
leaq 0x12617(%rip), %rax     # 0x18650
movq %rax, (%rsp)
movl $0x6, 0x8(%rsp)
callq 0x5670
movq 0x127bf(%rip), %rax     # 0x18810
movq %rax, -0x8(%rbp)
movq $0x5a0074, -0x28(%rbp)  # imm = 0x5A0074
movq 0x125b4(%rip), %rdi     # 0x18618
movq 0x12775(%rip), %rsi     # 0x187e0
movl $0x4800, %edx           # imm = 0x4800
leaq -0x70(%rbp), %rcx
callq 0x57b0
movq 0x12598(%rip), %rdi     # 0x18618
movq 0x12759(%rip), %rsi     # 0x187e0
movq -0x28(%rbp), %rdx
callq 0x54a0
callq 0x6fc0
addq $0xd0, %rsp
popq %rbp
retq
nop