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

```asm
<FS460_set_input_mode>:
  endbr64
  push   %rbp
  lea    -0x1(%rdi),%edx
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0x1000,%eax
  cmp    $0x1,%edx
  ja     L262
  mov    %edi,%ebx
  mov    %esi,%ebp
  lea    0x8(%rsp),%rsi
  mov    $0x3c,%edi
  call   <sio_read_reg@plt>
  test   %eax,%eax
  je     L227
L262:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L128
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L227:
  lea    0x10(%rsp),%rsi
  mov    $0x3e,%edi
  call   <sio_read_reg@plt>
  test   %eax,%eax
  jne    L262
  cmp    $0x2,%ebp
  je     L48
  jg     L101
  test   %ebp,%ebp
  je     L206
  cmp    $0x1,%ebp
  jne    L156
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rax
  cmp    $0x2,%ebx
  je     L214
  and    $0xfffffffffffffbf7,%rax
  and    $0xfffffffffffffbff,%rsi
  or     $0x1010,%rax
  mov    %rsi,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L252
  nopl   0x0(%rax)
L101:
  cmp    $0x3,%ebp
  jne    L156
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rax
  cmp    $0x2,%ebx
  je     L94
  and    $0xfffffffffffffbff,%rsi
  or     $0x1419,%rax
  mov    %rsi,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L252:
  mov    $0x3c,%edi
  call   <sio_write_reg@plt>
  test   %eax,%eax
  jne    L262
  mov    0x10(%rsp),%rsi
  mov    $0x3e,%edi
  call   <sio_write_reg@plt>
  jmp    L262
  cs nopw 0x0(%rax,%rax,1)
L94:
  and    $0xfffffffffffff7ff,%rsi
  or     $0x2825,%rax
  mov    %rsi,0x8(%rsp)
L112:
  mov    %rax,0x10(%rsp)
  jmp    L252
  nopl   0x0(%rax)
L214:
  and    $0xfffffffffffff7fb,%rax
  and    $0xfffffffffffff7ff,%rsi
  or     $0x2020,%rax
  mov    %rsi,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L252
  nop
L156:
  mov    0x8(%rsp),%rsi
  jmp    L252
  nopw   0x0(%rax,%rax,1)
L48:
  lea    0x4(%rsp),%rsi
  cmp    $0x2,%ebx
  je     L138
  mov    $0x2,%edi
  call   <FS460_get_input_mode@plt>
  test   %eax,%eax
  jne    L262
  cmpl   $0x2,0x4(%rsp)
  je     L251
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rax
  or     $0x400,%rsi
  and    $0xffffffffffffffee,%rax
  mov    %rsi,0x8(%rsp)
  or     $0x14,%ah
  jmp    L112
  nopl   0x0(%rax)
L206:
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rax
  cmp    $0x2,%ebx
  je     L67
  and    $0xfffffffffffffbff,%rsi
  and    $0xeb,%ah
  mov    %rsi,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L252
  nopl   0x0(%rax,%rax,1)
L138:
  mov    $0x1,%edi
  call   <FS460_get_input_mode@plt>
  test   %eax,%eax
  jne    L262
  cmpl   $0x2,0x4(%rsp)
  je     L251
  mov    0x8(%rsp),%rsi
  mov    0x10(%rsp),%rax
  or     $0x800,%rsi
  and    $0xffffffffffffffde,%rax
  mov    %rsi,0x8(%rsp)
  or     $0x28,%ah
  jmp    L112
  nopl   0x0(%rax,%rax,1)
L67:
  and    $0xfffffffffffff7ff,%rsi
  and    $0xd7,%ah
  mov    %rsi,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L252
L251:
  mov    $0x1125,%eax
  jmp    L262
L128:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int FS460_set_input_mode(int input, int mode) {
  int err;
  unsigned long mux1, mux2;
  if ((1 != input) && (2 != input))
    return 0x1000;
  err = sio_read_reg(0x3C, &mux1);
  if (err)
    return err;
  err = sio_read_reg(0x3E, &mux2);
  if (err)
    return err;
  switch (mode) {
  case 0: {
    switch (input) {
    case 1: {
      mux1 &= ~(1 << 10);
      mux2 &= ~(1 << 10);
      mux2 &= ~(1 << 12);
    } break;
    case 2: {
      mux1 &= ~(1 << 11);
      mux2 &= ~(1 << 11);
      mux2 &= ~(1 << 13);
    }
    }
  } break;
  case 1: {
    switch (input) {
    case 1: {
      mux1 &= ~(1 << 10);
      mux2 &= ~(1 << 3);
      mux2 |= (1 << 4);
      mux2 &= ~(1 << 10);
      mux2 |= (1 << 12);
    } break;
    case 2: {
      mux1 &= ~(1 << 11);
      mux2 &= ~(1 << 2);
      mux2 |= (1 << 5);
      mux2 &= ~(1 << 11);
      mux2 |= (1 << 13);
    }
    }
  } break;
  case 2: {
    int i;
    switch (input) {
    case 1: {
      err = FS460_get_input_mode(2, &i);
      if (err)
        return err;
      if (2 == i)
        return 0x1125;
      mux1 |= (1 << 10);
      mux2 &= ~(1 << 0);
      mux2 &= ~(1 << 4);
      mux2 |= (1 << 10);
      mux2 |= (1 << 12);
    } break;
    case 2: {
      err = FS460_get_input_mode(1, &i);
      if (err)
        return err;
      if (2 == i)
        return 0x1125;
      mux1 |= (1 << 11);
      mux2 &= ~(1 << 0);
      mux2 &= ~(1 << 5);
      mux2 |= (1 << 11);
      mux2 |= (1 << 13);
    } break;
    }
  } break;
  case 3: {
    switch (input) {
    case 1: {
      mux1 &= ~(1 << 10);
      mux2 |= (1 << 0);
      mux2 |= (1 << 3);
      mux2 |= (1 << 4);
      mux2 |= (1 << 10);
      mux2 |= (1 << 12);
    } break;
    case 2: {
      mux1 &= ~(1 << 11);
      mux2 |= (1 << 0);
      mux2 |= (1 << 2);
      mux2 |= (1 << 5);
      mux2 |= (1 << 11);
      mux2 |= (1 << 13);
    } break;
    }
  } break;
  }
  err = sio_write_reg(0x3C, mux1);
  if (err)
    return err;
  err = sio_write_reg(0x3E, mux2);
  if (err)
    return err;
  return 0;
}
```