user: 请将以下的汇编代码转换成C语言代码：

```asm
<variance>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8d,-0x44(%rbp)
  mov    %r9d,-0x48(%rbp)
  movsd  %xmm0,-0x50(%rbp)
  movsd  %xmm1,-0x58(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L0
L41:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L0:
  mov    -0x44(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jl     L41
  mov    -0x50(%rbp),%rax
  mov    $0xff,%edi
  movq   %rax,%xmm0
  call   <sumgaus1d@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x14(%rbp)
  sarl   $0xa,-0x14(%rbp)
  addl   $0x1,-0x14(%rbp)
  mov    0x10(%rbp),%eax
  mov    %eax,%ecx
  shll   %cl,-0x14(%rbp)
  mov    -0x50(%rbp),%rdi
  mov    -0x48(%rbp),%r8d
  mov    -0x44(%rbp),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <gaussian_blur@plt>
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L63
  mov    -0x10(%rbp),%eax
  jmp    L30
L63:
  mov    -0x48(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  imul   -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%esi
  cltd
  idiv   %esi
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L78
L80:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  imul   -0x8(%rbp),%eax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    %edx,%eax
  cltd
  idiv   %ecx
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L46
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L46:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L78:
  mov    -0x44(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jl     L80
  mov    -0x58(%rbp),%rdi
  mov    -0x48(%rbp),%r8d
  mov    -0x44(%rbp),%ecx
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rsi
  mov    -0x40(%rbp),%rax
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <gaussian_blur@plt>
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L52
  mov    -0x10(%rbp),%eax
  jmp    L30
L52:
  mov    $0x0,%eax
L30:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D7
data_type: string

tool: D7: dif:%d


assistant: ```c
int variance(int16_t *in, int *out, int *tmp1, int *tmp2, int w, int h, double sd1, double sd2, int shift) {
  int i;
  int dif;
  int ndiv;
  int nmul;
  int err;
  int idx;
  for (i = 0; i < w * h; i++)
    tmp1[i] = in[i];
  ndiv = sumgaus1d(sd1, 255);
  ndiv *= ndiv;
  ndiv >>= 10;
  ndiv++;
  ndiv <<= shift;
  if ((err = gaussian_blur(tmp1, out, tmp2, w, h, sd1)))
    return err;
  idx = (h / 2) * w + (w / 2);
  nmul = out[idx] / in[idx];
  for (i = 0; i < w * h; i++) {
    dif = in[i];
    dif = (dif * nmul - out[i]) / (ndiv / 2);
    if (dif < 0)
      printf("dif:%d\n", dif);
    tmp2[i] = (dif * dif);
  }
  if ((err = gaussian_blur(tmp2, out, tmp1, w, h, sd2)))
    return err;
  return 0;
}
```