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

```asm
<test_null_term>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r12
  movl   $0x74736574,0x7(%rsp)
  lea    0x110(%rsp),%r13
  movl   $0x74736574,0xb(%rsp)
  movb   $0x0,0xf(%rsp)
  call   <smaz_build_trie@plt>
  lea    0x7(%rsp),%rsi
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    %rax,%rdi
  mov    $0x100,%r8d
  mov    %rax,%rbp
  call   <smaz_compress@plt>
  mov    $0x100,%ecx
  mov    %r13,%rdx
  mov    %r12,%rdi
  mov    %eax,%esi
  call   <smaz_decompress@plt>
  cmp    $0x4,%eax
  je     L19
  mov    %eax,%edx
  lea    D24(%rip),%rdi
  mov    $0x4,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L19:
  movsbl 0x113(%rsp),%esi
  cmp    $0x74,%sil
  je     L50
  lea    D33(%rip),%rdi
  mov    $0x74,%edx
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L50:
  lea    0xb(%rsp),%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %r12,%rcx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  lea    0x1(%rax),%edx
  mov    $0x100,%r8d
  call   <smaz_compress@plt>
  mov    %r12,%rdi
  mov    $0x100,%ecx
  mov    %r13,%rdx
  mov    %eax,%esi
  call   <smaz_decompress@plt>
  mov    %eax,%r12d
  cmp    $0x5,%eax
  je     L16
  mov    %eax,%edx
  mov    $0x5,%esi
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D11(%rip),%rdi
  mov    %r12d,%edx
  mov    %r13,%rsi
  call   <hexDump@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L16:
  movsbl 0x114(%rsp),%esi
  test   %sil,%sil
  jne    L21
L20:
  mov    %rbp,%rdi
  call   <smaz_free_trie@plt>
  lea    D42(%rip),%rdi
  call   <puts@plt>
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x228,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L21:
  lea    D50(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L20
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D24
datatype: string
name: unpack_data
arguments: tag: D33
datatype: string
name: unpack_data
arguments: tag: D11
datatype: string
name: unpack_data
arguments: tag: D42
datatype: string
name: unpack_data
arguments: tag: D50
datatype: string

tool: D24: Error: Expected return size: %d, got %d


tool: D33: Error: Incorrect final char on string: %c, expected %c


tool: D11: out

tool: D42: TEST PASSED :)

tool: D50: Error: Incorrect final char on string: %c, expected \0


assistant: ```c
void test_null_term() {
  char comp_out[256];
  char decomp_out[256];
  char no_null_str[4] = "test";
  char null_term_str[] = "test";
  int comprlen = 0;
  int decomprlen = 0;
  struct SmazBranch *trie;
  trie = smaz_build_trie();
  comprlen = smaz_compress(trie, no_null_str, 4, comp_out, 256);
  decomprlen = smaz_decompress(comp_out, comprlen, decomp_out, 256);
  if (decomprlen != 4) {
    printf("Error: Expected return size: %d, got %d\n", 4, decomprlen);
    exit(1);
  }
  if (decomp_out[3] != 't') {
    printf("Error: Incorrect final char on string: %c, expected %c\n", decomp_out[3], 't');
    exit(1);
  }
  comprlen = smaz_compress(trie, null_term_str, strlen(null_term_str) + 1, comp_out, 256);
  decomprlen = smaz_decompress(comp_out, comprlen, decomp_out, 256);
  if (decomprlen != 5) {
    printf("Error: Expected return size: %d, got %d\n", 5, decomprlen);
    hexDump("out", &decomp_out, decomprlen);
    exit(1);
  }
  if (decomp_out[4] != 0) {
    printf("Error: Incorrect final char on string: %c, expected \\0\n", decomp_out[4]);
    exit(1);
  }
  smaz_free_trie(trie);
  printf("TEST PASSED :)\n");
}
```