user: What is the c source code of the assembly code below?

```asm
<generate_leak>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  lea    D161(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L60
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rsi
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L60:
  mov    -0x28(%rbp),%rax
  lea    D179(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L114
  mov    -0x2c(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,%rsi
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L114:
  mov    -0x28(%rbp),%rax
  lea    D58(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L130
  mov    $0xa,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <realloc@plt>
  mov    %rax,%rsi
  lea    D154(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L130:
  mov    -0x28(%rbp),%rax
  lea    D14(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L37
  mov    -0x2c(%rbp),%edx
  lea    -0x18(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <posix_memalign@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D147(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L37:
  mov    -0x28(%rbp),%rax
  lea    D32(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L0
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <valloc@plt>
  mov    %rax,%rsi
  lea    D165(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L0:
  mov    -0x28(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L144
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  mov    $0x200,%edi
  call   <memalign@plt>
  mov    %rax,%rsi
  lea    D159(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L144:
  mov    -0x28(%rbp),%rax
  lea    D152(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L6
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <pvalloc@plt>
  mov    %rax,%rsi
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L6:
  mov    -0x28(%rbp),%rax
  lea    D116(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L91
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  mov    $0x200,%edi
  call   <aligned_alloc@plt>
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L91:
  mov    -0x28(%rbp),%rax
  lea    D43(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L92
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L34
L92:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L34:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L176
  call   <__stack_chk_fail@plt>
L176:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D161
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D46
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D179
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D136
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D58
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D154
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D14
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D147
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D32
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D165
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D7
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D159
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D152
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D95
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D116
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D31
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D43
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D62
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D51
type_guessed: string

tool: D161: malloc

tool: D46: leaking via malloc, %p


tool: D179: calloc

tool: D136: leaking via calloc, %p


tool: D58: realloc

tool: D154: leaking via realloc, %p


tool: D14: posix_memalign

tool: D147: leaking via posix_memalign, %p


tool: D32: valloc

tool: D165: leaking via valloc, %p


tool: D7: memalign

tool: D159: leaking via memalign, %p


tool: D152: pvalloc

tool: D95: leaking via pvalloc, %p


tool: D116: aligned_alloc

tool: D31: leaking via aligned_alloc, %p


tool: D43: no_leak

tool: D62: ptr = %p


tool: D51: unknown leak type '%s'


assistant: ```c
void generate_leak(const char *kind, int amount) {
  void *ptr = NULL;
  if (strcmp(kind, "malloc") == 0) {
    printf("leaking via malloc, %p\n", malloc(amount));
    return;
  }
  if (strcmp(kind, "calloc") == 0) {
    printf("leaking via calloc, %p\n", calloc(amount, 1));
    return;
  }
  if (strcmp(kind, "realloc") == 0) {
    printf("leaking via realloc, %p\n", realloc(malloc(10), amount));
    return;
  }
  if (strcmp(kind, "posix_memalign") == 0) {
    posix_memalign(&ptr, 512, amount);
    printf("leaking via posix_memalign, %p\n", ptr);
    return;
  }
  if (strcmp(kind, "valloc") == 0) {
    printf("leaking via valloc, %p\n", valloc(amount));
    return;
  }
  if (strcmp(kind, "memalign") == 0) {
    printf("leaking via memalign, %p\n", memalign(512, amount));
    return;
  }
  if (strcmp(kind, "pvalloc") == 0) {
    printf("leaking via pvalloc, %p\n", pvalloc(amount));
    return;
  }
  if (strcmp(kind, "aligned_alloc") == 0) {
    printf("leaking via aligned_alloc, %p\n", aligned_alloc(512, amount));
    return;
  }
  if (strcmp(kind, "no_leak") == 0) {
    void *ptr = malloc(amount);
    printf("ptr = %p\n", ptr);
    free(ptr);
    return;
  }
  printf("unknown leak type '%s'\n", kind);
}
```