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

```asm
<getbsize>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D76(%rip),%rdi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <getenv@plt>
  test   %rax,%rax
  je     L123
  cmpb   $0x0,(%rax)
  mov    %rax,%rbp
  mov    $0x200,%ecx
  mov    $0x200,%r14d
  lea    D122(%rip),%r8
  jne    L6
L54:
  lea    D70(%rip),%r13
  lea    D135(%rip),%rdx
  mov    $0x14,%esi
  mov    %r13,%rdi
  call   <snprintf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,(%rbx)
  mov    %r14,(%r12)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x20,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  lea    0x10(%rsp),%rsi
  mov    $0xa,%edx
  mov    %rax,%rdi
  mov    %r8,(%rsp)
  call   <strtol@plt>
  mov    (%rsp),%r8
  test   %rax,%rax
  js     L34
  mov    0x10(%rsp),%rdx
  movzbl (%rdx),%ecx
  je     L182
  test   %cl,%cl
  jne    L23
  cmp    $0x40000000,%rax
  jle    L198
  mov    $0x40000000,%ecx
L185:
  mov    $0x1,%esi
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  mov    %r8,0x8(%rsp)
  mov    %rcx,(%rsp)
  mov    $0x40000000,%r14d
  call   <warnx@plt>
  mov    (%rsp),%rcx
  mov    0x8(%rsp),%r8
  jmp    L54
  xchg   %ax,%ax
L123:
  lea    D122(%rip),%r8
  mov    $0x200,%r14d
  mov    $0x200,%ecx
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L182:
  mov    $0x1,%eax
  test   %cl,%cl
  jne    L23
L34:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  mov    $0x200,%r14d
  call   <warnx@plt>
  lea    D122(%rip),%r8
  mov    $0x200,%ecx
  jmp    L54
  xchg   %ax,%ax
L23:
  cmpb   $0x0,0x1(%rdx)
  jne    L4
  sub    $0x47,%ecx
  cmp    $0x26,%cl
  ja     L4
  mov    $0x1,%edx
  shl    %cl,%rdx
  movabs $0x1000000010,%rcx
  test   %rcx,%rdx
  jne    L42
  movabs $0x100000001,%rcx
  test   %rcx,%rdx
  jne    L71
  movabs $0x4000000040,%rcx
  test   %rcx,%rdx
  jne    L202
L4:
  mov    %rbp,%rsi
  lea    D13(%rip),%rdi
  xor    %eax,%eax
  mov    $0x200,%r14d
  call   <warnx@plt>
  lea    D122(%rip),%r8
  mov    $0x200,%ecx
  jmp    L54
L202:
  lea    D82(%rip),%r8
  mov    $0x100000,%r14d
  mov    $0x400,%ecx
L219:
  cmp    %rax,%rcx
  jl     L185
  imul   %rax,%r14
  mov    %rax,%rcx
  jmp    L54
L71:
  cmp    $0x1,%rax
  je     L203
  lea    D112(%rip),%r8
  mov    $0x1,%ecx
  jmp    L185
L42:
  lea    D111(%rip),%r8
  mov    $0x400,%r14d
  mov    $0x100000,%ecx
  jmp    L219
L18:
  call   <__stack_chk_fail@plt>
L198:
  mov    %rax,%r14
  mov    %rax,%rcx
  cmp    $0x1ff,%rax
  jle    L34
  jmp    L54
L203:
  mov    $0x1,%ecx
  lea    D112(%rip),%r8
  mov    $0x40000000,%r14d
  jmp    L54
```

tool_calls: name: extract_symbolic_data
arguments: tag: D76
type_infered: string
name: extract_symbolic_data
arguments: tag: D122
type_infered: string
name: extract_symbolic_data
arguments: tag: D135
type_infered: string
name: extract_symbolic_data
arguments: tag: D66
type_infered: string
name: extract_symbolic_data
arguments: tag: D16
type_infered: string
name: extract_symbolic_data
arguments: tag: D13
type_infered: string
name: extract_symbolic_data
arguments: tag: D82
type_infered: string
name: extract_symbolic_data
arguments: tag: D112
type_infered: string
name: extract_symbolic_data
arguments: tag: D111
type_infered: string

tool: D76: BLOCKSIZE

tool: 

tool: D135: %ld%s-blocks

tool: D66: maximum blocksize is %ldG

tool: D16: minimum blocksize is 512

tool: D13: %s: unknown blocksize

tool: D82: M

tool: D112: G

tool: D111: K

assistant: ```c
char *getbsize(int *headerlenp, long *blocksizep) {
  static char header[20];
  long n, max, mul, blocksize;
  char *ep, *p;
  const char *form;
  form = "";
  if ((p = getenv("BLOCKSIZE")) != NULL && *p != '\0') {
    if ((n = strtol(p, &ep, 10)) < 0)
      goto underflow;
    if (n == 0)
      n = 1;
    if (*ep && ep[1])
      goto fmterr;
    switch (*ep) {
    case 'G':
    case 'g':
      form = "G";
      max = (1024L * 1024L * 1024L) / (1024L * 1024L * 1024L);
      mul = (1024L * 1024L * 1024L);
      break;
    case 'K':
    case 'k':
      form = "K";
      max = (1024L * 1024L * 1024L) / (1024L);
      mul = (1024L);
      break;
    case 'M':
    case 'm':
      form = "M";
      max = (1024L * 1024L * 1024L) / (1024L * 1024L);
      mul = (1024L * 1024L);
      break;
    case '\0':
      max = (1024L * 1024L * 1024L);
      mul = 1;
      break;
    default:
    fmterr:
      warnx("%s: unknown blocksize", p);
      n = 512;
      max = (1024L * 1024L * 1024L);
      mul = 1;
      break;
    }
    if (n > max) {
      warnx("maximum blocksize is %ldG", (1024L * 1024L * 1024L) / (1024L * 1024L * 1024L));
      n = max;
    }
    if ((blocksize = n * mul) < 512) {
    underflow:
      warnx("minimum blocksize is 512");
      form = "";
      blocksize = n = 512;
    }
  } else
    blocksize = n = 512;
  (void)snprintf(header, sizeof(header), "%ld%s-blocks", n, form);
  *headerlenp = strlen(header);
  *blocksizep = blocksize;
  return (header);
}
```