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

```asm
<fnmatch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  and    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L204
L49:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L80
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L80
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L80
L96:
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L97
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L97
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L96
L97:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
L80:
  mov    -0x34(%rbp),%edx
  lea    -0x30(%rbp),%rcx
  lea    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fnmatch_helper@plt>
  test   %eax,%eax
  jne    L136
  jmp    L160
L164:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
L160:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L259
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L164
L259:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L208
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L208
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  jmp    L172
L208:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L136
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L136
  mov    $0x0,%eax
  jmp    L94
L136:
  cmpq   $0x0,-0x10(%rbp)
  je     L252
  cmpq   $0x0,-0x8(%rbp)
  je     L252
  cmpl   $0x0,-0x18(%rbp)
  je     L5
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L252
  jmp    L5
L32:
  addq   $0x1,-0x8(%rbp)
L5:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L150
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L32
L150:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L252
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L172
L252:
  mov    $0x1,%eax
  jmp    L94
L172:
  jmp    L49
L204:
  mov    -0x34(%rbp),%edx
  lea    -0x30(%rbp),%rcx
  lea    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fnmatch_helper@plt>
L94:
  leave
  ret
```

assistant: ```c
int fnmatch(p, s, flags) const char *p;
const char *s;
int flags;
{
  const int period = !(flags & 0x04);
  const int pathname = flags & 0x02;
  const char *ptmp = 0;
  const char *stmp = 0;
  if (pathname) {
    while (1) {
      if (p[0] == '*' && p[1] == '*' && p[2] == '/') {
        do {
          p += 3;
        } while (p[0] == '*' && p[1] == '*' && p[2] == '/');
        ptmp = p;
        stmp = s;
      }
      if (fnmatch_helper(&p, &s, flags) == 0) {
        while (*s && *s != '/')
          (++(s));
        if (*p && *s) {
          p++;
          s++;
          continue;
        }
        if (!*p && !*s)
          return 0;
      }
      if (ptmp && stmp && !(period && *stmp == '.')) {
        while (*stmp && *stmp != '/')
          (++(stmp));
        if (*stmp) {
          p = ptmp;
          stmp++;
          s = stmp;
          continue;
        }
      }
      return 1;
    }
  } else
    return fnmatch_helper(&p, &s, flags);
}
```