user: Converte this assembly snippet into its equivalent C code:

```asm
<wpa_supplicant_cipher_txt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x1,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    D139(%rip),%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L4
  cmpl   $0x0,-0x4(%rbp)
  je     L46
  lea    D91(%rip),%rax
  jmp    L93
L46:
  lea    D155(%rip),%rax
L93:
  mov    -0x20(%rbp),%rdx
  sub    -0x18(%rbp),%rdx
  mov    %edx,%esi
  mov    -0x18(%rbp),%rdi
  mov    %rax,%rcx
  lea    D0(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%eax
  call   <snprintf@plt>
  cltq
  add    %rax,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
L4:
  mov    -0x24(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L103
  cmpl   $0x0,-0x4(%rbp)
  je     L122
  lea    D91(%rip),%rax
  jmp    L79
L122:
  lea    D155(%rip),%rax
L79:
  mov    -0x20(%rbp),%rdx
  sub    -0x18(%rbp),%rdx
  mov    %edx,%esi
  mov    -0x18(%rbp),%rdi
  mov    %rax,%rcx
  lea    D71(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%eax
  call   <snprintf@plt>
  cltq
  add    %rax,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
L103:
  mov    -0x24(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L80
  cmpl   $0x0,-0x4(%rbp)
  je     L41
  lea    D91(%rip),%rax
  jmp    L18
L41:
  lea    D155(%rip),%rax
L18:
  mov    -0x20(%rbp),%rdx
  sub    -0x18(%rbp),%rdx
  mov    %edx,%esi
  mov    -0x18(%rbp),%rdi
  mov    %rax,%rcx
  lea    D122(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%eax
  call   <snprintf@plt>
  cltq
  add    %rax,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
L80:
  mov    -0x24(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L131
  cmpl   $0x0,-0x4(%rbp)
  je     L10
  lea    D91(%rip),%rax
  jmp    L118
L10:
  lea    D155(%rip),%rax
L118:
  mov    -0x20(%rbp),%rdx
  sub    -0x18(%rbp),%rdx
  mov    %edx,%esi
  mov    -0x18(%rbp),%rdi
  mov    %rax,%rcx
  lea    D141(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%eax
  call   <snprintf@plt>
  cltq
  add    %rax,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
L131:
  mov    -0x24(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L111
  cmpl   $0x0,-0x4(%rbp)
  je     L91
  lea    D91(%rip),%rax
  jmp    L43
L91:
  lea    D155(%rip),%rax
L43:
  mov    -0x20(%rbp),%rdx
  sub    -0x18(%rbp),%rdx
  mov    %edx,%esi
  mov    -0x18(%rbp),%rdi
  mov    %rax,%rcx
  lea    D14(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%eax
  call   <snprintf@plt>
  cltq
  add    %rax,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
L111:
  mov    -0x18(%rbp),%rax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D139
datatype: string
name: extract_symbolic_data
arguments: tag: D91
datatype: string
name: extract_symbolic_data
arguments: tag: D155
datatype: string
name: extract_symbolic_data
arguments: tag: D0
datatype: string
name: extract_symbolic_data
arguments: tag: D71
datatype: string
name: extract_symbolic_data
arguments: tag: D122
datatype: string
name: extract_symbolic_data
arguments: tag: D141
datatype: string
name: extract_symbolic_data
arguments: tag: D14
datatype: string

tool: D139: -

tool: 

tool: D155: +

tool: D0: %sNONE

tool: D71: %sWEP40

tool: D122: %sWEP104

tool: D141: %sTKIP

tool: D14: %sCCMP

assistant: ```c
char *wpa_supplicant_cipher_txt(char *pos, char *end, int cipher) {
  int first = 1;
  pos += snprintf(pos, end - pos, "-");
  if (cipher & (1 << (0))) {
    pos += snprintf(pos, end - pos, "%sNONE", first ? "" : "+");
    first = 0;
  }
  if (cipher & (1 << (1))) {
    pos += snprintf(pos, end - pos, "%sWEP40", first ? "" : "+");
    first = 0;
  }
  if (cipher & (1 << (2))) {
    pos += snprintf(pos, end - pos, "%sWEP104", first ? "" : "+");
    first = 0;
  }
  if (cipher & (1 << (3))) {
    pos += snprintf(pos, end - pos, "%sTKIP", first ? "" : "+");
    first = 0;
  }
  if (cipher & (1 << (4))) {
    pos += snprintf(pos, end - pos, "%sCCMP", first ? "" : "+");
    first = 0;
  }
  return pos;
}
```