// File: /workspace/github_c_makefile_star2_O0/tkln[P]mcwm/mcwm.c
// Function: unmax
void unmax(struct client *client)
{
    uint32_t values[5];
    uint32_t mask = 0;

    if (NULL == client)
    {
        PDEBUG("unmax: client was NULL!\n");
        return;
    }

    client->x = client->origsize.x;
    client->y = client->origsize.y;
    client->width = client->origsize.width;
    client->height = client->origsize.height;
    
    /* Restore geometry. */
    if (client->maxed)
    {
        values[0] = client->x;
        values[1] = client->y;
        values[2] = client->width;
        values[3] = client->height;

        /* Set borders again. */
        values[4] = conf.borderwidth;
        
        mask =
            XCB_CONFIG_WINDOW_X
            | XCB_CONFIG_WINDOW_Y
            | XCB_CONFIG_WINDOW_WIDTH
            | XCB_CONFIG_WINDOW_HEIGHT
            | XCB_CONFIG_WINDOW_BORDER_WIDTH;
    }
    else
    {
        values[0] = client->y;
        values[1] = client->width;
        values[2] = client->height;

        mask = XCB_CONFIG_WINDOW_Y
            | XCB_CONFIG_WINDOW_WIDTH
            | XCB_CONFIG_WINDOW_HEIGHT;
    }

    xcb_configure_window(conn, client->id, mask, values);

    /* Warp pointer to window or we might lose it. */
    xcb_warp_pointer(conn, XCB_NONE, client->id, 0, 0, 0, 0,
                     client->width / 2, client->height / 2);

    xcb_flush(conn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x24(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
jne 0x7780
jmp 0x78bb
movq -0x8(%rbp), %rax
movw 0xe(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x6(%rax)
movq -0x8(%rbp), %rax
movw 0x10(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movw 0x12(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x8(%rbp), %rax
movw 0x14(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0x31(%rax)
je 0x7808
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
movl %eax, -0x14(%rbp)
movl 0x6154(%rip), %eax      # 0xd950
movl %eax, -0x10(%rbp)
movl $0x1f, -0x24(%rbp)
jmp 0x7830
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
movl %eax, -0x18(%rbp)
movl $0xe, -0x24(%rbp)
movq 0x6141(%rip), %rdi      # 0xd978
movq -0x8(%rbp), %rax
movl (%rax), %esi
movl -0x24(%rbp), %eax
leaq -0x20(%rbp), %rcx
movzwl %ax, %edx
callq 0x3200
movl %eax, -0x28(%rbp)
movq 0x6122(%rip), %rdi      # 0xd978
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %r10w
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x30(%rbp), %edx
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movswl %r10w, %r10d
movl %r10d, 0x8(%rsp)
cwtl
movl %eax, 0x10(%rsp)
callq 0x3050
movl %eax, -0x2c(%rbp)
movq 0x60c2(%rip), %rdi      # 0xd978
callq 0x3140
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)