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

```asm
<vga_font_load>:
  endbr64
  push   %r15
  push   %r14
  movslq %ecx,%r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x2,%edi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  call   <read_seq_b@plt>
  mov    $0x3c4,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  call   <outb@plt>
  mov    %r13d,%edi
  mov    $0x3c5,%esi
  and    $0xf0,%edi
  or     $0x4,%edi
  call   <outb@plt>
  mov    $0x4,%edi
  call   <read_seq_b@plt>
  mov    $0x3c4,%esi
  mov    $0x4,%edi
  mov    %eax,%r13d
  call   <outb@plt>
  or     $0x4,%r13d
  mov    $0x3c5,%esi
  movzbl %r13b,%edi
  call   <outb@plt>
  mov    $0x3ce,%esi
  mov    $0x4,%edi
  call   <outb@plt>
  mov    $0x3cf,%esi
  mov    $0x2,%edi
  call   <outb@plt>
  mov    $0x5,%edi
  call   <read_gra_b@plt>
  mov    $0x3ce,%esi
  mov    $0x5,%edi
  mov    %eax,%r13d
  call   <outb@plt>
  mov    %r13d,%edi
  mov    $0x3cf,%esi
  and    $0xef,%edi
  call   <outb@plt>
  mov    $0x3ce,%esi
  mov    $0x6,%edi
  call   <outb@plt>
  xor    %edi,%edi
  mov    $0x3cf,%esi
  call   <outb@plt>
  test   %r14d,%r14d
  jle    L123
  test   %r12d,%r12d
  jle    L123
  lea    -0x1(%r12),%eax
  shl    $0x4,%r14
  mov    %r12d,%r15d
  mov    %rbp,%rcx
  mov    %eax,0x4(%rsp)
  mov    %r12d,%eax
  mov    %rbx,%rdx
  and    $0xfffffff0,%r15d
  shr    $0x4,%eax
  mov    %r14,0x8(%rsp)
  xor    %r10d,%r10d
  xor    %r8d,%r8d
  lea    -0x1(%rax),%r9d
  mov    %r12d,%eax
  and    $0xf,%eax
  add    $0x1,%r9
  mov    %eax,0x10(%rsp)
  sub    $0x1,%eax
  shl    $0x4,%r9
  mov    %eax,0x14(%rsp)
  mov    %r12d,%eax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L66:
  lea    0x1(%rdx),%rsi
  mov    %rcx,%rax
  mov    %r8d,%edi
  mov    %r10d,%r11d
  sub    %rsi,%rax
  cmp    $0xe,%rax
  jbe    L34
  cmpl   $0x6,0x4(%rsp)
  jbe    L34
  cmpl   $0xe,0x4(%rsp)
  jbe    L186
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L77:
  movdqu (%rdx,%rax,1),%xmm1
  movups %xmm1,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %r9,%rax
  jne    L77
  cmp    %r15d,%r12d
  je     L135
  cmpl   $0x6,0x14(%rsp)
  mov    0x10(%rsp),%r13d
  jbe    L9
  mov    %r15d,%esi
  mov    %r15d,%eax
L182:
  lea    (%rbx,%rsi,1),%r14
  movq   (%r14,%r8,1),%xmm0
  lea    0x0(%rbp,%r10,1),%r14
  movq   %xmm0,(%r14,%rsi,1)
  mov    %r13d,%esi
  and    $0xfffffff8,%esi
  add    %esi,%eax
  cmp    %esi,%r13d
  je     L135
L105:
  lea    (%rdi,%rax,1),%esi
  movslq %esi,%rsi
  movzbl (%rbx,%rsi,1),%r13d
  lea    (%r11,%rax,1),%esi
  movslq %esi,%rsi
  mov    %r13b,0x0(%rbp,%rsi,1)
  lea    0x1(%rax),%esi
  cmp    %esi,%r12d
  jle    L135
  lea    (%rdi,%rsi,1),%r13d
  add    %r11d,%esi
  movslq %r13d,%r13
  movslq %esi,%rsi
  movzbl (%rbx,%r13,1),%r13d
  mov    %r13b,0x0(%rbp,%rsi,1)
  lea    0x2(%rax),%esi
  cmp    %esi,%r12d
  jle    L135
  lea    (%rdi,%rsi,1),%r13d
  add    %r11d,%esi
  movslq %r13d,%r13
  movslq %esi,%rsi
  movzbl (%rbx,%r13,1),%r13d
  mov    %r13b,0x0(%rbp,%rsi,1)
  lea    0x3(%rax),%esi
  cmp    %esi,%r12d
  jle    L135
  lea    (%rdi,%rsi,1),%r13d
  add    %r11d,%esi
  movslq %r13d,%r13
  movslq %esi,%rsi
  movzbl (%rbx,%r13,1),%r13d
  mov    %r13b,0x0(%rbp,%rsi,1)
  lea    0x4(%rax),%esi
  cmp    %esi,%r12d
  jle    L135
  lea    (%rdi,%rsi,1),%r13d
  add    %r11d,%esi
  movslq %r13d,%r13
  movslq %esi,%rsi
  movzbl (%rbx,%r13,1),%r13d
  mov    %r13b,0x0(%rbp,%rsi,1)
  lea    0x5(%rax),%esi
  cmp    %esi,%r12d
  jle    L135
  lea    (%rdi,%rsi,1),%r13d
  add    %r11d,%esi
  add    $0x6,%eax
  movslq %r13d,%r13
  movslq %esi,%rsi
  movzbl (%rbx,%r13,1),%r13d
  mov    %r13b,0x0(%rbp,%rsi,1)
  cmp    %eax,%r12d
  jle    L135
  add    %eax,%edi
  add    %r11d,%eax
  movslq %edi,%rdi
  cltq
  movzbl (%rbx,%rdi,1),%esi
  mov    %sil,0x0(%rbp,%rax,1)
L135:
  add    $0x20,%rcx
  add    $0x10,%rdx
  add    $0x10,%r8
  add    $0x20,%r10
  cmp    0x8(%rsp),%r8
  jne    L66
L123:
  mov    $0x2,%edi
  call   <read_seq_b@plt>
  mov    $0x3c4,%esi
  mov    $0x2,%edi
  mov    %eax,%ebx
  call   <outb@plt>
  and    $0xf0,%ebx
  mov    $0x3c5,%esi
  mov    %ebx,%edi
  or     $0x3,%edi
  call   <outb@plt>
  mov    $0x4,%edi
  call   <read_seq_b@plt>
  mov    $0x3c4,%esi
  mov    $0x4,%edi
  mov    %eax,%ebx
  call   <outb@plt>
  and    $0xfb,%ebx
  mov    $0x3c5,%esi
  mov    %ebx,%edi
  call   <outb@plt>
  mov    $0x3ce,%esi
  mov    $0x4,%edi
  call   <outb@plt>
  mov    $0x3cf,%esi
  xor    %edi,%edi
  call   <outb@plt>
  mov    $0x5,%edi
  call   <read_gra_b@plt>
  mov    $0x3ce,%esi
  mov    $0x5,%edi
  mov    %eax,%ebx
  call   <outb@plt>
  or     $0x10,%ebx
  mov    $0x3cf,%esi
  movzbl %bl,%edi
  call   <outb@plt>
  mov    $0x3ce,%esi
  mov    $0x6,%edi
  call   <outb@plt>
  add    $0x28,%rsp
  mov    $0x3cf,%esi
  mov    $0xe,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <outb@plt>
  xchg   %ax,%ax
L34:
  mov    0x18(%rsp),%rdi
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L69:
  movzbl (%rdx,%rax,1),%esi
  mov    %sil,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L69
  jmp    L135
L186:
  mov    %r12d,%r13d
  xor    %esi,%esi
  xor    %eax,%eax
  jmp    L182
L9:
  mov    %r15d,%eax
  jmp    L105
```

