user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<micro_qr_m3>:
  endbr64
  push   %r15
  mov    $0x54,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%esi
  mov    $0x44,%eax
  cmove  %eax,%r15d
  call   <strlen@plt>
  mov    %r15d,%r14d
  sub    %eax,%r14d
  cmp    $0x7,%r14d
  jg     L278
  xor    %r12d,%r12d
  lea    D26(%rip),%r13
  test   %r14d,%r14d
  jle    L377
  nopl   (%rax)
L66:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <strcat@plt>
  cmp    %r12d,%r14d
  jne    L66
L377:
  xor    %esi,%esi
  cmp    $0x2,%ebx
  lea    0xc(%rsp),%r14
  movq   $0x0,0xc(%rsp)
  setne  %sil
  lea    0x10(%rsp),%rdi
  sete   %r13b
  setne  %r12b
  lea    0x8(%rsi,%rsi,1),%eax
  movzbl %r13b,%r13d
  movzbl %r12b,%r12d
  xor    %r8d,%r8d
  mov    %rax,%rsi
  lea    0x6(%r13,%r13,1),%r13d
  lea    0x9(%r12,%r12,1),%r12d
  movq   $0x0,0x4(%rsp,%rax,1)
  mov    %r14,%rax
  sub    %rdi,%rax
  add    %esi,%eax
  and    $0xfffffff8,%eax
  cmp    $0x8,%eax
  jb     L362
  and    $0xfffffff8,%eax
  mov    %eax,%edx
  xor    %eax,%eax
L58:
  mov    %eax,%ecx
  add    $0x8,%eax
  mov    %r8,(%rdi,%rcx,1)
  cmp    %edx,%eax
  jb     L58
L362:
  lea    -0x1(%rsi),%edx
  mov    %rbp,%rax
  mov    %r14,%rcx
  mov    $0xffffffc0,%r10d
  lea    0xd(%rsp,%rdx,1),%r11
  mov    $0x40,%r9d
  mov    $0xffffff80,%r8d
  xor    %edi,%edi
  nopl   0x0(%rax,%rax,1)
L202:
  cmpb   $0x31,(%rax)
  mov    %edi,%edx
  mov    %r9d,%esi
  cmove  %r8d,%edx
  cmove  %r10d,%esi
  cmpb   $0x31,0x1(%rax)
  mov    %dl,(%rcx)
  jne    L256
  mov    %sil,(%rcx)
  mov    %esi,%edx
L256:
  cmpb   $0x31,0x2(%rax)
  jne    L129
  add    $0x20,%edx
  mov    %dl,(%rcx)
L129:
  cmpb   $0x31,0x3(%rax)
  jne    L59
  add    $0x10,%edx
  mov    %dl,(%rcx)
L59:
  cmpb   $0x31,0x4(%rax)
  jne    L281
  add    $0x8,%edx
  mov    %dl,(%rcx)
L281:
  cmpb   $0x31,0x5(%rax)
  jne    L25
  add    $0x4,%edx
  mov    %dl,(%rcx)
L25:
  cmpb   $0x31,0x6(%rax)
  jne    L85
  add    $0x2,%edx
  mov    %dl,(%rcx)
L85:
  cmpb   $0x31,0x7(%rax)
  jne    L93
  add    $0x1,%edx
  mov    %dl,(%rcx)
L93:
  add    $0x1,%rcx
  add    $0x8,%rax
  cmp    %r11,%rcx
  jne    L202
  cmp    $0x1,%ebx
  je     L156
  cmp    $0x2,%ebx
  jne    L117
  cmpb   $0x31,0x40(%rbp)
  mov    $0xffffff80,%eax
  mov    $0x0,%edx
  movb   $0x0,0x14(%rsp)
  cmovne %edx,%eax
  sete   %cl
  cmpb   $0x31,0x41(%rbp)
  jne    L339
  add    $0x40,%eax
  mov    $0x1,%ecx
L339:
  cmpb   $0x31,0x42(%rbp)
  je     L201
  cmpb   $0x31,0x43(%rbp)
  je     L115
  test   %cl,%cl
  jne    L145
  nopl   (%rax)
L117:
  mov    $0x11d,%edi
  lea    0x3(%rsp),%rbx
  call   <rs_init_gf@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  call   <rs_init_code@plt>
  mov    %rbx,%rdx
  mov    %r12d,%edi
  mov    %r14,%rsi
  call   <rs_encode@plt>
  xor    %eax,%eax
  call   <rs_free@plt>
  movslq %r13d,%rax
  lea    0x2(%rsp,%rax,1),%r12
  add    %rax,%rbx
  lea    -0x1(%r13),%eax
  sub    %rax,%r12
  nopl   0x0(%rax,%rax,1)
