user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_msg>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  jmp    L57
  xchg   %ax,%ax
L143:
  mov    D6(%rip),%rdx
  cmp    %al,(%rdx)
  je     L208
  mov    %al,0x0(%rbp,%rbx,1)
  add    $0x1,%rbx
L57:
  mov    %r13,%rdi
  movslq %ebx,%r12
  call   <fgetc@plt>
  cmp    $0xa,%al
  jne    L143
L208:
  mov    %rbp,%rdi
  movb   $0x0,(%rsp,%r12,1)
  call   <strlen@plt>
  movslq %eax,%rbx
  lea    0x1(%rbx),%r12d
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%r8
  test   %ebx,%ebx
  js     L106
  lea    0x1(%rsp),%rdx
  sub    %rdx,%rax
  cmp    $0xe,%rax
  jbe    L144
  cmp    $0x6,%ebx
  jbe    L144
  cmp    $0xe,%ebx
  jbe    L93
  mov    %r12d,%eax
  sub    %r8,%rbp
  shr    $0x4,%eax
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%r8,%rax,1),%rdx
  mov    %r8,%rax
  nopl   (%rax)
L27:
  movdqa (%rax,%rbp,1),%xmm0
  add    $0x10,%rax
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L27
  mov    %r12d,%edx
  and    $0xfffffff0,%edx
  mov    %edx,%eax
  cmp    %edx,%r12d
  je     L106
  mov    %ebx,%ecx
  sub    %edx,%ecx
  lea    0x1(%rcx),%r12d
  cmp    $0x6,%ecx
  jbe    L157
L199:
  mov    (%rsp,%rdx,1),%rcx
  mov    %rcx,(%r8,%rdx,1)
  mov    %r12d,%edx
  and    $0xfffffff8,%edx
  add    %edx,%eax
  cmp    %edx,%r12d
  je     L106
L157:
  movslq %eax,%rdx
  movzbl (%rsp,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  lea    0x1(%rax),%edx
  cmp    %edx,%ebx
  jl     L106
  movslq %edx,%rdx
  movzbl (%rsp,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  lea    0x2(%rax),%edx
  cmp    %edx,%ebx
  jl     L106
  movslq %edx,%rdx
  movzbl (%rsp,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  lea    0x3(%rax),%edx
  cmp    %edx,%ebx
  jl     L106
  movslq %edx,%rdx
  movzbl (%rsp,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  lea    0x4(%rax),%edx
  cmp    %edx,%ebx
  jl     L106
  movslq %edx,%rdx
  movzbl (%rsp,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  lea    0x5(%rax),%edx
  cmp    %edx,%ebx
  jl     L106
  movslq %edx,%rdx
  add    $0x6,%eax
  movzbl (%rsp,%rdx,1),%ecx
  mov    %cl,(%r8,%rdx,1)
  cmp    %eax,%ebx
  jl     L106
  cltq
  movzbl (%rsp,%rax,1),%edx
  mov    %dl,(%r8,%rax,1)
L106:
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x818,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L144:
  lea    0x1(%r8,%rbx,1),%rcx
  mov    %r8,%rax
  sub    %r8,%rbp
  nopl   0x0(%rax,%rax,1)
L42:
  movzbl 0x0(%rbp,%rax,1),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L42
  jmp    L106
L93:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L199
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *get_msg(FILE *fh) {
  char c;
  char *msg;
  char tempmsg[2048];
  int i = 0;
  int len = 0;
  int j;
  while (((c = fgetc(fh)) != '\n') && (c != EOF)) {
    tempmsg[i++] = c;
  }
  tempmsg[i] = '\0';
  len = strlen(tempmsg);
  msg = (char *)malloc((len + 1) * sizeof(c));
  for (j = 0; j <= len; j++) {
    msg[j] = tempmsg[j];
  }
  return (msg);
}
```