// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/converters/fsio/os8.c
// Function: os8FileName
static char *os8FileName(
  struct mountedFS *mount,
  uint16_t off,
  char *buf
)
{
  struct OS8data *data = &mount->os8data;
  uint16_t fname1 = os8Word(le16toh(data->buf[off + OS8_DI_FNAME1]));
  uint16_t fname2 = os8Word(le16toh(data->buf[off + OS8_DI_FNAME2]));
  uint16_t fname3 = os8Word(le16toh(data->buf[off + OS8_DI_FNAME3]));
  uint16_t ext = os8Word(le16toh(data->buf[off + OS8_DI_EXT]));

  buf[0] = sixbit[(fname1 >> 6) & 0x3F];
  buf[1] = sixbit[fname1 & 0x3F];
  buf[2] = sixbit[(fname2 >> 6) & 0x3F];
  buf[3] = sixbit[fname2 & 0x3F];
  buf[4] = sixbit[(fname3 >> 6) & 0x3F];
  buf[5] = sixbit[fname3 & 0x3F];
  buf[6] = '.';
  buf[7] = sixbit[(ext >> 6) & 0x3F];
  buf[8] = sixbit[ext & 0x3F];
  buf[9] = '\0';

  return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl -0xa(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzwl 0x14(%rax,%rcx,2), %edi
callq 0x14890
movzwl %ax, %edi
callq 0x14f90
movw %ax, -0x22(%rbp)
movq -0x20(%rbp), %rax
movzwl -0xa(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzwl 0x14(%rax,%rcx,2), %edi
callq 0x14890
movzwl %ax, %edi
callq 0x14f90
movw %ax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movzwl -0xa(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzwl 0x14(%rax,%rcx,2), %edi
callq 0x14890
movzwl %ax, %edi
callq 0x14f90
movw %ax, -0x26(%rbp)
movq -0x20(%rbp), %rax
movzwl -0xa(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl 0x14(%rax,%rcx,2), %edi
callq 0x14890
movzwl %ax, %edi
callq 0x14f90
movw %ax, -0x28(%rbp)
movzwl -0x22(%rbp), %eax
sarl $0x6, %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7f19(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movzwl -0x22(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7eff(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movzwl -0x24(%rbp), %eax
sarl $0x6, %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7ee1(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x2(%rax)
movzwl -0x24(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7ec6(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x3(%rax)
movzwl -0x26(%rbp), %eax
sarl $0x6, %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7ea8(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x4(%rax)
movzwl -0x26(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7e8d(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x18(%rbp), %rax
movb $0x2e, 0x6(%rax)
movzwl -0x28(%rbp), %eax
sarl $0x6, %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7e67(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x7(%rax)
movzwl -0x28(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x7e4c(%rip), %rax      # 0x1f100
movb (%rax,%rcx), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x9(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq