user: Translate the below assembly code into C programming language:

```asm
<itob>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  cmpl   $0x10,-0x18(%rbp)
  je     L102
  cmpl   $0x10,-0x18(%rbp)
  jg     L109
  cmpl   $0x2,-0x18(%rbp)
  je     L0
  cmpl   $0x8,-0x18(%rbp)
  je     L98
  jmp    L109
L0:
  movl   $0x0,-0x4(%rbp)
  jmp    L155
L100:
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x4(%rbp)
L155:
  cmpl   $0x0,-0x14(%rbp)
  jg     L100
  jmp    L109
L98:
  movl   $0x0,-0x4(%rbp)
  jmp    L145
L115:
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x14(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x4(%rbp)
L145:
  cmpl   $0x0,-0x14(%rbp)
  jg     L115
  jmp    L109
L102:
  movl   $0x0,-0x4(%rbp)
  jmp    L42
L12:
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  cmp    $0x9,%eax
  jg     L151
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L46
L151:
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  cmp    $0x9,%eax
  jle    L46
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  cmp    $0xf,%eax
  jg     L46
  mov    -0x14(%rbp),%eax
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  lea    0x37(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L46:
  mov    -0x14(%rbp),%eax
  lea    0xf(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x4,%eax
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x4(%rbp)
L42:
  cmpl   $0x0,-0x14(%rbp)
  jg     L12
  nop
L109:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <reverse@plt>
  nop
  leave
  ret
```

assistant: ```c
void itob(int n, char s[], int b) {
  int i;
  switch (b) {
  case 2:
    for (i = 0; n > 0; ++i) {
      s[i] = n % 2 + '0';
      n /= 2;
    }
    break;
  case 8:
    for (i = 0; n > 0; ++i) {
      s[i] = n % 8 + '0';
      n /= 8;
    }
    break;
  case 16:
    for (i = 0; n > 0; ++i) {
      if (n % 16 <= 9)
        s[i] = n % 16 + '0';
      else if (n % 16 >= 10 && n % 16 <= 15)
        s[i] = '7' + n % 16;
      n /= 16;
    }
    break;
  }
  s[i] = '\0';
  reverse(s);
}
```