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

```asm
<printMapAsPgm2>:
  endbr64
  push   %r15
  push   %r14
  lea    D43(%rip),%r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %r14,%rdi
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <strlen@plt>
  lea    0x1(%r13,%rax,1),%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%r15
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  call   <strcpy@plt>
  mov    %r15,%rdi
  mov    %r14,%rsi
  call   <strcat@plt>
  mov    %r15,%rdi
  lea    D9(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %ebx,%ebx
  je     L2
  mov    (%r12),%rax
  lea    -0x1(%rbx),%edx
  mov    %ebx,%edi
  mov    $0xffffffff,%r13d
  mov    %rdx,%r10
  and    $0xfffffffc,%edi
  lea    0x8(%rax),%rsi
  mov    (%rax),%rcx
  lea    (%rsi,%rdx,8),%r11
  mov    %ebx,%edx
  shr    $0x2,%edx
  lea    -0x1(%rdx),%r9d
  add    $0x1,%r9
  shl    $0x4,%r9
  cmp    $0x2,%r10d
  jbe    L78
  nopl   0x0(%rax)
L13:
  movd   %r13d,%xmm3
  mov    %rcx,%rax
  lea    (%r9,%rcx,1),%rdx
  pshufd $0x0,%xmm3,%xmm2
  nopl   0x0(%rax)
L30:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  por    %xmm0,%xmm2
  cmp    %rdx,%rax
  jne    L30
  movdqa %xmm2,%xmm1
  mov    %edi,%eax
  psrldq $0x8,%xmm1
  movdqa %xmm1,%xmm0
  pcmpgtd %xmm2,%xmm0
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movd   %xmm1,%r13d
  cmp    %edi,%ebx
  je     L119
L37:
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%rbp
  mov    (%rcx,%rdx,4),%edx
  cmp    %edx,%r13d
  cmovl  %edx,%r13d
  lea    0x1(%rax),%edx
  cmp    %ebx,%edx
  jae    L119
  mov    0x4(%rcx,%rbp,1),%edx
  cmp    %edx,%r13d
  cmovl  %edx,%r13d
  add    $0x2,%eax
  cmp    %ebx,%eax
  jae    L119
  mov    0x8(%rcx,%rbp,1),%eax
  cmp    %eax,%r13d
  cmovl  %eax,%r13d
L119:
  mov    %rsi,%rax
  cmp    %r11,%rsi
  je     L56
  mov    (%rax),%rcx
  add    $0x8,%rsi
  cmp    $0x2,%r10d
  ja     L13
L78:
  xor    %eax,%eax
  jmp    L37
L56:
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  xor    %ebp,%ebp
  lea    D78(%rip),%rdi
  call   <fwrite@plt>
  mov    %ebx,%ecx
  mov    %ebx,%edx
  lea    D38(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r13d,%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D10(%rip),%rsi
  lea    D35(%rip),%r13
  call   <fprintf@plt>
  lea    0x0(,%rbx,8),%rax
  shl    $0x2,%rbx
  mov    %rax,(%rsp)
  nopl   0x0(%rax,%rax,1)
L81:
  xor    %r14d,%r14d
  nopl   0x0(%rax,%rax,1)
L24:
  mov    (%r12),%rax
  mov    %r13,%rsi
  mov    %r15,%rdi
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%r14,1),%edx
  xor    %eax,%eax
  add    $0x4,%r14
  call   <fprintf@plt>
  cmp    %rbx,%r14
  jne    L24
  mov    %r15,%rsi
  mov    $0xa,%edi
  add    $0x8,%rbp
  call   <fputc@plt>
  cmp    (%rsp),%rbp
  jne    L81
L114:
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rdi
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10e0 <free@plt>
L2:
  mov    %rax,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D78(%rip),%rdi
  call   <fwrite@plt>
  xor    %edx,%edx
  mov    %r15,%rdi
  xor    %ecx,%ecx
  lea    D38(%rip),%rsi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  jmp    L114
```

tool_calls: name: unpack_data
arguments: label: D43
data_type: string
name: unpack_data
arguments: label: D9
data_type: string
name: unpack_data
arguments: label: D78
data_type: string
name: unpack_data
arguments: label: D38
data_type: string
name: unpack_data
arguments: label: D10
data_type: string
name: unpack_data
arguments: label: D35
data_type: string

tool: D43: is.pgm

tool: D9: w

tool: D78: P2


tool: D38: %u %u


tool: D10: %d


tool: D35: %d 

assistant: ```c
void printMapAsPgm2(int ***map, const unsigned int MAP_SIZE, char *fn) {
  int i, j, max = -1;
  FILE *f;
  char *filename = (char *)malloc((strlen("is.pgm") + strlen(fn)) * sizeof(char) + 1);
  strcpy(filename, fn);
  strcat(filename, "is.pgm");
  f = fopen(filename, "w");
  for (i = 0; i < MAP_SIZE; ++i) {
    for (j = 0; j < MAP_SIZE; ++j) {
      max = max < (*map)[i][j] ? (*map)[i][j] : max;
    }
  }
  fprintf(f, "P2\n");
  fprintf(f, "%u %u\n", MAP_SIZE, MAP_SIZE);
  fprintf(f, "%d\n", max);
  for (i = 0; i < MAP_SIZE; ++i) {
    for (j = 0; j < MAP_SIZE; ++j) {
      fprintf(f, "%d ", (*map)[i][j]);
    }
    fprintf(f, "\n");
  }
  fclose(f);
  free(filename);
}
```