user: What would the C source look like for the assembly code provided here:

```asm
<format_replace_emails>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  test   %eax,%eax
  jle    L258
  mov    %eax,%r10d
  xor    %r11d,%r11d
  xor    %ebx,%ebx
  xor    %eax,%eax
  mov    %r10d,%ebp
  jmp    L50
  nopl   0x0(%rax)
L268:
  movslq %ebx,%rax
  add    $0x1,%ebx
  mov    %dl,(%r12,%rax,1)
  mov    %ecx,%eax
L527:
  cmp    %eax,%ebp
  jle    L454
L50:
  movslq %eax,%rdx
  lea    0x1(%rax),%ecx
  movzbl (%r15,%rdx,1),%edx
  test   %eax,%eax
  jle    L268
  cmp    $0x40,%dl
  jne    L268
  lea    -0x2(%rbp),%esi
  cmp    %eax,%esi
  jle    L268
  cmp    %ecx,%ebp
  jle    L261
  movslq %ecx,%rdx
  mov    %ecx,%r13d
  add    %r15,%rdx
  jmp    L243
  nopw   0x0(%rax,%rax,1)
L101:
  cmp    $0x2e,%sil
  sete   %sil
  movzbl %sil,%esi
  add    %esi,%r11d
L2:
  add    $0x1,%r13d
  add    $0x1,%rdx
  cmp    %r13d,%ebp
  je     L113
L243:
  movzbl (%rdx),%esi
  cmp    $0x2c,%sil
  ja     L101
  movabs $0xffffeffeffffdbff,%rdi
  bt     %rsi,%rdi
  jb     L2
L113:
  test   %r11d,%r11d
  jne    L225
  movslq %ebx,%rax
  add    $0x1,%ebx
  movb   $0x40,(%r12,%rax,1)
  mov    %ecx,%eax
  cmp    %eax,%ebp
  jg     L50
  nop
L454:
  movslq %ebx,%rbx
  add    %rbx,%r12
L258:
  movb   $0x0,(%r12)
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L86
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L225:
  mov    %eax,%esi
  sub    $0x1,%esi
  je     L185
  movslq %esi,%rdx
  jmp    L369
L6:
  sub    $0x1,%rdx
  test   %edx,%edx
  je     L185
L369:
  movzbl (%r15,%rdx,1),%ecx
  cmp    $0x2c,%cl
  ja     L6
  movabs $0xffffeffeffffdbff,%rdi
  bt     %rcx,%rdi
  jb     L6
  lea    0x1(%rdx),%edi
  mov    %edi,0x4(%rsp)
  sub    %edi,%eax
  mov    %eax,%esi
L232:
  sub    %esi,%ebx
  mov    $0x0,%eax
  lea    0x20(%rsp),%rdi
  mov    %r11d,0x10(%rsp)
  cmovs  %eax,%ebx
  lea    D5(%rip),%rdx
  mov    %rdi,0x18(%rsp)
  lea    D11(%rip),%rsi
  call   <sprintf@plt>
  mov    %r12,%rax
  xor    %edx,%edx
  mov    %ebp,0x8(%rsp)
  movslq %ebx,%rcx
  mov    %r13d,0x14(%rsp)
  mov    %ebx,%ebp
  mov    0x18(%rsp),%r13
  lea    (%r12,%rcx,1),%r14
  mov    %rdx,%rbx
  mov    %r14,%r12
  mov    %rax,%r14
  jmp    L199
  nopl   0x0(%rax)
L17:
  movzbl 0x0(%r13,%rbx,1),%eax
  add    $0x1,%r12
  add    $0x1,%rbx
  mov    %esi,%ebp
  mov    %al,-0x1(%r12)
L199:
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x1(%rbp),%esi
  cmp    %ebx,%eax
  jg     L17
  mov    0x14(%rsp),%r13d
  mov    0x4(%rsp),%edi
  mov    %r14,%rax
  mov    %ebp,%ebx
  mov    %r12,%r14
  mov    0x10(%rsp),%r11d
  mov    0x8(%rsp),%ebp
  mov    %rax,%r12
  cmp    %edi,%r13d
  jle    L462
  mov    %r13d,%eax
  movslq %edi,%r10
  mov    %r14,%rdx
  movslq %ebx,%r8
  sub    %edi,%eax
  lea    0x1(%r15,%r10,1),%rdi
  lea    -0x1(%rax),%ecx
  mov    %rdi,0x8(%rsp)
  cmp    $0x6,%ecx
  mov    %ecx,0x14(%rsp)
  seta   0x10(%rsp)
  sub    %rdi,%rdx
  movzbl 0x10(%rsp),%esi
  cmp    $0xe,%rdx
  jbe    L205
  test   %sil,%sil
  je     L205
  cmp    $0xe,%ecx
  jbe    L520
  mov    %eax,%edi
  lea    (%r15,%r10,1),%rdx
  xor    %esi,%esi
  shr    $0x4,%edi
  shl    $0x4,%rdi
  nopl   0x0(%rax)
L29:
  movdqu (%rdx,%rsi,1),%xmm0
  movups %xmm0,(%r14,%rsi,1)
  add    $0x10,%rsi
  cmp    %rsi,%rdi
  jne    L29
  mov    0x4(%rsp),%edi
  mov    %eax,%ecx
  and    $0xfffffff0,%ecx
  lea    (%rdi,%rcx,1),%esi
  lea    (%rbx,%rcx,1),%edi
  cmp    %ecx,%eax
  je     L104
  mov    %eax,%r9d
  sub    %ecx,%r9d
  lea    -0x1(%r9),%r14d
  cmp    $0x6,%r14d
  jbe    L132
L572:
  mov    (%rdx,%rcx,1),%rdx
  add    %r12,%r8
  mov    %rdx,(%r8,%rcx,1)
  mov    %r9d,%edx
  and    $0xfffffff8,%edx
  add    %edx,%esi
  add    %edx,%edi
  cmp    %edx,%r9d
  je     L104
L132:
  movslq %esi,%rdx
  lea    0x1(%rdi),%ecx
  movzbl (%r15,%rdx,1),%r8d
  movslq %edi,%rdx
  mov    %r8b,(%r12,%rdx,1)
  lea    0x1(%rsi),%edx
  cmp    %edx,%r13d
  jle    L104
  movslq %edx,%rdx
  movslq %ecx,%rcx
  lea    0x2(%rdi),%r8d
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rcx,1)
  lea    0x2(%rsi),%edx
  cmp    %edx,%r13d
  jle    L104
  movslq %edx,%rdx
  movslq %r8d,%r8
  lea    0x3(%rdi),%ecx
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%r8,1)
  lea    0x3(%rsi),%edx
  cmp    %edx,%r13d
  jle    L104
  movslq %edx,%rdx
  movslq %ecx,%rcx
  lea    0x4(%rdi),%r8d
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rcx,1)
  lea    0x4(%rsi),%edx
  cmp    %edx,%r13d
  jle    L104
  movslq %edx,%rdx
  movslq %r8d,%r8
  lea    0x5(%rdi),%ecx
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%r8,1)
  lea    0x5(%rsi),%edx
  cmp    %edx,%r13d
  jle    L104
  movslq %edx,%rdx
  movslq %ecx,%rcx
  add    $0x6,%esi
  add    $0x6,%edi
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rcx,1)
  cmp    %esi,%r13d
  jle    L104
  movslq %esi,%rsi
  movslq %edi,%rdi
  movzbl (%r15,%rsi,1),%edx
  mov    %dl,(%r12,%rdi,1)
L104:
  add    %eax,%ebx
  movslq %ebx,%rdx
  lea    0x2(%rbx),%r8d
  movb   $0x22,(%r12,%rdx,1)
  lea    0x1(%rbx),%edx
  sub    $0x1,%ebx
  mov    %r8d,%esi
  movslq %ebx,%rcx
  movslq %edx,%rdx
  add    $0x3,%rcx
  movb   $0x3e,(%r12,%rdx,1)
  lea    (%r12,%rcx,1),%rdi
  mov    %rdi,%rdx
  sub    0x8(%rsp),%rdx
  cmp    $0xe,%rdx
  jbe    L467
  cmpb   $0x0,0x10(%rsp)
  je     L467
  cmpl   $0xe,0x14(%rsp)
  jbe    L566
  mov    %eax,%r9d
  lea    (%r15,%r10,1),%rdx
  xor    %esi,%esi
  shr    $0x4,%r9d
  shl    $0x4,%r9
  nopl   0x0(%rax)
L180:
  movdqu (%rdx,%rsi,1),%xmm1
  movups %xmm1,(%rdi,%rsi,1)
  add    $0x10,%rsi
  cmp    %rsi,%r9
  jne    L180
  mov    %eax,%edi
  and    $0xfffffff0,%edi
  add    %edi,0x4(%rsp)
  lea    (%r8,%rdi,1),%esi
  cmp    %edi,%eax
  je     L533
  mov    %eax,%r9d
  sub    %edi,%r9d
  lea    -0x1(%r9),%r10d
  cmp    $0x6,%r10d
  jbe    L138
L42:
  mov    (%rdx,%rdi,1),%rdx
  add    %r12,%rdi
  mov    %rdx,(%rdi,%rcx,1)
  mov    %r9d,%edx
  and    $0xfffffff8,%edx
  add    %edx,0x4(%rsp)
  add    %edx,%esi
  cmp    %r9d,%edx
  je     L533
L138:
  movslq 0x4(%rsp),%rdx
  lea    0x1(%rsi),%ecx
  movzbl (%r15,%rdx,1),%edi
  mov    %rdx,%rbx
  movslq %esi,%rdx
  mov    %dil,(%r12,%rdx,1)
  lea    0x1(%rbx),%edx
  cmp    %r13d,%edx
  jge    L533
  movslq %edx,%rdx
  movslq %ecx,%rcx
  lea    0x2(%rsi),%edi
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rcx,1)
  lea    0x2(%rbx),%edx
  cmp    %r13d,%edx
  jge    L533
  movslq %edx,%rdx
  movslq %edi,%rdi
  lea    0x3(%rsi),%ecx
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rdi,1)
  lea    0x3(%rbx),%edx
  cmp    %edx,%r13d
  jle    L533
  movslq %edx,%rdx
  movslq %ecx,%rcx
  lea    0x4(%rsi),%edi
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rcx,1)
  lea    0x4(%rbx),%edx
  cmp    %edx,%r13d
  jle    L533
  movslq %edx,%rdx
  movslq %edi,%rdi
  lea    0x5(%rsi),%ecx
  movzbl (%r15,%rdx,1),%edx
  mov    %dl,(%r12,%rdi,1)
  lea    0x5(%rbx),%edx
  mov    %ebx,%edi
  cmp    %edx,%r13d
  jle    L533
  movslq %edx,%rdx
  add    $0x6,%edi
  movslq %ecx,%rcx
  add    $0x6,%esi
  movzbl (%r15,%rdx,1),%edx
  movslq %edi,%r14
  mov    %dl,(%r12,%rcx,1)
  cmp    %r14d,%r13d
  jle    L533
  movzbl (%r15,%r14,1),%ecx
  movslq %esi,%rdx
  mov    %cl,(%r12,%rdx,1)
L533:
  add    %r8d,%eax
L460:
  movslq %eax,%rdx
  lea    0x4(%rax),%ebx
  movb   $0x3c,(%r12,%rdx,1)
  lea    0x1(%rax),%edx
  movslq %edx,%rdx
  movb   $0x2f,(%r12,%rdx,1)
  lea    0x2(%rax),%edx
  add    $0x3,%eax
  cltq
  movslq %edx,%rdx
  movb   $0x61,(%r12,%rdx,1)
  movb   $0x3e,(%r12,%rax,1)
  mov    %r13d,%eax
  jmp    L527
L185:
  movl   $0x1,0x4(%rsp)
  jmp    L232
L467:
  movslq %r8d,%rsi
  mov    %r10,%rdx
  sub    %r10,%rsi
  add    %r12,%rsi
  nopl   0x0(%rax)
L410:
  movzbl (%r15,%rdx,1),%ecx
  mov    %cl,(%rsi,%rdx,1)
  add    $0x1,%rdx
  cmp    %edx,%r13d
  jg     L410
  jmp    L533
L205:
  sub    %r10,%r8
  mov    %r10,%rdx
  lea    (%r12,%r8,1),%rcx
  nopl   (%rax)
L228:
  movzbl (%r15,%rdx,1),%esi
  mov    %sil,(%rcx,%rdx,1)
  add    $0x1,%rdx
  cmp    %edx,%r13d
  jg     L228
  jmp    L104
L462:
  movslq %esi,%rsi
  movb   $0x22,(%r14)
  lea    0x2(%rbx),%eax
  movb   $0x3e,(%r12,%rsi,1)
  jmp    L460
L566:
  mov    %eax,%r9d
  xor    %edi,%edi
  lea    (%r15,%r10,1),%rdx
  jmp    L42
L520:
  mov    0x4(%rsp),%esi
  mov    %eax,%r9d
  mov    %ebx,%edi
  xor    %ecx,%ecx
  lea    (%r15,%r10,1),%rdx
  jmp    L572
L261:
  mov    %ecx,%r13d
  jmp    L113
L86:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D5
type: string
name: extract_symbolic_data
arguments: data_label: D11
type: string

tool: D5: <a href="mailto:

tool: D11: %s

assistant: ```c
void format_replace_emails(char *text, char *result) {
  char str[32];
  int i, start, end, k, length = strlen(text);
  int ctr = 0, dots = 0;
  for (i = 0; i < length; i++) {
    if ((text[i] == '@') && (i > 0) && (i < length - 2)) {
      end = i + 1;
      while (end < length) {
        if ((text[end] == ' ') || (text[end] == ',') || (text[end] == 10) || (text[end] == 13)) {
          break;
        }
        if (text[end] == '.')
          dots++;
        end++;
      }
      if (dots == 0) {
        result[ctr++] = text[i];
        continue;
      }
      start = i - 1;
      while (start >= 1) {
        if ((text[start] == ' ') || (text[start] == ',') || (text[start] == 10) || (text[start] == 13)) {
          break;
        }
        start--;
      }
      start++;
      ctr -= (i - start);
      if (ctr < 0)
        ctr = 0;
      sprintf(str, "%s", "<a href=\"mailto:");
      for (k = 0; k < strlen(str); k++) {
        result[ctr++] = str[k];
      }
      for (k = start; k < end; k++) {
        result[ctr++] = text[k];
      }
      result[ctr++] = '"';
      result[ctr++] = '>';
      for (k = start; k < end; k++) {
        result[ctr++] = text[k];
      }
      result[ctr++] = '<';
      result[ctr++] = '/';
      result[ctr++] = 'a';
      result[ctr++] = '>';
      i = end - 1;
    } else {
      result[ctr++] = text[i];
    }
  }
  result[ctr] = 0;
}
```