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

```asm
<notmain>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    $0x0,%eax
  call   <leds_off@plt>
  mov    $0x0,%eax
  call   <uart_init@plt>
  mov    $0x12345678,%edi
  call   <hexstring@plt>
  mov    $0x0,%eax
  call   <GETPC@plt>
  mov    %eax,%edi
  call   <hexstring@plt>
  mov    $0x0,%eax
  call   <GETCPSR@plt>
  mov    %eax,%edi
  call   <hexstring@plt>
  mov    $0x0,%eax
  call   <GETSCTLR@plt>
  mov    %eax,%edi
  call   <hexstring@plt>
  mov    $0x49,%edi
  call   <uart_send@plt>
  mov    $0x48,%edi
  call   <uart_send@plt>
  mov    $0x45,%edi
  call   <uart_send@plt>
  mov    $0x58,%edi
  call   <uart_send@plt>
  mov    $0xd,%edi
  call   <uart_send@plt>
  mov    $0xa,%edi
  call   <uart_send@plt>
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x1c(%rbp)
L168:
  mov    $0x0,%eax
  call   <uart_recv@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x3a,-0x4(%rbp)
  jne    L150
  movl   $0x1,-0x20(%rbp)
  jmp    L89
L150:
  cmpl   $0xd,-0x4(%rbp)
  jne    L224
  movl   $0x0,-0x20(%rbp)
  jmp    L89
L224:
  cmpl   $0xa,-0x4(%rbp)
  jne    L7
  movl   $0x0,-0x20(%rbp)
  jmp    L89
L7:
  cmpl   $0x67,-0x4(%rbp)
  je     L259
  cmpl   $0x47,-0x4(%rbp)
  jne    L345
L259:
  mov    $0xd,%edi
  call   <uart_send@plt>
  mov    $0x2d,%edi
  call   <uart_send@plt>
  mov    $0x2d,%edi
  call   <uart_send@plt>
  mov    $0xd,%edi
  call   <uart_send@plt>
  mov    $0xa,%edi
  call   <uart_send@plt>
  mov    $0xa,%edi
  call   <uart_send@plt>
  mov    $0x8000,%edi
  call   <BRANCHTO@plt>
  movl   $0x0,-0x20(%rbp)
  jmp    L179
L345:
  cmpl   $0x15,-0x20(%rbp)
  ja     L168
  mov    -0x20(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D5(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  shll   $0x4,-0x1c(%rbp)
  cmpl   $0x39,-0x4(%rbp)
  jbe    L55
  subl   $0x7,-0x4(%rbp)
L55:
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  or     %eax,-0x1c(%rbp)
  andl   $0xff,-0x1c(%rbp)
  addl   $0x1,-0x20(%rbp)
  jmp    L89
  shll   $0x4,-0x18(%rbp)
  cmpl   $0x39,-0x4(%rbp)
  jbe    L277
  subl   $0x7,-0x4(%rbp)
L277:
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  or     %eax,-0x18(%rbp)
  andl   $0xffff,-0x18(%rbp)
  mov    -0x10(%rbp),%eax
  or     %eax,-0x18(%rbp)
  addl   $0x1,-0x20(%rbp)
  jmp    L89
  shll   $0x4,-0x14(%rbp)
  cmpl   $0x39,-0x4(%rbp)
  jbe    L160
  subl   $0x7,-0x4(%rbp)
L160:
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  or     %eax,-0x14(%rbp)
  andl   $0xff,-0x14(%rbp)
  addl   $0x1,-0x20(%rbp)
  jmp    L89
  shll   $0x4,-0x14(%rbp)
  cmpl   $0x39,-0x4(%rbp)
  jbe    L217
  subl   $0x7,-0x4(%rbp)
L217:
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  or     %eax,-0x14(%rbp)
  andl   $0xff,-0x14(%rbp)
  cmpl   $0x2,-0x14(%rbp)
  je     L267
  cmpl   $0x2,-0x14(%rbp)
  ja     L122
  cmpl   $0x0,-0x14(%rbp)
  je     L177
  cmpl   $0x1,-0x14(%rbp)
  je     L32
  jmp    L122
L177:
  movl   $0xe,-0x20(%rbp)
  jmp    L15
L32:
  movl   $0x0,-0x4(%rbp)
  jmp    L210
L271:
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hexstring@plt>
  addl   $0x1,-0x4(%rbp)
L210:
  cmpl   $0x13,-0x4(%rbp)
  jbe    L271
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L15
L267:
  movl   $0x9,-0x20(%rbp)
  jmp    L15
L122:
  movl   $0x0,-0x20(%rbp)
  nop
L15:
  jmp    L89
  shll   $0x4,-0x10(%rbp)
  cmpl   $0x39,-0x4(%rbp)
  jbe    L231
  subl   $0x7,-0x4(%rbp)
L231:
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  or     %eax,-0x10(%rbp)
  andl   $0xffff,-0x10(%rbp)
  addl   $0x1,-0x20(%rbp)
  jmp    L89
  shll   $0x4,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L89
  shll   $0x4,-0xc(%rbp)
  cmpl   $0x39,-0x4(%rbp)
  jbe    L220
  subl   $0x7,-0x4(%rbp)
L220:
  mov    -0x4(%rbp),%eax
  and    $0xf,%eax
  or     %eax,-0xc(%rbp)
  cmpl   $0x15,-0x20(%rbp)
  jne    L196
  mov    -0xc(%rbp),%eax
  shr    $0x18,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  shl    $0x18,%eax
  or     %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  shr    $0x8,%eax
  and    $0xff00,%eax
  or     %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0x8,%eax
  and    $0xff0000,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <PUT32@plt>
  mov    -0x18(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,-0x8(%rbp)
  addl   $0x4,-0x18(%rbp)
  movl   $0xe,-0x20(%rbp)
  jmp    L89
L196:
  addl   $0x1,-0x20(%rbp)
  jmp    L89
  nop
L89:
  jmp    L168
L179:
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int notmain(void) {
  unsigned int state;
  unsigned int byte_count;
  unsigned int address;
  unsigned int record_type;
  unsigned int segment;
  unsigned int data;
  unsigned int sum;
  unsigned int ra;
  leds_off();
  uart_init();
  hexstring(0x12345678);
  hexstring(GETPC());
  hexstring(GETCPSR());
  hexstring(GETSCTLR());
  uart_send('I');
  uart_send('H');
  uart_send('E');
  uart_send('X');
  uart_send(0x0D);
  uart_send(0x0A);
  state = 0;
  segment = 0;
  sum = 0;
  data = 0;
  record_type = 0;
  address = 0;
  byte_count = 0;
  while (1) {
    ra = uart_recv();
    if (ra == ':') {
      state = 1;
      continue;
    }
    if (ra == 0x0D) {
      state = 0;
      continue;
    }
    if (ra == 0x0A) {
      state = 0;
      continue;
    }
    if ((ra == 'g') || (ra == 'G')) {
      uart_send(0x0D);
      uart_send('-');
      uart_send('-');
      uart_send(0x0D);
      uart_send(0x0A);
      uart_send(0x0A);
      BRANCHTO(0x8000);
      state = 0;
      break;
    }
    switch (state) {
    case 0: {
      break;
    }
    case 1:
    case 2: {
      byte_count <<= 4;
      if (ra > 0x39)
        ra -= 7;
      byte_count |= (ra & 0xF);
      byte_count &= 0xFF;
      state++;
      break;
    }
    case 3:
    case 4:
    case 5:
    case 6: {
      address <<= 4;
      if (ra > 0x39)
        ra -= 7;
      address |= (ra & 0xF);
      address &= 0xFFFF;
      address |= segment;
      state++;
      break;
    }
    case 7: {
      record_type <<= 4;
      if (ra > 0x39)
        ra -= 7;
      record_type |= (ra & 0xF);
      record_type &= 0xFF;
      state++;
      break;
    }
    case 8: {
      record_type <<= 4;
      if (ra > 0x39)
        ra -= 7;
      record_type |= (ra & 0xF);
      record_type &= 0xFF;
      switch (record_type) {
      case 0x00: {
        state = 14;
        break;
      }
      case 0x01: {
        for (ra = 0; ra < 20; ra++)
          hexstring(sum);
        segment = 0;
        sum = 0;
        data = 0;
        record_type = 0;
        address = 0;
        byte_count = 0;
        state = 0;
        break;
      }
      case 0x02: {
        state = 9;
        break;
      }
      default: {
        state = 0;
        break;
      }
      }
      break;
    }
    case 9:
    case 10:
    case 11:
    case 12: {
      segment <<= 4;
      if (ra > 0x39)
        ra -= 7;
      segment |= (ra & 0xF);
      segment &= 0xFFFF;
      state++;
      break;
    }
    case 13: {
      segment <<= 4;
      state = 0;
      break;
    }
    case 14:
    case 15:
    case 16:
    case 17:
    case 18:
    case 19:
    case 20:
    case 21: {
      data <<= 4;
      if (ra > 0x39)
        ra -= 7;
      data |= (ra & 0xF);
      if (state == 21) {
        ra = (data >> 24) | (data << 24);
        ra |= (data >> 8) & 0x0000FF00;
        ra |= (data << 8) & 0x00FF0000;
        data = ra;
        PUT32(address, data);
        sum += address;
        sum += data;
        address += 4;
        state = 14;
      } else {
        state++;
      }
      break;
    }
    }
  }
  return (0);
}
```