user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mborg_isqrt4>:
  endbr64
  mov    %rdi,%rax
  cmp    $0x3fffffff,%rdi
  jbe    L86
  sub    $0x40000000,%rax
  mov    $0x50000000,%edx
  mov    $0x8000,%r8d
L62:
  cmp    %rdx,%rax
  jb     L64
  add    $0x4000,%r8d
  sub    %rdx,%rax
L64:
  mov    %r8d,%edx
  shl    $0xe,%edx
  add    $0x4000000,%edx
  cmp    %rax,%rdx
  ja     L115
  add    $0x2000,%r8d
  sub    %rdx,%rax
L115:
  mov    %r8d,%edx
  shl    $0xd,%edx
  add    $0x1000000,%edx
  cmp    %rax,%rdx
  ja     L40
  add    $0x1000,%r8d
  sub    %rdx,%rax
L40:
  mov    %r8d,%edx
  shl    $0xc,%edx
  add    $0x400000,%edx
  cmp    %rax,%rdx
  ja     L46
  add    $0x800,%r8d
  sub    %rdx,%rax
L46:
  mov    %r8d,%edx
  shl    $0xb,%edx
  add    $0x100000,%edx
  cmp    %rax,%rdx
  ja     L43
  add    $0x400,%r8d
  sub    %rdx,%rax
L43:
  mov    %r8d,%edx
  shl    $0xa,%edx
  add    $0x40000,%edx
  cmp    %rax,%rdx
  ja     L7
  add    $0x200,%r8d
  sub    %rdx,%rax
L7:
  mov    %r8d,%edx
  shl    $0x9,%edx
  add    $0x10000,%edx
  cmp    %rax,%rdx
  ja     L28
  add    $0x100,%r8d
  sub    %rdx,%rax
L28:
  mov    %r8d,%edx
  shl    $0x8,%edx
  add    $0x4000,%edx
  cmp    %rax,%rdx
  ja     L78
  sub    $0xffffff80,%r8d
  sub    %rdx,%rax
L78:
  mov    %r8d,%edx
  shl    $0x7,%edx
  add    $0x1000,%edx
  cmp    %rax,%rdx
  ja     L57
  add    $0x40,%r8d
  sub    %rdx,%rax
L57:
  mov    %r8d,%edx
  shl    $0x6,%edx
  add    $0x400,%edx
  cmp    %rax,%rdx
  ja     L36
  add    $0x20,%r8d
  sub    %rdx,%rax
L36:
  mov    %r8d,%edx
  shl    $0x5,%edx
  add    $0x100,%edx
  cmp    %rax,%rdx
  ja     L143
  add    $0x10,%r8d
  sub    %rdx,%rax
L143:
  mov    %r8d,%edx
  shl    $0x4,%edx
  add    $0x40,%edx
  cmp    %rax,%rdx
  ja     L10
  add    $0x8,%r8d
  sub    %rdx,%rax
L10:
  lea    0x10(,%r8,8),%edx
  cmp    %rax,%rdx
  ja     L87
  add    $0x4,%r8d
  sub    %rdx,%rax
L87:
  lea    0x4(,%r8,4),%edx
  cmp    %rax,%rdx
  ja     L33
  add    $0x2,%r8d
  sub    %rdx,%rax
L33:
  lea    0x1(%r8,%r8,1),%edx
  cmp    %rdx,%rax
  sbb    $0xffffffff,%r8d
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L86:
  mov    $0x10000000,%edx
  xor    %r8d,%r8d
  jmp    L62
```

assistant: ```c
unsigned int mborg_isqrt4(unsigned long val) {
  unsigned int temp, g = 0;
  if (val >= 0x40000000) {
    g = 0x8000;
    val -= 0x40000000;
  }
  temp = (g << (15)) + (1 << ((15) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((15) - 1);
    val -= temp;
  }
  temp = (g << (14)) + (1 << ((14) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((14) - 1);
    val -= temp;
  }
  temp = (g << (13)) + (1 << ((13) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((13) - 1);
    val -= temp;
  }
  temp = (g << (12)) + (1 << ((12) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((12) - 1);
    val -= temp;
  }
  temp = (g << (11)) + (1 << ((11) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((11) - 1);
    val -= temp;
  }
  temp = (g << (10)) + (1 << ((10) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((10) - 1);
    val -= temp;
  }
  temp = (g << (9)) + (1 << ((9) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((9) - 1);
    val -= temp;
  }
  temp = (g << (8)) + (1 << ((8) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((8) - 1);
    val -= temp;
  }
  temp = (g << (7)) + (1 << ((7) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((7) - 1);
    val -= temp;
  }
  temp = (g << (6)) + (1 << ((6) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((6) - 1);
    val -= temp;
  }
  temp = (g << (5)) + (1 << ((5) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((5) - 1);
    val -= temp;
  }
  temp = (g << (4)) + (1 << ((4) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((4) - 1);
    val -= temp;
  }
  temp = (g << (3)) + (1 << ((3) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((3) - 1);
    val -= temp;
  }
  temp = (g << (2)) + (1 << ((2) * 2 - 2));
  if (val >= temp) {
    g += 1 << ((2) - 1);
    val -= temp;
  }
  temp = g + g + 1;
  if (val >= temp)
    g++;
  return g;
}
```