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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1d8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1c8(%rsp)
  xor    %eax,%eax
  movabs $0xe56be4647ef6ff98,%rax
  movabs $0x12d0f69acc052eee,%rdx
  mov    %rax,0x120(%rsp)
  mov    %rdx,0x128(%rsp)
  movabs $0x347c69489a42fb2d,%rax
  mov    %rax,0x114(%rsp)
  movl   $0x86a86d00,0x11c(%rsp)
  movabs $0x979fa9684a1bb929,%rax
  movabs $0x7a5c7af108751cc4,%rdx
  mov    %rax,0x130(%rsp)
  mov    %rdx,0x138(%rsp)
  movabs $0x29e183ca1a9efc7a,%rcx
  movabs $0x17cf67f63bd85b0,%rbx
  mov    %rcx,0x140(%rsp)
  mov    %rbx,0x148(%rsp)
  mov    %rax,0x150(%rsp)
  mov    %rdx,0x158(%rsp)
  movabs $0x5b6c22c06158caa0,%rax
  movabs $0x5a81772bc814655a,%rdx
  mov    %rax,0x160(%rsp)
  mov    %rdx,0x168(%rsp)
  movabs $0x36dd4d059b30e9e,%rax
  movabs $0xc4a04de1baf2c333,%rdx
  mov    %rax,0x170(%rsp)
  mov    %rdx,0x178(%rsp)
  movabs $0x64aab41602c03003,%rax
  movabs $0xf628c371b8edc1b7,%rdx
  mov    %rax,0x180(%rsp)
  mov    %rdx,0x188(%rsp)
  movabs $0xb9ad2cadff5a1cec,%rax
  movabs $0xea9528ee1dcfebf5,%rdx
  mov    %rax,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  movabs $0x402d554e450d057f,%rax
  movabs $0xe023d92aa9bb73f1,%rdx
  mov    %rax,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  movabs $0xe0f3ee15cfc7ba3e,%rax
  movabs $0x30f87d796f7ffee,%rdx
  mov    %rax,0x30(%rsp)
  mov    %rdx,0x38(%rsp)
  movabs $0x7df3861d0c3389fc,%rax
  movabs $0x35941e61cd4d0b70,%rdx
  mov    %rax,0x40(%rsp)
  mov    %rdx,0x48(%rsp)
  movabs $0xf8ccc775b2a5bf01,%rax
  movabs $0x58be76879728ea52,%rdx
  mov    %rax,0x50(%rsp)
  mov    %rdx,0x58(%rsp)
  movabs $0xfefe1d610e2279e,%rax
  movabs $0x68f9d0c3f498de18,%rdx
  mov    %rax,0x60(%rsp)
  mov    %rdx,0x68(%rsp)
  movabs $0x8ace211c0fe82faa,%rax
  movabs $0x2e25903910f07d5d,%rdx
  mov    %rax,0x70(%rsp)
  mov    %rdx,0x78(%rsp)
  movabs $0x1f6878c8772f30c7,%rax
  movabs $0x174fc25d78a72e9,%rdx
  mov    %rax,0x80(%rsp)
  mov    %rdx,0x88(%rsp)
  movabs $0xa58974589e457754,%rax
  movabs $0xe29d31d173c795b4,%rdx
  mov    %rax,0x90(%rsp)
  mov    %rdx,0x98(%rsp)
  movabs $0x172727ddccfadfb4,%rax
  movabs $0x41b9007b8e739cef,%rdx
  mov    %rax,0xa0(%rsp)
  mov    %rdx,0xa8(%rsp)
  movabs $0x62c209ae07bb1de9,%rax
  movabs $0x14b59189b2a9cde0,%rdx
  mov    %rax,0xb0(%rsp)
  mov    %rdx,0xb8(%rsp)
  movabs $0xf00a4c6c54ec96f1,%rax
  movabs $0x759171b9ba88e08b,%rdx
  mov    %rax,0xc0(%rsp)
  mov    %rdx,0xc8(%rsp)
  movabs $0x577e2318a8364c79,%rax
  movabs $0xd8341bd83e96f68,%rdx
  mov    %rax,0xd0(%rsp)
  mov    %rdx,0xd8(%rsp)
  movabs $0x9979f2fd60da8c78,%rax
  movabs $0x90c4b4d547862eea,%rdx
  mov    %rax,0xe0(%rsp)
  mov    %rdx,0xe8(%rsp)
  movabs $0x8379dbae9cbaeb42,%rax
  movabs $0xd7d2366832954321,%rdx
  mov    %rax,0xf0(%rsp)
  mov    %rdx,0xf8(%rsp)
  movabs $0x7088475c1528fa70,%rax
  movabs $0x863de052ae1aa72,%rdx
  mov    %rax,0x100(%rsp)
  mov    %rdx,0x108(%rsp)
  movabs $0x29c37de2b3ee2fc2,%rax
  movabs $0x6781ee3901034593,%rdx
  mov    %rax,0x190(%rsp)
  mov    %rdx,0x198(%rsp)
  movabs $0x9578033999a8a819,%rax
  movabs $0x5baf4002fa6549d7,%rdx
  mov    %rax,0x1a0(%rsp)
  mov    %rdx,0x1a8(%rsp)
  movabs $0x8a3966d5592619e3,%rax
  movabs $0x5753cd4be0f3955d,%rdx
  mov    %rax,0x1b0(%rsp)
  mov    %rdx,0x1b8(%rsp)
  mov    $0x30,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    $0x10,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    $0x0,%ebp
  lea    D20(%rip),%r14
  lea    D6(%rip),%r15
