user: 请将以下的汇编代码转换成C语言代码:

```asm
<mborg_isqrt4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  cmpq   $0x3fffffff,-0x18(%rbp)
  jbe    L19
  movl   $0x8000,-0x8(%rbp)
  subq   $0x40000000,-0x18(%rbp)
L19:
  mov    -0x8(%rbp),%eax
  shl    $0xf,%eax
  add    $0x10000000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L28
  addl   $0x4000,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L28:
  mov    -0x8(%rbp),%eax
  shl    $0xe,%eax
  add    $0x4000000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L46
  addl   $0x2000,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L46:
  mov    -0x8(%rbp),%eax
  shl    $0xd,%eax
  add    $0x1000000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L86
  addl   $0x1000,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L86:
  mov    -0x8(%rbp),%eax
  shl    $0xc,%eax
  add    $0x400000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L133
  addl   $0x800,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L133:
  mov    -0x8(%rbp),%eax
  shl    $0xb,%eax
  add    $0x100000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L45
  addl   $0x400,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L45:
  mov    -0x8(%rbp),%eax
  shl    $0xa,%eax
  add    $0x40000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L76
  addl   $0x200,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L76:
  mov    -0x8(%rbp),%eax
  shl    $0x9,%eax
  add    $0x10000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L150
  addl   $0x100,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L150:
  mov    -0x8(%rbp),%eax
  shl    $0x8,%eax
  add    $0x4000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L138
  subl   $0xffffff80,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L138:
  mov    -0x8(%rbp),%eax
  shl    $0x7,%eax
  add    $0x1000,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L87
  addl   $0x40,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L87:
  mov    -0x8(%rbp),%eax
  shl    $0x6,%eax
  add    $0x400,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L16
  addl   $0x20,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L16:
  mov    -0x8(%rbp),%eax
  shl    $0x5,%eax
  add    $0x100,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L139
  addl   $0x10,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L139:
  mov    -0x8(%rbp),%eax
  shl    $0x4,%eax
  add    $0x40,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L72
  addl   $0x8,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L72:
  mov    -0x8(%rbp),%eax
  shl    $0x3,%eax
  add    $0x10,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L156
  addl   $0x4,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L156:
  mov    -0x8(%rbp),%eax
  shl    $0x2,%eax
  add    $0x4,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L113
  addl   $0x2,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %rax,-0x18(%rbp)
L113:
  mov    -0x8(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    %rax,-0x18(%rbp)
  jb     L12
  addl   $0x1,-0x8(%rbp)
L12:
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

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;
}
```