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

```asm
<construct_include_directive_marker>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  mov    %rsi,%rdi
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <strlen@plt>
  lea    0x12(%rax),%edi
  mov    %rax,%rbx
  mov    %eax,%r15d
  call   <malloc@plt>
  mov    %rax,0x0(%r13)
  mov    %rax,%rcx
  movzbl (%r12),%eax
  test   %ebx,%ebx
  jle    L163
  test   %al,%al
  je     L163
  mov    $0x1,%ebx
  xor    %r8d,%r8d
  xor    %ebp,%ebp
  xor    %r14d,%r14d
  xor    %esi,%esi
  mov    $0x1,%edx
  lea    D12(%rip),%r9
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L54:
  mov    %al,(%rdi)
  mov    0x0(%r13),%rcx
  mov    %edx,%r14d
  movslq %edx,%rsi
  xor    %ebp,%ebp
  add    $0x1,%edx
L106:
  movzbl (%r12,%rbx,1),%eax
  test   %al,%al
  setne  %r10b
  cmp    %ebx,%r15d
  setg   %dil
  add    $0x1,%rbx
  test   %dil,%r10b
  je     L63
L10:
  lea    (%rcx,%rsi,1),%rdi
  test   %ebp,%ebp
  jne    L54
  cmp    $0x40,%al
  je     L167
  jg     L136
  cmp    $0x25,%al
  je     L1
  cmp    $0x3f,%al
  jne    L20
L1:
  movb   $0x25,(%rdi)
  mov    0x0(%r13),%rax
  movslq %edx,%rdx
  add    $0x1,%r8d
  add    $0x2,%r14d
  movb   $0x73,(%rax,%rdx,1)
  cmp    $0x3,%r8d
  jg     L101
  mov    0x0(%r13),%rcx
  movslq %r14d,%rsi
  lea    0x1(%r14),%edx
  jmp    L106
  nop
L136:
  cmp    $0x5c,%al
  jne    L20
  mov    $0x1,%ebp
  jmp    L106
  nopl   0x0(%rax,%rax,1)
L167:
  movb   $0x20,(%rdi)
  mov    %edx,%r14d
  movslq %edx,%rsi
  mov    0x0(%r13),%rcx
  add    $0x1,%edx
  jmp    L106
  nopl   (%rax)
L20:
  mov    %al,(%rdi)
  mov    %edx,%r14d
  movslq %edx,%rsi
  mov    0x0(%r13),%rcx
  add    $0x1,%edx
  jmp    L106
  nopl   0x0(%rax)
L63:
  add    %rsi,%rcx
  movslq %edx,%rdx
L40:
  movb   $0xa,(%rcx)
  mov    0x0(%r13),%rax
  movb   $0x0,(%rax,%rdx,1)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L101:
  mov    %r9,%rdi
  mov    %r8d,0xc(%rsp)
  call   <bug@plt>
  mov    0x0(%r13),%rcx
  movslq %r14d,%rsi
  lea    0x1(%r14),%edx
  mov    0xc(%rsp),%r8d
  lea    D12(%rip),%r9
  jmp    L106
  nopl   0x0(%rax)
L163:
  mov    $0x1,%edx
  jmp    L40
```

tool_calls: name: retrieve_data
arguments: tag: D12
data_type: string

tool: D12: only 3 substitutions allowed in -includemarker

assistant: ```c
void construct_include_directive_marker(char **include_directive_marker, char *includemarker_input) {
  int len = (int)strlen(includemarker_input);
  char ch;
  int in_idx = 0, out_idx = 0;
  int quoted = 0, num_repl = 0;
  *include_directive_marker = malloc(len + 18);
  ch = *includemarker_input;
  while (ch != '\0' && in_idx < len) {
    if (quoted) {
      *(*include_directive_marker + out_idx) = ch;
      out_idx++;
      quoted = 0;
    } else {
      switch (ch) {
      case '\\':
        quoted = 1;
        break;
      case '@':
        *(*include_directive_marker + out_idx) = ' ';
        out_idx++;
        break;
      case '%':
      case '?':
        *(*include_directive_marker + out_idx) = '%';
        out_idx++;
        *(*include_directive_marker + out_idx) = 's';
        out_idx++;
        if (++num_repl > 3)
          bug("only 3 substitutions allowed in -includemarker");
        break;
      default:
        *(*include_directive_marker + out_idx) = ch;
        out_idx++;
      }
    }
    in_idx++;
    ch = *(includemarker_input + in_idx);
  }
  *(*include_directive_marker + out_idx) = '\n';
  out_idx++;
  *(*include_directive_marker + out_idx) = '\0';
}
```