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

```asm
<aRomanos>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  je     L551
  cmpl   $0xf9f,-0x34(%rbp)
  jg     L551
  cmpl   $0x3e7,-0x34(%rbp)
  jle    L340
  mov    -0x34(%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,-0x28(%rbp)
  mov    -0x34(%rbp),%eax
  sub    -0x28(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%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,-0x4(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L175
L599:
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x24(%rbp)
L175:
  mov    -0x24(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L599
L340:
  cmpl   $0x383,-0x28(%rbp)
  jle    L194
  cmpl   $0x3e7,-0x28(%rbp)
  jle    L454
L194:
  cmpl   $0x383,-0x34(%rbp)
  jle    L217
  cmpl   $0x3e7,-0x34(%rbp)
  jg     L217
L454:
  lea    D135(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L217:
  cmpl   $0x3e7,-0x34(%rbp)
  jg     L447
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x28(%rbp)
L447:
  cmpl   $0x1f3,-0x28(%rbp)
  jle    L3
  cmpl   $0x383,-0x28(%rbp)
  jle    L102
L3:
  cmpl   $0x1f3,-0x34(%rbp)
  jle    L541
  cmpl   $0x383,-0x34(%rbp)
  jg     L541
L102:
  lea    D113(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x28(%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,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%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
  sub    $0x5,%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L592
L459:
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x20(%rbp)
L592:
  mov    -0x20(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L459
L541:
  cmpl   $0x18f,-0x28(%rbp)
  jle    L110
  cmpl   $0x1f3,-0x28(%rbp)
  jle    L436
L110:
  cmpl   $0x18f,-0x34(%rbp)
  jle    L496
  cmpl   $0x1f3,-0x34(%rbp)
  jg     L496
L436:
  lea    D159(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L559
L496:
  cmpl   $0x1f3,-0x28(%rbp)
  jg     L581
  cmpl   $0x63,-0x28(%rbp)
  jg     L407
L581:
  cmpl   $0x1f3,-0x34(%rbp)
  jg     L559
  cmpl   $0x63,-0x34(%rbp)
  jle    L559
L407:
  mov    -0x28(%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,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%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,-0x4(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L160
L512:
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x1c(%rbp)
L160:
  mov    -0x1c(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L512
L559:
  mov    -0x28(%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,-0x28(%rbp)
  cmpl   $0x31,-0x28(%rbp)
  jle    L336
  cmpl   $0x59,-0x28(%rbp)
  jle    L7
L336:
  cmpl   $0x31,-0x34(%rbp)
  jle    L147
  cmpl   $0x59,-0x34(%rbp)
  jg     L147
L7:
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x28(%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
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x28(%rbp),%eax
  sub    %ecx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%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
  sub    $0x5,%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L301
L172:
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x18(%rbp)
L301:
  mov    -0x18(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L172
L147:
  cmpl   $0x59,-0x28(%rbp)
  jle    L180
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L180:
  cmpl   $0x27,-0x28(%rbp)
  jle    L81
  cmpl   $0x31,-0x28(%rbp)
  jle    L332
L81:
  cmpl   $0x27,-0x34(%rbp)
  jle    L204
  cmpl   $0x31,-0x34(%rbp)
  jg     L204
L332:
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L115
L204:
  cmpl   $0x31,-0x28(%rbp)
  jg     L481
  cmpl   $0x9,-0x28(%rbp)
  jg     L68
L481:
  cmpl   $0x31,-0x34(%rbp)
  jg     L115
  cmpl   $0x9,-0x34(%rbp)
  jle    L115
L68:
  mov    -0x28(%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
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x28(%rbp),%eax
  sub    %ecx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%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,-0x4(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L345
L281:
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L345:
  mov    -0x14(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L281
L115:
  mov    -0x28(%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,-0x28(%rbp)
  cmpl   $0x4,-0x28(%rbp)
  jle    L292
  cmpl   $0x8,-0x28(%rbp)
  jle    L485
L292:
  cmpl   $0x4,-0x34(%rbp)
  jle    L96
  cmpl   $0x8,-0x34(%rbp)
  jg     L96
L485:
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x1,-0x10(%rbp)
  jmp    L468
L305:
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x10(%rbp)
L468:
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L305
L96:
  cmpl   $0x8,-0x28(%rbp)
  jle    L568
  lea    D126(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L568:
  cmpl   $0x4,-0x28(%rbp)
  je     L364
  cmpl   $0x4,-0x34(%rbp)
  jne    L595
L364:
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L595:
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x3,-0x28(%rbp)
  jle    L287
  cmpl   $0x3,-0x34(%rbp)
  jg     L552
L287:
  movl   $0x1,-0xc(%rbp)
  jmp    L444
L594:
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0xc(%rbp)
L444:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L594
  jmp    L552
L551:
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L346
L552:
  nop
L346:
  mov    $0x0,%eax
  call   <getchar@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D17
data_type: string
name: extract_symbolic_data
arguments: label: D135
data_type: string
name: extract_symbolic_data
arguments: label: D113
data_type: string
name: extract_symbolic_data
arguments: label: D60
data_type: string
name: extract_symbolic_data
arguments: label: D159
data_type: string
name: extract_symbolic_data
arguments: label: D7
data_type: string
name: extract_symbolic_data
arguments: label: D31
data_type: string
name: extract_symbolic_data
arguments: label: D35
data_type: string
name: extract_symbolic_data
arguments: label: D70
data_type: string
name: extract_symbolic_data
arguments: label: D21
data_type: string
name: extract_symbolic_data
arguments: label: D49
data_type: string
name: extract_symbolic_data
arguments: label: D126
data_type: string
name: extract_symbolic_data
arguments: label: D114
data_type: string
name: extract_symbolic_data
arguments: label: D27
data_type: string

tool: D17: M

tool: D135: CM

tool: D113: D

tool: D60: C

tool: D159: CD

tool: D7: L

tool: D31: X

tool: D35: XC

tool: D70: XL

tool: D21: V

tool: D49: I

tool: D126: IX

tool: D114: IV

tool: D27: ERROR: Numero Invalido


assistant: ```c
void aRomanos(int p1) {
  int rem;
  int redondo;
  int pTimes;
  if (p1 != 0 && p1 < 4000) {
    if (p1 / 1000 >= 1) {
      rem = p1 % 1000;
      redondo = p1 - rem;
      pTimes = redondo / 1000;
      for (int i = 1; i <= pTimes; i++) {
        printf("M");
      }
    }
    if ((rem >= 900 && rem <= 999) || (p1 >= 900 && p1 <= 999)) {
      printf("CM");
      ;
    }
    if (p1 < 1000) {
      rem = p1;
    }
    if ((rem >= 500 && rem < 900) || (p1 >= 500 && p1 < 900)) {
      printf("D");
      redondo = rem - (rem % 100);
      pTimes = (redondo / 100) - 5;
      for (int i = 1; i <= pTimes; i++) {
        printf("C");
      }
    }
    if ((rem >= 400 && rem < 500) || (p1 >= 400 && p1 < 500)) {
      printf("CD");
    } else if (rem < 500 && rem >= 100 || p1 < 500 && p1 >= 100) {
      redondo = rem - (rem % 100);
      pTimes = redondo / 100;
      for (int i = 1; i <= pTimes; i++) {
        printf("C");
      }
    }
    rem = rem % 100;
    if ((rem >= 50 && rem < 90) || (p1 >= 50 && p1 < 90)) {
      printf("L");
      redondo = rem - (rem % 10);
      pTimes = (redondo / 10) - 5;
      for (int i = 1; i <= pTimes; i++) {
        printf("X");
      }
    }
    if (rem >= 90) {
      printf("XC");
    }
    if ((rem >= 40 && rem < 50) || (p1 >= 40 && p1 < 50)) {
      printf("XL");
    } else if (rem < 50 && rem >= 10 || p1 < 50 && p1 >= 10) {
      redondo = rem - (rem % 10);
      pTimes = redondo / 10;
      for (int i = 1; i <= pTimes; i++) {
        printf("X");
      }
    }
    rem = rem % 10;
    if ((rem >= 5 && rem < 9) || (p1 >= 5 && p1 < 9)) {
      printf("V");
      redondo = rem;
      pTimes = redondo - 5;
      for (int i = 1; i <= pTimes; i++) {
        printf("I");
      }
    }
    if (rem >= 9) {
      printf("IX");
    }
    if (rem == 4 || p1 == 4) {
      printf("IV");
    }
    redondo = rem;
    pTimes = redondo;
    if (rem < 4 || p1 < 4) {
      for (int i = 1; i <= pTimes; i++) {
        printf("I");
      }
    }
  } else {
    printf("ERROR: Numero Invalido\n");
  }
  getchar();
}
```