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     L50
  mov    %eax,%edx
  lea    D5(%rip),%rdi
  mov    $0x4,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L50:
  movsbl 0x113(%rsp),%esi
  cmp    $0x74,%sil
  je     L51
  lea    D10(%rip),%rdi
  mov    $0x74,%edx
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L51:
  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     L31
  mov    %eax,%edx
  mov    $0x5,%esi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D0(%rip),%rdi
  mov    %r12d,%edx
  mov    %r13,%rsi
  call   <hexDump@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L31:
  movsbl 0x114(%rsp),%esi
  test   %sil,%sil
  jne    L8
L12:
  mov    %rbp,%rdi
  call   <smaz_free_trie@plt>
  lea    D4(%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)
L8:
  lea    D45(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L12
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D5
type: string
name: read_data
arguments: data_label: D10
type: string
name: read_data
arguments: data_label: D0
type: string
name: read_data
arguments: data_label: D4
type: string
name: read_data
arguments: data_label: D45
type: string

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


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


tool: D0: out

tool: D4: TEST PASSED :)

tool: D45: 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");
}
```