user: Demonstrate the C code that generates the assembly output below:

```asm
<translate_mac>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x138,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  mov    $0x4,%edx
  lea    D52(%rip),%rdi
  call   <memcpy@plt>
  mov    $0x0,%edi
  call   <debugfs_mount@plt>
  lea    D52(%rip),%rbx
  test   %rax,%rax
  je     L146
  lea    0x20(%rsp),%rbx
  mov    $0x101,%ecx
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  lea    D60(%rip),%rdi
  call   <debugfs_make_path@plt>
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  lea    D52(%rip),%rbx
  test   %rax,%rax
  je     L146
  lea    D65(%rip),%rbp
  lea    D14(%rip),%r14
  mov    %rbx,%r15
  jmp    L64
L59:
  cmp    $0x3,%ebx
  jne    L141
  call   <ether_aton@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L29
L64:
  lea    0x8(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  mov    %r13,%rdx
  call   <getline@plt>
  cmp    $0xffffffff,%eax
  je     L145
  mov    0x10(%rsp),%rdi
  mov    $0x0,%ebx
  lea    D61(%rip),%r12
  jmp    L49
L81:
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L64
  mov    $0x1,%ebx
  jmp    L141
L66:
  mov    %r14,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  mov    $0x3,%eax
  cmove  %eax,%ebx
L141:
  mov    $0x0,%edi
L49:
  lea    0x18(%rsp),%rdx
  mov    %rbp,%rsi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L64
  cmp    $0x2,%ebx
  je     L66
  ja     L59
  test   %ebx,%ebx
  je     L81
  call   <ether_aton@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L64
  mov    $0x4,%edx
  mov    %r15,%rsi
  call   <memcmp@plt>
  test   %eax,%eax
  jne    L64
  mov    $0x2,%ebx
  jmp    L141
L145:
  lea    D52(%rip),%rbx
L29:
  mov    %r13,%rdi
  call   <fclose@plt>
L146:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L147
  mov    %rbx,%rax
  add    $0x138,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L147:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D60
datatype: string
name: extract_symbolic_data
arguments: data_tag: D10
datatype: string
name: extract_symbolic_data
arguments: data_tag: D65
datatype: string
name: extract_symbolic_data
arguments: data_tag: D14
datatype: string
name: extract_symbolic_data
arguments: data_tag: D61
datatype: string

tool: D60: %s/batman_adv/%s/transtable_global

tool: D10: r

tool: D65:  	

tool: D14: via

tool: D61: *

assistant: ```c
struct ether_addr *translate_mac(const char *mesh_iface, struct ether_addr *mac) {
  enum {
    tg_start,
    tg_mac,
    tg_via,
    tg_originator,
  } pos;
  char full_path[256 + 1];
  char *debugfs_mnt;
  static struct ether_addr in_mac;
  struct ether_addr *mac_result, *mac_tmp;
  FILE *f = NULL;
  size_t len = 0;
  char *line = NULL;
  char *input, *saveptr, *token;
  int line_invalid;
  memcpy(&in_mac, mac, sizeof(in_mac));
  mac_result = &in_mac;
  debugfs_mnt = debugfs_mount(NULL);
  if (!debugfs_mnt)
    goto out;
  debugfs_make_path("%s/batman_adv/%s"
                    "/"
                    "transtable_global",
                    mesh_iface, full_path, sizeof(full_path));
  f = fopen(full_path, "r");
  if (!f)
    goto out;
  while (getline(&line, &len, f) != -1) {
    line_invalid = 0;
    pos = tg_start;
    input = line;
    while ((token = strtok_r(input, " \t", &saveptr))) {
      input = NULL;
      switch (pos) {
      case tg_start:
        if (strcmp(token, "*") != 0)
          line_invalid = 1;
        else
          pos = tg_mac;
        break;
      case tg_mac:
        mac_tmp = ether_aton(token);
        if (!mac_tmp || memcmp(mac_tmp, &in_mac, sizeof(in_mac)) != 0)
          line_invalid = 1;
        else
          pos = tg_via;
        break;
      case tg_via:
        if (strcmp(token, "via") == 0)
          pos = tg_originator;
        break;
      case tg_originator:
        mac_tmp = ether_aton(token);
        if (!mac_tmp) {
          line_invalid = 1;
        } else {
          mac_result = mac_tmp;
          goto out;
        }
        break;
      }
      if (line_invalid)
        break;
    }
  }
out:
  if (f)
    fclose(f);
  free(line);
  return mac_result;
}
```