L287:
  movzbl -0x1(%rbx),%esi
  mov    $0x80,%edx
  mov    %rbp,%rdi
  sub    $0x1,%rbx
  call   <qr_diran@plt>
  cmp    %r12,%rbx
  jne    L287
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L349
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L156:
  cmpb   $0x31,0x50(%rbp)
  mov    $0xffffff80,%eax
  mov    $0x0,%edx
  movb   $0x0,0x16(%rsp)
  cmovne %edx,%eax
  sete   %cl
  cmpb   $0x31,0x51(%rbp)
  jne    L19
  add    $0x40,%eax
  mov    $0x1,%ecx
L19:
  cmpb   $0x31,0x52(%rbp)
  je     L32
  cmpb   $0x31,0x53(%rbp)
  je     L89
  test   %cl,%cl
  je     L117
  jmp    L176
  nopl   (%rax)
L278:
  lea    D67(%rip),%rsi
  mov    %rbp,%rdi
  mov    %r15d,%r14d
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  sub    %eax,%r14d
  cmp    $0x4,%r14d
  jg     L168
  xor    %r12d,%r12d
  lea    D26(%rip),%r13
  test   %r14d,%r14d
  jle    L377
L354:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <strcat@plt>
  cmp    %r12d,%r14d
  jne    L354
  jmp    L377
L168:
  mov    %rbp,%rdi
  mov    $0x0,%r12d
  lea    D26(%rip),%r13
  call   <strlen@plt>
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %eax,%edx
  lea    0x8(%rdx),%r14d
  je     L127
  nopl   (%rax)
L96:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <strcat@plt>
  cmp    %r12d,%r14d
  jne    L96
L127:
  mov    %rbp,%rdi
  call   <strlen@plt>
  sub    %eax,%r15d
  cmp    $0x4,%r15d
  jle    L180
  lea    -0x4(%r15),%r13d
  xor    %r12d,%r12d
  lea    D52(%rip),%rsi
  sar    $0x3,%r13d
  lea    D11(%rip),%r15
  mov    %rsi,%r14
  jne    L45
  jmp    L180
  nopl   (%rax)
L288:
  test   $0x1,%r12b
  mov    %r14,%rsi
  cmovne %r15,%rsi
L45:
  mov    %rbp,%rdi
  add    $0x1,%r12d
  call   <strcat@plt>
  cmp    %r12d,%r13d
  jne    L288
L180:
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L377
L32:
  add    $0x20,%eax
  cmpb   $0x31,0x53(%rbp)
  jne    L176
L89:
  add    $0x10,%eax
L176:
  mov    %al,0x16(%rsp)
  jmp    L117
L201:
  add    $0x20,%eax
  cmpb   $0x31,0x43(%rbp)
  jne    L145
L115:
  add    $0x10,%eax
L145:
  mov    %al,0x14(%rsp)
  jmp    L117
L349:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D26
type: string
name: retrieve_data
arguments: tag: D67
type: string
name: retrieve_data
arguments: tag: D52
type: string
name: retrieve_data
arguments: tag: D11
type: string
name: retrieve_data
arguments: tag: D7
type: string

tool: D26: 0

tool: D67: 0000000

tool: D52: 11101100

tool: D11: 00010001

tool: D7: 0000

assistant: ```c
void micro_qr_m3(char binary_data[], int ecc_mode) {
  int i, j, latch;
  int bits_total, bits_left, remainder;
  int data_codewords, ecc_codewords;
  unsigned char data_blocks[12], ecc_blocks[9];
  latch = 0;
  if (ecc_mode == 1) {
    bits_total = 84;
  }
  if (ecc_mode == 2) {
    bits_total = 68;
  }
  bits_left = bits_total - strlen(binary_data);
  if (bits_left <= 7) {
    for (i = 0; i < bits_left; i++) {
      strcat(binary_data, "0");
    }
    latch = 1;
  } else {
    strcat(binary_data, "0000000");
  }
  if (latch == 0) {
    bits_left = bits_total - strlen(binary_data);
    if (bits_left <= 4) {
      for (i = 0; i < bits_left; i++) {
        strcat(binary_data, "0");
      }
      latch = 1;
    }
  }
  if (latch == 0) {
    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 - 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");
      }
    }
    strcat(binary_data, "0000");
  }
  if (ecc_mode == 1) {
    data_codewords = 11;
    ecc_codewords = 6;
  }
  if (ecc_mode == 2) {
    data_codewords = 9;
    ecc_codewords = 8;
  }
  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;
      }
    }
  }
  if (ecc_mode == 1) {
    data_blocks[10] = 0;
    for (j = 0; j < 4; j++) {
      if (binary_data[80 + j] == '1') {
        data_blocks[10] += 0x80 >> j;
      }
    }
  }
  if (ecc_mode == 2) {
    data_blocks[8] = 0;
    for (j = 0; j < 4; j++) {
      if (binary_data[64 + j] == '1') {
        data_blocks[8] += 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++) {
    qr_diran(binary_data, ecc_blocks[ecc_codewords - i - 1], 0x80);
  }
  return;
}
```