user: 请将以下的汇编代码转换成C语言代码:

```asm
<micro_qr_m1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x14,-0x20(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x3,-0x1c(%rbp)
  jg     L231
  movl   $0x0,-0x30(%rbp)
  jmp    L212
L78:
  mov    -0x38(%rbp),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  addl   $0x1,-0x30(%rbp)
L212:
  mov    -0x30(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L78
  movl   $0x1,-0x28(%rbp)
  jmp    L30
L231:
  mov    -0x38(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L30:
  cmpl   $0x0,-0x28(%rbp)
  jne    L23
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x4,-0x1c(%rbp)
  jg     L23
  movl   $0x0,-0x30(%rbp)
  jmp    L114
L217:
  mov    -0x38(%rbp),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  addl   $0x1,-0x30(%rbp)
L114:
  mov    -0x30(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L217
  movl   $0x1,-0x28(%rbp)
L23:
  cmpl   $0x0,-0x28(%rbp)
  jne    L51
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    $0x8,%eax
  sub    %edx,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x8,-0x24(%rbp)
  jne    L220
  movl   $0x0,-0x24(%rbp)
L220:
  movl   $0x0,-0x30(%rbp)
  jmp    L108
L167:
  mov    -0x38(%rbp),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  addl   $0x1,-0x30(%rbp)
L108:
  mov    -0x30(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L167
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x4,-0x1c(%rbp)
  jle    L134
  mov    -0x1c(%rbp),%eax
  sub    $0x4,%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L182
L10:
  mov    -0x30(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L20
  lea    D29(%rip),%rax
  jmp    L228
L20:
  lea    D20(%rip),%rax
L228:
  mov    -0x38(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcat@plt>
  addl   $0x1,-0x30(%rbp)
L182:
  mov    -0x30(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L10
L134:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x4,%esi
  mov    $0x0,%edi
  call   <bin_append@plt>
L51:
  movl   $0x3,-0x18(%rbp)
  movl   $0x2,-0x14(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L257
L235:
  mov    -0x30(%rbp),%eax
  cltq
  movb   $0x0,-0xc(%rbp,%rax,1)
  movl   $0x0,-0x2c(%rbp)
  jmp    L93
L43:
  mov    -0x30(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x31,%al
  jne    L92
  mov    -0x30(%rbp),%eax
  cltq
  movzbl -0xc(%rbp,%rax,1),%edx
  mov    -0x2c(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%ecx
  sar    %cl,%esi
  mov    %esi,%eax
  add    %eax,%edx
  mov    -0x30(%rbp),%eax
  cltq
  mov    %dl,-0xc(%rbp,%rax,1)
L92:
  addl   $0x1,-0x2c(%rbp)
L93:
  cmpl   $0x7,-0x2c(%rbp)
  jle    L43
  addl   $0x1,-0x30(%rbp)
L257:
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x30(%rbp)
  jl     L235
  movb   $0x0,-0xa(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L250
L46:
  mov    -0x2c(%rbp),%eax
  add    $0x10,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x31,%al
  jne    L36
  movzbl -0xa(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  mov    $0x80,%esi
  mov    %eax,%ecx
  sar    %cl,%esi
  mov    %esi,%eax
  add    %edx,%eax
  mov    %al,-0xa(%rbp)
L36:
  addl   $0x1,-0x2c(%rbp)
L250:
  cmpl   $0x3,-0x2c(%rbp)
  jle    L46
  mov    $0x11d,%edi
  call   <rs_init_gf@plt>
  mov    -0x14(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <rs_init_code@plt>
  lea    -0xf(%rbp),%rdx
  lea    -0xc(%rbp),%rcx
  mov    -0x18(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <rs_encode@plt>
  mov    $0x0,%eax
  call   <rs_free@plt>
  movl   $0x0,-0x30(%rbp)
  jmp    L124
L19:
  mov    -0x14(%rbp),%eax
  sub    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0xf(%rbp,%rax,1),%eax
  movzbl %al,%eax
  mov    -0x38(%rbp),%rdx
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <bin_append@plt>
  addl   $0x1,-0x30(%rbp)
L124:
  mov    -0x30(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L19
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L176
  call   <__stack_chk_fail@plt>
L176:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D39
type: string
name: read_data
arguments: data_label: D3
type: string
name: read_data
arguments: data_label: D29
type: string
name: read_data
arguments: data_label: D20
type: string

tool: D39: 0

tool: D3: 000

tool: D29: 00010001

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