user: Translate the below assembly code into C programming language:

```asm
<pocl_mkstemp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <getpid@plt>
  movzbl 0x0(%rbp),%ecx
  mov    %eax,%edx
  test   %cl,%cl
  je     L292
  mov    %rbp,%rsi
  xor    %eax,%eax
  xor    %edi,%edi
  jmp    L194
  nopl   0x0(%rax)
L29:
  mov    %r15,%rsi
L194:
  add    $0x1,%eax
  cmp    $0x58,%cl
  movzbl 0x1(%rsi),%ecx
  lea    0x1(%rsi),%r15
  cmovne %edi,%eax
  test   %cl,%cl
  jne    L29
  cmpb   $0x58,-0x1(%r15)
  movzbl D39(%rip),%edi
  je     L303
L326:
  mov    %rsi,%rbx
  nopl   (%rax)
L63:
  cmp    $0x7a,%dil
  je     L18
  add    $0x1,%edi
  mov    %dil,D35(%rip)
L263:
  cmp    %rbx,%rbp
  jb     L300
  jmp    L204
  nopl   0x0(%rax,%rax,1)
L248:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L204
L300:
  cmpb   $0x2f,(%rbx)
  jne    L248
  movb   $0x0,(%rbx)
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jne    L84
  mov    0x4(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %eax,%eax
  je     L81
  movb   $0x2f,(%rbx)
L204:
  mov    D35(%rip),%r14
  mov    D73(%rip),%r13
  mov    D5(%rip),%r12
L203:
  mov    (%r14),%esi
  mov    $0x180,%edx
  or     0x0(%r13),%esi
  mov    %rbp,%rdi
  or     (%r12),%esi
  call   <open@plt>
  test   %eax,%eax
  jns    L120
  mov    D31(%rip),%rax
  mov    D60(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L2
  movzbl (%r15),%edi
  test   %dil,%dil
  je     L84
  mov    %r15,%rbx
  jmp    L24
  nopl   0x0(%rax)
L146:
  movzbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  movb   $0x61,-0x1(%rbx)
  test   %dil,%dil
  je     L84
L24:
  cmp    $0x7a,%dil
  je     L146
  call   <isdigit@plt>
  mov    %rax,%r8
  mov    $0x61,%eax
  test   %r8,%r8
  je     L196
  mov    %al,(%rbx)
  jmp    L203
  nopl   (%rax)
L84:
  xor    %eax,%eax
L120:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L59
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L196:
  movzbl (%rbx),%eax
  add    $0x1,%eax
  mov    %al,(%rbx)
  jmp    L203
  nopl   (%rax)
L18:
  movzbl D25(%rip),%edx
  movb   $0x61,D35(%rip)
  lea    0x1(%rdx),%eax
  cmp    $0x7a,%dl
  mov    $0x61,%edx
  cmove  %edx,%eax
  mov    %al,D7(%rip)
  jmp    L263
  nop
L303:
  mov    %dil,-0x1(%r15)
  cmp    $0x6,%eax
  jle    L113
  cmpb   $0x58,-0x2(%r15)
  jne    L14
  movzbl D7(%rip),%eax
  sub    $0x1,%rsi
  lea    -0x3(%r15),%rbx
  mov    %al,-0x2(%r15)
  movzbl -0x3(%r15),%eax
L309:
  cmp    $0x58,%al
  jne    L271
  nopl   0x0(%rax,%rax,1)
L316:
  movslq %edx,%rax
  mov    %edx,%ecx
  mov    %rbx,%r15
  sub    $0x1,%rbx
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x22,%rax
  sub    %ecx,%eax
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  add    $0x30,%edx
  mov    %dl,0x1(%rbx)
  cmpb   $0x58,(%rbx)
  mov    %eax,%edx
  je     L316
  jmp    L63
  nopl   (%rax)
L292:
  cmpb   $0x58,-0x1(%rbp)
  movzbl D35(%rip),%edi
  lea    -0x1(%rbp),%rsi
  mov    %rbp,%r15
  jne    L326
  mov    %dil,-0x1(%rbp)
L113:
  movzbl -0x2(%r15),%eax
  lea    -0x1(%rsi),%rbx
  jmp    L309
L81:
  mov    D7(%rip),%rdx
  mov    (%rdx),%rcx
  mov    D60(%rip),%rdx
  mov    %rcx,(%rdx)
  jmp    L120
L2:
  mov    $0xffffffff,%eax
  jmp    L120
L59:
  call   <__stack_chk_fail@plt>
L271:
  mov    %rsi,%r15
  jmp    L63
L14:
  mov    %rsi,%r15
  sub    $0x1,%rsi
  jmp    L326
```

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;
      }
    }
  }
}
```