user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<writeParagraph>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%eax
  test   %al,%al
  je     L241
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %edx,%r13d
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r14d
  lea    D34(%rip),%r15
  jmp    L274
L247:
  mov    %r12,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D41(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
L210:
  lea    0x1(%rbx),%rbp
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  je     L241
L274:
  cmp    $0x26,%al
  je     L247
  cmp    $0x3c,%al
  je     L96
  cmp    $0x3e,%al
  je     L256
  test   %r13d,%r13d
  sete   %dl
  cmp    $0x5b,%al
  jne    L180
  test   %dl,%dl
  jne    L275
L180:
  cmp    $0x27,%al
  je     L73
  cmp    $0x2a,%al
  jne    L157
  test   %dl,%dl
  jne    L77
L157:
  cmp    $0x5c,%al
  je     L225
  movsbl %al,%edi
  mov    %r12,%rsi
  call   <fputc@plt>
  mov    %rbp,%rbx
  jmp    L210
L96:
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D51(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
  jmp    L210
L256:
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D46(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
  jmp    L210
L275:
  lea    0x1(%rbp),%rbx
  movzbl 0x1(%rbp),%eax
  cmp    $0x5d,%al
  je     L193
  lea    0x20(%rsp),%rdx
L108:
  add    $0x1,%rbx
  add    $0x1,%rdx
  mov    %al,-0x1(%rdx)
  movzbl (%rbx),%eax
  cmp    $0x5d,%al
  jne    L108
L11:
  movb   $0x0,(%rdx)
  lea    0x20(%rsp),%rdi
  mov    $0x2e,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L210
  movb   $0x0,(%rax)
  lea    0x1c(%rsp),%rdx
  lea    0x1(%rax),%rdi
  lea    D65(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L210
  mov    0x1c(%rsp),%ecx
  lea    0x20(%rsp),%rdx
  mov    %ecx,%r9d
  mov    %rdx,%r8
  lea    D45(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L210
L193:
  lea    0x20(%rsp),%rdx
  jmp    L11
L73:
  test   %r14d,%r14d
  jne    L143
  mov    %r12,%rcx
  mov    $0x12,%edx
  mov    $0x1,%esi
  lea    D3(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
  mov    $0x1,%r14d
  jmp    L210
L143:
  mov    %r12,%rcx
  mov    $0x7,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
  mov    $0x0,%r14d
  jmp    L210
L77:
  cmpl   $0x0,0xc(%rsp)
  jne    L113
  mov    %r12,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D6(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
  movl   $0x1,0xc(%rsp)
  jmp    L210
L113:
  mov    %r12,%rcx
  mov    $0x7,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  mov    %rbp,%rbx
  movl   $0x0,0xc(%rsp)
  jmp    L210
L225:
  lea    0x1(%rbp),%rbx
  movsbl 0x1(%rbp),%edi
  mov    %r12,%rsi
  call   <fputc@plt>
  jmp    L210
L241:
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L251
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L251:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D34
type_guessed: string
name: unpack_data
arguments: data_tag: D41
type_guessed: string
name: unpack_data
arguments: data_tag: D51
type_guessed: string
name: unpack_data
arguments: data_tag: D46
type_guessed: string
name: unpack_data
arguments: data_tag: D65
type_guessed: string
name: unpack_data
arguments: data_tag: D45
type_guessed: string
name: unpack_data
arguments: data_tag: D3
type_guessed: string
name: unpack_data
arguments: data_tag: D6
type_guessed: string

tool: D34: </span>

tool: D41: &amp;

tool: D51: &lt;

tool: D46: &gt;

tool: D65: %d

tool: D45: <a href="%s.%d.html">%s(%d)</a>

tool: D3: <span class="ref">

tool: D6: <span class="emph">

assistant: ```c
void writeParagraph(const char *scan, FILE *out, int codeMode) {
  int refState = 0;
  int emphState = 0;
  for (; *scan != 0; scan++) {
    if (*scan == '&') {
      fprintf(out, "&amp;");
    } else if (*scan == '<') {
      fprintf(out, "&lt;");
    } else if (*scan == '>') {
      fprintf(out, "&gt;");
    } else if ((*scan == '[') && (!codeMode)) {
      char buffer[1024];
      scan++;
      char *put = buffer;
      while (*scan != ']') {
        *put++ = *scan++;
      };
      *put = 0;
      char *dot = strchr(buffer, '.');
      if (dot == NULL)
        continue;
      *dot = 0;
      int chapter;
      if (sscanf(dot + 1, "%d", &chapter) != 1)
        continue;
      fprintf(out, "<a href=\"%s.%d.html\">%s(%d)</a>", buffer, chapter, buffer, chapter);
    } else if (*scan == '\'') {
      refState = !refState;
      if (refState) {
        fprintf(out, "<span class=\"ref\">");
      } else {
        fprintf(out, "</span>");
      };
    } else if ((*scan == '*') && (!codeMode)) {
      emphState = !emphState;
      if (emphState) {
        fprintf(out, "<span class=\"emph\">");
      } else {
        fprintf(out, "</span>");
      };
    } else if (*scan == '\\') {
      scan++;
      fprintf(out, "%c", *scan);
    } else {
      fprintf(out, "%c", *scan);
    };
  };
}
```