// File: /workspace/github_c_makefile_star2_O0/mcaimi[P]st/x.c
// Function: skip_taskbar_and_pager
void
skip_taskbar_and_pager(void)
{
  /*
    window  = the respective client window
    message_type = _NET_WM_STATE
    format = 32
    data.l[0] = the action, as listed below
    data.l[1] = first property to alter
    data.l[2] = second property to alter
    data.l[3] = source indication
    other data.l[] elements = 0

    _NET_WM_STATE_REMOVE 0
    _NET_WM_STATE_ADD 1
    _NET_WM_STATE_TOGGLE 2
  */

  if ((skiptaskbar == FALSE) && (skippager == FALSE))
    return;

  // should we skip the taskbar?
  xw.skip_taskbar = XInternAtom(xw.dpy, "_NET_WM_STATE_SKIP_TASKBAR", False);
  xw.skip_pager = XInternAtom(xw.dpy, "_NET_WM_STATE_SKIP_PAGER", False);

  // See Xlib.h, line 36
  XEvent xevent;
  bzero(&xevent, sizeof(xevent));
  // prepare client message
  // we are interested in the 'xclient' field of the Xevent union
  xevent.type = ClientMessage;
  xevent.xclient.window = xw.win;
  xevent.xclient.message_type = xw.window_state;
  xevent.xclient.format = 32;
  xevent.xclient.data.l[0] = _NET_WM_STATE_ADD;
  xevent.xclient.data.l[1] = (skiptaskbar == TRUE) ? xw.skip_pager : 0;
  xevent.xclient.data.l[2] = (skippager == TRUE) ? xw.skip_pager : 0;
  xevent.xclient.data.l[3] = 0;
  xevent.xclient.data.l[4] = 0;
  // Send Message to root win, see https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317705584 for XCB,
  // for Xlib, as used in this program, the equivalent Root window flags are named:
  // X.h:#define SubstructureNotifyMask              (1L<<19)
  // X.h:#define SubstructureRedirectMask    (1L<<20)
  XSendEvent(xw.dpy, DefaultRootWindow(xw.dpy), False, SubstructureNotifyMask|SubstructureRedirectMask, &xevent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
cmpl $0x0, 0x13fee(%rip)     # 0x24870
jne 0x10892
cmpl $0x0, 0x13fe9(%rip)     # 0x24874
jne 0x10892
jmp 0x109c7
movq 0x140ef(%rip), %rdi     # 0x24988
leaq 0xa966(%rip), %rsi      # 0x1b206
xorl %edx, %edx
callq 0x6810
movq %rax, 0x1413a(%rip)     # 0x249e8
movq 0x140d3(%rip), %rdi     # 0x24988
leaq 0xa965(%rip), %rsi      # 0x1b221
xorl %edx, %edx
callq 0x6810
movq %rax, 0x14126(%rip)     # 0x249f0
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0xc0, %edx
callq 0x60c0
movl $0x21, -0xc0(%rbp)
movq 0x140aa(%rip), %rax     # 0x24998
movq %rax, -0xa0(%rbp)
movq 0x140e4(%rip), %rax     # 0x249e0
movq %rax, -0x98(%rbp)
movl $0x20, -0x90(%rbp)
movq $0x1, -0x88(%rbp)
cmpl $0x1, 0x13f51(%rip)     # 0x24870
jne 0x10931
movq 0x140c8(%rip), %rax     # 0x249f0
movq %rax, -0xc8(%rbp)
jmp 0x1093c
xorl %eax, %eax
movq %rax, -0xc8(%rbp)
jmp 0x1093c
movq -0xc8(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpl $0x1, 0x13f26(%rip)     # 0x24874
jne 0x10960
movq 0x14099(%rip), %rax     # 0x249f0
movq %rax, -0xd0(%rbp)
jmp 0x1096b
xorl %eax, %eax
movq %rax, -0xd0(%rbp)
jmp 0x1096b
movq -0xd0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x68(%rbp)
movq 0x13ffb(%rip), %rdi     # 0x24988
movq 0x13ff4(%rip), %rax     # 0x24988
movq 0xe8(%rax), %rax
movq 0x13fe6(%rip), %rcx     # 0x24988
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
xorl %edx, %edx
movl $0x180000, %ecx         # imm = 0x180000
leaq -0xc0(%rbp), %r8
callq 0x66d0
addq $0xd0, %rsp
popq %rbp
retq