// File: /workspace/github_c_makefile_star2_O1/tkln[P]mcwm/mcwm.c
// Function: fixwindow
void fixwindow(struct client *client, bool setcolour)
{
    uint32_t values[1];
    uint32_t ws;
    
    if (NULL == client)
    {
        return;
    }
    
    if (client->fixed)
    {
        client->fixed = false;
        setwmdesktop(client->id, curws);

        if (setcolour)
        {
            /* Set border color to ordinary focus colour. */
            values[0] = conf.focuscol;
            xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
                                         values);
        }

        /* Delete from all workspace lists except current. */
        for (ws = 0; ws < WORKSPACES; ws ++)
        {
            if (ws != curws)
            {
                delfromworkspace(client, ws);
            }
        }
    }
    else
    {
        /*
         * First raise the window. If we're going to another desktop
         * we don't want this fixed window to be occluded behind
         * something else.
         */
        raisewindow(client->id);
        
        client->fixed = true;
        setwmdesktop(client->id, NET_WM_FIXED);

        /* Add window to all workspace lists. */
        for (ws = 0; ws < WORKSPACES; ws ++)
        {
            if (ws != curws)
            {
                addtoworkspace(client, ws);
            }
        }

        if (setcolour)
        {
            /* Set border color to fixed colour. */
            values[0] = conf.fixedcol;
            xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
                                         values);
        }
    }

    xcb_flush(conn);    
}

// Assembly:
testq %rdi, %rdi
je 0x618e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x1, 0x32(%rdi)
jne 0x60f4
movb $0x0, 0x32(%rbx)
movl (%rbx), %edx
movl 0x485e(%rip), %eax      # 0xa8c0
leaq 0x10(%rsp), %r10
movl %eax, (%r10)
movq 0x4907(%rip), %rdi      # 0xa978
movl 0x4909(%rip), %ecx      # 0xa980
xorl %esi, %esi
movl $0x6, %r8d
movl $0x20, %r9d
pushq %r10
pushq $0x1
callq 0x3520
addq $0x10, %rsp
testb %bpl, %bpl
je 0x60b7
movl 0x48cb(%rip), %eax      # 0xa968
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movq 0x48cd(%rip), %rdi      # 0xa978
movl (%rbx), %esi
movl $0x8, %edx
callq 0x30f0
leaq 0x4822(%rip), %r14      # 0xa8e0
xorl %r15d, %r15d
movl 0x47f9(%rip), %eax      # 0xa8c0
cmpq %rax, %r15
je 0x60e2
movq 0x48(%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x6d49
movq $0x0, 0x48(%rbx,%r15,8)
incq %r15
addq $0x8, %r14
cmpq $0xa, %r15
jne 0x60c1
jmp 0x6178
movl (%rbx), %edi
callq 0x618f
movb $0x1, 0x32(%rbx)
movl (%rbx), %edx
leaq 0x14(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x4865(%rip), %rdi      # 0xa978
movl 0x4867(%rip), %ecx      # 0xa980
xorl %r14d, %r14d
xorl %esi, %esi
movl $0x6, %r8d
movl $0x20, %r9d
pushq %rax
pushq $0x1
callq 0x3520
addq $0x10, %rsp
cmpl 0x4783(%rip), %r14d     # 0xa8c0
je 0x614a
movq %rbx, %rdi
movl %r14d, %esi
callq 0x61cd
incl %r14d
cmpl $0xa, %r14d
jne 0x6136
testb %bpl, %bpl
je 0x6178
movl 0x4812(%rip), %eax      # 0xa970
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movq 0x480c(%rip), %rdi      # 0xa978
movl (%rbx), %esi
movl $0x8, %edx
callq 0x30f0
movq 0x47f9(%rip), %rdi      # 0xa978
callq 0x3150
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq