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

```asm
<form_component_prediction>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edx,%r12d
  mov    %ecx,0xc(%rsp)
  mov    %r8d,%r15d
  mov    %r9d,%r14d
  mov    0x58(%rsp),%edx
  mov    0x70(%rsp),%r13d
  movslq 0x50(%rsp),%rcx
  mov    0x68(%rsp),%eax
  sar    %eax
  add    %edx,%eax
  imul   %r12d,%eax
  cltq
  mov    0x60(%rsp),%r8d
  sar    %r8d
  movslq %r8d,%r8
  add    %rcx,%r8
  add    %r8,%rax
  lea    (%rdi,%rax,1),%rbp
  imul   %r12d,%edx
  movslq %edx,%rdx
  add    %rcx,%rdx
  lea    (%rsi,%rdx,1),%rbx
  cmp    %rbx,%rbp
  je     L274
L120:
  mov    0x60(%rsp),%eax
  or     0x68(%rsp),%eax
  test   $0x1,%al
  je     L60
  mov    0x60(%rsp),%edx
  and    $0x1,%edx
  mov    0x68(%rsp),%eax
  and    $0x1,%eax
  je     L33
  test   %edx,%edx
  je     L490
L33:
  test   %eax,%eax
  jne    L74
  test   %edx,%edx
  jne    L413
L74:
  test   %r13d,%r13d
  jne    L316
  test   %r14d,%r14d
  jle    L532
  movslq 0xc(%rsp),%rdi
  movslq %r12d,%rcx
  add    %rbp,%rcx
  mov    %r15d,%r8d
  jmp    L514
L274:
  lea    D14(%rip),%rcx
  mov    $0x1da,%edx
  lea    D10(%rip),%rsi
  lea    D2(%rip),%rdi
  call   <__assert_fail@plt>
  jmp    L120
L60:
  test   %r13d,%r13d
  jne    L51
  mov    %r15d,%ecx
  movslq 0xc(%rsp),%rsi
  test   %r14d,%r14d
  jg     L496
  jmp    L532
L51:
  mov    $0x0,%edi
  mov    %r15d,%esi
  movslq 0xc(%rsp),%r8
  test   %r14d,%r14d
  jg     L132
  jmp    L532
L536:
  movzbl (%rbx,%rax,1),%ecx
  movzbl 0x0(%rbp,%rax,1),%edx
  lea    0x1(%rcx,%rdx,1),%edx
  sar    %edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L536
L356:
  add    %r8,%rbp
  add    %r8,%rbx
  add    $0x1,%edi
  cmp    %edi,%r14d
  je     L532
L132:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L536
  jmp    L356
L208:
  movzbl 0x0(%rbp,%rax,1),%edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L208
L167:
  add    %rsi,%rbp
  add    %rsi,%rbx
  add    $0x1,%r13d
  cmp    %r13d,%r14d
  je     L532
L496:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L208
  jmp    L167
L490:
  test   %r13d,%r13d
  jne    L44
  test   %r14d,%r14d
  jle    L532
  movslq 0xc(%rsp),%r8
  movslq %r12d,%rsi
  add    %rbp,%rsi
  mov    %r15d,%edi
  jmp    L515
L44:
  test   %r14d,%r14d
  jle    L532
  movslq 0xc(%rsp),%r8
  movslq %r12d,%rsi
  add    %rbp,%rsi
  mov    $0x0,%r9d
  mov    %r15d,%edi
  jmp    L38
L87:
  movzbl 0x0(%rbp,%rax,1),%ecx
  movzbl (%rsi,%rax,1),%edx
  lea    0x1(%rcx,%rdx,1),%edx
  shr    %edx
  movzbl (%rbx,%rax,1),%ecx
  lea    0x1(%rdx,%rcx,1),%edx
  sar    %edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L87
L58:
  add    %r8,%rbp
  add    %r8,%rbx
  add    $0x1,%r9d
  add    %r8,%rsi
  cmp    %r9d,%r14d
  je     L532
L38:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L87
  jmp    L58
L526:
  movzbl 0x0(%rbp,%rax,1),%ecx
  movzbl (%rsi,%rax,1),%edx
  lea    0x1(%rcx,%rdx,1),%edx
  shr    %edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L526
L333:
  add    %r8,%rbp
  add    %r8,%rbx
  add    $0x1,%r13d
  add    %r8,%rsi
  cmp    %r13d,%r14d
  je     L532
L515:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L526
  jmp    L333
L413:
  test   %r13d,%r13d
  jne    L428
  mov    %r15d,%esi
  movslq 0xc(%rsp),%rdi
  test   %r14d,%r14d
  jle    L532
L442:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jle    L17
L244:
  movzbl 0x0(%rbp,%rax,1),%ecx
  movzbl 0x1(%rbp,%rax,1),%edx
  lea    0x1(%rcx,%rdx,1),%edx
  shr    %edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L244
L17:
  add    %rdi,%rbp
  add    %rdi,%rbx
  add    $0x1,%r13d
  cmp    %r13d,%r14d
  jne    L442
L532:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L428:
  mov    $0x0,%edi
  mov    %r15d,%esi
  movslq 0xc(%rsp),%r8
  test   %r14d,%r14d
  jg     L55
  jmp    L532
L374:
  movzbl 0x0(%rbp,%rax,1),%ecx
  movzbl 0x1(%rbp,%rax,1),%edx
  lea    0x1(%rcx,%rdx,1),%edx
  shr    %edx
  movzbl (%rbx,%rax,1),%ecx
  lea    0x1(%rdx,%rcx,1),%edx
  sar    %edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L374
L265:
  add    %r8,%rbp
  add    %r8,%rbx
  add    $0x1,%edi
  cmp    %edi,%r14d
  je     L532
L55:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L374
  jmp    L265
L316:
  test   %r14d,%r14d
  jle    L532
  movslq 0xc(%rsp),%rdi
  movslq %r12d,%rcx
  add    %rbp,%rcx
  mov    $0x0,%r8d
  mov    %r15d,%esi
  jmp    L124
L527:
  movzbl 0x0(%rbp,%rax,1),%edx
  movzbl 0x1(%rbp,%rax,1),%r9d
  add    %r9d,%edx
  movzbl (%rcx,%rax,1),%r9d
  add    %r9d,%edx
  movzbl 0x1(%rcx,%rax,1),%r9d
  lea    0x2(%rdx,%r9,1),%edx
  shr    $0x2,%edx
  movzbl (%rbx,%rax,1),%r9d
  lea    0x1(%rdx,%r9,1),%edx
  sar    %edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L527
L177:
  add    %rdi,%rbp
  add    %rdi,%rbx
  add    $0x1,%r8d
  add    %rdi,%rcx
  cmp    %r8d,%r14d
  je     L532
L124:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L527
  jmp    L177
L266:
  movzbl 0x0(%rbp,%rax,1),%edx
  movzbl 0x1(%rbp,%rax,1),%esi
  add    %esi,%edx
  movzbl (%rcx,%rax,1),%esi
  add    %esi,%edx
  movzbl 0x1(%rcx,%rax,1),%esi
  lea    0x2(%rdx,%rsi,1),%edx
  shr    $0x2,%edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L266
L457:
  add    %rdi,%rbp
  add    %rdi,%rbx
  add    $0x1,%r13d
  add    %rdi,%rcx
  cmp    %r13d,%r14d
  je     L532
L514:
  mov    $0x0,%eax
  test   %r15d,%r15d
  jg     L266
  jmp    L457
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D14
data_type: string
name: extract_symbolic_data
arguments: data_tag: D10
data_type: string
name: extract_symbolic_data
arguments: data_tag: D2
data_type: string

tool: D14: form_component_prediction

tool: D10: src/recon.c

tool: D2: s!=d

assistant: ```c
void form_component_prediction(unsigned char *src, unsigned char *dst, int lx, int lx2, int w, int h, int x, int y, int dx, int dy, int average_flag) {
  int xint;
  int yint;
  int xh;
  int yh;
  int i;
  int j;
  int v;
  unsigned char *s;
  unsigned char *d;
  int tmp;
  int tmp___0;
  int tmp___1;
  int tmp___2;
  {
    xint = dx >> 1;
    yint = dy >> 1;
    s = ((src + lx * (y + yint)) + x) + xint;
    d = (dst + lx * y) + x;
    xh = dx & 1;
    yh = dy & 1;
    if (!((unsigned long)s != (unsigned long)d)) {
      __assert_fail("s!=d", "src/recon.c", 474U, "form_component_prediction");
    }
    if (!xh) {
      if (!yh) {
        if (average_flag) {
          j = 0;
          while (j < h) {
            i = 0;
            while (i < w) {
              v = (int)*(d + i) + (int)*(s + i);
              if (v >= 0) {
                tmp = 1;
              } else {
                tmp = 0;
              }
              *(d + i) = (unsigned char)((v + tmp) >> 1);
              i++;
            }
            s += lx2;
            d += lx2;
            j++;
          }
        } else {
          j = 0;
          while (j < h) {
            i = 0;
            while (i < w) {
              *(d + i) = *(s + i);
              i++;
            }
            s += lx2;
            d += lx2;
            j++;
          }
        }
      } else {
        goto _L___1;
      }
    } else
    _L___1:
      if (!xh) {
        if (yh) {
          if (average_flag) {
            j = 0;
            while (j < h) {
              i = 0;
              while (i < w) {
                v = (int)((unsigned int)*(d + i) + ((unsigned int)(((int)*(s + i) + (int)*(s + (i + lx))) + 1) >> 1));
                if (v >= 0) {
                  tmp___0 = 1;
                } else {
                  tmp___0 = 0;
                }
                *(d + i) = (unsigned char)((v + tmp___0) >> 1);
                i++;
              }
              s += lx2;
              d += lx2;
              j++;
            }
          } else {
            j = 0;
            while (j < h) {
              i = 0;
              while (i < w) {
                *(d + i) = (unsigned char)((unsigned int)(((int)*(s + i) + (int)*(s + (i + lx))) + 1) >> 1);
                i++;
              }
              s += lx2;
              d += lx2;
              j++;
            }
          }
        } else {
          goto _L___0;
        }
      } else
      _L___0:
        if (xh) {
          if (!yh) {
            if (average_flag) {
              j = 0;
              while (j < h) {
                i = 0;
                while (i < w) {
                  v = (int)((unsigned int)*(d + i) + ((unsigned int)(((int)*(s + i) + (int)*(s + (i + 1))) + 1) >> 1));
                  if (v >= 0) {
                    tmp___1 = 1;
                  } else {
                    tmp___1 = 0;
                  }
                  *(d + i) = (unsigned char)((v + tmp___1) >> 1);
                  i++;
                }
                s += lx2;
                d += lx2;
                j++;
              }
            } else {
              j = 0;
              while (j < h) {
                i = 0;
                while (i < w) {
                  *(d + i) = (unsigned char)((unsigned int)(((int)*(s + i) + (int)*(s + (i + 1))) + 1) >> 1);
                  i++;
                }
                s += lx2;
                d += lx2;
                j++;
              }
            }
          } else {
            goto _L;
          }
        } else
        _L:
          if (average_flag) {
            j = 0;
            while (j < h) {
              i = 0;
              while (i < w) {
                v = (int)((unsigned int)*(d + i) + ((unsigned int)(((((int)*(s + i) + (int)*(s + (i + 1))) + (int)*(s + (i + lx))) + (int)*(s + ((i + lx) + 1))) + 2) >> 2));
                if (v >= 0) {
                  tmp___2 = 1;
                } else {
                  tmp___2 = 0;
                }
                *(d + i) = (unsigned char)((v + tmp___2) >> 1);
                i++;
              }
              s += lx2;
              d += lx2;
              j++;
            }
          } else {
            j = 0;
            while (j < h) {
              i = 0;
              while (i < w) {
                *(d + i) = (unsigned char)((unsigned int)(((((int)*(s + i) + (int)*(s + (i + 1))) + (int)*(s + (i + lx))) + (int)*(s + ((i + lx) + 1))) + 2) >> 2);
                i++;
              }
              s += lx2;
              d += lx2;
              j++;
            }
          }
    return;
  }
}
```