user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<arch_select_free_register>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x1,-0x4(%rbp)
  movl   $0x25,-0x8(%rbp)
  jmp    L148
L139:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L148:
  cmpl   $0x1,-0x4(%rbp)
  jne    L22
  cmpl   $0x2c,-0x8(%rbp)
  jle    L139
L22:
  movl   $0x1d,-0x8(%rbp)
  jmp    L21
L98:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L21:
  cmpl   $0x1,-0x4(%rbp)
  jne    L19
  cmpl   $0x24,-0x8(%rbp)
  jle    L98
L19:
  movl   $0x1a,-0x8(%rbp)
  jmp    L210
L267:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  subl   $0x1,-0x8(%rbp)
L210:
  cmpl   $0x1,-0x4(%rbp)
  jne    L173
  cmpl   $0x12,-0x8(%rbp)
  jg     L267
L173:
  movl   $0xb,-0x8(%rbp)
  jmp    L197
L240:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L197:
  cmpl   $0x1,-0x4(%rbp)
  jne    L17
  cmpl   $0x12,-0x8(%rbp)
  jle    L240
L17:
  movl   $0x3,-0x8(%rbp)
  jmp    L255
L66:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L255:
  cmpl   $0x1,-0x4(%rbp)
  jne    L209
  cmpl   $0xa,-0x8(%rbp)
  jle    L66
L209:
  movl   $0x3,-0x8(%rbp)
  jmp    L144
L157:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L144:
  cmpl   $0x1,-0x4(%rbp)
  jne    L228
  cmpl   $0x6,-0x8(%rbp)
  jle    L157
L228:
  movl   $0x1c,-0x8(%rbp)
  jmp    L137
L90:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L137:
  cmpl   $0x1,-0x4(%rbp)
  jne    L14
  cmpl   $0x1c,-0x8(%rbp)
  jle    L90
L14:
  movl   $0x1b,-0x8(%rbp)
  jmp    L18
L135:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L18:
  cmpl   $0x1,-0x4(%rbp)
  jne    L202
  cmpl   $0x1b,-0x8(%rbp)
  jle    L135
L202:
  movl   $0x2,-0x8(%rbp)
  jmp    L212
L117:
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <do_select_reg@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L212:
  cmpl   $0x1,-0x4(%rbp)
  jne    L74
  cmpl   $0x2,-0x8(%rbp)
  jle    L117
L74:
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int arch_select_free_register(struct compile_state *state, char *used, int classes) {
  int i, reg;
  reg = 1;
  for (i = 37; (reg == 1) && (i <= 44); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 29; (reg == 1) && (i <= 36); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 26; (reg == 1) && (i >= 19); i--) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 11; (reg == 1) && (i <= 18); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 3; (reg == 1) && (i <= 10); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 3; (reg == 1) && (i <= 6); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 28; (reg == 1) && (i <= 28); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 27; (reg == 1) && (i <= 27); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  for (i = 2; (reg == 1) && (i <= 2); i++) {
    reg = do_select_reg(state, used, i, classes);
  }
  return reg;
}
```