// File: /workspace/github_c_makefile_star2_O0/tkln[P]mcwm/mcwm.c
// Function: resizelim
void resizelim(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 smaller than it wants to  be? */
    if (0 != client->min_height && client->height < client->min_height)
    {
        client->height = client->min_height;
    }

    if (0 != client->min_width && client->width < client->min_width)
    {
        client->width = client->min_width;
    }

    if (client->x + client->width + conf.borderwidth * 2 > mon_x + mon_width)
    {
        client->width = mon_width - ((client->x - mon_x) + conf.borderwidth
                                     * 2);
    }
    
    if (client->y + client->height + conf.borderwidth * 2 > mon_y + mon_height)
    {
        client->height = mon_height - ((client->y - mon_y) + conf.borderwidth
                                       * 2);
    }
    
    resize(client->id, client->width, client->height);
}

// 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 0x73c4
movw $0x0, -0xa(%rbp)
movw $0x0, -0xc(%rbp)
movq 0x659d(%rip), %rax      # 0xd948
movw 0x14(%rax), %ax
movw %ax, -0xe(%rbp)
movq 0x658e(%rip), %rax      # 0xd948
movw 0x16(%rax), %ax
movw %ax, -0x10(%rbp)
jmp 0x7404
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
movzwl 0x18(%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x7436
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jge 0x7436
movq -0x8(%rbp), %rax
movw 0x18(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x8(%rbp), %rax
movzwl 0x16(%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x7468
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x16(%rcx), %ecx
cmpl %ecx, %eax
jge 0x7468
movq -0x8(%rbp), %rax
movw 0x16(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl 0x64d0(%rip), %ecx      # 0xd950
shll %ecx
addl %ecx, %eax
movswl -0xa(%rbp), %ecx
movzwl -0xe(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x74bb
movzwl -0xe(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x6(%rcx), %ecx
movswl -0xa(%rbp), %edx
subl %edx, %ecx
movl 0x64a6(%rip), %edx      # 0xd950
shll %edx
addl %edx, %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x8(%rbp), %rax
movswl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
addl %ecx, %eax
movl 0x647d(%rip), %ecx      # 0xd950
shll %ecx
addl %ecx, %eax
movswl -0xc(%rbp), %ecx
movzwl -0x10(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x750e
movzwl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x8(%rcx), %ecx
movswl -0xc(%rbp), %edx
subl %edx, %ecx
movl 0x6453(%rip), %edx      # 0xd950
shll %edx
addl %edx, %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x8(%rbp), %rax
movw 0xa(%rax), %cx
movq -0x8(%rbp), %rax
movzwl %cx, %esi
movzwl 0xc(%rax), %edx
callq 0x70f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)