// File: /workspace/github_c_makefile_star2_O0/tkln[P]mcwm/mcwm.c
// Function: movestep
int movestep(struct client *client, const union cb_arg arg)
{
    int16_t start_x;
    int16_t start_y;
    
    if (NULL == client)
    {
        return 0;
    }

    if (client->maxed)
    {
        /* We can't move a fully maximized window. */
        return 0;
    }

    /* Save pointer position so we can warp pointer here later. */
    if (!getpointer(client->id, &start_x, &start_y))
    {
        return 0;
    }

    raisewindow(client->id);
    switch (arg.c)
    {
    case 'h':
        client->x = client->x - MOVE_STEP;
        break;

    case 'j':
        client->y = client->y + MOVE_STEP;
        break;

    case 'k':
        client->y = client->y - MOVE_STEP;
        break;

    case 'l':
        client->x = client->x + MOVE_STEP;
        break;

    default:
        PDEBUG("movestep: Moving in unknown direction.\n");
        break;
    } /* switch direction */
    
    movelim(client);
    
    /*
     * If the pointer was inside the window to begin with, move
     * pointer back to where it was, relative to the window.
     */
    if (start_x > 0 - conf.borderwidth && start_x < client->width
        + conf.borderwidth && start_y > 0 - conf.borderwidth && start_y
        < client->height + conf.borderwidth)
    {
        xcb_warp_pointer(conn, XCB_NONE, client->id, 0, 0, 0, 0,
                         start_x, start_y);
        xcb_flush(conn);        
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
jne 0x36e4
movl $0x0, -0x4(%rbp)
jmp 0x3855
movq -0x18(%rbp), %rax
testb $0x1, 0x31(%rax)
je 0x36fa
movl $0x0, -0x4(%rbp)
jmp 0x3855
movq -0x18(%rbp), %rax
movl (%rax), %edi
leaq -0x1a(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
callq 0x7540
testb $0x1, %al
jne 0x371d
movl $0x0, -0x4(%rbp)
jmp 0x3855
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x6f50
movsbl -0x10(%rbp), %eax
addl $-0x68, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x4, %eax
ja 0x37ae
movq -0x28(%rbp), %rax
leaq 0x68bf(%rip), %rcx      # 0xa004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %eax
subl $0x20, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x6(%rax)
jmp 0x37b0
movq -0x18(%rbp), %rax
movswl 0x8(%rax), %eax
addl $0x20, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0x37b0
movq -0x18(%rbp), %rax
movswl 0x8(%rax), %eax
subl $0x20, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0x37b0
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %eax
addl $0x20, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x6(%rax)
jmp 0x37b0
jmp 0x37b0
movq -0x18(%rbp), %rdi
callq 0x75d0
movswl -0x1a(%rbp), %eax
xorl %ecx, %ecx
subl 0xa18b(%rip), %ecx      # 0xd950
cmpl %ecx, %eax
jle 0x384e
movswl -0x1a(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl 0xa171(%rip), %ecx      # 0xd950
cmpl %ecx, %eax
jge 0x384e
movswl -0x1c(%rbp), %eax
xorl %ecx, %ecx
subl 0xa161(%rip), %ecx      # 0xd950
cmpl %ecx, %eax
jle 0x384e
movswl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
addl 0xa14b(%rip), %ecx      # 0xd950
cmpl %ecx, %eax
jge 0x384e
movq 0xa168(%rip), %rdi      # 0xd978
movq -0x18(%rbp), %rax
movl (%rax), %edx
movw -0x1a(%rbp), %ax
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
cwtl
movl %eax, 0x8(%rsp)
movswl -0x1c(%rbp), %eax
movl %eax, 0x10(%rsp)
callq 0x3050
movl %eax, -0x20(%rbp)
movq 0xa12f(%rip), %rdi      # 0xd978
callq 0x3140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop