user: Translate the below assembly code into C programming language:

```asm
<intToRoman>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x6,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L114
L17:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4d,(%rax)
  subl   $0x1,-0x14(%rbp)
L114:
  cmpl   $0x0,-0x14(%rbp)
  jg     L17
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x6,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x3e8,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x383,-0x24(%rbp)
  jle    L120
  mov    -0x10(%rbp),%rax
  movb   $0x43,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x4d,(%rax)
  addq   $0x2,-0x10(%rbp)
  subl   $0x384,-0x24(%rbp)
  jmp    L67
L120:
  cmpl   $0x1f3,-0x24(%rbp)
  jle    L167
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x44,(%rax)
  subl   $0x1f4,-0x24(%rbp)
  jmp    L67
L167:
  cmpl   $0x18f,-0x24(%rbp)
  jle    L67
  mov    -0x10(%rbp),%rax
  movb   $0x43,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x44,(%rax)
  addq   $0x2,-0x10(%rbp)
  subl   $0x190,-0x24(%rbp)
L67:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L83
L88:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x43,(%rax)
  subl   $0x1,-0x14(%rbp)
L83:
  cmpl   $0x0,-0x14(%rbp)
  jg     L88
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x64,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x59,-0x24(%rbp)
  jle    L50
  mov    -0x10(%rbp),%rax
  movb   $0x58,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x43,(%rax)
  addq   $0x2,-0x10(%rbp)
  subl   $0x5a,-0x24(%rbp)
  jmp    L44
L50:
  cmpl   $0x31,-0x24(%rbp)
  jle    L21
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4c,(%rax)
  subl   $0x32,-0x24(%rbp)
  jmp    L44
L21:
  cmpl   $0x27,-0x24(%rbp)
  jle    L44
  mov    -0x10(%rbp),%rax
  movb   $0x58,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x4c,(%rax)
  addq   $0x2,-0x10(%rbp)
  subl   $0x28,-0x24(%rbp)
L44:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L54
L218:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x58,(%rax)
  subl   $0x1,-0x14(%rbp)
L54:
  cmpl   $0x0,-0x14(%rbp)
  jg     L218
  mov    -0x24(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x24(%rbp)
  cmpl   $0x9,-0x24(%rbp)
  jne    L101
  mov    -0x10(%rbp),%rax
  movb   $0x49,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x58,(%rax)
  addq   $0x2,-0x10(%rbp)
  subl   $0x9,-0x24(%rbp)
  jmp    L217
L101:
  cmpl   $0x4,-0x24(%rbp)
  jle    L173
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x56,(%rax)
  subl   $0x5,-0x24(%rbp)
  jmp    L217
L173:
  cmpl   $0x4,-0x24(%rbp)
  jne    L217
  mov    -0x10(%rbp),%rax
  movb   $0x49,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x56,(%rax)
  addq   $0x2,-0x10(%rbp)
  subl   $0x4,-0x24(%rbp)
L217:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L107
L155:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x49,(%rax)
  subl   $0x1,-0x14(%rbp)
L107:
  cmpl   $0x0,-0x14(%rbp)
  jg     L155
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *intToRoman(int num) {
  char *r = (char *)malloc(16 * sizeof(char));
  char *cr = r;
  int i;
  for (i = num / 1000; i > 0; --i)
    *cr++ = 'M';
  num %= 1000;
  if (num >= 900) {
    cr[0] = 'C';
    cr[1] = 'M';
    cr += 2;
    num -= 900;
  } else if (num >= 500) {
    *cr++ = 'D';
    num -= 500;
  } else if (num >= 400) {
    cr[0] = 'C';
    cr[1] = 'D';
    cr += 2;
    num -= 400;
  }
  for (i = num / 100; i > 0; --i)
    *cr++ = 'C';
  num %= 100;
  if (num >= 90) {
    cr[0] = 'X';
    cr[1] = 'C';
    cr += 2;
    num -= 90;
  } else if (num >= 50) {
    *cr++ = 'L';
    num -= 50;
  } else if (num >= 40) {
    cr[0] = 'X';
    cr[1] = 'L';
    cr += 2;
    num -= 40;
  }
  for (i = num / 10; i > 0; --i)
    *cr++ = 'X';
  num %= 10;
  if (9 == num) {
    cr[0] = 'I';
    cr[1] = 'X';
    cr += 2;
    num -= 9;
  } else if (num >= 5) {
    *cr++ = 'V';
    num -= 5;
  } else if (4 == num) {
    cr[0] = 'I';
    cr[1] = 'V';
    cr += 2;
    num -= 4;
  }
  for (i = num; i > 0; --i)
    *cr++ = 'I';
  *cr = 0;
  return r;
}
```