user: 请从给定的汇编指令推导出C源代码:

```asm
<sqrti>:
  endbr64
  mov    %edi,%eax
  cmp    $0x3fffffff,%edi
  jle    L4
  sub    $0x40000000,%eax
  mov    $0x8000,%edx
L9:
  lea    0x1000(%rdx),%ecx
  shl    $0xe,%ecx
  cmp    %ecx,%eax
  jl     L120
  sub    %ecx,%eax
  or     $0x20,%dh
L120:
  lea    0x800(%rdx),%ecx
  shl    $0xd,%ecx
  cmp    %ecx,%eax
  jl     L0
  sub    %ecx,%eax
  or     $0x10,%dh
L0:
  lea    0x400(%rdx),%ecx
  shl    $0xc,%ecx
  cmp    %ecx,%eax
  jl     L109
  sub    %ecx,%eax
  or     $0x8,%dh
L109:
  lea    0x200(%rdx),%ecx
  shl    $0xb,%ecx
  cmp    %ecx,%eax
  jl     L1
  sub    %ecx,%eax
  or     $0x4,%dh
L1:
  lea    0x100(%rdx),%ecx
  shl    $0xa,%ecx
  cmp    %ecx,%eax
  jl     L17
  sub    %ecx,%eax
  or     $0x2,%dh
L17:
  lea    0x80(%rdx),%ecx
  shl    $0x9,%ecx
  cmp    %ecx,%eax
  jl     L136
  sub    %ecx,%eax
  or     $0x1,%dh
L136:
  lea    0x40(%rdx),%ecx
  shl    $0x8,%ecx
  cmp    %ecx,%eax
  jl     L157
  sub    %ecx,%eax
  or     $0x80,%dl
L157:
  lea    0x20(%rdx),%ecx
  shl    $0x7,%ecx
  cmp    %ecx,%eax
  jl     L115
  sub    %ecx,%eax
  or     $0x40,%edx
L115:
  lea    0x10(%rdx),%ecx
  shl    $0x6,%ecx
  cmp    %ecx,%eax
  jl     L133
  sub    %ecx,%eax
  or     $0x20,%edx
L133:
  lea    0x8(%rdx),%ecx
  shl    $0x5,%ecx
  cmp    %ecx,%eax
  jl     L66
  sub    %ecx,%eax
  or     $0x10,%edx
L66:
  lea    0x4(%rdx),%ecx
  shl    $0x4,%ecx
  cmp    %ecx,%eax
  jl     L37
  sub    %ecx,%eax
  or     $0x8,%edx
L37:
  lea    0x10(,%rdx,8),%ecx
  cmp    %ecx,%eax
  jl     L68
  sub    %ecx,%eax
  or     $0x4,%edx
L68:
  lea    0x4(,%rdx,4),%ecx
  cmp    %ecx,%eax
  jl     L11
  sub    %ecx,%eax
  or     $0x2,%edx
L11:
  lea    (%rdx,%rdx,1),%esi
  mov    %edx,%ecx
  or     $0x1,%ecx
  cmp    %eax,%esi
  cmovl  %ecx,%edx
  mov    %edx,%eax
  ret
L4:
  cmp    $0xfffffff,%edi
  jle    L146
  sub    $0x10000000,%eax
  mov    $0x4000,%edx
  jmp    L9
L146:
  mov    $0x0,%edx
  jmp    L9
```

assistant: ```c
uint32_t sqrti(uint32_t n) {
  uint32_t s, t;
  s = 0;
  if (n >= 1 << 30) {
    n -= 1 << 30;
    s = 1 << 15;
  }
  t = s + (1UL << (14 - 1));
  t <<= 14 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 14;
  };
  t = s + (1UL << (13 - 1));
  t <<= 13 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 13;
  };
  t = s + (1UL << (12 - 1));
  t <<= 12 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 12;
  };
  t = s + (1UL << (11 - 1));
  t <<= 11 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 11;
  };
  t = s + (1UL << (10 - 1));
  t <<= 10 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 10;
  };
  t = s + (1UL << (9 - 1));
  t <<= 9 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 9;
  };
  t = s + (1UL << (8 - 1));
  t <<= 8 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 8;
  };
  t = s + (1UL << (7 - 1));
  t <<= 7 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 7;
  };
  t = s + (1UL << (6 - 1));
  t <<= 6 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 6;
  };
  t = s + (1UL << (5 - 1));
  t <<= 5 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 5;
  };
  t = s + (1UL << (4 - 1));
  t <<= 4 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 4;
  };
  t = s + (1UL << (3 - 1));
  t <<= 3 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 3;
  };
  t = s + (1UL << (2 - 1));
  t <<= 2 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 2;
  };
  t = s + (1UL << (1 - 1));
  t <<= 1 + 1;
  if (n >= t) {
    n -= t;
    s |= 1UL << 1;
  };
  if (n > s << 1)
    s |= 1;
  return s;
}
```