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

```asm
<get_upupright_pred>:
  endbr64
  push   %rbx
  sub    $0x410,%rsp
  mov    %rdi,%r10
  mov    0x420(%rsp),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L94
  mov    %edx,%r11d
  mov    %ecx,%ebx
  test   %r8d,%r8d
  jle    L2
  mov    %r8d,%r9d
  lea    -0x1(%rsi),%eax
  imul   %ecx,%eax
  add    %edx,%eax
  cltq
  lea    (%r10,%rax,4),%rcx
  mov    $0x0,%eax
L38:
  mov    (%rcx,%rax,4),%edx
  mov    %edx,(%rsp,%rax,4)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L38
L2:
  cmpl   $0x0,0x428(%rsp)
  jne    L155
  lea    (%r8,%r8,1),%edx
  cmp    %edx,%r8d
  jge    L8
  lea    -0x1(%rsi),%eax
  imul   %ebx,%eax
  add    %r11d,%eax
  add    %r8d,%eax
  cltq
  mov    -0x4(%r10,%rax,4),%ecx
  movslq %r8d,%rsi
  lea    (%rsp,%rsi,4),%rax
  sub    %r8d,%edx
  lea    -0x1(%rdx),%edx
  add    %rsi,%rdx
  lea    0x4(%rsp,%rdx,4),%rdx
L179:
  mov    %ecx,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L179
  jmp    L8
L94:
  lea    (%r8,%r8,1),%edx
  test   %edx,%edx
  jle    L8
  mov    %rsp,%rax
  lea    -0x1(%rdx),%edx
  lea    0x4(%rsp,%rdx,4),%rdx
L136:
  movl   $0x80,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L136
L8:
  mov    (%rsp),%eax
  lea    (%rax,%rax,2),%eax
  add    0x4(%rsp),%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,0x200(%rsp)
  lea    (%r8,%r8,1),%r10d
  lea    -0x1(%r10),%r11d
  cmp    $0x1,%r11d
  jle    L131
  mov    %rsp,%rdx
  lea    0x204(%rsp),%rcx
  lea    -0x3(%r10),%eax
  lea    0x4(%rsp,%rax,4),%r9
L123:
  mov    0x4(%rdx),%esi
  mov    (%rdx),%eax
  lea    (%rax,%rsi,2),%eax
  add    0x8(%rdx),%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,(%rcx)
  add    $0x4,%rdx
  add    $0x4,%rcx
  cmp    %r9,%rdx
  jne    L123
L131:
  movslq %r11d,%rdx
  mov    (%rsp,%rdx,4),%ecx
  lea    -0x2(%r10),%eax
  cltq
  mov    (%rsp,%rax,4),%eax
  lea    (%rax,%rcx,2),%eax
  lea    0x2(%rcx,%rax,1),%eax
  sar    $0x2,%eax
  mov    %eax,0x200(%rsp,%rdx,4)
  test   %r8d,%r8d
  jle    L65
  mov    %r8d,%esi
  mov    $0x0,%r10d
  mov    $0x0,%r9d
  jmp    L182
L155:
  lea    (%r8,%r8,1),%ecx
  cmp    %ecx,%r8d
  jge    L8
  movslq %r8d,%rax
  lea    -0x1(%rsi),%edx
  imul   %ebx,%edx
  add    %r11d,%edx
  movslq %edx,%rdx
  lea    (%r10,%rdx,4),%rsi
L118:
  mov    (%rsi,%rax,4),%edx
  mov    %edx,(%rsp,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L118
  jmp    L8
L73:
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  sar    %edx
  movslq %ecx,%rbx
  lea    0x1(%rdx),%r11d
  movslq %r11d,%r11
  movslq %edx,%rdx
  mov    0x200(%rsp,%rdx,4),%edx
  add    0x200(%rsp,%r11,4),%edx
  sar    %edx
  mov    %edx,(%rdi,%rbx,4)
L99:
  add    $0x2,%eax
  add    $0x1,%ecx
  cmp    %ecx,%esi
  je     L196
L85:
  test   $0x1,%al
  je     L73
  movslq %ecx,%rbx
  lea    0x1(%rax),%r11d
  mov    %r11d,%edx
  shr    $0x1f,%edx
  add    %r11d,%edx
  sar    %edx
  movslq %edx,%rdx
  mov    0x200(%rsp,%rdx,4),%edx
  mov    %edx,(%rdi,%rbx,4)
  jmp    L99
L196:
  add    $0x1,%r9d
  add    %r8d,%esi
  add    %r8d,%r10d
  cmp    %r9d,%r8d
  je     L65
L182:
  mov    %r9d,%eax
  mov    %r10d,%ecx
  jmp    L85
L65:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L56
  add    $0x410,%rsp
  pop    %rbx
  ret
L56:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void get_upupright_pred(uint8_t *rec, int ypos, int xpos, int stride, int size, int width, uint8_t *pblock, int upright_available) {
  int i, j, diag;
  uint16_t ver[2 * 64];
  uint8_t verF[2 * 64];
  if (ypos > 0) {
    for (j = 0; j < size; j++) {
      ver[j] = rec[(ypos - 1) * stride + xpos + j];
    }
    if (upright_available) {
      for (j = size; j < 2 * size; j++) {
        ver[j] = rec[(ypos - 1) * stride + xpos + j];
      }
    } else {
      for (j = size; j < 2 * size; j++) {
        ver[j] = rec[(ypos - 1) * stride + xpos + size - 1];
      }
    }
  } else {
    for (j = 0; j < 2 * size; j++) {
      ver[j] = 128;
    }
  }
  verF[0] = (uint8_t)((ver[0] + 2 * ver[0] + ver[1] + 2) >> 2);
  for (j = 1; j < 2 * size - 1; j++) {
    verF[j] = (uint8_t)((ver[j - 1] + 2 * ver[j] + ver[j + 1] + 2) >> 2);
  }
  verF[2 * size - 1] = (uint8_t)((ver[2 * size - 2] + 2 * ver[2 * size - 1] + ver[2 * size - 1] + 2) >> 2);
  for (i = 0; i < size; i++) {
    for (j = 0; j < size; j++) {
      diag = i + 2 * j;
      if (diag & 1) {
        pblock[i * size + j] = verF[(diag + 1) / 2];
      } else {
        pblock[i * size + j] = (verF[diag / 2] + verF[diag / 2 + 1]) >> 1;
      }
    }
  }
}
```