assistant: ```c
void vga_font_load(unsigned char *vidmem, const unsigned char *font, int height, int num_chars) {
  int i, j;
  unsigned char byte;
  byte = read_seq_b(0x02) & ~0xf;
  outb(0x02, 0x3C4);
  outb(byte | 4, 0x3C5);
  byte = read_seq_b(0x04);
  outb(0x04, 0x3C4);
  outb(byte | 4, 0x3C5);
  outb(0x04, 0x3CE);
  outb(2, 0x3CF);
  byte = read_gra_b(0x05) & ~0x10;
  outb(0x05, 0x3CE);
  outb(byte, 0x3CF);
  outb(0x06, 0x3CE);
  outb(0, 0x3CF);
  for (i = 0; i < num_chars; i++) {
    for (j = 0; j < height; j++) {
      vidmem[i * 32 + j] = font[i * 16 + j];
    }
  }
  byte = read_seq_b(0x02) & ~0xf;
  outb(0x02, 0x3C4);
  outb(byte | 3, 0x3C5);
  byte = read_seq_b(0x04) & ~0x4;
  outb(0x04, 0x3C4);
  outb(byte, 0x3C5);
  outb(0x04, 0x3CE);
  outb(0, 0x3CF);
  byte = read_gra_b(0x05);
  outb(0x05, 0x3CE);
  outb(byte | 0x10, 0x3CF);
  outb(0x06, 0x3CE);
  outb(0xe, 0x3CF);
}
```