user: What is the c source code of the assembly code below?

```asm
<lg>:
  endbr64
  mov    D1(%rip),%rdx
  mov    $0x1,%r8d
  mov    %edi,%eax
  movslq (%rdx),%rdx
  shl    $0x2,%rdx
  mov    %rdx,%rcx
  shr    %rcx
  shl    %cl,%r8d
  sub    $0x1,%r8d
  shl    %cl,%r8d
  and    %edi,%r8d
  je     L211
  shr    %cl,%eax
  mov    %ecx,%r8d
L211:
  mov    %rdx,%rcx
  shr    $0x2,%rcx
  cmp    $0x4,%rdx
  je     L52
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L49
L52:
  lea    0x7(%rdx),%rcx
  shr    $0x3,%rcx
  cmp    $0x1,%rcx
  je     L45
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L69
L45:
  lea    0xf(%rdx),%rcx
  shr    $0x4,%rcx
  cmp    $0x1,%rcx
  je     L81
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L139
L81:
  lea    0x1f(%rdx),%rcx
  shr    $0x5,%rcx
  cmp    $0x1,%rcx
  je     L32
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L185
L32:
  lea    0x3f(%rdx),%rcx
  shr    $0x6,%rcx
  cmp    $0x1,%rcx
  je     L169
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L218
L169:
  lea    0x7f(%rdx),%rcx
  shr    $0x7,%rcx
  cmp    $0x1,%rcx
  je     L144
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L87
L144:
  lea    0xff(%rdx),%rcx
  shr    $0x8,%rcx
  cmp    $0x1,%rcx
  je     L177
  mov    $0x1,%esi
  shl    %cl,%esi
  sub    $0x1,%esi
  shl    %cl,%esi
  test   %eax,%esi
  jne    L133
L177:
  lea    0x1ff(%rdx),%rcx
  shr    $0x9,%rcx
  cmp    $0x1,%rcx
  je     L135
  mov    $0x1,%edx
  shl    %cl,%edx
  sub    $0x1,%edx
  shl    %cl,%edx
  test   %eax,%edx
  je     L135
  shr    %cl,%eax
  add    %ecx,%r8d
L135:
  and    $0x2,%eax
  cmp    $0x1,%eax
  sbb    $0xffffffff,%r8d
  mov    %r8d,%eax
  ret
L133:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L177
  nopw   0x0(%rax,%rax,1)
L87:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L144
  nopw   0x0(%rax,%rax,1)
L218:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L169
  nopw   0x0(%rax,%rax,1)
L185:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L139:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L69:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L45
  nopw   0x0(%rax,%rax,1)
L49:
  shr    %cl,%eax
  add    %ecx,%r8d
  jmp    L52
```

assistant: ```c
unsigned lg(unsigned int v) {
  unsigned r = 0;
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (1)) - 1) >> (1)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (1)) - 1) >> (1))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (1)) - 1) >> (1)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (1)) - 1) >> (1)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (1)) - 1) >> (1));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (2)) - 1) >> (2)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (2)) - 1) >> (2))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (2)) - 1) >> (2)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (2)) - 1) >> (2)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (2)) - 1) >> (2));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (3)) - 1) >> (3)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (3)) - 1) >> (3))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (3)) - 1) >> (3)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (3)) - 1) >> (3)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (3)) - 1) >> (3));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (4)) - 1) >> (4)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (4)) - 1) >> (4))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (4)) - 1) >> (4)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (4)) - 1) >> (4)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (4)) - 1) >> (4));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (5)) - 1) >> (5)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (5)) - 1) >> (5))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (5)) - 1) >> (5)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (5)) - 1) >> (5)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (5)) - 1) >> (5));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (6)) - 1) >> (6)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (6)) - 1) >> (6))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (6)) - 1) >> (6)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (6)) - 1) >> (6)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (6)) - 1) >> (6));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (7)) - 1) >> (7)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (7)) - 1) >> (7))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (7)) - 1) >> (7)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (7)) - 1) >> (7)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (7)) - 1) >> (7));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (8)) - 1) >> (8)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (8)) - 1) >> (8))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (8)) - 1) >> (8)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (8)) - 1) >> (8)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (8)) - 1) >> (8));
  if (((((sizeof(unsigned int) * CHAR_BIT) + (1 << (9)) - 1) >> (9)) != 1) && (v & ((((unsigned int)1 << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (9)) - 1) >> (9))) - 1) << (((sizeof(unsigned int) * CHAR_BIT) + (1 << (9)) - 1) >> (9)))))
    v >>= (((sizeof(unsigned int) * CHAR_BIT) + (1 << (9)) - 1) >> (9)), r += (((sizeof(unsigned int) * CHAR_BIT) + (1 << (9)) - 1) >> (9));
  if (v & 2)
    ++r;
  return r;
}
```