user: 请从给定的汇编指令推导出C源代码：

```asm
<vector_set>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  shr    $0x4,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xf,%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L6
L20:
  mov    -0x10(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x3,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x4,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x5,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x6,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x7,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x8,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0x9,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0xa,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0xb,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0xc,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0xd,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0xe,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  add    $0xf,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x10,-0x10(%rbp)
L6:
  mov    -0x8(%rbp),%eax
  shl    $0x4,%eax
  cmp    %eax,-0x10(%rbp)
  jb     L20
  movl   $0x0,-0xc(%rbp)
  jmp    L15
L24:
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xc(%rbp)
L15:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jb     L24
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void vector_set(int *v, unsigned int val, unsigned int length) {
  unsigned int i, j;
  unsigned int num_blocks = length / 16;
  unsigned int rem = length % 16;
  for (i = 0; i < num_blocks * 16; i += 16) {
    v[i + 0] = val;
    v[i + 1] = val;
    v[i + 2] = val;
    v[i + 3] = val;
    v[i + 4] = val;
    v[i + 5] = val;
    v[i + 6] = val;
    v[i + 7] = val;
    v[i + 8] = val;
    v[i + 9] = val;
    v[i + 10] = val;
    v[i + 11] = val;
    v[i + 12] = val;
    v[i + 13] = val;
    v[i + 14] = val;
    v[i + 15] = val;
  }
  for (j = 0; j < rem; j++)
    v[i + j] = val;
}
```