user: Please show me the C implementation that matches the assembly code listed below:

```asm
<writeCombine>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <prj_get_name@plt>
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <prj_get_path@plt>
  lea    D133(%rip),%rdx
  mov    %ebp,%esi
  mov    %eax,%edi
  call   <path_join@plt>
  mov    %eax,%edi
  call   <io_openfile@plt>
  test   %eax,%eax
  jne    L72
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L72:
  xor    %eax,%eax
  xor    %r12d,%r12d
  lea    D65(%rip),%r14
  call   <prj_get_name@plt>
  lea    D13(%rip),%rdi
  lea    D20(%rip),%rbp
  mov    %eax,%esi
  xor    %eax,%eax
  lea    D45(%rip),%r13
  call   <io_print@plt>
  xor    %edi,%edi
  call   <prj_select_package@plt>
  xor    %edi,%edi
  call   <prj_select_config@plt>
  xor    %eax,%eax
  call   <prj_get_cfgname@plt>
  mov    %eax,%edi
  call   <xmlEscape@plt>
  lea    D49(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <io_print@plt>
  xor    %eax,%eax
  call   <prj_get_numconfigs@plt>
  cmp    %r12d,%eax
  jle    L60
  nopl   0x0(%rax,%rax,1)
L65:
  mov    %r12d,%edi
  xor    %ebx,%ebx
  call   <prj_select_config@plt>
  xor    %eax,%eax
  call   <prj_get_cfgname@plt>
  mov    %eax,%edi
  call   <xmlEscape@plt>
  mov    %r14,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <io_print@plt>
  xor    %edi,%edi
  call   <prj_select_config@plt>
  jmp    L33
  nopl   (%rax)
L61:
  mov    %ebx,%edi
  add    $0x1,%ebx
  call   <prj_select_package@plt>
  xor    %eax,%eax
  call   <prj_get_cfgname@plt>
  mov    %eax,%edi
  call   <xmlEscape@plt>
  mov    %eax,%r15d
  xor    %eax,%eax
  call   <prj_get_pkgname@plt>
  mov    %r15d,%edx
  mov    %rbp,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <io_print@plt>
L33:
  xor    %eax,%eax
  call   <prj_get_numpackages@plt>
  cmp    %ebx,%eax
  jg     L61
  xor    %eax,%eax
  mov    %r13,%rdi
  add    $0x1,%r12d
  call   <io_print@plt>
  xor    %eax,%eax
  call   <prj_get_numconfigs@plt>
  cmp    %r12d,%eax
  jg     L65
L60:
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <io_print@plt>
  xor    %edi,%edi
  lea    D141(%rip),%rbp
  call   <prj_select_package@plt>
  xor    %eax,%eax
  call   <prj_get_pkgname@plt>
  lea    D140(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <io_print@plt>
  jmp    L22
  nopl   0x0(%rax)
L38:
  mov    %ebx,%edi
  add    $0x1,%ebx
  call   <prj_select_package@plt>
  xor    %eax,%eax
  call   <prj_get_pkgname@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <io_print@plt>
L22:
  xor    %eax,%eax
  call   <prj_get_numpackages@plt>
  cmp    %ebx,%eax
  jg     L38
  lea    D139(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <io_print@plt>
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  lea    D19(%rip),%r14
  call   <io_print@plt>
  lea    D47(%rip),%r13
  lea    D164(%rip),%r15
  lea    D57(%rip),%r12
  jmp    L1
  nopl   0x0(%rax)
L12:
  mov    %ebx,%edi
  call   <prj_select_package@plt>
  mov    %r14,%rdi
  call   <prj_get_pkgfilename@plt>
  mov    %r13,%rdi
  mov    %rax,%rbp
  xor    %eax,%eax
  call   <io_print@plt>
  cmpb   $0x2e,0x0(%rbp)
  je     L63
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <io_print@plt>
L63:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <io_print@plt>
L1:
  xor    %eax,%eax
  call   <prj_get_numpackages@plt>
  cmp    %ebx,%eax
  jg     L12
  lea    D40(%rip),%rdi
  xor    %eax,%eax
  call   <io_print@plt>
  lea    D39(%rip),%rdi
  xor    %eax,%eax
  call   <io_print@plt>
  xor    %eax,%eax
  call   <io_closefile@plt>
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D133
datatype: string
name: disassemble_data
arguments: data_label: D65
datatype: string
name: disassemble_data
arguments: data_label: D13
datatype: string
name: disassemble_data
arguments: data_label: D20
datatype: string
name: disassemble_data
arguments: data_label: D45
datatype: string
name: disassemble_data
arguments: data_label: D49
datatype: string
name: disassemble_data
arguments: data_label: D36
datatype: string
name: disassemble_data
arguments: data_label: D141
datatype: string
name: disassemble_data
arguments: data_label: D140
datatype: string
name: disassemble_data
arguments: data_label: D139
datatype: string
name: disassemble_data
arguments: data_label: D85
datatype: string
name: disassemble_data
arguments: data_label: D19
datatype: string
name: disassemble_data
arguments: data_label: D47
datatype: string
name: disassemble_data
arguments: data_label: D164
datatype: string
name: disassemble_data
arguments: data_label: D57
datatype: string
name: disassemble_data
arguments: data_label: D40
datatype: string
name: disassemble_data
arguments: data_label: D39
datatype: string

tool: D133: mds

tool: D65:     <Configuration name="%s" ctype="CombineConfiguration">


tool: D13: <Combine name="%s" fileversion="2.0">


tool: D20:       <Entry build="True" name="%s" configuration="%s" />


tool: D45:     </Configuration>


tool: D49:   <Configurations active="%s">


tool: D36:   </Configurations>


tool: D141:     <Execute type="None" entry="%s" />


tool: D140:   <StartMode startupentry="%s" single="True">


tool: D139:   </StartMode>


tool: D85:   <Entries>


tool: D19: mdp

tool: D47:     <Entry filename="

tool: D164: ./

tool: D57: %s" />


tool: D40:   </Entries>


tool: D39: </Combine>

assistant: ```c
int writeCombine() {
  const char *path;
  int i, j;
  if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "mds")))
    return 0;
  io_print("<Combine name=\"%s\" fileversion=\"2.0\">\n", prj_get_name());
  prj_select_package(0);
  prj_select_config(0);
  io_print("  <Configurations active=\"%s\">\n", xmlEscape(prj_get_cfgname()));
  for (i = 0; i < prj_get_numconfigs(); ++i) {
    prj_select_config(i);
    io_print("    <Configuration name=\"%s\" ctype=\"CombineConfiguration\">\n", xmlEscape(prj_get_cfgname()));
    prj_select_config(0);
    for (j = 0; j < prj_get_numpackages(); j++) {
      prj_select_package(j);
      io_print("      <Entry build=\"True\" name=\"%s\" configuration=\"%s\" />\n", prj_get_pkgname(), xmlEscape(prj_get_cfgname()));
    }
    io_print("    </Configuration>\n");
  }
  io_print("  </Configurations>\n");
  prj_select_package(0);
  io_print("  <StartMode startupentry=\"%s\" single=\"True\">\n", prj_get_pkgname());
  for (i = 0; i < prj_get_numpackages(); ++i) {
    prj_select_package(i);
    io_print("    <Execute type=\"None\" entry=\"%s\" />\n", prj_get_pkgname());
  }
  io_print("  </StartMode>\n");
  io_print("  <Entries>\n");
  for (i = 0; i < prj_get_numpackages(); ++i) {
    prj_select_package(i);
    path = prj_get_pkgfilename("mdp");
    io_print("    <Entry filename=\"");
    if (path[0] != '.')
      io_print("./");
    io_print("%s\" />\n", path);
  }
  io_print("  </Entries>\n");
  io_print("</Combine>");
  io_closefile();
  return 1;
}
```