user: 请将以下的汇编代码转换成C语言代码:

```asm
<pocl_mkstemp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x20(%rbp)
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L287
L293:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L119
  addl   $0x1,-0x20(%rbp)
  jmp    L113
L119:
  movl   $0x0,-0x20(%rbp)
L113:
  addq   $0x1,-0x18(%rbp)
L287:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L293
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L252
  subq   $0x1,-0x18(%rbp)
  movzbl D28(%rip),%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
L252:
  cmpl   $0x6,-0x20(%rbp)
  jle    L10
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L10
  subq   $0x1,-0x18(%rbp)
  movzbl D137(%rip),%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L10
L25:
  mov    -0x24(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    %ecx,%eax
  add    $0x30,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x24(%rbp)
L10:
  subq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  je     L25
  movzbl D28(%rip),%eax
  cmp    $0x7a,%al
  je     L270
  movzbl D28(%rip),%eax
  add    $0x1,%eax
  mov    %al,D37(%rip)
  jmp    L248
L270:
  movb   $0x61,D37(%rip)
  movzbl D137(%rip),%eax
  cmp    $0x7a,%al
  je     L262
  movzbl D137(%rip),%eax
  add    $0x1,%eax
  mov    %al,D37(%rip)
  jmp    L248
L262:
  movb   $0x61,D37(%rip)
L248:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
L188:
  mov    -0x18(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jbe    L203
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L175
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  lea    -0x28(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L165
  mov    $0x0,%eax
  jmp    L159
L165:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %eax,%eax
  jne    L38
  mov    D37(%rip),%rax
  mov    (%rax),%rdx
  mov    D133(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L159
L38:
  mov    -0x18(%rbp),%rax
  movb   $0x2f,(%rax)
  jmp    L96
L175:
  subq   $0x1,-0x18(%rbp)
  jmp    L188
L203:
  nop
L96:
  mov    D80(%rip),%rax
  mov    (%rax),%edx
  mov    D53(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D98(%rip),%rax
  mov    (%rax),%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x38(%rbp),%rax
  mov    $0x180,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <open@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  js     L195
  mov    -0x1c(%rbp),%eax
  jmp    L159
L195:
  mov    D133(%rip),%rax
  mov    (%rax),%rdx
  mov    D30(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L124
  mov    $0xffffffff,%eax
  jmp    L159
L124:
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L237:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L285
  mov    $0x0,%eax
  jmp    L159
L285:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jne    L40
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x61,(%rax)
  jmp    L237
L40:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L211
  mov    -0x18(%rbp),%rax
  movb   $0x61,(%rax)
  jmp    L133
L211:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
L133:
  jmp    L96
L159:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L110
  call   <__stack_chk_fail@plt>
L110:
  leave
  ret
```

assistant: ```c
int pocl_mkstemp(char *path) {
  int fd;
  char *start, *trv;
  struct stat sbuf;
  pid_t pid;
  static char xtra[2] = "aa";
  int xcnt = 0;
  pid = getpid();
  for (trv = path; *trv; ++trv)
    if (*trv == 'X')
      xcnt++;
    else
      xcnt = 0;
  if (*(trv - 1) == 'X')
    *--trv = xtra[0];
  if (xcnt > 6 && *(trv - 1) == 'X')
    *--trv = xtra[1];
  while (*--trv == 'X') {
    *trv = (pid % 10) + '0';
    pid /= 10;
  }
  if (xtra[0] != 'z')
    xtra[0]++;
  else {
    xtra[0] = 'a';
    if (xtra[1] != 'z')
      xtra[1]++;
    else
      xtra[1] = 'a';
  }
  for (start = trv + 1;; --trv) {
    if (trv <= path)
      break;
    if (*trv == '/') {
      *trv = '\0';
      if (stat(path, &sbuf))
        return (0);
      if (!S_ISDIR(sbuf.st_mode)) {
        errno = ENOTDIR;
        return (0);
      }
      *trv = '/';
      break;
    }
  }
  for (;;) {
    if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR | 0, 0600)) >= 0)
      return (fd);
    if (errno != EEXIST)
      return -1;
    for (trv = start;;) {
      if (!*trv)
        return (0);
      if (*trv == 'z')
        *trv++ = 'a';
      else {
        if (isdigit((unsigned char)*trv))
          *trv = 'a';
        else
          ++*trv;
        break;
      }
    }
  }
}
```