user: Translate the below assembly code into C programming language:

```asm
<micro_qr_m1>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    $0x14,%ebx
  mov    %ebx,%r13d
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  sub    %eax,%r13d
  cmp    $0x3,%r13d
  jg     L307
  xor    %ebx,%ebx
  lea    D29(%rip),%rbp
  test   %r13d,%r13d
  jle    L268
L338:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <strcat@plt>
  cmp    %ebx,%r13d
  jne    L338
L268:
  cmpb   $0x31,(%r12)
  mov    $0xffffffc0,%eax
  mov    $0x40,%edx
  mov    $0x0,%ecx
  cmove  %eax,%edx
  mov    $0xffffff80,%eax
  cmovne %ecx,%eax
  cmpb   $0x31,0x1(%r12)
  mov    %al,0x4(%rsp)
  jne    L320
  mov    %dl,0x4(%rsp)
  mov    %edx,%eax
L320:
  cmpb   $0x31,0x2(%r12)
  jne    L347
  add    $0x20,%eax
  mov    %al,0x4(%rsp)
L347:
  cmpb   $0x31,0x3(%r12)
  jne    L185
  add    $0x10,%eax
  mov    %al,0x4(%rsp)
L185:
  cmpb   $0x31,0x4(%r12)
  jne    L171
  add    $0x8,%eax
  mov    %al,0x4(%rsp)
L171:
  cmpb   $0x31,0x5(%r12)
  jne    L72
  add    $0x4,%eax
  mov    %al,0x4(%rsp)
L72:
  cmpb   $0x31,0x6(%r12)
  jne    L108
  add    $0x2,%eax
  mov    %al,0x4(%rsp)
L108:
  cmpb   $0x31,0x7(%r12)
  jne    L275
  add    $0x1,%eax
  mov    %al,0x4(%rsp)
L275:
  cmpb   $0x31,0x8(%r12)
  mov    $0xffffffc0,%eax
  mov    $0x40,%edx
  mov    $0x0,%ecx
  cmove  %eax,%edx
  mov    $0xffffff80,%eax
  cmovne %ecx,%eax
  cmpb   $0x31,0x9(%r12)
  mov    %al,0x5(%rsp)
  jne    L36
  mov    %dl,0x5(%rsp)
  mov    %edx,%eax
L36:
  cmpb   $0x31,0xa(%r12)
  jne    L149
  add    $0x20,%eax
  mov    %al,0x5(%rsp)
L149:
  cmpb   $0x31,0xb(%r12)
  jne    L325
  add    $0x10,%eax
  mov    %al,0x5(%rsp)
L325:
  cmpb   $0x31,0xc(%r12)
  jne    L30
  add    $0x8,%eax
  mov    %al,0x5(%rsp)
L30:
  cmpb   $0x31,0xd(%r12)
  jne    L158
  add    $0x4,%eax
  mov    %al,0x5(%rsp)
L158:
  cmpb   $0x31,0xe(%r12)
  jne    L159
  add    $0x2,%eax
  mov    %al,0x5(%rsp)
L159:
  cmpb   $0x31,0xf(%r12)
  jne    L314
  add    $0x1,%eax
  mov    %al,0x5(%rsp)
L314:
  cmpb   $0x31,0x10(%r12)
  mov    $0xffffff80,%eax
  mov    $0x0,%edx
  movb   $0x0,0x6(%rsp)
  cmovne %edx,%eax
  sete   %cl
  cmpb   $0x31,0x11(%r12)
  je     L167
L300:
  cmpb   $0x31,0x12(%r12)
  je     L39
  cmpb   $0x31,0x13(%r12)
  je     L110
  test   %cl,%cl
  jne    L358
L236:
  mov    $0x11d,%edi
  call   <rs_init_gf@plt>
  xor    %esi,%esi
  mov    $0x2,%edi
  call   <rs_init_code@plt>
  lea    0x1(%rsp),%rdx
  lea    0x4(%rsp),%rsi
  mov    $0x3,%edi
  call   <rs_encode@plt>
  xor    %eax,%eax
  call   <rs_free@plt>
  movzbl 0x2(%rsp),%edi
  mov    %r12,%rdx
  mov    $0x8,%esi
  call   <bin_append@plt>
  movzbl 0x1(%rsp),%edi
  mov    %r12,%rdx
  mov    $0x8,%esi
  call   <bin_append@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L242
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L39:
  add    $0x20,%eax
  cmpb   $0x31,0x13(%r12)
  jne    L358
L110:
  add    $0x10,%eax
L358:
  mov    %al,0x6(%rsp)
  jmp    L236
  nop
L167:
  add    $0x40,%eax
  mov    $0x1,%ecx
  jmp    L300
  nopl   (%rax)
L307:
  lea    D14(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  sub    %eax,%ebx
  cmp    $0x4,%ebx
  jg     L152
  xor    %r13d,%r13d
  lea    D29(%rip),%rbp
  test   %ebx,%ebx
  jle    L268
L22:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%r13d
  call   <strcat@plt>
  cmp    %r13d,%ebx
  jne    L22
  jmp    L268
L152:
  mov    %r12,%rdi
  mov    $0x0,%ebx
  lea    D29(%rip),%rbp
  call   <strlen@plt>
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %eax,%edx
  lea    0x8(%rdx),%r13d
  je     L19
  xchg   %ax,%ax
L245:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <strcat@plt>
  cmp    %ebx,%r13d
  jne    L245
L19:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    $0x14,%edx
  sub    %eax,%edx
  cmp    $0x4,%edx
  jle    L4
  mov    $0x10,%ebp
  lea    D1(%rip),%rsi
  xor    %ebx,%ebx
  sub    %eax,%ebp
  lea    D41(%rip),%r14
  mov    %rsi,%r13
  sar    $0x3,%ebp
  test   %ebp,%ebp
  jg     L310
  jmp    L4
  nopw   0x0(%rax,%rax,1)
L76:
  test   $0x1,%bl
  mov    %r13,%rsi
  cmovne %r14,%rsi
L310:
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <strcat@plt>
  cmp    %ebx,%ebp
  jne    L76
L4:
  mov    %r12,%rdx
  mov    $0x4,%esi
  xor    %edi,%edi
  call   <bin_append@plt>
  jmp    L268
L242:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D29
type: string
name: retrieve_data
arguments: data_tag: D14
type: string
name: retrieve_data
arguments: data_tag: D1
type: string
name: retrieve_data
arguments: data_tag: D41
type: string

tool: D29: 0

tool: D14: 000

tool: D1: 11101100

tool: D41: 00010001

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);
  }
}
```