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

```asm
<evaluate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r9
  mov    %edx,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %esi,%eax
  imul   %esi,%eax
  mov    %eax,-0x64(%rbp)
  cltq
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffffff0,%rdx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdi
  sub    %rax,%rdi
L360:
  cmp    %rdi,%rsp
  je     L354
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L360
L354:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L525
  orq    $0x0,-0x8(%rsp,%rax,1)
L525:
  mov    %rsp,%rdi
  test   %esi,%esi
  jle    L322
  mov    %esi,%r12d
  mov    $0x0,%ebx
  movslq %esi,%r10
L209:
  mov    %rbx,%r8
  mov    $0x0,%eax
L125:
  movzbl (%r9,%r8,1),%edx
  sar    %cl,%edx
  and    $0x1,%edx
  add    $0x30,%edx
  mov    %dl,(%rdi,%r8,1)
  mov    %eax,%r11d
  add    $0x1,%eax
  add    %r10,%r8
  cmp    %eax,%esi
  jne    L125
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L209
  mov    %rdi,%r12
  mov    %rdi,%r13
  mov    $0x0,%r9d
  mov    $0x0,%r14d
  cltq
  mov    $0x0,%r15d
  jmp    L446
L402:
  add    $0x1,%r8d
L468:
  lea    0x1(%rcx),%r10d
  add    %rax,%rdx
  cmp    %ecx,%r11d
  je     L678
  mov    %r10d,%ecx
L568:
  movzbl (%rdx),%r10d
  cmp    %bl,%r10b
  je     L402
  cmp    $0x5,%r8d
  jle    L668
  lea    -0x2(%r8,%r9,1),%r9d
  mov    %r10d,%ebx
  mov    $0x0,%r8d
  jmp    L468
L668:
  mov    %r10d,%ebx
  mov    $0x0,%r8d
  jmp    L468
L678:
  lea    -0x2(%r8,%r9,1),%edx
  cmp    $0x5,%r8d
  cmovg  %edx,%r9d
  lea    0x1(%r14),%edx
  add    $0x1,%r13
  cmp    %r11d,%r14d
  je     L4
  mov    %edx,%r14d
L446:
  movzbl 0x0(%r13),%ebx
  mov    %r13,%rdx
  mov    $0x0,%r8d
  mov    %r15d,%ecx
  jmp    L568
L4:
  mov    %r11d,%edx
  lea    0x1(%rdi,%rdx,1),%rbx
  mov    $0x0,%r13d
  jmp    L286
L118:
  add    $0x1,%ecx
L778:
  add    $0x1,%rdx
  cmp    %rbx,%rdx
  je     L608
L251:
  movzbl (%rdx),%r8d
  cmp    %r10b,%r8b
  je     L118
  cmp    $0x5,%ecx
  jle    L508
  lea    -0x2(%rcx,%r9,1),%r9d
  mov    %r8d,%r10d
  mov    $0x0,%ecx
  jmp    L778
L508:
  mov    %r8d,%r10d
  mov    $0x0,%ecx
  jmp    L778
L608:
  lea    -0x2(%rcx,%r9,1),%edx
  cmp    $0x5,%ecx
  cmovg  %edx,%r9d
  lea    0x1(%r13),%edx
  add    %rax,%r12
  add    %rax,%rbx
  cmp    %r13d,%r11d
  je     L691
  mov    %edx,%r13d
L286:
  movzbl (%r12),%r10d
  mov    %r12,%rdx
  mov    $0x0,%ecx
  jmp    L251
L649:
  add    %r12,%rax
  add    %esi,%ecx
  cmp    %r13d,%edx
  je     L656
L154:
  movzbl (%rax),%r8d
  add    $0x1,%edx
  mov    %rax,%r10
  sub    %r11,%r10
  cmp    (%r10,%rbx,1),%r8b
  jne    L649
  movslq %ecx,%r10
  cmp    (%rdi,%r10,1),%r8b
  jne    L649
  lea    (%rcx,%rsi,1),%r10d
  movslq %r10d,%r10
  cmp    (%rdi,%r10,1),%r8b
  jne    L649
  add    $0x3,%r9d
  jmp    L649
L656:
  lea    0x1(%r11),%rax
  add    $0x1,%rbx
  cmp    %r14,%r11
  je     L573
  mov    %rax,%r11
L598:
  lea    (%rdi,%r11,1),%rax
  lea    0x1(%r11),%ecx
  mov    $0x0,%edx
  jmp    L154
L573:
  test   %esi,%esi
  jle    L522
L36:
  mov    %esi,%eax
  mov    %rax,-0x58(%rbp)
  lea    0x0(,%rsi,8),%eax
  sub    %esi,%eax
  mov    %eax,-0x5c(%rbp)
  imul   $0xfffffff5,%esi,%eax
  mov    %eax,-0x4c(%rbp)
  movq   $0x0,-0x48(%rbp)
  lea    -0x7(%rsi),%r14d
  mov    %r14d,-0x50(%rbp)
  movslq %esi,%rax
  mov    $0x40,%r11d
  mov    %r9d,-0x60(%rbp)
  jmp    L731
L166:
  add    $0x1,%ecx
  add    %rax,%r10
  cmp    $0x7,%ecx
  je     L853
L336:
  cmpb   $0x31,(%r10)
  jne    L166
  mov    %r11d,%r12d
  sar    %cl,%r12d
  add    %r12d,%ebx
  jmp    L166
L853:
  cmp    $0x5d,%ebx
  je     L187
L179:
  add    $0x1,%edx
  add    %esi,%r9d
  add    %rax,%r8
  cmp    %r14d,%edx
  je     L548
L68:
  mov    %r8,%r10
  mov    $0x0,%ebx
  mov    $0x0,%ecx
  jmp    L336
L187:
  mov    %edx,%r12d
  lea    -0x4(%rdx),%ecx
  mov    -0x4c(%rbp),%ebx
  lea    (%r9,%rbx,1),%r10d
  mov    $0x0,%ebx
  jmp    L150
L600:
  add    $0x1,%ebx
L562:
  add    $0x1,%ecx
  add    %esi,%r10d
  cmp    %edx,%ecx
  je     L842
L150:
  test   %ecx,%ecx
  js     L600
  movslq %r10d,%r13
  add    $0x1,%ebx
  cmpb   $0x30,(%rdi,%r13,1)
  je     L562
  mov    $0x0,%ebx
  jmp    L562
L842:
  lea    0x7(%r12),%ecx
  mov    %r9d,%r10d
  mov    $0x0,%r13d
  add    $0xb,%r12d
  jmp    L323
L144:
  movslq %r10d,%r15
  add    $0x1,%r13d
  cmpb   $0x30,(%rdi,%r15,1)
  je     L140
  mov    $0x0,%r13d
L140:
  add    $0x1,%ecx
  add    %esi,%r10d
  cmp    %r12d,%ecx
  je     L62
L323:
  cmp    %ecx,%esi
  jg     L144
  add    $0x1,%r13d
  jmp    L140
L62:
  cmp    $0x4,%ebx
  je     L218
  cmp    $0x4,%r13d
  jne    L179
L218:
  addl   $0x28,-0x60(%rbp)
  jmp    L179
L548:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rbx
  cmp    -0x58(%rbp),%rbx
  je     L185
L731:
  test   %r14d,%r14d
  jle    L548
  mov    -0x5c(%rbp),%r9d
  mov    -0x48(%rbp),%rbx
  add    %ebx,%r9d
  lea    (%rdi,%rbx,1),%r8
  mov    $0x0,%edx
  jmp    L68
L312:
  add    $0x1,%rcx
  cmp    $0x7,%rcx
  je     L597
L271:
  cmpb   $0x31,(%rax,%rcx,1)
  jne    L312
  mov    %r8d,%r11d
  sar    %cl,%r11d
  add    %r11d,%r10d
  jmp    L312
L597:
  cmp    $0x5d,%r10d
  je     L88
L186:
  add    $0x1,%edx
  add    $0x1,%rax
  cmp    %edx,%r13d
  je     L303
L239:
  mov    %edx,%r14d
  mov    $0x0,%ecx
  mov    $0x0,%r10d
  jmp    L271
L88:
  lea    -0x4(%r14),%ecx
  mov    $0x0,%r11d
  jmp    L72
L797:
  add    $0x1,%r11d
L317:
  add    $0x1,%ecx
  cmp    %edx,%ecx
  je     L739
L72:
  test   %ecx,%ecx
  js     L797
  lea    (%rcx,%r12,1),%r10d
  movslq %r10d,%r10
  add    $0x1,%r11d
  cmpb   $0x30,(%rdi,%r10,1)
  je     L317
  mov    $0x0,%r11d
  jmp    L317
L739:
  lea    0x7(%r14),%ecx
  mov    $0x0,%r10d
  add    $0xb,%r14d
  jmp    L367
L742:
  lea    (%rcx,%r12,1),%r15d
  movslq %r15d,%r15
  add    $0x1,%r10d
  cmpb   $0x30,(%rdi,%r15,1)
  je     L532
  mov    $0x0,%r10d
L532:
  add    $0x1,%ecx
  cmp    %ecx,%r14d
  je     L24
L367:
  cmp    %ecx,%esi
  jg     L742
  add    $0x1,%r10d
  jmp    L532
L24:
  cmp    $0x4,%r11d
  je     L618
  cmp    $0x4,%r10d
  jne    L186
L618:
  add    $0x28,%r9d
  jmp    L186
L303:
  lea    0x1(%rbx),%edx
  add    %esi,%r12d
  cmp    %edx,%esi
  je     L606
  mov    %edx,%ebx
L363:
  cmpl   $0x0,-0x50(%rbp)
  jle    L303
  movslq %r12d,%rax
  add    %rdi,%rax
  mov    $0x0,%edx
  jmp    L239
L606:
  mov    %ebx,%r11d
  mov    $0x0,%r10d
  mov    $0x0,%eax
  movslq %edx,%r8
  mov    $0x0,%r12d
  jmp    L261
L185:
  mov    -0x60(%rbp),%r9d
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  lea    -0x7(%rsi),%r13d
  mov    $0x40,%r8d
  jmp    L363
L485:
  mov    %esi,%ecx
L85:
  cmpb   $0x31,(%rdx)
  sete   %sil
  movzbl %sil,%esi
  add    %esi,%eax
  lea    0x1(%rcx),%esi
  add    %r8,%rdx
  cmp    %ecx,%ebx
  jne    L485
  lea    0x1(%r10),%rdx
  cmp    %r11,%r10
  je     L732
  mov    %rdx,%r10
L261:
  lea    (%rdi,%r10,1),%rdx
  mov    %r12d,%ecx
  jmp    L85
L732:
  cltd
  idivl  -0x64(%rbp)
  imul   $0x64,%eax,%eax
  cmp    $0x32,%eax
  jle    L27
  sub    $0x32,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  sar    $0x1f,%eax
  sub    %eax,%edx
  jmp    L294
L522:
  mov    $0x0,%eax
L27:
  mov    $0x32,%ecx
  sub    %eax,%ecx
  movslq %ecx,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
L294:
  lea    (%rdx,%rdx,4),%eax
  lea    (%r9,%rax,2),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L387
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L322:
  mov    $0x0,%r9d
  mov    $0x0,%eax
  cmp    $0x1,%esi
  jg     L455
  jmp    L27
L691:
  cmp    $0x1,%esi
  jle    L36
L455:
  movslq %esi,%r12
  lea    -0x2(%rsi),%r14d
  mov    %r12,%rbx
  mov    $0x0,%r11d
  lea    -0x1(%rsi),%r13d
  jmp    L598
L387:
  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;
}
```