user: Translate the below assembly code into C programming language:

```asm
<get_upupright_pred>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    (%r8,%r8,1),%r12d
  push   %rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  mov    0x460(%rsp),%rbp
  test   %esi,%esi
  jle    L150
  mov    %rdi,%r14
  mov    %esi,%r13d
  mov    %edx,%r15d
  test   %r8d,%r8d
  jle    L77
  lea    -0x1(%rsi),%eax
  movslq %r8d,%rdx
  lea    0x10(%rsp),%rdi
  mov    %ecx,0xc(%rsp)
  imul   %ecx,%eax
  shl    $0x2,%rdx
  add    %r15d,%eax
  cltq
  lea    (%r14,%rax,4),%rsi
  call   <memcpy@plt>
  mov    0xc(%rsp),%ecx
L77:
  mov    0x468(%rsp),%eax
  test   %eax,%eax
  je     L76
  cmp    %r12d,%ebx
  jge    L229
  mov    %r12d,%eax
  movslq %ebx,%rdx
  sub    %ebx,%eax
  lea    0x10(%rsp,%rdx,4),%rdi
  sub    $0x1,%eax
  lea    0x4(,%rax,4),%r8
  lea    -0x1(%r13),%eax
  imul   %ecx,%eax
  add    %r15d,%eax
  cltq
  add    %rdx,%rax
  mov    %r8,%rdx
  lea    (%r14,%rax,4),%rsi
  call   <memcpy@plt>
  lea    -0x1(%r12),%ecx
L282:
  mov    0x10(%rsp),%eax
  lea    -0x2(%r12),%esi
  lea    (%rax,%rax,2),%eax
  add    0x14(%rsp),%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,0x210(%rsp)
  cmp    $0x1,%ecx
  jle    L11
L316:
  lea    -0x3(%r12),%eax
  lea    -0x2(%r12),%esi
  cmp    $0x2,%eax
  jbe    L27
  mov    %esi,%edi
  movdqa D23(%rip),%xmm1
  lea    0x18(%rsp),%rax
  lea    0x214(%rsp),%rdx
  shr    $0x2,%edi
  sub    $0x1,%edi
  shl    $0x4,%rdi
  lea    0x224(%rsp,%rdi,1),%rdi
  nopw   0x0(%rax,%rax,1)
L16:
  movdqu -0x4(%rax),%xmm0
  movdqu (%rax),%xmm2
  add    $0x10,%rdx
  add    $0x10,%rax
  pslld  $0x1,%xmm0
  paddd  -0x18(%rax),%xmm0
  paddd  %xmm2,%xmm0
  paddd  %xmm1,%xmm0
  psrad  $0x2,%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %rdx,%rdi
  jne    L16
  mov    %esi,%eax
  and    $0xfffffffc,%eax
  lea    0x1(%rax),%edx
  cmp    %eax,%esi
  je     L11
L22:
  sub    %eax,%r12d
  cmp    $0x3,%r12d
  je     L237
  shl    $0x2,%rax
  movq   0x14(%rsp,%rax,1),%xmm0
  movq   0x10(%rsp,%rax,1),%xmm1
  pslld  $0x1,%xmm0
  paddd  %xmm1,%xmm0
  movq   0x18(%rsp,%rax,1),%xmm1
  paddd  %xmm1,%xmm0
  movq   D23(%rip),%xmm1
  paddd  %xmm1,%xmm0
  psrad  $0x2,%xmm0
  movq   %xmm0,0x214(%rsp,%rax,1)
L11:
  movslq %ecx,%rcx
  movslq %esi,%rsi
  mov    0x10(%rsp,%rcx,4),%eax
  mov    0x10(%rsp,%rsi,4),%edx
  lea    (%rdx,%rax,2),%edx
  lea    0x2(%rax,%rdx,1),%eax
  sar    $0x2,%eax
  mov    %eax,0x210(%rsp,%rcx,4)
  test   %ebx,%ebx
  jle    L232
  lea    (%rbx,%rbx,1),%r8d
  xor    %edi,%edi
  lea    (%r8,%rbx,1),%r9d
  mov    %r8d,%esi
  nopw   0x0(%rax,%rax,1)
L30:
  mov    %esi,%eax
  movslq %edi,%rdx
  sub    %r8d,%eax
  lea    0x0(%rbp,%rdx,4),%rdx
  jmp    L143
  nop
L138:
  lea    0x1(%rax),%ecx
  add    $0x2,%eax
  add    $0x4,%rdx
  sar    %ecx
  movslq %ecx,%rcx
  mov    0x210(%rsp,%rcx,4),%ecx
  mov    %ecx,-0x4(%rdx)
  cmp    %eax,%esi
  je     L101
L143:
  test   $0x1,%al
  jne    L138
  mov    %eax,%ecx
  add    $0x2,%eax
  add    $0x4,%rdx
  sar    %ecx
  lea    0x1(%rcx),%r10d
  movslq %ecx,%rcx
  movslq %r10d,%r10
  mov    0x210(%rsp,%rcx,4),%ecx
  add    0x210(%rsp,%r10,4),%ecx
  sar    %ecx
  mov    %ecx,-0x4(%rdx)
  cmp    %eax,%esi
  jne    L143
L101:
  add    $0x1,%esi
  add    %ebx,%edi
  cmp    %esi,%r9d
  jne    L30
L232:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L214
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L76:
  cmp    %r12d,%ebx
  jge    L229
  lea    -0x1(%r13),%eax
  mov    %r12d,%esi
  imul   %ecx,%eax
  sub    %ebx,%esi
  add    %r15d,%eax
  add    %ebx,%eax
  cltq
  mov    -0x4(%r14,%rax,4),%edi
  lea    -0x1(%rsi),%eax
  cmp    $0x2,%eax
  jbe    L53
  movslq %ebx,%rax
  movd   %edi,%xmm3
  lea    0x10(%rsp,%rax,4),%rdx
  mov    %esi,%eax
  pshufd $0x0,%xmm3,%xmm0
  shr    $0x2,%eax
  lea    -0x1(%rax),%ecx
  lea    0x10(%rdx),%rax
  shl    $0x4,%rcx
  add    %rax,%rcx
  jmp    L203
  nopl   0x0(%rax)
L19:
  add    $0x10,%rax
L203:
  movups %xmm0,(%rdx)
  mov    %rax,%rdx
  cmp    %rax,%rcx
  jne    L19
  mov    %esi,%edx
  lea    -0x1(%r12),%ecx
  and    $0xfffffffc,%edx
  lea    (%rdx,%rbx,1),%eax
  cmp    %esi,%edx
  je     L282
L147:
  movslq %eax,%rdx
  mov    %edi,0x10(%rsp,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %r12d,%edx
  jge    L229
  movslq %edx,%rdx
  add    $0x2,%eax
  mov    %edi,0x10(%rsp,%rdx,4)
  cmp    %r12d,%eax
  jge    L229
  cltq
  mov    %edi,0x10(%rsp,%rax,4)
L229:
  lea    -0x1(%r12),%ecx
  jmp    L282
  nopw   0x0(%rax,%rax,1)
L237:
  lea    -0x1(%rdx),%eax
  movslq %edx,%rdi
  add    $0x1,%edx
  cltq
  mov    0x10(%rsp,%rdi,4),%r8d
  movslq %edx,%rdx
  mov    0x10(%rsp,%rax,4),%eax
  lea    (%rax,%r8,2),%eax
  add    0x10(%rsp,%rdx,4),%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,0x210(%rsp,%rdi,4)
  jmp    L11
L150:
  lea    -0x1(%r12),%ecx
  test   %r12d,%r12d
  jle    L282
  cmp    $0x2,%ecx
  jbe    L135
  mov    %r12d,%edx
  movdqa D25(%rip),%xmm0
  lea    0x10(%rsp),%rax
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x20(%rsp,%rdx,1),%rdx
  nopw   0x0(%rax,%rax,1)
L211:
  movaps %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L211
  mov    %r12d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r12b
  je     L317
L120:
  movslq %eax,%rdx
  movl   $0x80,0x10(%rsp,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %r12d,%edx
  jge    L282
  movslq %edx,%rdx
  add    $0x2,%eax
  movl   $0x80,0x10(%rsp,%rdx,4)
  cmp    %r12d,%eax
  jge    L282
  cltq
  movl   $0x80,0x10(%rsp,%rax,4)
L317:
  mov    0x10(%rsp),%eax
  lea    (%rax,%rax,2),%eax
  add    0x14(%rsp),%eax
  add    $0x2,%eax
  sar    $0x2,%eax
  mov    %eax,0x210(%rsp)
  jmp    L316
L27:
  xor    %eax,%eax
  mov    $0x1,%edx
  jmp    L22
L135:
  xor    %eax,%eax
  jmp    L120
L53:
  mov    %ebx,%eax
  jmp    L147
L214:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D23
type: byte[16]
name: retrieve_data
arguments: data_label: D25
type: byte[16]

tool: {"D23": [0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

tool: {"D25": [0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00]}

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;
      }
    }
  }
}
```