user: What is the c source code of the assembly code below:

```asm
<to_dec>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  call   <init_roman@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L159
  sub    $0x1,%eax
  mov    %rbx,%rdi
  lea    D7(%rip),%rsi
  xor    %edx,%edx
  lea    0x1(%rbx,%rax,1),%r8
  nopl   0x0(%rax,%rax,1)
L13:
  movzbl (%rdi),%eax
  lea    -0x61(%rax),%ecx
  cmp    $0x19,%cl
  ja     L38
  sub    $0x20,%eax
  mov    %al,(%rdi)
L38:
  sub    $0x43,%eax
  cmp    $0x1b,%al
  ja     L162
  movzbl %al,%eax
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L443:
  movslq %eax,%rdx
  lea    0x401(%rsp),%r10
  xor    %r8d,%r8d
  movsbl 0x400(%rsp),%r11d
  movb   $0x0,0x400(%rsp,%rdx,1)
  lea    -0x2(%rax),%edx
  mov    %r10,%rsi
  lea    0x402(%rsp,%rdx,1),%r9
  mov    %r11d,%edi
  jmp    L354
  nopw   0x0(%rax,%rax,1)
L320:
  xor    %r8d,%r8d
L368:
  add    $0x1,%rsi
  cmp    %r9,%rsi
  je     L40
L354:
  movsbl (%rsi),%edx
  movsbl %dil,%ecx
  mov    %edx,%edi
  sub    %ecx,%edx
  test   %edx,%edx
  jg     L162
  jne    L320
  add    $0x1,%r8d
  cmp    $0x4,%r8d
  jne    L368
  nopl   0x0(%rax,%rax,1)
L162:
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L224
  add    $0x818,%rsp
  mov    %rbp,%rdi
  lea    D10(%rip),%rsi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1080 <strcpy@plt>
  nopl   0x0(%rax,%rax,1)
  lea    -0x1(%rdx),%eax
  cltq
  addb   $0x6,(%rsp,%rax,1)
  nopl   0x0(%rax)
L522:
  add    $0x1,%rdi
  cmp    %r8,%rdi
  jne    L13
  movslq %edx,%rax
  movb   $0x0,(%rsp,%rax,1)
  movzbl (%rsp),%ecx
  mov    %cl,0x400(%rsp)
  cmp    $0x1,%edx
  jle    L528
  cmp    $0x3,%edx
  jle    L428
  lea    -0x4(%rdx),%r8d
  lea    0x2(%rsp),%r10
  mov    $0x1,%eax
  movsbl %cl,%esi
  and    $0xfffffffe,%r8d
  mov    $0x1,%r11d
  add    $0x3,%r8d
L536:
  movsbl -0x1(%r10),%edi
  lea    0x1(%rsi),%r12d
  lea    0x1(%rax),%r9d
  mov    %edi,%ebx
  cmp    %r12d,%edi
  je     L351
L272:
  add    $0x2,%esi
  cmp    %esi,%edi
  je     L110
L527:
  cltq
  mov    %bl,0x400(%rsp,%rax,1)
L474:
  movsbl (%r10),%esi
  lea    0x2(%r11),%r12d
  lea    0x1(%rdi),%r13d
  mov    %r12d,%r11d
  lea    0x1(%r9),%eax
  mov    %esi,%ecx
  cmp    %esi,%r13d
  je     L237
L338:
  add    $0x2,%edi
  cmp    %esi,%edi
  je     L64
L476:
  movslq %r9d,%r9
  mov    %cl,0x400(%rsp,%r9,1)
L177:
  add    $0x2,%r10
  cmp    %r12d,%r8d
  jne    L536
L508:
  movslq %r11d,%rcx
  lea    (%rsp,%rcx,1),%r8
  sub    %r8d,%r11d
  jmp    L46
  nopl   (%rax)
L23:
  add    $0x2,%ecx
  cmp    %ecx,%esi
  je     L310
L203:
  cltq
  mov    %r9b,0x400(%rsp,%rax,1)
  mov    %ebx,%eax
L211:
  add    $0x1,%r8
  lea    (%r11,%r8,1),%ecx
  cmp    %ecx,%edx
  jle    L443
L46:
  movsbl -0x1(%r8),%ecx
  movsbl (%r8),%esi
  lea    0x1(%rax),%ebx
  lea    0x1(%rcx),%edi
  mov    %esi,%r9d
  mov    %ecx,%r10d
  cmp    %edi,%esi
  jne    L23
  test   $0x1,%sil
  jne    L23
  lea    -0x1(%rax),%ecx
  movslq %ebx,%rbx
  movslq %ecx,%rcx
  mov    %r10b,0x400(%rsp,%rcx,1)
  movslq %eax,%rcx
  mov    %r10b,0x400(%rsp,%rcx,1)
  lea    0x2(%rax),%ecx
  add    $0x3,%eax
  movslq %ecx,%rcx
  mov    %r10b,0x400(%rsp,%rbx,1)
  mov    %r10b,0x400(%rsp,%rcx,1)
  jmp    L211
  nopl   (%rax)
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x3,(%rsp,%rax,1)
  jmp    L522
  nopw   0x0(%rax,%rax,1)
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x2,(%rsp,%rax,1)
  jmp    L522
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x7,(%rsp,%rax,1)
  jmp    L522
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x4,(%rsp,%rax,1)
  jmp    L522
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x1,(%rsp,%rax,1)
  jmp    L522
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x6,(%rsp,%rax,1)
  jmp    L522
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x5,(%rsp,%rax,1)
  jmp    L522
  nop
L237:
  test   $0x1,%sil
  jne    L338
  lea    -0x1(%r9),%edi
  cltq
  movslq %edi,%rdi
  mov    %bl,0x400(%rsp,%rdi,1)
  movslq %r9d,%rdi
  mov    %bl,0x400(%rsp,%rdi,1)
  mov    %bl,0x400(%rsp,%rax,1)
  lea    0x2(%r9),%eax
  cltq
  mov    %bl,0x400(%rsp,%rax,1)
  lea    0x3(%r9),%eax
  jmp    L177
  nopl   0x0(%rax)
L351:
  test   $0x1,%dil
  jne    L272
  lea    -0x1(%rax),%esi
  movslq %r9d,%r9
  movslq %esi,%rsi
  mov    %cl,0x400(%rsp,%rsi,1)
  movslq %eax,%rsi
  mov    %cl,0x400(%rsp,%rsi,1)
  lea    0x2(%rax),%esi
  movslq %esi,%rsi
  mov    %cl,0x400(%rsp,%r9,1)
  lea    0x3(%rax),%r9d
  mov    %cl,0x400(%rsp,%rsi,1)
  jmp    L474
  nopw   0x0(%rax,%rax,1)
L110:
  mov    %ebx,%r12d
  shr    $0x7,%r12b
  lea    (%rbx,%r12,1),%esi
  and    $0x1,%esi
  sub    %r12d,%esi
  cmp    $0x1,%sil
  jne    L527
  lea    -0x1(%rax),%esi
  lea    -0x1(%rbx),%r12d
  movslq %r9d,%r9
  movslq %esi,%rsi
  mov    %r12b,0x400(%rsp,%rsi,1)
  movslq %eax,%rsi
  mov    %cl,0x400(%rsp,%rsi,1)
  lea    0x2(%rax),%esi
  movslq %esi,%rsi
  mov    %cl,0x400(%rsp,%r9,1)
  lea    0x4(%rax),%r9d
  mov    %cl,0x400(%rsp,%rsi,1)
  lea    0x3(%rax),%esi
  movslq %esi,%rsi
  mov    %cl,0x400(%rsp,%rsi,1)
  jmp    L474
  nopl   (%rax)
L64:
  mov    %ecx,%r13d
  shr    $0x7,%r13b
  lea    (%rcx,%r13,1),%edi
  and    $0x1,%edi
  sub    %r13d,%edi
  cmp    $0x1,%dil
  jne    L476
  lea    -0x1(%r9),%edi
  lea    -0x1(%rcx),%r13d
  cltq
  movslq %edi,%rdi
  mov    %r13b,0x400(%rsp,%rdi,1)
  movslq %r9d,%rdi
  mov    %bl,0x400(%rsp,%rdi,1)
  mov    %bl,0x400(%rsp,%rax,1)
  lea    0x2(%r9),%eax
  cltq
  mov    %bl,0x400(%rsp,%rax,1)
  lea    0x3(%r9),%eax
  cltq
  mov    %bl,0x400(%rsp,%rax,1)
  lea    0x4(%r9),%eax
  jmp    L177
  nopl   0x0(%rax)
L310:
  mov    %r9d,%esi
  shr    $0x7,%sil
  lea    (%r9,%rsi,1),%ecx
  and    $0x1,%ecx
  sub    %esi,%ecx
  cmp    $0x1,%cl
  jne    L203
  lea    -0x1(%rax),%ecx
  sub    $0x1,%r9d
  movslq %ebx,%rbx
  movslq %ecx,%rcx
  mov    %r9b,0x400(%rsp,%rcx,1)
  movslq %eax,%rcx
  mov    %r10b,0x400(%rsp,%rcx,1)
  lea    0x2(%rax),%ecx
  movslq %ecx,%rcx
  mov    %r10b,0x400(%rsp,%rbx,1)
  mov    %r10b,0x400(%rsp,%rcx,1)
  lea    0x3(%rax),%ecx
  add    $0x4,%eax
  movslq %ecx,%rcx
  mov    %r10b,0x400(%rsp,%rcx,1)
  jmp    L211
  nopl   (%rax)
L40:
  sub    $0x1,%r11d
  mov    %r11d,%edx
  shr    $0x1f,%edx
  add    %r11d,%edx
  sar    %edx
  lea    0x1(%rdx),%esi
  movslq %esi,%r9
L537:
  test   %esi,%esi
  jg     L399
L118:
  movb   $0x0,0x0(%rbp,%r9,1)
  sub    $0x1,%eax
  lea    0x400(%rsp),%rcx
  lea    (%r10,%rax,1),%rdi
  nopw   0x0(%rax,%rax,1)
L111:
  movsbl (%rcx),%edx
  mov    %edx,%r8d
  add    $0x1,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  mov    %esi,%edx
  sar    %eax
  sub    %eax,%edx
  movslq %edx,%rdx
  add    %rbp,%rdx
  movzbl (%rdx),%eax
  lea    0x1(%rax),%r9d
  add    $0x5,%eax
  and    $0x1,%r8d
  cmovne %r9d,%eax
  mov    %al,(%rdx)
  cmp    $0x39,%al
  jg     L162
  add    $0x1,%rcx
  cmp    %rdi,%rcx
  jne    L111
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L224
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L159:
  xor    %esi,%esi
  mov    $0x1,%r9d
  xor    %edx,%edx
  mov    $0x1,%eax
  mov    %si,0x400(%rsp)
  lea    0x401(%rsp),%r10
  mov    $0x1,%esi
L399:
  movabs $0x3030303030303030,%rdi
  xor    %ecx,%ecx
  test   %edx,%edx
  cmovs  %ecx,%edx
  add    $0x1,%edx
  cmp    $0x8,%edx
  jae    L251
  test   $0x4,%dl
  jne    L424
  test   %edx,%edx
  je     L118
  movb   $0x30,0x0(%rbp)
  test   $0x2,%dl
  je     L118
  mov    $0x3030,%ecx
  mov    %cx,-0x2(%rbp,%rdx,1)
  jmp    L118
  nopl   0x0(%rax)
L251:
  mov    %edx,%ecx
  lea    0x8(%rbp),%r8
  mov    %rdi,0x0(%rbp)
  and    $0xfffffffffffffff8,%r8
  mov    %rdi,-0x8(%rbp,%rcx,1)
  mov    %rbp,%rcx
  sub    %r8,%rcx
  add    %ecx,%edx
  and    $0xfffffff8,%edx
  cmp    $0x8,%edx
  jb     L118
  and    $0xfffffff8,%edx
  xor    %ecx,%ecx
L413:
  mov    %ecx,%r11d
  add    $0x8,%ecx
  mov    %rdi,(%r8,%r11,1)
  cmp    %edx,%ecx
  jb     L413
  jmp    L118
L424:
  movl   $0x30303030,0x0(%rbp)
  movl   $0x30303030,-0x4(%rbp,%rdx,1)
  jmp    L118
L428:
  mov    $0x1,%eax
  mov    $0x1,%r11d
  jmp    L508
L528:
  movsbl %cl,%eax
  movb   $0x0,0x401(%rsp)
  lea    0x401(%rsp),%r10
  sub    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  mov    $0x1,%eax
  sar    %edx
  lea    0x1(%rdx),%esi
  movslq %esi,%r9
  jmp    L537
L224:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D10
datatype: string

tool: D10: <invalid>

assistant: ```c
void to_dec(char *r, char *d) {
  int i, j, k, length, iter = 0;
  char string1[1024], string2[1024];
  ;
  init_roman();
  length = strlen(r);
  j = 0;
  for (i = 0; i < length; i++) {
    if ((r[i] >= 'a') && (r[i] <= 'z'))
      r[i] -= 32;
    switch (r[i]) {
    case 'I': {
      string1[j] = 1;
      ++j;
      break;
    }
    case 'V': {
      string1[j] = 2;
      ++j;
      break;
    }
    case 'X': {
      string1[j] = 3;
      ++j;
      break;
    }
    case 'L': {
      string1[j] = 4;
      ++j;
      break;
    }
    case 'C': {
      string1[j] = 5;
      ++j;
      break;
    }
    case 'D': {
      string1[j] = 6;
      ++j;
      break;
    }
    case 'M': {
      string1[j] = 7;
      ++j;
      break;
    }
    case '^': {
      string1[j - 1] += 6;
      break;
    }
    default: {
      strcpy(d, "<invalid>");
      return;
      break;
    }
    }
  }
  length = j;
  string1[length] = 0;
  string2[0] = string1[0];
  i = 1;
  j = 1;
  while (i < length) {
    if ((string1[i] == string1[i - 1] + 1) && (string1[i] % 2 == 0)) {
      --j;
      for (k = 0; k < 4; k++) {
        string2[j] = string1[i - 1];
        j++;
      };
      ++i;
    } else if ((string1[i] == string1[i - 1] + 2) && (string1[i] % 2 == 1)) {
      string2[j - 1] = string1[i] - 1;
      for (k = 0; k < 4; k++) {
        string2[j] = string1[i - 1];
        j++;
      };
      ++i;
    } else {
      string2[j] = string1[i];
      ++i;
      ++j;
    }
  }
  length = j;
  string2[length] = 0;
  for (i = 1; i < length; i++) {
    k = string2[i] - string2[i - 1];
    if (k > 0) {
      strcpy(d, "<invalid>");
      return;
    }
    if (k < 0)
      iter = 0;
    if (k == 0)
      ++iter;
    if (iter >= 4) {
      strcpy(d, "<invalid>");
      return;
    }
  }
  k = 1 + (string2[0] - 1) / 2;
  for (i = 0; i < k; i++)
    d[i] = '0';
  d[k] = 0;
  for (i = 0; i < length; i++) {
    j = k - (string2[i] + 1) / 2;
    if (string2[i] % 2)
      d[j] += 1;
    else
      d[j] += 5;
    if (d[j] > '9') {
      strcpy(d, "<invalid>");
      return;
    }
  }
}
```