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

   if(!systray_enable || traywin) return False;

   if(XGetSelectionOwner(dpy, netatom[NetSystemTray]) != None) {
      fprintf(stderr, "Can't initialize system tray: owned by another process\n");
      return False;
   }

   // Init traywin window
   wattr.event_mask        = ButtonPressMask | ExposureMask;
   wattr.override_redirect = True;
   wattr.background_pixmap = ParentRelative;
   wattr.background_pixel  = dc.colors[0][ColBG];

   //traywin = XCreateSimpleWindow(dpy, root, 200, 100, 500, 500, 0, BlackPixel (dpy, 0), BlackPixel(dpy, 0));
   //traywin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, dc.colors[0][ColBG]);
   traywin = XCreateWindow(dpy, root, 0, 0, 1, 1, 0, DefaultDepth(dpy, screen),
         CopyFromParent, DefaultVisual(dpy, screen),
         CWOverrideRedirect|CWBackPixmap|CWEventMask|CWBackPixel, &wattr);

   XSelectInput(dpy, traywin, KeyPressMask | ButtonPressMask);
   XMapRaised(dpy, traywin);

   XDefineCursor(dpy, traywin, cursor[CurNormal]);
   XSetSelectionOwner(dpy, netatom[NetSystemTray], traywin, CurrentTime);

   if(XGetSelectionOwner(dpy, netatom[NetSystemTray]) != traywin) {
      systray_freeicons();
      fprintf(stderr, "System tray: can't get systray manager\n");
      return False;
   }
   dwm_send_message(ROOT, ROOT, "MANAGER", CurrentTime, netatom[NetSystemTray], traywin, 0, 0);

   XSync(dpy, False);

   return True;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
cmpq $0x0, 0x118b5(%rip)     # 0x18628
je 0x6d81
movl $0x0, -0x4(%rbp)
jmp 0x6fac
movq 0x11890(%rip), %rdi     # 0x18618
movq 0x118e1(%rip), %rsi     # 0x18670
callq 0x5780
cmpq $0x0, %rax
je 0x6dbe
movq 0x10247(%rip), %rax     # 0x16fe8
movq (%rax), %rdi
leaq 0xb7d8(%rip), %rsi      # 0x12583
movb $0x0, %al
callq 0x5740
movl $0x0, -0x4(%rbp)
jmp 0x6fac
movq $0x8004, -0x30(%rbp)    # imm = 0x8004
movl $0x1, -0x20(%rbp)
movq $0x1, -0x78(%rbp)
movq 0x118c4(%rip), %rax     # 0x186a0
movq %rax, -0x70(%rbp)
movq 0x11831(%rip), %rdi     # 0x18618
movq 0x119f2(%rip), %rsi     # 0x187e0
movq 0x11823(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x119f5(%rip), %rcx     # 0x187f8
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x38(%rax), %r11d
movq 0x11803(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movslq 0x119d5(%rip), %rcx     # 0x187f8
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x40(%rax), %r10
xorl %ecx, %ecx
movl $0x1, %r9d
leaq -0x78(%rbp), %rax
movl %ecx, %edx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl %r11d, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0xa03, 0x20(%rsp)      # imm = 0xA03
movq %rax, 0x28(%rsp)
callq 0x5240
movq %rax, 0x117b6(%rip)     # 0x18628
movq 0x1179f(%rip), %rdi     # 0x18618
movq 0x117a8(%rip), %rsi     # 0x18628
movl $0x5, %edx
callq 0x54a0
movq 0x11787(%rip), %rdi     # 0x18618
movq 0x11790(%rip), %rsi     # 0x18628
callq 0x5720
movq 0x11774(%rip), %rdi     # 0x18618
movq 0x1177d(%rip), %rsi     # 0x18628
movq 0x1195e(%rip), %rdx     # 0x18810
callq 0x55b0
movq 0x1175a(%rip), %rdi     # 0x18618
movq 0x117ab(%rip), %rsi     # 0x18670
movq 0x1175c(%rip), %rdx     # 0x18628
xorl %eax, %eax
movl %eax, %ecx
callq 0x54e0
movq 0x1173c(%rip), %rdi     # 0x18618
movq 0x1178d(%rip), %rsi     # 0x18670
callq 0x5780
cmpq 0x11739(%rip), %rax     # 0x18628
je 0x6f1a
callq 0xa150
movq 0x100eb(%rip), %rax     # 0x16fe8
movq (%rax), %rdi
leaq 0xb6b4(%rip), %rsi      # 0x125bb
movb $0x0, %al
callq 0x5740
movl $0x0, -0x4(%rbp)
jmp 0x6fac
movq 0x116f7(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movq 0x116e9(%rip), %rcx     # 0x18618
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq 0x116d0(%rip), %rax     # 0x18618
movq 0xe8(%rax), %rax
movq 0x116c2(%rip), %rcx     # 0x18618
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movq 0x11701(%rip), %r8      # 0x18670
movq 0x116b2(%rip), %r9      # 0x18628
leaq 0xb666(%rip), %rdx      # 0x125e3
xorl %eax, %eax
movl %eax, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0xa230
movq 0x1167a(%rip), %rdi     # 0x18618
xorl %esi, %esi
callq 0x54d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)