// File: /workspace/github_c_makefile_star2_O0/tkln[P]mcwm/mcwm.c
// Function: movelim
void movelim(struct client *client)
{
    int16_t mon_x;
    int16_t mon_y;
    uint16_t mon_width;
    uint16_t mon_height;
    
    if (NULL == client->monitor)
    {
        mon_x = 0;
        mon_y = 0;
        mon_width = screen->width_in_pixels;
        mon_height = screen->height_in_pixels;
    }
    else
    {
        mon_x = client->monitor->x;
        mon_y = client->monitor->y;
        mon_width = client->monitor->width;
        mon_height = client->monitor->height;        
    }

    /* Is it outside the physical monitor? */
    if (client->x < mon_x)
    {
        client->x = mon_x;
    }
    if (client->y < mon_y)
    {
        client->y = mon_y;
    }

    if (client->x + client->width > mon_x + mon_width - conf.borderwidth * 2)
    {
        client->x = (mon_x + mon_width - conf.borderwidth * 2) - client->width;
    }

    if (client->y + client->height > mon_y + mon_height - conf.borderwidth * 2)
    {
        client->y = (mon_y + mon_height - conf.borderwidth * 2)
            - client->height;
    }    

    movewindow(client->id, client->x, client->y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq 0x38(%rcx), %rax
jne 0x7614
movw $0x0, -0xa(%rbp)
movw $0x0, -0xc(%rbp)
movq 0x634d(%rip), %rax      # 0xd948
movw 0x14(%rax), %ax
movw %ax, -0xe(%rbp)
movq 0x633e(%rip), %rax      # 0xd948
movw 0x16(%rax), %ax
movw %ax, -0x10(%rbp)
jmp 0x7654
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movw 0x10(%rax), %ax
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movw 0x12(%rax), %ax
movw %ax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movw 0x14(%rax), %ax
movw %ax, -0xe(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movw 0x16(%rax), %ax
movw %ax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movswl -0xa(%rbp), %ecx
cmpl %ecx, %eax
jge 0x7670
movw -0xa(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x6(%rax)
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movswl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jge 0x768c
movw -0xc(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movswl -0xa(%rbp), %ecx
movzwl -0xe(%rbp), %edx
addl %edx, %ecx
movl 0x62a2(%rip), %edx      # 0xd950
shll %edx
subl %edx, %ecx
cmpl %ecx, %eax
jle 0x76df
movswl -0xa(%rbp), %eax
movzwl -0xe(%rbp), %ecx
addl %ecx, %eax
movl 0x628a(%rip), %ecx      # 0xd950
shll %ecx
subl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x6(%rax)
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
addl %ecx, %eax
movswl -0xc(%rbp), %ecx
movzwl -0x10(%rbp), %edx
addl %edx, %ecx
movl 0x624f(%rip), %edx      # 0xd950
shll %edx
subl %edx, %ecx
cmpl %ecx, %eax
jle 0x7732
movswl -0xc(%rbp), %eax
movzwl -0x10(%rbp), %ecx
addl %ecx, %eax
movl 0x6237(%rip), %ecx      # 0xd950
shll %ecx
subl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x8(%rbp), %rax
movw 0x6(%rax), %cx
movq -0x8(%rbp), %rax
movzwl %cx, %esi
movzwl 0x8(%rax), %edx
callq 0x7080
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)