user: Demonstrate the C code that generates the assembly output below:

```asm
<sega_lz77>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    0x10(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  movl   $0x0,-0x4c(%rbp)
  movl   $0x0,-0x48(%rbp)
  mov    $0x0,%eax
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x44(%rbp)
  mov    $0x1,%eax
  mov    %eax,-0x38(%rbp)
  jmp    L58
L128:
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetBit_00E1F5D0.0>
  mov    %al,-0x4d(%rbp)
  cmpb   $0x0,-0x4d(%rbp)
  je     L71
  mov    -0x44(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x44(%rbp)
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetByte_00E1F580.1>
  mov    %al,(%rbx)
  jmp    L128
L71:
  nop
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetBit_00E1F5D0.0>
  test   %al,%al
  je     L65
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetByte_00E1F580.1>
  movzbl %al,%eax
  mov    %eax,-0x4c(%rbp)
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetByte_00E1F580.1>
  movzbl %al,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  or     %edx,%eax
  mov    %al,-0x4d(%rbp)
  cmpb   $0x0,-0x4d(%rbp)
  je     L24
  mov    -0x48(%rbp),%eax
  shl    $0x5,%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  shr    $0x3,%eax
  add    %edx,%eax
  sub    $0x2000,%eax
  mov    %eax,-0x48(%rbp)
  andl   $0x7,-0x4c(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  je     L43
  addl   $0x2,-0x4c(%rbp)
  jmp    L58
L43:
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetByte_00E1F580.1>
  movzbl %al,%eax
  add    $0xa,%eax
  mov    %eax,-0x4c(%rbp)
  jmp    L58
L65:
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetBit_00E1F5D0.0>
  movzbl %al,%eax
  add    %eax,%eax
  mov    %eax,-0x4c(%rbp)
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetBit_00E1F5D0.0>
  movzbl %al,%eax
  add    $0x2,%eax
  add    %eax,-0x4c(%rbp)
  lea    -0x40(%rbp),%rax
  mov    %rax,%r10
  call   <GetByte_00E1F580.1>
  movzbl %al,%eax
  sub    $0x100,%eax
  mov    %eax,-0x48(%rbp)
L58:
  mov    -0x30(%rbp),%edx
  mov    -0x34(%rbp),%eax
  cmp    %eax,%edx
  jl     L128
  jmp    L109
L24:
  nop
  jmp    L109
L49:
  mov    -0x44(%rbp),%edx
  mov    -0x48(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    -0x44(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x68(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x44(%rbp)
  subl   $0x1,-0x4c(%rbp)
L109:
  cmpl   $0x0,-0x4c(%rbp)
  jne    L49
  mov    -0x44(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L108
  call   <__stack_chk_fail@plt>
L108:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int sega_lz77(unsigned char *Buf, int File_Size, unsigned char *Buf2) {
  int SrcPos;
  unsigned char CurByte;
  int BitCounter;
  unsigned char GetByte_00E1F580(void) {
    unsigned char RESULT;
    if (SrcPos >= File_Size)
      return (0);
    RESULT = Buf[SrcPos];
    SrcPos++;
    return (RESULT);
  }
  unsigned char GetBit_00E1F5D0(void) {
    unsigned char RESULT;
    BitCounter--;
    if (!BitCounter) {
      CurByte = GetByte_00E1F580();
      BitCounter = 8;
    }
    RESULT = CurByte & 1;
    CurByte >>= 1;
    return (RESULT);
  }
  unsigned int _EBP_m_4 = 0, _EBP_m_8 = 0;
  int DstPos;
  unsigned char _EAX;
  SrcPos = 0;
  DstPos = 0;
  BitCounter = 1;
  while (SrcPos < File_Size) {
    for (;;) {
      _EAX = GetBit_00E1F5D0();
      if (!_EAX)
        break;
      Buf2[DstPos++] = GetByte_00E1F580();
    }
    if (GetBit_00E1F5D0()) {
      _EBP_m_4 = GetByte_00E1F580();
      _EBP_m_8 = GetByte_00E1F580();
      _EAX = _EBP_m_8 | _EBP_m_4;
      if (!_EAX)
        break;
      _EBP_m_8 = (_EBP_m_8 << 5) + (_EBP_m_4 >> 3) - 0x2000;
      _EBP_m_4 &= 7;
      if (_EBP_m_4) {
        _EBP_m_4 += 2;
      } else {
        _EBP_m_4 = GetByte_00E1F580() + 0x0A;
      }
    } else {
      _EBP_m_4 = GetBit_00E1F5D0() * 2;
      _EBP_m_4 += GetBit_00E1F5D0() + 2;
      _EBP_m_8 = GetByte_00E1F580() - 0x100;
    }
  }
  while (_EBP_m_4 > 0) {
    Buf2[DstPos] = Buf2[DstPos + _EBP_m_8];
    DstPos++;
    _EBP_m_4--;
  }
  return (DstPos);
}
```