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

```asm
<evaluate>:
  endbr64
  push   %rbp
  mov    %rdi,%r8
  mov    %edx,%ecx
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    %esi,%eax
  mov    %rsp,%rdi
  imul   %esi,%eax
  mov    %eax,-0x84(%rbp)
  cltq
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rdi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rdi,%rsp
  je     L185
L215:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdi,%rsp
  jne    L215
L185:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L521
L890:
  mov    %rsp,%r15
  lea    -0x1(%rsi),%r11d
  test   %esi,%esi
  jle    L775
  movslq %esi,%rdx
  xor    %r10d,%r10d
  xchg   %ax,%ax
L209:
  mov    %r10,%rdi
  xor    %r9d,%r9d
  cs nopw 0x0(%rax,%rax,1)
L803:
  movzbl (%r8,%rdi,1),%eax
  sar    %cl,%eax
  and    $0x1,%eax
  add    $0x30,%eax
  mov    %al,(%r15,%rdi,1)
  mov    %r9d,%eax
  lea    0x1(%r9),%r9d
  add    %rdx,%rdi
  cmp    %r9d,%esi
  jne    L803
  add    $0x1,%r10
  cmp    %rdx,%r10
  jne    L209
  mov    %r15,%rbx
  mov    %r15,%r12
  xor    %r14d,%r14d
  xor    %r13d,%r13d
  nopl   (%rax)
L294:
  movzbl (%r12),%edi
  mov    %r12,%rcx
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  jmp    L170
  nopl   0x0(%rax,%rax,1)
L84:
  cmp    $0x5,%r9d
  jle    L307
  lea    -0x2(%r14,%r9,1),%r14d
  xor    %r9d,%r9d
L760:
  lea    0x1(%r8),%r10d
  add    %rdx,%rcx
  cmp    %r8d,%eax
  je     L276
L428:
  mov    %r10d,%r8d
L170:
  mov    %edi,%r10d
  movzbl (%rcx),%edi
  cmp    %dil,%r10b
  jne    L84
  add    $0x1,%r9d
  lea    0x1(%r8),%r10d
  add    %rdx,%rcx
  cmp    %r8d,%eax
  jne    L428
L276:
  lea    -0x2(%r14,%r9,1),%ecx
  cmp    $0x5,%r9d
  cmovg  %ecx,%r14d
  lea    0x1(%r13),%ecx
  add    $0x1,%r12
  cmp    %eax,%r13d
  je     L858
  mov    %ecx,%r13d
  jmp    L294
  nopw   0x0(%rax,%rax,1)
L307:
  xor    %r9d,%r9d
  jmp    L760
L858:
  lea    (%r15,%rdx,1),%r10
  xor    %r12d,%r12d
  mov    %r14d,%r13d
  nop
L742:
  movzbl (%rbx),%edi
  mov    %rbx,%rcx
  xor    %r8d,%r8d
  jmp    L245
  nopl   0x0(%rax,%rax,1)
L291:
  cmp    $0x5,%r8d
  jle    L520
  lea    -0x2(%r8,%r13,1),%r13d
  xor    %r8d,%r8d
L754:
  add    $0x1,%rcx
  cmp    %r10,%rcx
  je     L634
L245:
  mov    %edi,%r9d
  movzbl (%rcx),%edi
  cmp    %dil,%r9b
  jne    L291
  add    $0x1,%rcx
  add    $0x1,%r8d
  cmp    %r10,%rcx
  jne    L245
L634:
  lea    -0x2(%r8,%r13,1),%edi
  cmp    $0x5,%r8d
  lea    (%rcx,%rdx,1),%r10
  cmovg  %edi,%r13d
  lea    0x1(%r12),%edi
  add    %rdx,%rbx
  cmp    %r12d,%eax
  je     L36
  mov    %edi,%r12d
  jmp    L742
  nopw   0x0(%rax,%rax,1)
L520:
  xor    %r8d,%r8d
  jmp    L754
L36:
  mov    %r13d,-0x6c(%rbp)
  test   %r11d,%r11d
  jle    L385
L163:
  mov    -0x6c(%rbp),%r13d
  mov    %rdx,%rbx
  xor    %r10d,%r10d
L679:
  lea    (%r15,%r10,1),%rax
  lea    0x1(%r10),%ecx
  xor    %edi,%edi
  jmp    L843
  nopl   0x0(%rax)
L76:
  add    %rdx,%rax
  mov    %r9d,%ecx
  cmp    %r11d,%edi
  jge    L31
L843:
  mov    %rax,%r12
  movzbl (%rax),%r8d
  add    $0x1,%edi
  lea    (%rcx,%rsi,1),%r9d
  sub    %r10,%r12
  cmp    (%r12,%rbx,1),%r8b
  jne    L76
  movslq %ecx,%rcx
  cmp    (%r15,%rcx,1),%r8b
  jne    L76
  movslq %r9d,%rcx
  cmp    (%r15,%rcx,1),%r8b
  jne    L76
  add    $0x3,%r13d
  add    %rdx,%rax
  mov    %r9d,%ecx
  cmp    %r11d,%edi
  jl     L843
  nopl   0x0(%rax,%rax,1)
L31:
  add    $0x1,%r10
  add    $0x1,%rbx
  cmp    %r10d,%r11d
  jg     L679
  mov    %r13d,-0x6c(%rbp)
  test   %esi,%esi
  jle    L586
L385:
  lea    -0x7(%rsi),%eax
  lea    0x0(,%rsi,4),%edi
  mov    %rdx,-0x58(%rbp)
  xor    %r12d,%r12d
  mov    %eax,-0x7c(%rbp)
  lea    (%rsi,%rsi,1),%eax
  movslq %edi,%rbx
  lea    (%rdi,%rsi,1),%r8d
  lea    (%rax,%rsi,1),%ecx
  mov    %rbx,-0x48(%rbp)
  movslq %eax,%rbx
  neg    %eax
  lea    (%rcx,%rcx,1),%r13d
  movslq %ecx,%rcx
  mov    %eax,-0x78(%rbp)
  lea    0x3(%rsi),%eax
  mov    %rcx,-0x50(%rbp)
  lea    (%rsi,%rsi,8),%ecx
  movslq %r13d,%r13
  movslq %r8d,%r14
  mov    %ecx,-0x80(%rbp)
  movl   $0x0,-0x70(%rbp)
  mov    %eax,-0x60(%rbp)
  mov    %r15,-0x68(%rbp)
  mov    %rdx,%r15
  nopl   0x0(%rax)
L378:
  mov    -0x7c(%rbp),%edx
  test   %edx,%edx
  jle    L788
  mov    -0x68(%rbp),%rax
  mov    -0x80(%rbp),%r9d
  mov    $0xa,%ecx
  mov    -0x78(%rbp),%r8d
  lea    (%rax,%r12,1),%rdi
  mov    -0x70(%rbp),%eax
  add    %eax,%r9d
  add    %eax,%r8d
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L131:
  add    -0x58(%rbp),%rdi
  add    $0x1,%ecx
  mov    %r10d,%r9d
  mov    %r11d,%r8d
  cmp    %ecx,-0x60(%rbp)
  je     L788
L32:
  xor    %edx,%edx
  mov    %rdi,%rax
  cmpb   $0x31,(%rdi)
  sete   %dl
  sub    %r12,%rax
  shl    $0x6,%edx
  cmpb   $0x31,(%rax,%r15,1)
  jne    L264
  add    $0x20,%edx
L264:
  cmpb   $0x31,(%rax,%rbx,1)
  jne    L857
  add    $0x10,%edx
L857:
  mov    -0x50(%rbp),%r11
  cmpb   $0x31,(%rax,%r11,1)
  jne    L439
  add    $0x8,%edx
L439:
  mov    -0x48(%rbp),%r11
  cmpb   $0x31,(%rax,%r11,1)
  jne    L59
  add    $0x4,%edx
L59:
  cmpb   $0x31,(%rax,%r14,1)
  jne    L65
  add    $0x2,%edx
L65:
  cmpb   $0x31,(%rax,%r13,1)
  lea    (%rsi,%r8,1),%r11d
  lea    (%r9,%rsi,1),%r10d
  jne    L131
  cmp    $0x5c,%edx
  jne    L131
  mov    %ecx,%eax
  mov    $0x1,%edx
  sub    $0xe,%eax
  js     L640
  mov    -0x78(%rbp),%eax
  mov    -0x68(%rbp),%rdx
  add    %r8d,%eax
  cltq
  cmpb   $0x30,(%rdx,%rax,1)
  sete   %dl
  movzbl %dl,%edx
L640:
  mov    %ecx,%r11d
  lea    0x1(%rdx),%eax
  sub    $0xd,%r11d
  js     L168
  mov    %r8d,%r10d
  mov    -0x68(%rbp),%r11
  xor    %eax,%eax
  sub    %esi,%r10d
  movslq %r10d,%r10
  cmpb   $0x30,(%r11,%r10,1)
  jne    L168
  lea    0x1(%rdx),%eax
L168:
  mov    %ecx,%r11d
  lea    0x1(%rax),%edx
  sub    $0xc,%r11d
  js     L596
  mov    -0x68(%rbp),%r11
  movslq %r8d,%r10
  xor    %edx,%edx
  cmpb   $0x30,(%r11,%r10,1)
  jne    L596
  lea    0x1(%rax),%edx
L596:
  cmp    $0xa,%ecx
  je     L899
  mov    -0x68(%rbp),%r10
  lea    (%rsi,%r8,1),%r11d
  movb   $0x0,-0x71(%rbp)
  movslq %r11d,%r8
  cmpb   $0x30,(%r10,%r8,1)
  jne    L250
  cmp    $0x3,%edx
  sete   -0x71(%rbp)
L250:
  lea    -0x3(%rcx),%edx
  mov    $0x1,%r8d
  cmp    %edx,%esi
  jle    L42
  mov    -0x78(%rbp),%edx
  mov    -0x68(%rbp),%r10
  xor    %r8d,%r8d
  add    %r9d,%edx
  movslq %edx,%rdx
  cmpb   $0x30,(%r10,%rdx,1)
  sete   %r8b
L42:
  lea    -0x2(%rcx),%r10d
  lea    0x1(%r8),%edx
  cmp    %esi,%r10d
  jge    L208
  mov    %r9d,%r10d
  mov    -0x68(%rbp),%rax
  xor    %edx,%edx
  sub    %esi,%r10d
  movslq %r10d,%r10
  cmpb   $0x30,(%rax,%r10,1)
  jne    L208
  lea    0x1(%r8),%edx
  nopl   (%rax)
L208:
  lea    -0x1(%rcx),%r10d
  lea    0x1(%rdx),%r8d
  cmp    %esi,%r10d
  jge    L485
  mov    -0x68(%rbp),%rax
  movslq %r9d,%r10
  xor    %r8d,%r8d
  cmpb   $0x30,(%rax,%r10,1)
  jne    L485
  lea    0x1(%rdx),%r8d
  nopw   0x0(%rax,%rax,1)
L485:
  cmp    %esi,%ecx
  jge    L56
  mov    -0x68(%rbp),%rax
  lea    (%r9,%rsi,1),%r10d
  movslq %r10d,%rdx
  cmpb   $0x30,(%rax,%rdx,1)
  jne    L618
  cmp    $0x3,%r8d
  sete   %dl
  or     %dl,-0x71(%rbp)
  nopl   0x0(%rax,%rax,1)
L618:
  mov    -0x6c(%rbp),%r8d
  cmpb   $0x0,-0x71(%rbp)
  lea    0x28(%r8),%edx
  cmove  %r8d,%edx
  mov    %edx,-0x6c(%rbp)
  jmp    L131
  nopl   0x0(%rax,%rax,1)
L788:
  addl   $0x1,-0x70(%rbp)
  mov    -0x70(%rbp),%eax
  add    $0x1,%r12
  add    $0x1,%r13
  addq   $0x1,-0x48(%rbp)
  add    $0x1,%r14
  add    $0x1,%rbx
  add    $0x1,%r15
  addq   $0x1,-0x50(%rbp)
  cmp    %eax,%esi
  jg     L378
  mov    -0x58(%rbp),%rdx
  mov    -0x68(%rbp),%r15
  mov    %esi,-0x48(%rbp)
  lea    0x3(%rsi),%r11d
  movl   $0xa,-0x58(%rbp)
  movl   $0x0,-0x50(%rbp)
  mov    %rdx,-0x60(%rbp)
  xchg   %ax,%ax
L96:
  mov    -0x7c(%rbp),%eax
  test   %eax,%eax
  jle    L115
  mov    -0x58(%rbp),%r10d
  lea    -0xa(%r10),%eax
  cltq
  movzbl 0x3(%r15,%rax,1),%r12d
  movzbl 0x4(%r15,%rax,1),%ecx
  lea    0x2(%r15,%rax,1),%rdx
  movzbl 0x5(%r15,%rax,1),%edi
  movzbl (%r15,%rax,1),%ebx
  movzbl 0x1(%r15,%rax,1),%esi
  mov    $0xa,%eax
  jmp    L292
  xchg   %ax,%ax
L25:
  add    $0x1,%eax
  mov    %ecx,%r12d
  add    $0x1,%r10d
  add    $0x1,%rdx
  mov    %edi,%ecx
  mov    %esi,%ebx
  cmp    %eax,%r11d
  je     L115
  mov    %r8d,%esi
  mov    %r9d,%edi
L292:
  cmp    $0x31,%bl
  sete   %bl
  movzbl %bl,%ebx
  shl    $0x6,%ebx
  cmp    $0x31,%sil
  lea    0x20(%rbx),%r8d
  cmove  %r8d,%ebx
  movzbl (%rdx),%r8d
  lea    0x10(%rbx),%r9d
  cmp    $0x31,%r8b
  cmove  %r9d,%ebx
  cmp    $0x31,%r12b
  lea    0x8(%rbx),%r9d
  cmove  %r9d,%ebx
  cmp    $0x31,%cl
  lea    0x4(%rbx),%r9d
  cmove  %r9d,%ebx
  cmp    $0x31,%dil
  lea    0x2(%rbx),%r9d
  cmove  %r9d,%ebx
  movzbl 0x4(%rdx),%r9d
  cmp    $0x31,%r9b
  jne    L25
  cmp    $0x5c,%ebx
  jne    L25
  mov    %eax,%ebx
  mov    $0x1,%r12d
  sub    $0xe,%ebx
  js     L676
  lea    -0xe(%r10),%ebx
  xor    %r12d,%r12d
  movslq %ebx,%rbx
  cmpb   $0x30,(%r15,%rbx,1)
  sete   %r12b
L676:
  mov    %eax,%r14d
  lea    0x1(%r12),%ebx
  sub    $0xd,%r14d
  js     L160
  lea    -0xd(%r10),%r13d
  xor    %ebx,%ebx
  movslq %r13d,%r13
  cmpb   $0x30,(%r15,%r13,1)
  jne    L160
  lea    0x1(%r12),%ebx
L160:
  mov    %eax,%r14d
  lea    0x1(%rbx),%r12d
  sub    $0xc,%r14d
  js     L169
  lea    -0xc(%r10),%r13d
  xor    %r12d,%r12d
  movslq %r13d,%r13
  cmpb   $0x30,(%r15,%r13,1)
  jne    L169
  lea    0x1(%rbx),%r12d
L169:
  cmp    $0xa,%eax
  je     L48
  lea    -0xb(%r10),%r13d
  xor    %ebx,%ebx
  movslq %r13d,%r13
  cmpb   $0x30,(%r15,%r13,1)
  je     L48
L348:
  lea    -0x3(%rax),%r12d
  mov    $0x1,%r13d
  cmp    %r12d,-0x48(%rbp)
  jle    L834
  lea    -0x3(%r10),%r12d
  xor    %r13d,%r13d
  movslq %r12d,%r12
  cmpb   $0x30,(%r15,%r12,1)
  sete   %r13b
L834:
  lea    -0x2(%rax),%r14d
  lea    0x1(%r13),%r12d
  cmp    -0x48(%rbp),%r14d
  jge    L440
  lea    -0x2(%r10),%r14d
  xor    %r12d,%r12d
  movslq %r14d,%r14
  cmpb   $0x30,(%r15,%r14,1)
  jne    L440
  lea    0x1(%r13),%r12d
  nopl   0x0(%rax)
L440:
  lea    -0x1(%rax),%r14d
  lea    0x1(%r12),%r13d
  cmp    -0x48(%rbp),%r14d
  jge    L546
  lea    -0x1(%r10),%r14d
  xor    %r13d,%r13d
  movslq %r14d,%r14
  cmpb   $0x30,(%r15,%r14,1)
  jne    L546
  lea    0x1(%r12),%r13d
  nopl   (%rax)
L546:
  cmp    %eax,-0x48(%rbp)
  jle    L83
  movslq %r10d,%r12
  cmpb   $0x30,(%r15,%r12,1)
  je     L83
L898:
  mov    -0x6c(%rbp),%r14d
  test   %bl,%bl
  lea    0x28(%r14),%r12d
  cmove  %r14d,%r12d
  mov    %r12d,-0x6c(%rbp)
  jmp    L25
  xchg   %ax,%ax
L115:
  mov    -0x48(%rbp),%edx
  addl   $0x1,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  add    %edx,-0x58(%rbp)
  mov    %edx,%esi
  cmp    %eax,%edx
  jg     L96
  mov    -0x60(%rbp),%rdx
  xor    %r9d,%r9d
  xor    %eax,%eax
L810:
  lea    (%r15,%r9,1),%rdi
  xor    %ecx,%ecx
  cs nopw 0x0(%rax,%rax,1)
L454:
  xor    %r8d,%r8d
  cmpb   $0x31,(%rdi)
  sete   %r8b
  add    $0x1,%ecx
  add    %rdx,%rdi
  add    %r8d,%eax
  cmp    %ecx,%esi
  jg     L454
  add    $0x1,%r9
  cmp    %r9d,%esi
  jg     L810
  cltd
  idivl  -0x84(%rbp)
  imul   $0x64,%eax,%eax
  cmp    $0x32,%eax
  jle    L193
  sub    $0x32,%eax
L197:
  mov    $0xcccccccd,%edx
  imul   %rdx,%rax
  shr    $0x22,%rax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
L166:
  add    -0x6c(%rbp),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L498
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L83:
  cmp    $0x3,%r13d
  sete   %r12b
  or     %r12d,%ebx
  jmp    L898
L48:
  cmp    $0x3,%r12d
  sete   %bl
  jmp    L348
L56:
  cmp    $0x3,%r8d
  lea    (%r9,%rsi,1),%r10d
  sete   %dl
  or     %dl,-0x71(%rbp)
  jmp    L618
L899:
  cmp    $0x3,%edx
  lea    (%rsi,%r8,1),%r11d
  sete   -0x71(%rbp)
  jmp    L250
L193:
  mov    $0x32,%edx
  sub    %eax,%edx
  mov    %edx,%eax
  jmp    L197
L521:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L890
L775:
  movl   $0x0,-0x6c(%rbp)
  movslq %esi,%rdx
  test   %r11d,%r11d
  jg     L163
L586:
  mov    $0x64,%eax
  jmp    L166
L498:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int evaluate(unsigned char *eval, const int size, const int pattern) {
  int x, y, block, weight;
  int result = 0;
  char state;
  int p;
  int dark_mods;
  int percentage, k;
  int a, b, afterCount, beforeCount;
  char local[size * size];
  for (x = 0; x < size; x++) {
    for (y = 0; y < size; y++) {
      if ((eval[(y * size) + x] & (0x01 << pattern)) != 0) {
        local[(y * size) + x] = '1';
      } else {
        local[(y * size) + x] = '0';
      }
    }
  }
  for (x = 0; x < size; x++) {
    state = local[x];
    block = 0;
    for (y = 0; y < size; y++) {
      if (local[(y * size) + x] == state) {
        block++;
      } else {
        if (block > 5) {
          result += (3 + (block - 5));
        }
        block = 0;
        state = local[(y * size) + x];
      }
    }
    if (block > 5) {
      result += (3 + (block - 5));
    }
  }
  for (y = 0; y < size; y++) {
    state = local[y * size];
    block = 0;
    for (x = 0; x < size; x++) {
      if (local[(y * size) + x] == state) {
        block++;
      } else {
        if (block > 5) {
          result += (3 + (block - 5));
        }
        block = 0;
        state = local[(y * size) + x];
      }
    }
    if (block > 5) {
      result += (3 + (block - 5));
    }
  }
  for (x = 0; x < size - 1; x++) {
    for (y = 0; y < size - 1; y++) {
      if (((local[(y * size) + x] == local[((y + 1) * size) + x]) && (local[(y * size) + x] == local[(y * size) + (x + 1)])) && (local[(y * size) + x] == local[((y + 1) * size) + (x + 1)])) {
        result += 3;
      }
    }
  }
  for (x = 0; x < size; x++) {
    for (y = 0; y < (size - 7); y++) {
      p = 0;
      for (weight = 0; weight < 7; weight++) {
        if (local[((y + weight) * size) + x] == '1') {
          p += (0x40 >> weight);
        }
      }
      if (p == 0x5d) {
        beforeCount = 0;
        for (b = (y - 4); b < y; b++) {
          if (b < 0) {
            beforeCount++;
          } else {
            if (local[(b * size) + x] == '0') {
              beforeCount++;
            } else {
              beforeCount = 0;
            }
          }
        }
        afterCount = 0;
        for (a = (y + 7); a <= (y + 10); a++) {
          if (a >= size) {
            afterCount++;
          } else {
            if (local[(a * size) + x] == '0') {
              afterCount++;
            } else {
              afterCount = 0;
            }
          }
        }
        if ((beforeCount == 4) || (afterCount == 4)) {
          result += 40;
        }
      }
    }
  }
  for (y = 0; y < size; y++) {
    for (x = 0; x < (size - 7); x++) {
      p = 0;
      for (weight = 0; weight < 7; weight++) {
        if (local[(y * size) + x + weight] == '1') {
          p += (0x40 >> weight);
        }
      }
      if (p == 0x5d) {
        beforeCount = 0;
        for (b = (x - 4); b < x; b++) {
          if (b < 0) {
            beforeCount++;
          } else {
            if (local[(y * size) + b] == '0') {
              beforeCount++;
            } else {
              beforeCount = 0;
            }
          }
        }
        afterCount = 0;
        for (a = (x + 7); a <= (x + 10); a++) {
          if (a >= size) {
            afterCount++;
          } else {
            if (local[(y * size) + a] == '0') {
              afterCount++;
            } else {
              afterCount = 0;
            }
          }
        }
        if ((beforeCount == 4) || (afterCount == 4)) {
          result += 40;
        }
      }
    }
  }
  dark_mods = 0;
  for (x = 0; x < size; x++) {
    for (y = 0; y < size; y++) {
      if (local[(y * size) + x] == '1') {
        dark_mods++;
      }
    }
  }
  percentage = 100 * (dark_mods / (size * size));
  if (percentage <= 50) {
    k = ((100 - percentage) - 50) / 5;
  } else {
    k = (percentage - 50) / 5;
  }
  result += 10 * k;
  return result;
}
```