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

```asm
<challenge3>:
  endbr64
  push   %rbp
  lea    D12(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    -0x80(%rbp),%r12
  push   %rbx
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <puts@plt>
  movdqa D63(%rip),%xmm0
  mov    %r12,%rdi
  movb   $0x0,-0x3c(%rbp)
  movl   $0x36333733,-0x40(%rbp)
  movaps %xmm0,-0x80(%rbp)
  movdqa D2(%rip),%xmm0
  movaps %xmm0,-0x70(%rbp)
  movdqa D61(%rip),%xmm0
  movaps %xmm0,-0x60(%rbp)
  movdqa D24(%rip),%xmm0
  movaps %xmm0,-0x50(%rbp)
  call   <counthex@plt>
  mov    %rsp,%rdx
  movslq %eax,%r13
  lea    0xf(%r13),%rbx
  mov    %r13,%r15
  mov    %rbx,%rcx
  mov    %rbx,%rax
  and    $0xfffffffffffff000,%rcx
  and    $0xfffffffffffffff0,%rax
  sub    %rcx,%rdx
  cmp    %rdx,%rsp
  je     L112
L128:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L128
L112:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L50
L28:
  mov    %rsp,%rsi
  mov    %r12,%rdi
  mov    %rsp,-0xa8(%rbp)
  call   <str2hex@plt>
  mov    %r15d,%esi
  mov    %rsp,%rdi
  call   <printhex@plt>
  mov    %rbx,%rax
  mov    %rsp,%rdx
  and    $0xfffffffffffff000,%rbx
  sub    %rbx,%rdx
  and    $0xfffffffffffffff0,%rax
  cmp    %rdx,%rsp
  je     L158
L129:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L129
L158:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L121
L75:
  lea    0x1(%r15),%eax
  xor    %edx,%edx
  test   %r15d,%r15d
  mov    %r13,%r8
  cltq
  cmovns %r15d,%edx
  mov    %rsp,%r12
  movl   $0x0,-0x9c(%rbp)
  lea    0xf(%rax),%r11
  mov    %r11,%r14
  and    $0xff0,%r11d
  mov    %edx,-0xa0(%rbp)
  xor    %edx,%edx
  lea    -0x8(%r11),%rax
  and    $0xfffffffffffff000,%r14
  mov    %r11,%r9
  mov    %rax,-0xb0(%rbp)
  mov    %r14,%r13
  mov    %edx,%r14d
  nopw   0x0(%rax,%rax,1)
L148:
  mov    %rsp,%rax
  mov    %rsp,%r10
  sub    %r13,%rax
  cmp    %rax,%rsp
  je     L132
L107:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L107
L132:
  sub    %r9,%rsp
  test   %r9,%r9
  je     L111
  mov    -0xb0(%rbp),%rax
  orq    $0x0,(%rsp,%rax,1)
L111:
  mov    -0xa8(%rbp),%rdi
  mov    %rsp,%rcx
  mov    %r14d,%edx
  mov    %r15d,%esi
  mov    %r8,-0x98(%rbp)
  mov    %rsp,%rbx
  mov    %r9,-0x90(%rbp)
  mov    %r10,-0x88(%rbp)
  call   <xorarray@plt>
  mov    %rsp,%rdi
  call   <scorearray@plt>
  cmp    -0x9c(%rbp),%eax
  mov    -0x88(%rbp),%r10
  mov    -0x90(%rbp),%r9
  mov    -0x98(%rbp),%r8
  mov    %eax,%edi
  jg     L64
L169:
  add    $0x1,%r14d
  mov    %r10,%rsp
  cmp    $0x100,%r14d
  jne    L148
  mov    -0x9c(%rbp),%esi
  lea    D25(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %r12,%rsi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L150
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L50:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L28
  nopl   (%rax)
L64:
  test   %r15d,%r15d
  jle    L86
  xor    %eax,%eax
  nop
L59:
  movzbl (%rbx,%rax,1),%edx
  mov    %dl,(%r12,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L59
L86:
  movslq -0xa0(%rbp),%rax
  mov    %edi,-0x9c(%rbp)
  movb   $0x0,(%r12,%rax,1)
  jmp    L169
L121:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L75
L150:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D12
type: string
name: disassemble_data
arguments: tag: D63
type: byte[16]
name: disassemble_data
arguments: tag: D2
type: byte[16]
name: disassemble_data
arguments: tag: D61
type: byte[16]
name: disassemble_data
arguments: tag: D24
type: byte[16]
name: disassemble_data
arguments: tag: D25
type: string
name: disassemble_data
arguments: tag: D5
type: string

tool: D12: 
challenge 3:

tool: {"D63": [0x31,0x62,0x33,0x37,0x33,0x37,0x33,0x33,0x33,0x31,0x33,0x36,0x33,0x66,0x37,0x38]}

tool: {"D2": [0x31,0x35,0x31,0x62,0x37,0x66,0x32,0x62,0x37,0x38,0x33,0x34,0x33,0x31,0x33,0x33]}

tool: {"D61": [0x33,0x64,0x37,0x38,0x33,0x39,0x37,0x38,0x32,0x38,0x33,0x37,0x32,0x64,0x33,0x36]}

tool: {"D24": [0x33,0x63,0x37,0x38,0x33,0x37,0x33,0x65,0x37,0x38,0x33,0x61,0x33,0x39,0x33,0x62]}

tool: D25: topscore = '%d'


tool: D5: result = '%s'


assistant: ```c
void challenge3() {
  printf("\nchallenge 3:\n");
  char in[] = "1b37373331363f78151b7f2b783431333d"
              "78397828372d363c78373e783a393b3736";
  int size = counthex(in);
  unsigned char hex[size];
  str2hex(in, hex);
  printhex(hex, size);
  int topscore = 0;
  char top[size];
  int c;
  for (c = 0; c <= 255; c++) {
    char current[size + 1];
    xorarray(hex, size, c, current);
    int score = scorearray(current);
    if (score > topscore) {
      topscore = score;
      int i;
      for (i = 0; i < size; i++)
        top[i] = current[i];
      top[i] = '\0';
    }
  }
  printf("topscore = '%d'\n", topscore);
  printf("result = '%s'\n", top);
}
```