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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0xffffffff,-0x18(%rbp)
  cmpl   $0x3,-0x24(%rbp)
  je     L93
  cmpl   $0x4,-0x24(%rbp)
  je     L93
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <usage_error@plt>
L93:
  mov    -0x30(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <parse_gpio_pin@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x4,-0x24(%rbp)
  jne    L98
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L66
  movl   $0x2,-0x18(%rbp)
  jmp    L98
L66:
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L55
  movl   $0x1,-0x18(%rbp)
  jmp    L98
L55:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <usage_error@plt>
L98:
  mov    -0x10(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L3
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <write_pin_to_path@plt>
  mov    -0x14(%rbp),%eax
  lea    D41(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <allow_access_by_user@plt>
  mov    -0x14(%rbp),%eax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <allow_access_by_user@plt>
  mov    -0x14(%rbp),%eax
  lea    D75(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <allow_access_by_user@plt>
  mov    -0x14(%rbp),%eax
  lea    D61(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <allow_access_by_user@plt>
  cmpl   $0xffffffff,-0x18(%rbp)
  je     L53
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <set_pullupdown@plt>
  jmp    L53
L3:
  mov    -0x10(%rbp),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L27
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <write_pin_to_path@plt>
  jmp    L53
L27:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <usage_error@plt>
L53:
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D16
data_type: string
name: unpack_data
arguments: data_tag: D54
data_type: string
name: unpack_data
arguments: data_tag: D2
data_type: string
name: unpack_data
arguments: data_tag: D43
data_type: string
name: unpack_data
arguments: data_tag: D41
data_type: string
name: unpack_data
arguments: data_tag: D7
data_type: string
name: unpack_data
arguments: data_tag: D75
data_type: string
name: unpack_data
arguments: data_tag: D61
data_type: string
name: unpack_data
arguments: data_tag: D19
data_type: string
name: unpack_data
arguments: data_tag: D53
data_type: string

tool: D16: pullup

tool: D54: pulldown

tool: D2: export

tool: D43: /sys/class/gpio/export

tool: D41: direction

tool: D7: value

tool: D75: active_low

tool: D61: edge

tool: D19: unexport

tool: D53: /sys/class/gpio/unexport

assistant: ```c
int main(int argc, char **argv) {
  int pullupdown = -1;
  if (argc != 3 && argc != 4) {
    usage_error(argv);
  }
  const char *command = argv[1];
  const char *pin_str = argv[2];
  unsigned int pin = parse_gpio_pin(pin_str);
  if (argc == 4) {
    if (strcmp("pullup", argv[3]) == 0)
      pullupdown = 2;
    else if (strcmp("pulldown", argv[3]) == 0)
      pullupdown = 1;
    else {
      usage_error(argv);
    }
  }
  if (strcmp(command, "export") == 0) {
    write_pin_to_path(("/sys/class/gpio/"
                       "export"),
                      pin);
    allow_access_by_user(pin, "direction");
    allow_access_by_user(pin, "value");
    allow_access_by_user(pin, "active_low");
    allow_access_by_user(pin, "edge");
    if (pullupdown != -1) {
      set_pullupdown(pin, pullupdown);
    }
  } else if (strcmp(command, "unexport") == 0) {
    write_pin_to_path(("/sys/class/gpio/"
                       "unexport"),
                      pin);
  } else {
    usage_error(argv);
  }
  return 0;
}
```