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

```asm
<update_program>:
  endbr64
  push   %r14
  lea    D5(%rip),%rdi
  xor    %r14d,%r14d
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  xor    %ebx,%ebx
  call   <uart_puts@plt>
  xor    %eax,%eax
  call   <uart_get_file_size@plt>
  lea    D30(%rip),%rdi
  mov    %eax,%r12d
  call   <uart_printf@plt>
  mov    %r12d,%edi
  call   <uart_print_int@plt>
  lea    D105(%rip),%rdi
  call   <uart_puts@plt>
  nopl   0x0(%rax)
L21:
  lea    0x5fc00000(%rbx),%rdi
  call   <uart_get_file@plt>
  test   %rax,%rax
  je     L69
  add    $0x1,%ebp
  cmp    %ebp,%r12d
  je     L61
  mov    $0x1,%r14d
  xor    %r13d,%r13d
  movslq %ebp,%rbx
  jmp    L21
  nopw   0x0(%rax,%rax,1)
L69:
  test   %r14d,%r14d
  je     L23
  add    $0x1,%r13d
  cmp    $0xffffff,%r13d
  je     L61
L23:
  cmp    %r12d,%ebp
  jne    L21
L61:
  test   %ebp,%ebp
  je     L86
  lea    D90(%rip),%rdi
  call   <uart_printf@plt>
  mov    %ebp,%edi
  call   <uart_print_int@plt>
  lea    D11(%rip),%rdi
  call   <uart_printf@plt>
  lea    D114(%rip),%rdi
  call   <uart_printf@plt>
  mov    $0x5fc0000f,%esi
  mov    $0x5fc00000,%edi
  call   <sdram_read@plt>
  lea    D124(%rip),%rdi
  call   <uart_printf@plt>
  lea    0x5fbfffff(%rbp),%esi
  lea    0x5fbffff0(%rbp),%edi
  call   <sdram_read@plt>
  lea    D40(%rip),%rdi
  call   <uart_puts@plt>
  lea    D22(%rip),%rdi
  call   <uart_printf@plt>
  xor    %eax,%eax
  call   <uart_getc@plt>
  lea    D89(%rip),%rdi
  mov    %eax,%ebx
  call   <uart_puts@plt>
  and    $0xffffffdf,%ebx
  cmp    $0x59,%bl
  jne    L50
  lea    D35(%rip),%rdi
  call   <uart_puts@plt>
  xor    %edi,%edi
  call   <nand_erase_block@plt>
  mov    %ebp,%esi
  mov    $0x5fc00000,%edi
  call   <write_to_boot@plt>
  lea    D4(%rip),%rdi
  call   <uart_puts@plt>
  xor    %eax,%eax
L45:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L86:
  lea    D44(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0xffffffff,%eax
  jmp    L45
L50:
  lea    D93(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0xffffffff,%eax
  jmp    L45
```

tool_calls: name: parse_data
arguments: data_label: D5
type: string
name: parse_data
arguments: data_label: D30
type: string
name: parse_data
arguments: data_label: D105
type: string
name: parse_data
arguments: data_label: D90
type: string
name: parse_data
arguments: data_label: D11
type: string
name: parse_data
arguments: data_label: D114
type: string
name: parse_data
arguments: data_label: D124
type: string
name: parse_data
arguments: data_label: D40
type: string
name: parse_data
arguments: data_label: D22
type: string
name: parse_data
arguments: data_label: D89
type: string
name: parse_data
arguments: data_label: D35
type: string
name: parse_data
arguments: data_label: D4
type: string
name: parse_data
arguments: data_label: D44
type: string
name: parse_data
arguments: data_label: D93
type: string

tool: D5: Please send binary file!

tool: D30: file size = 

tool: D105: 
Receiving binary file ...

tool: D90: 
Received 

tool: D11:  bytes data.


tool: D114: 
The first 16 byte are:

tool: D124: 
The last 16 bytes are:

tool: D40: 
Do you sure update this program? (Y/n)

tool: D22:  >> 

tool: 

tool: D35: Updating ...

tool: D4: Update done!

tool: D44: No file receive.

tool: D93: You have cancel update.

assistant: ```c
int update_program(void) {
  unsigned int addr = 0x5FC00000;
  unsigned char *buffer = (unsigned char *)addr;
  unsigned int wait_time = 0;
  int start = 0;
  int length = 0;
  int size = 0;
  uart_puts("Please send binary file!");
  size = uart_get_file_size();
  uart_printf("file size = ");
  uart_print_int(size);
  uart_puts("\nReceiving binary file ...");
  while (1) {
    if (uart_get_file(&buffer[length])) {
      start = 1;
      wait_time = 0;
      ++length;
    } else {
      if (start)
        ++wait_time;
    }
    if (length == size)
      break;
    if (wait_time == 0x00FFFFFF)
      break;
  }
  if (length == 0) {
    uart_puts("No file receive.");
    return -1;
  }
  uart_printf("\nReceived ");
  uart_print_int(length);
  uart_printf(" bytes data.\n");
  uart_printf("\nThe first 16 byte are:");
  sdram_read(addr, addr + 0xF);
  uart_printf("\nThe last 16 bytes are:");
  sdram_read(addr + length - 1 - 0xF, addr + length - 1);
  uart_puts("\nDo you sure update this program? (Y/n)");
  uart_printf(" >> ");
  char ch = uart_getc();
  uart_puts("");
  if (ch != 'Y' && ch != 'y') {
    uart_puts("You have cancel update.");
    return -1;
  }
  uart_puts("Updating ...");
  nand_erase_block(0);
  write_to_boot(addr, length);
  uart_puts("Update done!");
  return 0;
}
```