user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<__emdnorm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r14d
  mov    %edx,0x8(%rsp)
  mov    %ecx,%ebp
  mov    %r8d,%r15d
  mov    %r9d,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movw   $0x0,0x20(%rsp)
  movw   $0x1,0x1e(%rsp)
  call   <__enormlz@plt>
  sub    %eax,%ebp
  cmp    $0x50,%eax
  setg   %r12b
  cmp    $0x7ffe,%ebp
  setle  %al
  and    %al,%r12b
  jne    L1
  test   %ebp,%ebp
  js     L38
  test   %r15d,%r15d
  je     L85
  cmp    $0x40,%r13d
  je     L330
L308:
  test   %ebp,%ebp
  setle  %r12b
  cmp    $0x50,%r13d
  setne  %al
  movl   $0x7,0xc(%rsp)
  mov    $0x8,%r15d
  and    %al,%r12b
  jne    L107
L267:
  movslq %r15d,%rax
  lea    (%rbx,%rax,2),%rdx
  movzwl (%rdx),%eax
  cmp    $0x4f,%r13d
  jg     L334
  cmp    $0x7,%r15d
  jle    L326
  jmp    L334
L1:
  mov    %rbx,%rdi
  call   <__ecleazs@plt>
  jmp    L332
L38:
  cmp    $0xffffffb0,%ebp
  jl     L87
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <__eshift@plt>
  test   %eax,%eax
  mov    $0x1,%eax
  cmovne %eax,%r14d
  test   %r15d,%r15d
  je     L89
  cmp    $0x40,%r13d
  jne    L308
  movw   $0x0,0x1e(%rsp)
  movw   $0x1,0x1c(%rsp)
  test   %ebp,%ebp
  setle  %r12b
  movl   $0x6,0xc(%rsp)
  mov    $0x7,%r15d
L107:
  movzwl 0x10(%rbx),%eax
  and    $0x1,%eax
  or     %eax,%r14d
  mov    %rbx,%rdi
  call   <__eshdn1@plt>
  jmp    L267
L87:
  mov    %rbx,%rdi
  call   <__ecleazs@plt>
  jmp    L332
L330:
  movw   $0x0,0x1e(%rsp)
  movw   $0x1,0x1c(%rsp)
  test   %ebp,%ebp
  setle  %al
  jle    L76
  lea    0xe(%rbx),%rdx
  movzwl 0xe(%rbx),%eax
  movl   $0x6,0xc(%rsp)
L326:
  cmpw   $0x0,0x10(%rbx)
  je     L141
  or     $0x1,%eax
L141:
  movw   $0x0,0x10(%rbx)
L334:
  movw   $0x0,(%rdx)
  test   %ax,%ax
  js     L250
L338:
  test   %r12b,%r12b
  jne    L222
  cmpw   $0x0,0x4(%rbx)
  jne    L189
L85:
  movw   $0x0,0x10(%rbx)
  cmp    $0x7ffe,%ebp
  jg     L220
L101:
  test   %ebp,%ebp
  mov    $0x0,%eax
  cmovns %ebp,%eax
  mov    %ax,0x2(%rbx)
L332:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L156
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L76:
  mov    %eax,%r12d
  movl   $0x6,0xc(%rsp)
  mov    $0x7,%r15d
  jmp    L107
L250:
  cmp    $0x8000,%ax
  jne    L297
  test   %r14d,%r14d
  jne    L155
  movslq 0xc(%rsp),%rax
  testb  $0x1,(%rbx,%rax,2)
  je     L338
L297:
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <__eaddm@plt>
  jmp    L338
L155:
  cmpl   $0x0,0x8(%rsp)
  je     L297
  jmp    L338
L222:
  mov    %rbx,%rdi
  call   <__eshup1@plt>
  cmpw   $0x0,0x4(%rbx)
  jne    L189
  movw   $0x0,0x10(%rbx)
  jmp    L101
L189:
  mov    %rbx,%rdi
  call   <__eshdn1@plt>
  add    $0x1,%ebp
  jmp    L85
L220:
  movw   $0x7fff,0x2(%rbx)
  lea    0x4(%rbx),%rax
  add    $0x10,%rbx
L206:
  movw   $0x0,(%rax)
  add    $0x2,%rax
  cmp    %rax,%rbx
  jne    L206
  jmp    L332
L89:
  movw   $0x0,0x10(%rbx)
  jmp    L101
L156:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void __emdnorm(short unsigned int *s, int lost, int subflg, int expo, int rcntrl, int rndprc) {
  int i, j;
  unsigned short r;
  int rw = (6 + 3) - 1;
  int re = (6 + 3) - 2;
  const unsigned short rmsk = 0xffff;
  const unsigned short rmbit = 0x8000;
  unsigned short rbit[(6 + 3)] = {0, 0, 0, 0, 0, 0, 0, 1, 0};
  j = __enormlz(s);
  expo -= j;
  if ((j > (((6 + 3) - 4) * 16)) && (expo < 32767L)) {
    __ecleazs(s);
    return;
  }
  if (expo < 0L) {
    if (expo > (long)(-(((6 + 3) - 4) * 16) - 1)) {
      j = (int)expo;
      i = __eshift(s, j);
      if (i)
        lost = 1;
    } else {
      __ecleazs(s);
      return;
    }
  }
  if (rcntrl == 0)
    goto mdfin;
  if (rndprc == 64) {
    rw = 7;
    re = 6;
    rbit[(6 + 3) - 2] = 0;
    rbit[6] = 1;
  }
  if ((expo <= 0) && (rndprc != (((6 + 3) - 4) * 16))) {
    lost |= s[(6 + 3) - 1] & 1;
    __eshdn1(s);
  }
  r = s[rw] & rmsk;
  if (rndprc < (((6 + 3) - 4) * 16)) {
    i = rw + 1;
    while (i < (6 + 3)) {
      if (s[i])
        r |= 1;
      s[i] = 0;
      ++i;
    }
  }
  s[rw] &= (rmsk ^ 0xffff);
  if ((r & rmbit) != 0) {
    if (r == rmbit) {
      if (lost == 0) {
        if ((s[re] & 1) == 0)
          goto mddone;
      } else {
        if (subflg != 0)
          goto mddone;
      }
    }
    __eaddm(rbit, s);
  }
mddone:
  if ((expo <= 0) && (rndprc != (((6 + 3) - 4) * 16))) {
    __eshup1(s);
  }
  if (s[2] != 0) {
    __eshdn1(s);
    expo += 1;
  }
mdfin:
  s[(6 + 3) - 1] = 0;
  if (expo >= 32767L) {
    s[1] = 32767;
    for (i = 2; i < (6 + 3) - 1; i++)
      s[i] = 0;
    return;
  }
  if (expo < 0)
    s[1] = 0;
  else
    s[1] = (unsigned short)expo;
}
```