user: Converte this assembly snippet into its equivalent C code:

```asm
<motion_vector>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  mov    0x50(%rsp),%r15d
  call   <Get_motion_code@plt>
  mov    %eax,%edx
  test   %eax,%eax
  je     L16
  test   %r14d,%r14d
  jne    L98
L16:
  xor    %ecx,%ecx
L64:
  xor    %eax,%eax
  mov    %r15d,%r8d
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <decode_motion_vector@plt>
  test   %r12d,%r12d
  jne    L88
L41:
  xor    %eax,%eax
  call   <Get_motion_code@plt>
  mov    %eax,%edx
  test   %ebp,%ebp
  je     L3
  test   %eax,%eax
  jne    L94
L3:
  xor    %ecx,%ecx
L4:
  lea    0x4(%rbx),%rdi
  test   %r13d,%r13d
  je     L46
  sarl   0x4(%rbx)
  mov    %r15d,%r8d
  mov    %ebp,%esi
  xor    %eax,%eax
  call   <decode_motion_vector@plt>
  shll   0x4(%rbx)
  test   %r12d,%r12d
  jne    L102
L10:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L46:
  xor    %eax,%eax
  mov    %r15d,%r8d
  mov    %ebp,%esi
  call   <decode_motion_vector@plt>
  test   %r12d,%r12d
  je     L10
L102:
  xor    %eax,%eax
  call   <Get_dmvector@plt>
  mov    (%rsp),%rbx
  mov    %eax,0x4(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L94:
  mov    %eax,0xc(%rsp)
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <Get_Bits@plt>
  mov    0xc(%rsp),%edx
  mov    %eax,%ecx
  jmp    L4
  nopl   (%rax)
L98:
  mov    %eax,0xc(%rsp)
  mov    %r14d,%edi
  xor    %eax,%eax
  call   <Get_Bits@plt>
  mov    0xc(%rsp),%edx
  mov    %eax,%ecx
  jmp    L64
  nopl   0x0(%rax)
L88:
  xor    %eax,%eax
  call   <Get_dmvector@plt>
  mov    (%rsp),%rsi
  mov    %eax,(%rsi)
  jmp    L41
```

assistant: ```c
void motion_vector(signed int *PMV, signed int *dmvector, signed int h_r_size, signed int v_r_size, signed int dmv, signed int mvscale, signed int full_pel_vector) {
  signed int motion_code;
  signed int motion_residual;
  motion_code = Get_motion_code();
  unsigned int tmp_if_expr$2;
  unsigned int return_value_Get_Bits$1;
  if (!(h_r_size == 0)) {
    if (motion_code == 0)
      goto __CPROVER_DUMP_L1;
    return_value_Get_Bits$1 = Get_Bits(h_r_size);
    tmp_if_expr$2 = return_value_Get_Bits$1;
  } else {
  __CPROVER_DUMP_L1:;
    tmp_if_expr$2 = (unsigned int)0;
  }
  motion_residual = (signed int)tmp_if_expr$2;
  decode_motion_vector(&PMV[(signed long int)0], h_r_size, motion_code, motion_residual, full_pel_vector);
  if (!(dmv == 0))
    dmvector[(signed long int)0] = Get_dmvector();
  motion_code = Get_motion_code();
  unsigned int tmp_if_expr$4;
  unsigned int return_value_Get_Bits$3;
  if (!(v_r_size == 0)) {
    if (motion_code == 0)
      goto __CPROVER_DUMP_L4;
    return_value_Get_Bits$3 = Get_Bits(v_r_size);
    tmp_if_expr$4 = return_value_Get_Bits$3;
  } else {
  __CPROVER_DUMP_L4:;
    tmp_if_expr$4 = (unsigned int)0;
  }
  motion_residual = (signed int)tmp_if_expr$4;
  if (!(mvscale == 0))
    PMV[(signed long int)1] = PMV[(signed long int)1] >> 1;
  decode_motion_vector(&PMV[(signed long int)1], v_r_size, motion_code, motion_residual, full_pel_vector);
  if (!(mvscale == 0))
    PMV[(signed long int)1] = PMV[(signed long int)1] << 1;
  if (!(dmv == 0))
    dmvector[(signed long int)1] = Get_dmvector();
}
```