user: 请从给定的汇编指令推导出C源代码：

```asm
<micro_qr_intermediate>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x68,%rsp
  mov    0xa0(%rsp),%rax
  mov    %rsi,0x28(%rsp)
  lea    D111(%rip),%rsi
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x30(%rsp)
  mov    %r9,0x38(%rsp)
  mov    %rax,0x40(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  call   <strcpy@plt>
  mov    0xa8(%rsp),%r10d
  test   %r10d,%r10d
  je     L450
  mov    %rbx,%rax
  mov    %r14,%rbp
  add    %r14,%rbx
  test   %rax,%rax
  je     L342
  nopl   0x0(%rax,%rax,1)
L201:
  movsbl 0x0(%rbp),%edi
  add    $0x1,%rbp
  call   <putchar@plt>
  cmp    %rbx,%rbp
  jne    L201
L342:
  mov    $0xa,%edi
  call   <putchar@plt>
L450:
  xor    %r12d,%r12d
L357:
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x80,%eax
  jg     L505
  mov    0x20(%rsp),%rdi
  movslq %r12d,%r13
  mov    0x10(%rsp),%rcx
  xor    %r14d,%r14d
  lea    0x1(%r13),%rbx
  lea    (%rdi,%r13,1),%rax
  mov    %rax,0x8(%rsp)
  movzbl (%rax),%edx
  jmp    L277
  nopl   0x0(%rax)
L314:
  lea    0x1(%rbx),%rax
  cmp    %dl,(%rdi,%rbx,1)
  jne    L6
  mov    %rax,%rbx
L277:
  movslq %r14d,%rbp
  add    $0x1,%r14d
  lea    (%r12,%r14,1),%esi
  cmp    %rbx,%rcx
  ja     L314
L6:
  mov    %esi,0x1c(%rsp)
  cmp    $0x4b,%dl
  je     L205
  jg     L109
  cmp    $0x41,%dl
  je     L210
  cmp    $0x42,%dl
  jne    L539
  lea    D34(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  mov    0x40(%rsp),%rax
  mov    %r15,%rdi
  lea    0x56(%rsp),%rsi
  mov    %r14b,0x56(%rsp)
  movl   $0x1,(%rax)
  movb   $0x0,0x57(%rsp)
  call   <strcat@plt>
  mov    0xa8(%rsp),%edi
  test   %edi,%edi
  jne    L430
L300:
  mov    0x28(%rsp),%rax
  add    %r13,%rbp
  mov    0xa8(%rsp),%r14d
  lea    (%rax,%r13,4),%r12
  lea    0x4(%rax,%rbp,4),%rbp
  jmp    L131
  nopl   0x0(%rax)
L198:
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x80,%eax
  jg     L505
L432:
  add    $0x4,%r12
  cmp    %r12,%rbp
  je     L537
L131:
  mov    (%r12),%r13d
  mov    %r15,%rdx
  mov    $0x8,%esi
  mov    %r13d,%edi
  call   <bin_append@plt>
  test   %r14d,%r14d
  je     L198
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  mov    %r13d,%esi
  call   <printf@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x80,%eax
  jle    L432
  nopl   (%rax)
L505:
  mov    $0x5,%eax
L478:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L326
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L109:
  cmp    $0x4e,%dl
  jne    L539
  lea    D98(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    0x56(%rsp),%rsi
  mov    %r15,%rdi
  mov    %r14b,0x56(%rsp)
  movb   $0x0,0x57(%rsp)
  call   <strcat@plt>
  mov    0xa8(%rsp),%edx
  test   %edx,%edx
  jne    L272
L466:
  mov    0x28(%rsp),%rax
  mov    %rbx,0x48(%rsp)
  xor    %r12d,%r12d
  mov    0x8(%rsp),%rbx
  mov    %ebp,0x8(%rsp)
  lea    (%rax,%r13,4),%r13
  jmp    L498
  nopw   0x0(%rax,%rax,1)
L266:
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x80,%eax
  jg     L505
  add    $0x3,%r12
  add    $0xc,%r13
  cmp    %r12d,%r14d
  jle    L170
L498:
  movsbl 0x0(%r13),%esi
  lea    D3(%rip),%rdi
  call   <posn@plt>
  mov    %eax,%ebp
  mov    $0x1,%eax
  cmp    %r12d,0x8(%rsp)
  jle    L391
  cmpb   $0x4e,0x1(%rbx,%r12,1)
  je     L10
L391:
  lea    0x2(%r12),%edx
  cmp    %edx,%r14d
  jle    L438
  cmpb   $0x4e,0x2(%rbx,%r12,1)
  je     L0
L438:
  lea    0x1(%rax,%rax,2),%esi
L287:
  mov    %r15,%rdx
  mov    %ebp,%edi
  call   <bin_append@plt>
  mov    0xa8(%rsp),%eax
  test   %eax,%eax
  je     L266
  mov    %ebp,%edx
  mov    %ebp,%esi
  lea    D49(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L266
  nopl   (%rax)
L170:
  mov    0x48(%rsp),%rbx
L537:
  mov    0xa8(%rsp),%r8d
  test   %r8d,%r8d
  je     L539
  mov    $0xa,%edi
  call   <putchar@plt>
  nopl   0x0(%rax)
L539:
  mov    0x10(%rsp),%rax
  sub    $0x1,%rax
  cmp    %rbx,%rax
  jbe    L50
  mov    0x1c(%rsp),%r12d
  jmp    L357
  nopl   0x0(%rax)
L0:
  movsbl 0x8(%r13),%esi
  lea    D3(%rip),%rdi
  call   <posn@plt>
  lea    0x0(%rbp,%rbp,4),%edx
  mov    $0xa,%esi
  lea    (%rax,%rdx,2),%ebp
  jmp    L287
  nopw   0x0(%rax,%rax,1)
L205:
  lea    D70(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  mov    0x30(%rsp),%rax
  lea    0x56(%rsp),%rsi
  mov    %r15,%rdi
  mov    %r14b,0x56(%rsp)
  movl   $0x1,(%rax)
  movb   $0x0,0x57(%rsp)
  call   <strcat@plt>
  mov    0xa8(%rsp),%r9d
  test   %r9d,%r9d
  jne    L512
L111:
  mov    0x28(%rsp),%rax
  add    %r13,%rbp
  lea    (%rax,%r13,4),%r12
  lea    0x4(%rax,%rbp,4),%rbp
  mov    0xa8(%rsp),%r13d
  jmp    L43
  nopl   (%rax)
L329:
  mov    %edx,%eax
L98:
  mov    %eax,%edx
  movzbl %al,%eax
  mov    $0xd,%esi
  sar    $0x8,%edx
  lea    (%rdx,%rdx,2),%r14d
  mov    %r15,%rdx
  shl    $0x6,%r14d
  add    %eax,%r14d
  mov    %r14d,%edi
  call   <bin_append@plt>
  test   %r13d,%r13d
  jne    L388
L223:
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x80,%eax
  jg     L505
  add    $0x4,%r12
  cmp    %r12,%rbp
  je     L537
L43:
  mov    (%r12),%eax
  lea    -0x8140(%rax),%edx
  cmp    $0x1ebc,%edx
  jbe    L329
  lea    -0xe040(%rax),%ecx
  lea    -0xc140(%rax),%edx
  cmp    $0xb80,%ecx
  cmovb  %edx,%eax
  jmp    L98
  nopl   0x0(%rax,%rax,1)
L388:
  mov    %r14d,%esi
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L223
  nopl   0x0(%rax,%rax,1)
L210:
  lea    D55(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  mov    0x38(%rsp),%rax
  lea    0x56(%rsp),%rsi
  mov    %r15,%rdi
  mov    %r14b,0x56(%rsp)
  movl   $0x1,(%rax)
  movb   $0x0,0x57(%rsp)
  call   <strcat@plt>
  mov    0xa8(%rsp),%esi
  test   %esi,%esi
  jne    L267
L269:
  mov    0x28(%rsp),%rax
  mov    %rbx,0x48(%rsp)
  xor    %r12d,%r12d
  lea    (%rax,%r13,4),%rax
  mov    %rax,%rbx
  jmp    L405
  xchg   %ax,%ax
L549:
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x80,%eax
  jg     L505
  add    $0x2,%r12
  cmp    %r12d,%r14d
  jle    L170
L405:
  movsbl (%rbx,%r12,4),%esi
  lea    D90(%rip),%rdi
  call   <posn@plt>
  mov    $0x6,%esi
  mov    %eax,%r13d
  cmp    %r12d,%ebp
  jle    L215
  mov    0x8(%rsp),%rax
  cmpb   $0x41,0x1(%rax,%r12,1)
  je     L175
L215:
  mov    %r15,%rdx
  mov    %r13d,%edi
  call   <bin_append@plt>
  mov    0xa8(%rsp),%ecx
  test   %ecx,%ecx
  je     L549
  mov    %r13d,%esi
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L549
  nopl   0x0(%rax)
L10:
  movsbl 0x4(%r13),%esi
  lea    D3(%rip),%rdi
  call   <posn@plt>
  lea    0x0(%rbp,%rbp,4),%edx
  lea    (%rax,%rdx,2),%ebp
  mov    $0x2,%eax
  jmp    L391
  nopw   0x0(%rax,%rax,1)
L175:
  movsbl 0x4(%rbx,%r12,4),%esi
  lea    D90(%rip),%rdi
  call   <posn@plt>
  imul   $0x2d,%r13d,%r8d
  mov    $0xb,%esi
  lea    (%r8,%rax,1),%r13d
  jmp    L215
L430:
  mov    %r14d,%esi
  lea    D22(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L300
L272:
  mov    %r14d,%esi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L466
L512:
  mov    %r14d,%esi
  lea    D28(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L111
L267:
  mov    %r14d,%esi
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L269
L50:
  xor    %eax,%eax
  jmp    L478
L326:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D111
type_infered: string
name: disassemble_data
arguments: label: D34
type_infered: string
name: disassemble_data
arguments: label: D67
type_infered: string
name: disassemble_data
arguments: label: D98
type_infered: string
name: disassemble_data
arguments: label: D3
type_infered: string
name: disassemble_data
arguments: label: D49
type_infered: string
name: disassemble_data
arguments: label: D70
type_infered: string
name: disassemble_data
arguments: label: D55
type_infered: string
name: disassemble_data
arguments: label: D90
type_infered: string
name: disassemble_data
arguments: label: D22
type_infered: string
name: disassemble_data
arguments: label: D5
type_infered: string
name: disassemble_data
arguments: label: D28
type_infered: string
name: disassemble_data
arguments: label: D60
type_infered: string

tool: 

tool: D34: B

tool: D67: 0x%4X 

tool: D98: N

tool: D3: 0123456789

tool: D49: 0x%4X (%d)

tool: D70: K

tool: D55: A

tool: D90: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:

tool: D22: Byte block (length %d)
	

tool: D5: Number block (length %d)
	

tool: D28: Kanji block (length %d)
	

tool: D60: Alpha block (length %d)
	

assistant: ```c
int micro_qr_intermediate(char binary[], const int jisdata[], const char mode[], const size_t length, int *kanji_used, int *alphanum_used, int *byte_used, const int debug) {
  int position = 0;
  int i;
  char buffer[2];
  strcpy(binary, "");
  if (debug) {
    for (i = 0; i < length; i++) {
      printf("%c", mode[i]);
    }
    printf("\n");
  }
  do {
    char data_block;
    int short_data_block_length = 0;
    if (strlen(binary) > 128) {
      return 5;
    }
    data_block = mode[position];
    do {
      short_data_block_length++;
    } while (((short_data_block_length + position) < length) && (mode[position + short_data_block_length] == data_block));
    switch (data_block) {
    case 'K':
      strcat(binary, "K");
      *kanji_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Kanji block (length %d)\n\t", short_data_block_length);
      }
      for (i = 0; i < short_data_block_length; i++) {
        int jis = jisdata[position + i];
        int prod;
        if (jis >= 0x8140 && jis <= 0x9ffc)
          jis -= 0x8140;
        else if (jis >= 0xe040 && jis <= 0xebbf)
          jis -= 0xc140;
        prod = ((jis >> 8) * 0xc0) + (jis & 0xff);
        bin_append(prod, 13, binary);
        if (debug) {
          printf("0x%4X ", prod);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
      }
      if (debug) {
        printf("\n");
      }
      break;
    case 'B':
      strcat(binary, "B");
      *byte_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Byte block (length %d)\n\t", short_data_block_length);
      }
      for (i = 0; i < short_data_block_length; i++) {
        int byte = jisdata[position + i];
        bin_append(byte, 8, binary);
        if (debug) {
          printf("0x%4X ", byte);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
      }
      if (debug) {
        printf("\n");
      }
      break;
    case 'A':
      strcat(binary, "A");
      *alphanum_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Alpha block (length %d)\n\t", short_data_block_length);
      }
      i = 0;
      while (i < short_data_block_length) {
        int count;
        int first = 0, prod;
        first = posn("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", (char)jisdata[position + i]);
        count = 1;
        prod = first;
        if (i + 1 < short_data_block_length && mode[position + i + 1] == 'A') {
          int second = posn("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", (char)jisdata[position + i + 1]);
          count = 2;
          prod = (first * 45) + second;
        }
        bin_append(prod, 1 + (5 * count), binary);
        if (debug) {
          printf("0x%4X ", prod);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
        i += 2;
      };
      if (debug) {
        printf("\n");
      }
      break;
    case 'N':
      strcat(binary, "N");
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Number block (length %d)\n\t", short_data_block_length);
      }
      i = 0;
      while (i < short_data_block_length) {
        int count;
        int first = 0, prod;
        first = posn("0123456789", (char)jisdata[position + i]);
        count = 1;
        prod = first;
        if (i + 1 < short_data_block_length && mode[position + i + 1] == 'N') {
          int second = posn("0123456789", (char)jisdata[position + i + 1]);
          count = 2;
          prod = (prod * 10) + second;
        }
        if (i + 2 < short_data_block_length && mode[position + i + 2] == 'N') {
          int third = posn("0123456789", (char)jisdata[position + i + 2]);
          count = 3;
          prod = (prod * 10) + third;
        }
        bin_append(prod, 1 + (3 * count), binary);
        if (debug) {
          printf("0x%4X (%d)", prod, prod);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
        i += 3;
      };
      if (debug) {
        printf("\n");
      }
      break;
    }
    position += short_data_block_length;
  } while (position < length - 1);
  return 0;
}
```