L20:
  mov    %ebp,%eax
  shl    $0x4,%eax
  mov    %eax,0xc(%rsp)
  lea    0x0(,%rbp,4),%eax
  mov    %eax,0x8(%rsp)
  mov    $0x0,%ebx
L22:
  lea    0x114(%rsp),%rcx
  lea    0x120(%rsp),%rdx
  push   %rbx
  lea    0x168(%rsp),%rax
  push   %rax
  mov    %ebp,%r9d
  lea    0x140(%rsp),%r8
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <aes128gcm@plt>
  mov    %ebx,%edx
  mov    %ebp,%esi
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x1a0(%rsp),%rsi
  mov    0x1c(%rsp),%edx
  mov    %r12,%rdi
  call   <memcmp@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  mov    %r15,%rsi
  cmove  %r14,%rsi
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%eax
  lea    (%rax,%rbx,1),%eax
  shl    $0x4,%rax
  lea    0x10(%rsp,%rax,1),%rsi
  mov    $0x10,%edx
  mov    %r13,%rdi
  call   <memcmp@plt>
  test   %eax,%eax
  mov    %r15,%rsi
  cmove  %r14,%rsi
  lea    D41(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%ebx
  cmp    $0x4,%ebx
  jne    L22
  add    $0x1,%ebp
  cmp    $0x4,%ebp
  jne    L20
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x1c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  mov    $0x0,%eax
  add    $0x1d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D20
type_infered: string
name: disassemble_data
arguments: data_tag: D6
type_infered: string
name: disassemble_data
arguments: data_tag: D24
type_infered: string
name: disassemble_data
arguments: data_tag: D43
type_infered: string
name: disassemble_data
arguments: data_tag: D41
type_infered: string

tool: D20: PASS

tool: D6: FAIL

tool: D24: lenghts %d %d: 

tool: D43: ciphertext %s 

tool: D41: tag %s



assistant: ```c
int main() {
  const unsigned char key[16] = {0x98, 0xff, 0xf6, 0x7e, 0x64, 0xe4, 0x6b, 0xe5, 0xee, 0x2e, 0x05, 0xcc, 0x9a, 0xf6, 0xd0, 0x12};
  const unsigned char IV[12] = {0x2d, 0xfb, 0x42, 0x9a, 0x48, 0x69, 0x7c, 0x34, 0x00, 0x6d, 0xa8, 0x86};
  const unsigned char plaintext[3 * 16] = {0x29, 0xb9, 0x1b, 0x4a, 0x68, 0xa9, 0x9f, 0x97, 0xc4, 0x1c, 0x75, 0x08, 0xf1, 0x7a, 0x5c, 0x7a, 0x7a, 0xfc, 0x9e, 0x1a, 0xca, 0x83, 0xe1, 0x29, 0xb0, 0x85, 0xbd, 0x63, 0x7f, 0xf6, 0x7c, 0x01, 0x29, 0xb9, 0x1b, 0x4a, 0x68, 0xa9, 0x9f, 0x97, 0xc4, 0x1c, 0x75, 0x08, 0xf1, 0x7a, 0x5c, 0x7a};
  const unsigned char add_data[3 * 16] = {0xa0, 0xca, 0x58, 0x61, 0xc0, 0x22, 0x6c, 0x5b, 0x5a, 0x65, 0x14, 0xc8, 0x2b, 0x77, 0x81, 0x5a, 0x9e, 0x0e, 0xb3, 0x59, 0xd0, 0xd4, 0x6d, 0x03, 0x33, 0xc3, 0xf2, 0xba, 0xe1, 0x4d, 0xa0, 0xc4, 0x03, 0x30, 0xc0, 0x02, 0x16, 0xb4, 0xaa, 0x64, 0xb7, 0xc1, 0xed, 0xb8, 0x71, 0xc3, 0x28, 0xf6};
  const unsigned char tag_ref[16][16] = {{0xec, 0x1c, 0x5a, 0xff, 0xad, 0x2c, 0xad, 0xb9, 0xf5, 0xeb, 0xcf, 0x1d, 0xee, 0x28, 0x95, 0xea}, {0x7f, 0x05, 0x0d, 0x45, 0x4e, 0x55, 0x2d, 0x40, 0xf1, 0x73, 0xbb, 0xa9, 0x2a, 0xd9, 0x23, 0xe0}, {0x3e, 0xba, 0xc7, 0xcf, 0x15, 0xee, 0xf3, 0xe0, 0xee, 0xff, 0xf7, 0x96, 0xd7, 0x87, 0x0f, 0x03}, {0xfc, 0x89, 0x33, 0x0c, 0x1d, 0x86, 0xf3, 0x7d, 0x70, 0x0b, 0x4d, 0xcd, 0x61, 0x1e, 0x94, 0x35}, {0x01, 0xbf, 0xa5, 0xb2, 0x75, 0xc7, 0xcc, 0xf8, 0x52, 0xea, 0x28, 0x97, 0x87, 0x76, 0xbe, 0x58}, {0x9e, 0x27, 0xe2, 0x10, 0xd6, 0xe1, 0xef, 0x0f, 0x18, 0xde, 0x98, 0xf4, 0xc3, 0xd0, 0xf9, 0x68}, {0xaa, 0x2f, 0xe8, 0x0f, 0x1c, 0x21, 0xce, 0x8a, 0x5d, 0x7d, 0xf0, 0x10, 0x39, 0x90, 0x25, 0x2e}, {0xc7, 0x30, 0x2f, 0x77, 0xc8, 0x78, 0x68, 0x1f, 0xe9, 0x72, 0x8a, 0xd7, 0x25, 0xfc, 0x74, 0x01}, {0x54, 0x77, 0x45, 0x9e, 0x58, 0x74, 0x89, 0xa5, 0xb4, 0x95, 0xc7, 0x73, 0xd1, 0x31, 0x9d, 0xe2}, {0xb4, 0xdf, 0xfa, 0xcc, 0xdd, 0x27, 0x27, 0x17, 0xef, 0x9c, 0x73, 0x8e, 0x7b, 0x00, 0xb9, 0x41}, {0xe9, 0x1d, 0xbb, 0x07, 0xae, 0x09, 0xc2, 0x62, 0xe0, 0xcd, 0xa9, 0xb2, 0x89, 0x91, 0xb5, 0x14}, {0xf1, 0x96, 0xec, 0x54, 0x6c, 0x4c, 0x0a, 0xf0, 0x8b, 0xe0, 0x88, 0xba, 0xb9, 0x71, 0x91, 0x75}, {0x79, 0x4c, 0x36, 0xa8, 0x18, 0x23, 0x7e, 0x57, 0x68, 0x6f, 0xe9, 0x83, 0xbd, 0x41, 0x83, 0x0d}, {0x78, 0x8c, 0xda, 0x60, 0xfd, 0xf2, 0x79, 0x99, 0xea, 0x2e, 0x86, 0x47, 0xd5, 0xb4, 0xc4, 0x90}, {0x42, 0xeb, 0xba, 0x9c, 0xae, 0xdb, 0x79, 0x83, 0x21, 0x43, 0x95, 0x32, 0x68, 0x36, 0xd2, 0xd7}, {0x70, 0xfa, 0x28, 0x15, 0x5c, 0x47, 0x88, 0x70, 0x72, 0xaa, 0xe1, 0x2a, 0x05, 0xde, 0x63, 0x08}};
  const unsigned char ciphertext_ref[3 * 16] = {0xc2, 0x2f, 0xee, 0xb3, 0xe2, 0x7d, 0xc3, 0x29, 0x93, 0x45, 0x03, 0x01, 0x39, 0xee, 0x81, 0x67, 0x19, 0xa8, 0xa8, 0x99, 0x39, 0x03, 0x78, 0x95, 0xd7, 0x49, 0x65, 0xfa, 0x02, 0x40, 0xaf, 0x5b, 0xe3, 0x19, 0x26, 0x59, 0xd5, 0x66, 0x39, 0x8a, 0x5d, 0x95, 0xf3, 0xe0, 0x4b, 0xcd, 0x53, 0x57};
  unsigned char *ciphertext = malloc(3 * 16 * sizeof(unsigned char));
  unsigned char *tag = malloc(16 * sizeof(unsigned char));
  unsigned int len_p;
  unsigned int len_ad;
  for (len_p = 0; len_p <= 3; len_p++) {
    for (len_ad = 0; len_ad <= 3; len_ad++) {
      aes128gcm(ciphertext, tag, key, IV, plaintext, len_p, add_data, len_ad);
      printf("lenghts %d %d: ", len_p, len_ad);
      printf("ciphertext %s ", !memcmp(ciphertext, ciphertext_ref, (len_p)*16) ? "PASS" : "FAIL");
      printf("tag %s\n\n", !memcmp(tag, tag_ref[len_p * 4 + len_ad], 16) ? "PASS" : "FAIL");
    }
  }
  free(ciphertext);
  free(tag);
  return 0;
}
```