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

```asm
<putnumln>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  je     L81
  mov    %edi,%ebx
  js     L147
L166:
  mov    %ebx,%eax
  mov    $0xcccccccd,%ecx
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%ebx
  add    $0x30,%ebx
  mov    %bl,0xe(%rsp)
  test   %eax,%eax
  je     L85
  mov    %eax,%edx
  imul   %rcx,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  add    $0x30,%eax
  mov    %al,0xf(%rsp)
  test   %edx,%edx
  je     L26
  mov    %edx,%eax
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%esi
  add    %esi,%esi
  sub    %esi,%edx
  add    $0x30,%edx
  mov    %dl,0x10(%rsp)
  test   %eax,%eax
  je     L22
  mov    %eax,%edx
  imul   %rcx,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  add    $0x30,%eax
  mov    %al,0x11(%rsp)
  test   %edx,%edx
  je     L124
  mov    %edx,%eax
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%esi
  add    %esi,%esi
  sub    %esi,%edx
  add    $0x30,%edx
  mov    %dl,0x12(%rsp)
  test   %eax,%eax
  je     L104
  mov    %eax,%edx
  imul   %rcx,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  add    $0x30,%eax
  mov    %al,0x13(%rsp)
  test   %edx,%edx
  je     L130
  mov    %edx,%eax
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%esi
  add    %esi,%esi
  sub    %esi,%edx
  add    $0x30,%edx
  mov    %dl,0x14(%rsp)
  test   %eax,%eax
  je     L225
  mov    %eax,%edx
  imul   %rcx,%rdx
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  add    $0x30,%eax
  mov    %al,0x15(%rsp)
  test   %edx,%edx
  je     L28
  mov    %edx,%eax
  imul   %rcx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edx
  add    $0x30,%edx
  mov    %dl,0x16(%rsp)
  test   %eax,%eax
  je     L213
  add    $0x30,%eax
  mov    %al,0x17(%rsp)
  mov    $0x9,%eax
L85:
  cltq
  lea    0xd(%rsp),%rbp
  lea    0xe(%rsp,%rax,1),%rbx
  nopw   0x0(%rax,%rax,1)
L151:
  movsbl (%rbx),%edi
  sub    $0x1,%rbx
  call   <putch@plt>
  cmp    %rbp,%rbx
  jne    L151
L36:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L186
  add    $0x28,%rsp
  lea    D3(%rip),%rdi
  pop    %rbx
  pop    %rbp
  jmp    1080 <putsln@plt>
  nopw   0x0(%rax,%rax,1)
L81:
  mov    $0x30,%edi
  call   <putch@plt>
  jmp    L36
  nopl   0x0(%rax)
L147:
  mov    $0x2d,%edi
  neg    %ebx
  call   <putch@plt>
  jmp    L166
L22:
  mov    $0x2,%eax
  jmp    L85
  nopl   0x0(%rax,%rax,1)
L26:
  mov    $0x1,%eax
  jmp    L85
L124:
  mov    $0x3,%eax
  jmp    L85
L104:
  mov    $0x4,%eax
  jmp    L85
L130:
  mov    $0x5,%eax
  jmp    L85
L225:
  mov    $0x6,%eax
  jmp    L85
L28:
  mov    $0x7,%eax
  jmp    L85
L213:
  mov    $0x8,%eax
  jmp    L85
L186:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D3
datatype: string

tool: 

assistant: ```c
void putnumln(int num) {
  int res = num;
  if (res == 0)
    putch('0');
  else {
    if (res < 0) {
      putch('-');
      res = -res;
    }
    char temp[10];
    int i = 0;
    do {
      temp[i++] = res % 10 + '0';
      res /= 10;
    } while (res);
    while (--i >= 0) {
      putch(temp[i]);
    }
  }
  putsln("");
}
```