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

```asm
<micro_qr_m1>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    $0x14,%ebp
  sub    %eax,%ebp
  cmp    $0x3,%ebp
  jg     L70
  test   %ebp,%ebp
  jle    L129
  mov    $0x0,%r12d
  lea    D28(%rip),%r13
L43:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  add    $0x1,%r12d
  cmp    %r12d,%ebp
  jne    L43
L129:
  movb   $0x0,0x4(%rsp)
  mov    $0x0,%edx
  mov    $0x0,%eax
  mov    $0x0,%ecx
  mov    $0x80,%edi
  mov    $0x1,%esi
  jmp    L244
L70:
  lea    D20(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    $0x14,%ebp
  sub    %eax,%ebp
  cmp    $0x4,%ebp
  jg     L90
  test   %ebp,%ebp
  jle    L129
  mov    $0x0,%r12d
  lea    D28(%rip),%r13
L10:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  add    $0x1,%r12d
  cmp    %r12d,%ebp
  jne    L10
  jmp    L129
L28:
  add    $0x1,%rcx
  cmp    $0x8,%rcx
  je     L259
L244:
  cmpb   $0x31,(%rbx,%rcx,1)
  jne    L28
  mov    %edi,%edx
  sar    %cl,%edx
  add    %edx,%eax
  mov    %esi,%edx
  jmp    L28
L259:
  test   %dl,%dl
  je     L92
  mov    %al,0x4(%rsp)
L92:
  movb   $0x0,0x5(%rsp)
  mov    $0x0,%ecx
  mov    $0x80,%edx
  jmp    L144
L220:
  add    $0x1,%rcx
  cmp    $0x8,%rcx
  je     L152
L144:
  cmpb   $0x31,0x8(%rbx,%rcx,1)
  jne    L220
  mov    %edx,%eax
  sar    %cl,%eax
  add    %al,0x5(%rsp)
  jmp    L220
L152:
  movb   $0x0,0x6(%rsp)
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%eax
  mov    $0x80,%edi
  mov    $0x1,%esi
  jmp    L201
L266:
  add    $0x1,%rcx
  cmp    $0x4,%rcx
  je     L188
L201:
  cmpb   $0x31,0x10(%rbx,%rcx,1)
  jne    L266
  mov    %edi,%edx
  sar    %cl,%edx
  add    %edx,%eax
  mov    %esi,%edx
  jmp    L266
L188:
  test   %dl,%dl
  je     L263
  mov    %al,0x6(%rsp)
L263:
  mov    $0x11d,%edi
  call   <rs_init_gf@plt>
  mov    $0x0,%esi
  mov    $0x2,%edi
  call   <rs_init_code@plt>
  lea    0x1(%rsp),%rdx
  lea    0x4(%rsp),%rsi
  mov    $0x3,%edi
  call   <rs_encode@plt>
  mov    $0x0,%eax
  call   <rs_free@plt>
  movzbl 0x2(%rsp),%edi
  mov    %rbx,%rdx
  mov    $0x8,%esi
  call   <bin_append@plt>
  movzbl 0x1(%rsp),%edi
  mov    %rbx,%rdx
  mov    $0x8,%esi
  call   <bin_append@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L170
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L90:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %eax,%edx
  lea    0x8(%rdx),%r12d
  mov    $0x0,%ebp
  lea    D28(%rip),%r13
  je     L98
L238:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  add    $0x1,%ebp
  cmp    %ebp,%r12d
  jne    L238
L98:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    $0x14,%edx
  sub    %eax,%edx
  cmp    $0x4,%edx
  jle    L9
  mov    $0x10,%edx
  sub    %eax,%edx
  lea    0x7(%rdx),%r12d
  cmovns %edx,%r12d
  sar    $0x3,%r12d
  cmp    $0x7,%edx
  jle    L9
  mov    $0x0,%ebp
  lea    D14(%rip),%r14
  lea    D37(%rip),%r13
L251:
  test   $0x1,%bpl
  mov    %r13,%rsi
  cmovne %r14,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  add    $0x1,%ebp
  cmp    %ebp,%r12d
  jg     L251
L9:
  mov    %rbx,%rdx
  mov    $0x4,%esi
  mov    $0x0,%edi
  call   <bin_append@plt>
  jmp    L129
L170:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D28
datatype: string
name: parse_data
arguments: label: D20
datatype: string
name: parse_data
arguments: label: D14
datatype: string
name: parse_data
arguments: label: D37
datatype: string

tool: D28: 0

tool: D20: 000

tool: D14: 00010001

tool: D37: 11101100

assistant: ```c
void micro_qr_m1(char binary_data[]) {
  int i, j, latch;
  int bits_total, bits_left;
  int data_codewords, ecc_codewords;
  unsigned char data_blocks[4], ecc_blocks[3];
  bits_total = 20;
  latch = 0;
  bits_left = bits_total - (int)strlen(binary_data);
  if (bits_left <= 3) {
    for (i = 0; i < bits_left; i++) {
      strcat(binary_data, "0");
    }
    latch = 1;
  } else {
    strcat(binary_data, "000");
  }
  if (latch == 0) {
    bits_left = bits_total - (int)strlen(binary_data);
    if (bits_left <= 4) {
      for (i = 0; i < bits_left; i++) {
        strcat(binary_data, "0");
      }
      latch = 1;
    }
  }
  if (latch == 0) {
    int remainder = 8 - (strlen(binary_data) % 8);
    if (remainder == 8) {
      remainder = 0;
    }
    for (i = 0; i < remainder; i++) {
      strcat(binary_data, "0");
    }
    bits_left = bits_total - (int)strlen(binary_data);
    if (bits_left > 4) {
      remainder = (bits_left - 4) / 8;
      for (i = 0; i < remainder; i++) {
        strcat(binary_data, (i & 1) ? "00010001" : "11101100");
      }
    }
    bin_append(0, 4, binary_data);
  }
  data_codewords = 3;
  ecc_codewords = 2;
  for (i = 0; i < (data_codewords - 1); i++) {
    data_blocks[i] = 0;
    for (j = 0; j < 8; j++) {
      if (binary_data[(i * 8) + j] == '1') {
        data_blocks[i] += 0x80 >> j;
      }
    }
  }
  data_blocks[2] = 0;
  for (j = 0; j < 4; j++) {
    if (binary_data[16 + j] == '1') {
      data_blocks[2] += 0x80 >> j;
    }
  }
  rs_init_gf(0x11d);
  rs_init_code(ecc_codewords, 0);
  rs_encode(data_codewords, data_blocks, ecc_blocks);
  rs_free();
  for (i = 0; i < ecc_codewords; i++) {
    bin_append(ecc_blocks[ecc_codewords - i - 1], 8, binary_data);
  }
}
```