user: Converte this assembly snippet into its equivalent C code:

```asm
<cmdCfgAdslSetting>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  lea    D18(%rip),%rsi
  push   %rbx
  mov    %rbp,%rdi
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r12
  mov    %r12,%rdx
  call   <getArgValue@plt>
  mov    %r12,%rdx
  lea    D87(%rip),%rsi
  mov    %rbp,%rdi
  cmp    $0x1,%eax
  sete   %bl
  call   <getArgValue@plt>
  shl    $0x3,%ebx
  mov    %r12,%rdx
  mov    %rbp,%rdi
  mov    %eax,%r8d
  mov    %ebx,%eax
  lea    D98(%rip),%rsi
  or     $0x2,%eax
  cmp    $0x1,%r8d
  cmove  %eax,%ebx
  call   <getArgValue@plt>
  mov    %r12,%rdx
  lea    D52(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r8d
  mov    %ebx,%eax
  or     $0x1,%eax
  cmp    $0x1,%r8d
  cmove  %eax,%ebx
  call   <getArgValue@plt>
  mov    %r12,%rdx
  lea    D79(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r8d
  mov    %ebx,%eax
  or     $0x10,%eax
  cmp    $0x1,%r8d
  cmove  %eax,%ebx
  call   <getArgValue@plt>
  mov    %r12,%rdx
  lea    D23(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r8d
  mov    %ebx,%eax
  or     $0x40,%eax
  cmp    $0x1,%r8d
  cmove  %eax,%ebx
  call   <getArgValue@plt>
  mov    %r12,%rdx
  lea    D95(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r8d
  mov    %ebx,%eax
  or     $0x20,%eax
  cmp    $0x1,%r8d
  cmove  %eax,%ebx
  call   <getArgValue@plt>
  mov    %r12,%rdx
  lea    D37(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r8d
  mov    %ebx,%eax
  or     $0x80,%al
  cmp    $0x1,%r8d
  cmove  %eax,%ebx
  call   <getArgValue@plt>
  lea    D15(%rip),%rsi
  mov    %rbp,%rdi
  mov    %r12,%rdx
  cmp    $0x1,%eax
  sete   %r13b
  call   <getArgValue@plt>
  movzwl %bx,%edi
  mov    %eax,%r8d
  mov    %r13d,%eax
  or     $0x2,%eax
  cmp    $0x1,%r8d
  cmove  %eax,%r13d
  movsbl %r13b,%esi
  call   <setAdslSettings@plt>
  cmp    $0xffffffff,%eax
  je     L20
L19:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L20:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  jmp    L19
L11:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D18
type: string
name: read_data
arguments: label: D87
type: string
name: read_data
arguments: label: D98
type: string
name: read_data
arguments: label: D52
type: string
name: read_data
arguments: label: D79
type: string
name: read_data
arguments: label: D23
type: string
name: read_data
arguments: label: D95
type: string
name: read_data
arguments: label: D37
type: string
name: read_data
arguments: label: D15
type: string
name: read_data
arguments: label: D0
type: string

tool: D18: g.lite

tool: D87: g.dmt

tool: D98: t1.413

tool: D52: adsl2

tool: D79: adsl2+

tool: D23: annexl

tool: D95: annexm

tool: D37: bitswap

tool: D15: sra

tool: D0: Set ADSL error!


assistant: ```c
void cmdCfgAdslSetting(int cmdType, struct cmd_arg *pCmdArg) {
  unsigned short mode = 0;
  char olr = 0;
  int intVal;
  if (getArgValue(pCmdArg, "g.lite", (void *)&intVal) == 1) {
    mode |= 0x0008;
  }
  if (getArgValue(pCmdArg, "g.dmt", (void *)&intVal) == 1) {
    mode |= 0x0002;
  }
  if (getArgValue(pCmdArg, "t1.413", (void *)&intVal) == 1) {
    mode |= 0x0001;
  }
  if (getArgValue(pCmdArg, "adsl2", (void *)&intVal) == 1) {
    mode |= 0x0010;
  }
  if (getArgValue(pCmdArg, "adsl2+", (void *)&intVal) == 1) {
    mode |= 0x0040;
  }
  if (getArgValue(pCmdArg, "annexl", (void *)&intVal) == 1) {
    mode |= 0x0020;
  }
  if (getArgValue(pCmdArg, "annexm", (void *)&intVal) == 1) {
    mode |= 0x0080;
  }
  if (getArgValue(pCmdArg, "bitswap", (void *)&intVal) == 1) {
    olr |= 1;
  }
  if (getArgValue(pCmdArg, "sra", (void *)&intVal) == 1) {
    olr |= 2;
  }
  if (setAdslSettings(mode, olr) == -1) {
    printf("Set ADSL error!\n");
  }
}
```