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    L259
L265:
  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)
L259:
  cmpl   $0x1,-0x4(%rbp)
  jne    L244
  cmpl   $0x2c,-0x8(%rbp)
  jle    L265
L244:
  movl   $0x1d,-0x8(%rbp)
  jmp    L27
L251:
  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)
L27:
  cmpl   $0x1,-0x4(%rbp)
  jne    L23
  cmpl   $0x24,-0x8(%rbp)
  jle    L251
L23:
  movl   $0x1a,-0x8(%rbp)
  jmp    L237
L120:
  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)
L237:
  cmpl   $0x1,-0x4(%rbp)
  jne    L65
  cmpl   $0x12,-0x8(%rbp)
  jg     L120
L65:
  movl   $0xb,-0x8(%rbp)
  jmp    L55
L219:
  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)
L55:
  cmpl   $0x1,-0x4(%rbp)
  jne    L161
  cmpl   $0x12,-0x8(%rbp)
  jle    L219
L161:
  movl   $0x3,-0x8(%rbp)
  jmp    L235
L187:
  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)
L235:
  cmpl   $0x1,-0x4(%rbp)
  jne    L126
  cmpl   $0xa,-0x8(%rbp)
  jle    L187
L126:
  movl   $0x3,-0x8(%rbp)
  jmp    L109
L206:
  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)
L109:
  cmpl   $0x1,-0x4(%rbp)
  jne    L136
  cmpl   $0x6,-0x8(%rbp)
  jle    L206
L136:
  movl   $0x1c,-0x8(%rbp)
  jmp    L144
L196:
  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    L96
  cmpl   $0x1c,-0x8(%rbp)
  jle    L196
L96:
  movl   $0x1b,-0x8(%rbp)
  jmp    L157
L36:
  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)
L157:
  cmpl   $0x1,-0x4(%rbp)
  jne    L250
  cmpl   $0x1b,-0x8(%rbp)
  jle    L36
L250:
  movl   $0x2,-0x8(%rbp)
  jmp    L153
L87:
  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)
L153:
  cmpl   $0x1,-0x4(%rbp)
  jne    L54
  cmpl   $0x2,-0x8(%rbp)
  jle    L87
L54:
  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;
}
```