// File: /workspace/github_c_makefile_star2_O0/tkln[P]mcwm/mcwm.c
// Function: changeworkspace
void changeworkspace(uint32_t ws)
{
    struct item *item;
    struct client *client;
    
    if (ws == curws)
    {
        PDEBUG("Changing to same workspace!\n");
        return;
    }

    PDEBUG("Changing from workspace #%d to #%d\n", curws, ws);

    /*
     * We lose our focus if the window we focus isn't fixed. An
     * EnterNotify event will set focus later.
     */
    if (NULL != focuswin && !focuswin->fixed)
    {
        setunfocus(focuswin->id);
        focuswin = NULL;
    }
    
    /* Go through list of current ws. Unmap everything that isn't fixed. */
    for (item = wslist[curws]; item != NULL; item = item->next)
    {
        client = item->data;

        PDEBUG("changeworkspace. unmap phase. ws #%d, client-fixed: %d\n",
               curws, client->fixed);

        if (!client->fixed)
        {
            /*
             * This is an ordinary window. Just unmap it. Note that
             * this will generate an unnecessary UnmapNotify event
             * which we will try to handle later.
             */
            xcb_unmap_window(conn, client->id);
        }
    } /* for */
    
    /* Go through list of new ws. Map everything that isn't fixed. */
    for (item = wslist[ws]; item != NULL; item = item->next)
    {
        client = item->data;

        PDEBUG("changeworkspace. map phase. ws #%d, client-fixed: %d\n",
               ws, client->fixed);

        /* Fixed windows are already mapped. Map everything else. */
        if (!client->fixed)
        {
            xcb_map_window(conn, client->id);
        }
    }

    xcb_flush(conn);

    curws = ws;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x6ccc(%rip), %eax      # 0xd8c0
jne 0x6bfb
jmp 0x6cee
xorl %eax, %eax
cmpq 0x6d3c(%rip), %rax      # 0xd940
je 0x6c2c
movq 0x6d33(%rip), %rax      # 0xd940
testb $0x1, 0x32(%rax)
jne 0x6c2c
movq 0x6d26(%rip), %rax      # 0xd940
movl (%rax), %edi
callq 0x6d00
movq $0x0, 0x6d14(%rip) # 0xd940
movl 0x6c8e(%rip), %eax      # 0xd8c0
movl %eax, %ecx
leaq 0x6ca5(%rip), %rax      # 0xd8e0
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6c84
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x32(%rax)
jne 0x6c74
movq 0x6d12(%rip), %rdi      # 0xd978
movq -0x18(%rbp), %rax
movl (%rax), %esi
callq 0x30c0
movl %eax, -0x1c(%rbp)
jmp 0x6c76
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x6c43
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x6c50(%rip), %rax      # 0xd8e0
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6cd9
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x32(%rax)
jne 0x6cc9
movq 0x6cbd(%rip), %rdi      # 0xd978
movq -0x18(%rbp), %rax
movl (%rax), %esi
callq 0x3410
movl %eax, -0x20(%rbp)
jmp 0x6ccb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x6c98
movq 0x6c98(%rip), %rdi      # 0xd978
callq 0x3140
movl -0x4(%rbp), %eax
movl %eax, 0x6bd2(%rip)      # 0xd8c0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)