user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hpgs_parse_papersize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L206
  mov    -0x50(%rbp),%rax
  movsd  D192(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  movsd  D261(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L206:
  mov    -0x48(%rbp),%rax
  lea    D24(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L103
  mov    -0x50(%rbp),%rax
  movsd  D261(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  movsd  D130(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L103:
  mov    -0x48(%rbp),%rax
  lea    D227(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L163
  mov    -0x50(%rbp),%rax
  movsd  D130(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  movsd  D55(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L163:
  mov    -0x48(%rbp),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L249
  mov    -0x50(%rbp),%rax
  movsd  D55(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  movsd  D115(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L249:
  mov    -0x48(%rbp),%rax
  lea    D284(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L75
  mov    -0x50(%rbp),%rax
  movsd  D115(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  movsd  D155(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L75:
  mov    -0x48(%rbp),%rax
  lea    D37(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L41
  mov    -0x58(%rbp),%rax
  movsd  D192(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  movsd  D261(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L41:
  mov    -0x48(%rbp),%rax
  lea    D283(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L151
  mov    -0x58(%rbp),%rax
  movsd  D261(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  movsd  D130(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L151:
  mov    -0x48(%rbp),%rax
  lea    D176(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L203
  mov    -0x58(%rbp),%rax
  movsd  D130(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  movsd  D55(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L203:
  mov    -0x48(%rbp),%rax
  lea    D242(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L49
  mov    -0x58(%rbp),%rax
  movsd  D55(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  movsd  D115(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L49:
  mov    -0x48(%rbp),%rax
  lea    D112(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L198
  mov    -0x58(%rbp),%rax
  movsd  D115(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  movsd  D155(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L185
L198:
  mov    -0x48(%rbp),%rax
  mov    $0x78,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L77
  mov    $0xffffffff,%eax
  jmp    L54
L77:
  mov    -0x38(%rbp),%rax
  sub    -0x48(%rbp),%rax
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x1f,-0x3c(%rbp)
  jle    L223
  mov    $0xffffffff,%eax
  jmp    L54
L223:
  mov    -0x3c(%rbp),%edx
  mov    -0x48(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x3c(%rbp),%eax
  cltq
  movb   $0x0,-0x30(%rbp,%rax,1)
  mov    -0x50(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <hpgs_parse_length@plt>
  test   %rax,%rax
  je     L70
  mov    $0xffffffff,%eax
  jmp    L54
L70:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <hpgs_parse_length@plt>
  test   %rax,%rax
  je     L185
  mov    $0xffffffff,%eax
  jmp    L54
L185:
  mov    $0x0,%eax
L54:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L126
  call   <__stack_chk_fail@plt>
L126:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D11
type: string
name: extract_symbolic_data
arguments: data_label: D192
type: f64
name: extract_symbolic_data
arguments: data_label: D261
type: f64
name: extract_symbolic_data
arguments: data_label: D24
type: string
name: extract_symbolic_data
arguments: data_label: D130
type: f64
name: extract_symbolic_data
arguments: data_label: D227
type: string
name: extract_symbolic_data
arguments: data_label: D55
type: f64
name: extract_symbolic_data
arguments: data_label: D39
type: string
name: extract_symbolic_data
arguments: data_label: D115
type: f64
name: extract_symbolic_data
arguments: data_label: D284
type: string
name: extract_symbolic_data
arguments: data_label: D155
type: f64
name: extract_symbolic_data
arguments: data_label: D37
type: string
name: extract_symbolic_data
arguments: data_label: D283
type: string
name: extract_symbolic_data
arguments: data_label: D176
type: string
name: extract_symbolic_data
arguments: data_label: D242
type: string
name: extract_symbolic_data
arguments: data_label: D112
type: string

tool: D11: A4

tool: D192: 595.9108454553883

tool: D261: 842.7451996082275

tool: D24: A3

tool: D130: 1191.8216909107766

tool: D227: A2

tool: D55: 1685.490399216455

tool: D39: A1

tool: D115: 2383.6433818215532

tool: D284: A0

tool: D155: 3370.98079843291

tool: D37: A4l

tool: D283: A3l

tool: D176: A2l

tool: D242: A1l

tool: D112: A0l

assistant: ```c
int hpgs_parse_papersize(const char *str, double *pt_width, double *pt_height) {
  if (strcmp(str, "A4") == 0) {
    *pt_width = 595.91084545538825881889;
    *pt_height = 842.74519960822752756850;
  } else if (strcmp(str, "A3") == 0) {
    *pt_width = 842.74519960822752756850;
    *pt_height = 1191.82169091077651766614;
  } else if (strcmp(str, "A2") == 0) {
    *pt_width = 1191.82169091077651766614;
    *pt_height = 1685.49039921645505516535;
  } else if (strcmp(str, "A1") == 0) {
    *pt_width = 1685.49039921645505516535;
    *pt_height = 2383.64338182155303536062;
  } else if (strcmp(str, "A0") == 0) {
    *pt_width = 2383.64338182155303536062;
    *pt_height = 3370.98079843291011035905;
  } else if (strcmp(str, "A4l") == 0) {
    *pt_height = 595.91084545538825881889;
    *pt_width = 842.74519960822752756850;
  } else if (strcmp(str, "A3l") == 0) {
    *pt_height = 842.74519960822752756850;
    *pt_width = 1191.82169091077651766614;
  } else if (strcmp(str, "A2l") == 0) {
    *pt_height = 1191.82169091077651766614;
    *pt_width = 1685.49039921645505516535;
  } else if (strcmp(str, "A1l") == 0) {
    *pt_height = 1685.49039921645505516535;
    *pt_width = 2383.64338182155303536062;
  } else if (strcmp(str, "A0l") == 0) {
    *pt_height = 2383.64338182155303536062;
    *pt_width = 3370.98079843291011035905;
  } else {
    const char *x = strchr(str, 'x');
    char wstr[32];
    int l;
    if (!x)
      return -1;
    l = x - str;
    if (l > 31)
      return -1;
    strncpy(wstr, str, l);
    wstr[l] = '\0';
    if (hpgs_parse_length(wstr, pt_width))
      return -1;
    if (hpgs_parse_length(str + l + 1, pt_height))
      return -1;
  }
  return 0;
}
```