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

```asm
<to_dec>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x810,%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    L134
  sub    $0x1,%eax
  mov    %rbx,%rdi
  lea    D18(%rip),%rsi
  xor    %edx,%edx
  lea    0x1(%rbx,%rax,1),%r8
  nopl   0x0(%rax)
L253:
  movzbl (%rdi),%eax
  lea    -0x61(%rax),%ecx
  cmp    $0x19,%cl
  ja     L341
  sub    $0x20,%eax
  mov    %al,(%rdi)
L341:
  sub    $0x43,%eax
  cmp    $0x1b,%al
  ja     L390
  movzbl %al,%eax
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L221:
  movslq %edi,%rax
  lea    0x401(%rsp),%r9
  lea    -0x2(%rdi),%r8d
  xor    %ecx,%ecx
  movb   $0x0,0x400(%rsp,%rax,1)
  add    %r9,%r8
  lea    0x400(%rsp),%rax
  jmp    L146
  cs nopw 0x0(%rax,%rax,1)
L167:
  xor    %ecx,%ecx
L324:
  add    $0x1,%rax
  cmp    %rax,%r8
  je     L17
L146:
  movsbl 0x1(%rax),%edx
  movsbl (%rax),%esi
  sub    %esi,%edx
  test   %edx,%edx
  jg     L390
  jne    L167
  add    $0x1,%ecx
  cmp    $0x4,%ecx
  jne    L324
  cs nopw 0x0(%rax,%rax,1)
L390:
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L405
  add    $0x810,%rsp
  mov    %rbp,%rdi
  lea    D3(%rip),%rsi
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1080 <strcpy@plt>
  nopl   0x0(%rax)
  lea    -0x1(%rdx),%eax
  cltq
  addb   $0x6,(%rsp,%rax,1)
  nopl   0x0(%rax)
L1:
  add    $0x1,%rdi
  cmp    %rdi,%r8
  jne    L253
  movslq %edx,%rax
  movb   $0x0,(%rsp,%rax,1)
  movzbl (%rsp),%ecx
  mov    %cl,0x400(%rsp)
  cmp    $0x1,%edx
  jle    L335
  lea    0x1(%rsp),%r9
  lea    -0x2(%rdx),%r11d
  mov    $0x1,%edi
  add    %r9,%r11
  jmp    L365
  nopl   0x0(%rax,%rax,1)
L228:
  add    $0x2,%eax
  cmp    %eax,%edx
  je     L343
L298:
  movslq %edi,%rdi
  mov    %r8b,0x400(%rsp,%rdi,1)
  mov    %r10d,%edi
L289:
  cmp    %r9,%r11
  je     L221
  add    $0x1,%r9
  mov    %r8d,%ecx
L365:
  movsbl (%r9),%edx
  movsbl %cl,%eax
  lea    0x1(%rdi),%r10d
  lea    0x1(%rax),%esi
  mov    %edx,%r8d
  cmp    %esi,%edx
  jne    L228
  test   $0x1,%dl
  jne    L228
  lea    -0x1(%rdi),%eax
  movslq %r10d,%r10
  cltq
  mov    %cl,0x400(%rsp,%rax,1)
  movslq %edi,%rax
  mov    %cl,0x400(%rsp,%rax,1)
  lea    0x2(%rdi),%eax
  add    $0x3,%edi
  cltq
  mov    %cl,0x400(%rsp,%r10,1)
  mov    %cl,0x400(%rsp,%rax,1)
  jmp    L289
  nopl   (%rax)
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x3,(%rsp,%rax,1)
  jmp    L1
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x2,(%rsp,%rax,1)
  jmp    L1
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x7,(%rsp,%rax,1)
  jmp    L1
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x4,(%rsp,%rax,1)
  jmp    L1
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x1,(%rsp,%rax,1)
  jmp    L1
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x6,(%rsp,%rax,1)
  jmp    L1
  nop
  movslq %edx,%rax
  add    $0x1,%edx
  movb   $0x5,(%rsp,%rax,1)
  jmp    L1
  nop
L343:
  mov    %r8d,%edx
  shr    $0x7,%dl
  lea    (%r8,%rdx,1),%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%al
  jne    L298
  lea    -0x1(%rdi),%eax
  lea    -0x1(%r8),%edx
  movslq %r10d,%r10
  cltq
  mov    %dl,0x400(%rsp,%rax,1)
  movslq %edi,%rax
  mov    %cl,0x400(%rsp,%rax,1)
  lea    0x2(%rdi),%eax
  cltq
  mov    %cl,0x400(%rsp,%r10,1)
  mov    %cl,0x400(%rsp,%rax,1)
  lea    0x3(%rdi),%eax
  add    $0x4,%edi
  cltq
  mov    %cl,0x400(%rsp,%rax,1)
  jmp    L289
  nopl   0x0(%rax)
L17:
  movsbl 0x400(%rsp),%edx
  lea    -0x1(%rdx),%esi
  mov    %edx,%ecx
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  lea    0x1(%rax),%r8d
  movslq %r8d,%r10
L281:
  test   %r8d,%r8d
  jg     L70
L67:
  sub    $0x1,%edi
  movb   $0x0,0x0(%rbp,%r10,1)
  mov    %r9,%rsi
  add    %r9,%rdi
  jmp    L235
  nopw   0x0(%rax,%rax,1)
L229:
  movsbl (%rsi),%edx
  add    $0x1,%rsi
  mov    %edx,%ecx
L235:
  add    $0x1,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  mov    %r8d,%edx
  sar    %eax
  sub    %eax,%edx
  movslq %edx,%rdx
  add    %rbp,%rdx
  movzbl (%rdx),%eax
  lea    0x1(%rax),%r9d
  add    $0x5,%eax
  and    $0x1,%ecx
  cmovne %r9d,%eax
  mov    %al,(%rdx)
  cmp    $0x39,%al
  jg     L390
  cmp    %rdi,%rsi
  jne    L229
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L405
  add    $0x810,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L134:
  movb   $0x0,0x401(%rsp)
  xor    %eax,%eax
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    $0x1,%r10d
  mov    $0x1,%r8d
  mov    $0x1,%edi
  lea    0x401(%rsp),%r9
L70:
  movabs $0x3030303030303030,%r11
  xor    %esi,%esi
  test   %eax,%eax
  cmovs  %esi,%eax
  add    $0x1,%eax
  cmp    $0x8,%eax
  jae    L195
  test   $0x4,%al
  jne    L248
  test   %eax,%eax
  je     L67
  movb   $0x30,0x0(%rbp)
  test   $0x2,%al
  je     L67
  mov    $0x3030,%esi
  mov    %si,-0x2(%rbp,%rax,1)
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L195:
  mov    %eax,%esi
  lea    0x8(%rbp),%rbx
  mov    %r11,0x0(%rbp)
  and    $0xfffffffffffffff8,%rbx
  mov    %r11,-0x8(%rbp,%rsi,1)
  mov    %rbp,%rsi
  sub    %rbx,%rsi
  add    %esi,%eax
  and    $0xfffffff8,%eax
  cmp    $0x8,%eax
  jb     L67
  and    $0xfffffff8,%eax
  xor    %esi,%esi
L305:
  mov    %esi,%r12d
  add    $0x8,%esi
  mov    %r11,(%rbx,%r12,1)
  cmp    %eax,%esi
  jb     L305
  jmp    L67
L248:
  movl   $0x30303030,0x0(%rbp)
  movl   $0x30303030,-0x4(%rbp,%rax,1)
  jmp    L67
L335:
  movsbl %cl,%edx
  movb   $0x0,0x401(%rsp)
  mov    $0x1,%edi
  lea    0x401(%rsp),%r9
  lea    -0x1(%rdx),%esi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  lea    0x1(%rax),%r8d
  movslq %r8d,%r10
  jmp    L281
L405:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D3
datatype: string

tool: D3: <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;
    }
  }
}
```