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

```asm
<oauth2_generate_state>:
  endbr64
  push   %r13
  lea    D7(%rip),%r13
  push   %r12
  mov    $0x4,%r12d
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movb   $0x0,(%rsp)
  mov    %rsp,%rbp
L7:
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  sub    $0x1,%r12d
  jne    L7
  mov    %rbp,%rdi
  lea    D14(%rip),%r12
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    $0x2d,%edx
  movslq %eax,%rdi
  add    %rbp,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    $0x2d,%edx
  movslq %eax,%rdi
  add    %rbp,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    $0x2d,%edx
  movslq %eax,%rdi
  add    %rbp,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    $0x2d,%edx
  mov    $0x6,%r12d
  movslq %eax,%rdi
  add    %rbp,%rdi
  call   <sprintf@plt>
  nopw   0x0(%rax,%rax,1)
L26:
  xor    %eax,%eax
  call   <random@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %ebx,%ecx
  mov    %r13,%rsi
  sar    $0x1f,%ecx
  movslq %eax,%rdi
  shr    $0x18,%ecx
  add    %rbp,%rdi
  lea    (%rbx,%rcx,1),%edx
  movzbl %dl,%edx
  sub    %ecx,%edx
  call   <sprintf@plt>
  sub    $0x1,%r12d
  jne    L26
  mov    %rbp,%rdi
  movb   $0x0,0x24(%rsp)
  call   <cpystr@plt>
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D14
type_guessed: string

tool: D7: %x

tool: D14: %c

assistant: ```c
char *oauth2_generate_state(void) {
  char rv[36];
  int i;
  rv[0] = '\0';
  for (i = 0; i < 4; i++)
    sprintf(rv + strlen(rv), "%x", random() % 256);
  sprintf(rv + strlen(rv), "%c", '-');
  for (i = 0; i < 2; i++)
    sprintf(rv + strlen(rv), "%x", random() % 256);
  sprintf(rv + strlen(rv), "%c", '-');
  for (i = 0; i < 2; i++)
    sprintf(rv + strlen(rv), "%x", random() % 256);
  sprintf(rv + strlen(rv), "%c", '-');
  for (i = 0; i < 2; i++)
    sprintf(rv + strlen(rv), "%x", random() % 256);
  sprintf(rv + strlen(rv), "%c", '-');
  for (i = 0; i < 6; i++)
    sprintf(rv + strlen(rv), "%x", random() % 256);
  rv[36] = '\0';
  return cpystr(rv);
}
```