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

```asm
<update_program>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D98(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0x0,%eax
  call   <uart_get_file_size@plt>
  mov    %eax,%r12d
  lea    D81(%rip),%rdi
  call   <uart_printf@plt>
  mov    %r12d,%edi
  call   <uart_print_int@plt>
  lea    D95(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0x0,%ebx
  mov    $0x0,%r13d
  mov    $0x0,%ebp
  mov    $0x1,%r14d
  jmp    L60
L35:
  cmp    $0x1,%r13d
  sbb    $0xffffffff,%ebp
L12:
  cmp    $0xffffff,%ebp
  je     L14
  cmp    %r12d,%ebx
  je     L14
L60:
  movslq %ebx,%rdi
  add    $0x5fc00000,%rdi
  call   <uart_get_file@plt>
  test   %rax,%rax
  je     L35
  add    $0x1,%ebx
  mov    %r14d,%r13d
  mov    $0x0,%ebp
  jmp    L12
L14:
  test   %ebx,%ebx
  je     L61
  lea    D54(%rip),%rdi
  call   <uart_printf@plt>
  mov    %ebx,%edi
  call   <uart_print_int@plt>
  lea    D28(%rip),%rdi
  call   <uart_printf@plt>
  lea    D93(%rip),%rdi
  call   <uart_printf@plt>
  mov    $0x5fc0000f,%esi
  mov    $0x5fc00000,%edi
  call   <sdram_read@plt>
  lea    D70(%rip),%rdi
  call   <uart_printf@plt>
  lea    0x5fbfffff(%rbx),%esi
  lea    0x5fbffff0(%rbx),%edi
  call   <sdram_read@plt>
  lea    D31(%rip),%rdi
  call   <uart_puts@plt>
  lea    D134(%rip),%rdi
  call   <uart_printf@plt>
  mov    $0x0,%eax
  call   <uart_getc@plt>
  mov    %eax,%ebp
  lea    D85(%rip),%rdi
  call   <uart_puts@plt>
  and    $0xffffffdf,%ebp
  cmp    $0x59,%bpl
  jne    L54
  lea    D42(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0x0,%edi
  call   <nand_erase_block@plt>
  mov    %ebx,%esi
  mov    $0x5fc00000,%edi
  call   <write_to_boot@plt>
  lea    D69(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0x0,%eax
L11:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L61:
  lea    D137(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0xffffffff,%eax
  jmp    L11
L54:
  lea    D119(%rip),%rdi
  call   <uart_puts@plt>
  mov    $0xffffffff,%eax
  jmp    L11
```

tool_calls: name: read_data
arguments: label: D98
type_guessed: string
name: read_data
arguments: label: D81
type_guessed: string
name: read_data
arguments: label: D95
type_guessed: string
name: read_data
arguments: label: D54
type_guessed: string
name: read_data
arguments: label: D28
type_guessed: string
name: read_data
arguments: label: D93
type_guessed: string
name: read_data
arguments: label: D70
type_guessed: string
name: read_data
arguments: label: D31
type_guessed: string
name: read_data
arguments: label: D134
type_guessed: string
name: read_data
arguments: label: D85
type_guessed: string
name: read_data
arguments: label: D42
type_guessed: string
name: read_data
arguments: label: D69
type_guessed: string
name: read_data
arguments: label: D137
type_guessed: string
name: read_data
arguments: label: D119
type_guessed: string

tool: D98: Please send binary file!

tool: D81: file size = 

tool: D95: 
Receiving binary file ...

tool: D54: 
Received 

tool: D28:  bytes data.


tool: D93: 
The first 16 byte are:

tool: D70: 
The last 16 bytes are:

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

tool: D134:  >> 

tool: 

tool: D42: Updating ...

tool: D69: Update done!

tool: D137: No file receive.

tool: D119: 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;
}
```