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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <initialise_acl@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  lea    D408(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D408(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D408(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D408(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x7,%edx
  lea    D408(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  lea    D219(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D219(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D219(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D219(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x7,%edx
  lea    D219(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x1,%edx
  lea    D118(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x2,%edx
  lea    D231(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x4,%edx
  lea    D519(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D231(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D231(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D231(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D519(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D519(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D519(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D202(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D547(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D597(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  lea    D615(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x2,%edx
  lea    D468(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D202(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D547(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D597(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D615(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x4,%edx
  lea    D408(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D202(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D547(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D597(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D615(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x4,%edx
  lea    D118(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D202(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D547(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D597(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D615(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x4,%edx
  lea    D468(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D118(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D202(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D547(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D597(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D615(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free_acl@plt>
  mov    $0x0,%eax
  call   <initialise_acl@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x2,%edx
  lea    D497(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D497(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D246(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D272(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x2,%edx
  lea    D468(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D497(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D246(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D272(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x2,%edx
  lea    D268(%rip),%rsi
  mov    %rax,%rdi
  call   <add_acl@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D497(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D246(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D272(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  cmp    $0x1,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D531(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D551(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D205(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D525(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <get_acl@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free_acl@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D408
type_guessed: string
name: extract_symbolic_data
arguments: label: D219
type_guessed: string
name: extract_symbolic_data
arguments: label: D118
type_guessed: string
name: extract_symbolic_data
arguments: label: D231
type_guessed: string
name: extract_symbolic_data
arguments: label: D519
type_guessed: string
name: extract_symbolic_data
arguments: label: D202
type_guessed: string
name: extract_symbolic_data
arguments: label: D547
type_guessed: string
name: extract_symbolic_data
arguments: label: D597
type_guessed: string
name: extract_symbolic_data
arguments: label: D615
type_guessed: string
name: extract_symbolic_data
arguments: label: D468
type_guessed: string
name: extract_symbolic_data
arguments: label: D497
type_guessed: string
name: extract_symbolic_data
arguments: label: D246
type_guessed: string
name: extract_symbolic_data
arguments: label: D272
type_guessed: string
name: extract_symbolic_data
arguments: label: D268
type_guessed: string
name: extract_symbolic_data
arguments: label: D531
type_guessed: string
name: extract_symbolic_data
arguments: label: D551
type_guessed: string
name: extract_symbolic_data
arguments: label: D205
type_guessed: string
name: extract_symbolic_data
arguments: label: D525
type_guessed: string

tool: D408: all

tool: D219: undefined

tool: D118: foo.amp.wand.net.nz

tool: D231: bar.amp.wand.net.nz

tool: D519: baz.amp.wand.net.nz

tool: D202: amp.wand.net.nz

tool: D547: wand.net.nz

tool: D597: net.nz

tool: D615: nz

tool: D468: .wand.net.nz

tool: D497: foo.bar.baz.wand.net.nz

tool: D246: bar.baz.wand.net.nz

tool: D272: baz.wand.net.nz

tool: D268: .nz

tool: D531: foo.net.nz

tool: D551: foo.bar.net.nz

tool: D205: foo.bar.baz.net.nz

tool: D525: foo.nz

assistant: ```c
int main(void) {
  struct acl_root *root;
  root = initialise_acl();
  assert(root);
  assert(get_acl(root, "all", 0x00) == 0);
  assert(get_acl(root, "all", 0x01) == 0);
  assert(get_acl(root, "all", 0x02) == 0);
  assert(get_acl(root, "all", 0x04) == 0);
  assert(get_acl(root, "all", (0x01 | 0x02 | 0x04)) == 0);
  assert(get_acl(root, "undefined", 0x00) == 0);
  assert(get_acl(root, "undefined", 0x01) == 0);
  assert(get_acl(root, "undefined", 0x02) == 0);
  assert(get_acl(root, "undefined", 0x04) == 0);
  assert(get_acl(root, "undefined", (0x01 | 0x02 | 0x04)) == 0);
  add_acl(root, "foo.amp.wand.net.nz", 0x01, 1);
  add_acl(root, "bar.amp.wand.net.nz", 0x02, 1);
  add_acl(root, "baz.amp.wand.net.nz", 0x04, 1);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x01) == 1);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x02) == 0);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x04) == 0);
  assert(get_acl(root, "bar.amp.wand.net.nz", 0x01) == 0);
  assert(get_acl(root, "bar.amp.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "bar.amp.wand.net.nz", 0x04) == 0);
  assert(get_acl(root, "baz.amp.wand.net.nz", 0x01) == 0);
  assert(get_acl(root, "baz.amp.wand.net.nz", 0x02) == 0);
  assert(get_acl(root, "baz.amp.wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "amp.wand.net.nz", 0x01) == 0);
  assert(get_acl(root, "wand.net.nz", 0x01) == 0);
  assert(get_acl(root, "net.nz", 0x01) == 0);
  assert(get_acl(root, "nz", 0x01) == 0);
  add_acl(root, ".wand.net.nz", 0x02, 1);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "amp.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "wand.net.nz", 0x02) == 0);
  assert(get_acl(root, "net.nz", 0x02) == 0);
  assert(get_acl(root, "nz", 0x02) == 0);
  add_acl(root, "all", 0x04, 1);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "amp.wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "net.nz", 0x04) == 1);
  assert(get_acl(root, "nz", 0x04) == 1);
  add_acl(root, "foo.amp.wand.net.nz", 0x04, 0);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x04) == 0);
  assert(get_acl(root, "amp.wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "net.nz", 0x04) == 1);
  assert(get_acl(root, "nz", 0x04) == 1);
  add_acl(root, ".wand.net.nz", 0x04, 0);
  assert(get_acl(root, "foo.amp.wand.net.nz", 0x04) == 0);
  assert(get_acl(root, "amp.wand.net.nz", 0x04) == 0);
  assert(get_acl(root, "wand.net.nz", 0x04) == 1);
  assert(get_acl(root, "net.nz", 0x04) == 1);
  assert(get_acl(root, "nz", 0x04) == 1);
  free_acl(root);
  root = initialise_acl();
  add_acl(root, "foo.bar.baz.wand.net.nz", 0x02, 1);
  assert(get_acl(root, "foo.bar.baz.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "bar.baz.wand.net.nz", 0x02) == 0);
  assert(get_acl(root, "baz.wand.net.nz", 0x02) == 0);
  add_acl(root, ".wand.net.nz", 0x02, 1);
  assert(get_acl(root, "foo.bar.baz.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "bar.baz.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "baz.wand.net.nz", 0x02) == 1);
  add_acl(root, ".nz", 0x02, 0);
  assert(get_acl(root, "foo.bar.baz.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "bar.baz.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "baz.wand.net.nz", 0x02) == 1);
  assert(get_acl(root, "foo.net.nz", 0x02) == 0);
  assert(get_acl(root, "foo.bar.net.nz", 0x02) == 0);
  assert(get_acl(root, "foo.bar.baz.net.nz", 0x02) == 0);
  assert(get_acl(root, "foo.nz", 0x02) == 0);
  free_acl(root);
  return 0;
}
```