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

```asm
<output_element>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %rdx,%r12
  mov    %ecx,%r13d
  mov    %rdi,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D39(%rip),%rdi
  call   <fwrite@plt>
  mov    %r13d,%r15d
  and    $0x8,%r15d
  jne    L4
L93:
  test   $0x20,%r13b
  jne    L151
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <fputs@plt>
L175:
  test   %r15d,%r15d
  je     L71
  mov    %rbp,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D42(%rip),%rdi
  call   <fwrite@plt>
L214:
  and    $0x10,%r13d
  je     L123
  mov    %rbp,%rsi
  mov    $0x7b,%edi
  call   <fputc@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  jle    L10
L161:
  mov    $0x0,%ebx
  mov    $0x0,%r15d
  jmp    L51
L4:
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D5(%rip),%rdi
  call   <fwrite@plt>
  jmp    L93
L151:
  mov    %r14,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L175
  mov    %r14,%rbx
  lea    -0x1(%rax),%eax
  lea    0x1(%r14,%rax,1),%r14
L12:
  movzbl (%rbx),%edi
  call   <toupper@plt>
  mov    %eax,%edi
  mov    %rbp,%rsi
  call   <fputc@plt>
  add    $0x1,%rbx
  cmp    %r14,%rbx
  jne    L12
  jmp    L175
L71:
  mov    %rbp,%rsi
  mov    $0x3d,%edi
  call   <fputc@plt>
  jmp    L214
L123:
  mov    %rbp,%rsi
  mov    $0x22,%edi
  call   <fputc@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  jg     L161
L145:
  mov    %rbp,%rsi
  mov    $0x22,%edi
  call   <fputc@plt>
  jmp    L115
L47:
  movsbl %dil,%edi
  mov    %rbp,%rsi
  call   <fputc@plt>
L43:
  add    $0x1,%rbx
  cmp    %ebx,%r14d
  jle    L142
L51:
  movzbl (%r12,%rbx,1),%edi
  cmp    $0x22,%dil
  jne    L47
  test   %r13d,%r13d
  jne    L189
  test   %ebx,%ebx
  jle    L224
  cmpb   $0x5c,-0x1(%r12,%rbx,1)
  je     L189
L224:
  test   $0x1,%r15b
  jne    L149
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D26(%rip),%rdi
  call   <fwrite@plt>
L105:
  add    $0x1,%r15d
  jmp    L43
L189:
  mov    %rbp,%rsi
  mov    $0x22,%edi
  call   <fputc@plt>
  jmp    L43
L149:
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D4(%rip),%rdi
  call   <fwrite@plt>
  jmp    L105
L142:
  test   %r13d,%r13d
  je     L145
L10:
  mov    %rbp,%rsi
  mov    $0x7d,%edi
  call   <fputc@plt>
L115:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D39
type: string
name: extract_symbolic_data
arguments: label: D42
type: string
name: extract_symbolic_data
arguments: label: D5
type: string
name: extract_symbolic_data
arguments: label: D26
type: string
name: extract_symbolic_data
arguments: label: D4
type: string

tool: D39: ,


tool: D42:  = 	

tool: D5:   

tool: D26: ``

tool: D4: ''

assistant: ```c
void output_element(FILE *fp, char *tag, char *data, int format_opts) {
  int i, len, nquotes = 0;
  char ch;
  fprintf(fp, ",\n");
  if (format_opts & (8))
    fprintf(fp, "  ");
  if (!(format_opts & (32)))
    fprintf(fp, "%s", tag);
  else {
    len = strlen(tag);
    for (i = 0; i < len; ++i)
      fprintf(fp, "%c", toupper((unsigned char)tag[i]));
  }
  if (format_opts & (8))
    fprintf(fp, " = \t");
  else
    fprintf(fp, "=");
  if (format_opts & (16))
    fprintf(fp, "{");
  else
    fprintf(fp, "\"");
  len = strlen(data);
  for (i = 0; i < len; ++i) {
    ch = data[i];
    if (ch != '\"')
      fprintf(fp, "%c", ch);
    else {
      if (format_opts & (16) || (i > 0 && data[i - 1] == '\\'))
        fprintf(fp, "\"");
      else {
        if (nquotes % 2 == 0)
          fprintf(fp, "``");
        else
          fprintf(fp, "\'\'");
        nquotes++;
      }
    }
  }
  if (format_opts & (16))
    fprintf(fp, "}");
  else
    fprintf(fp, "\"");
}
```