// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/dosfs.c
// Function: dosdir
FRESULT dosdir(int argc, const char **argv)
{
  int i;
  int bflag = 0;
  int sflag = 0;
  int xflag = 0;
  char *path  = "";
  char *pattern = 0;
  char label[40];
  DWORD serial;
  FRESULT res;
  int ndirs = 0;
  int nfiles = 0;
  FSIZE_t sfiles = 0;
  DWORD ncls;
  FATFS *vol;

  for (i=1; i<argc; i++) {
    if (! strcmp(argv[i], "-b"))
      bflag = 1;
    else if (! strcmp(argv[i], "-s"))
      sflag = 1;
    else if (! strcmp(argv[i], "-x"))
      xflag = 1;
    else if (argv[i][0] == '-')
      goto usage;
    else if (!path || !path[0])
      path = fix_path(argv[i]);
    else {
    usage:
      dosdirhelp();
      exit(EXIT_FAILURE);
    }
  }
  pattern = (pattern) ? pattern + 1 : path;
  if (dir_p(path)) {
    pattern = "*";
  } else if ((pattern = strrchr(path, '/'))) {
    *pattern = 0;
    pattern += 1;
  } else {
    pattern = path;
    path = "";
  }
  if (! bflag && f_getlabel("", label, &serial) == FR_OK) {
    if (label[0])
      printf(" Volume label: %s\n", label);
    else
      printf(" Volume has no label\n");
    printf(" Volume Serial Number is %04X-%04X\n", (serial >> 16) & 0xffff, serial & 0xffff);
  }
  res = rdir(path, pattern, sflag, bflag, xflag, &nfiles, &sfiles, &ndirs);
  if (res == FR_OK && ! bflag) {
    if (nfiles + ndirs == 0)
      printf("File not found\n");
    printf("\n");
    f_getfree(path, &ncls, &vol);
    printf("    %8d File(s) %12lld bytes\n", nfiles, (long long)sfiles);
    printf("    %8d Dir(s)  %12lld bytes free\n", ndirs, (long long)ncls * vol->csize * 512);
  }
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
leaq 0xee7d(%rip), %rax      # 0x114eb
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x277e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xee3a(%rip), %rsi      # 0x114f0
callq 0x1140
cmpl $0x0, %eax
jne 0x26cc
movl $0x1, -0x18(%rbp)
jmp 0x276e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xee14(%rip), %rsi      # 0x114f3
callq 0x1140
cmpl $0x0, %eax
jne 0x26f2
movl $0x1, -0x1c(%rbp)
jmp 0x276c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xedf1(%rip), %rsi      # 0x114f6
callq 0x1140
cmpl $0x0, %eax
jne 0x2718
movl $0x1, -0x20(%rbp)
jmp 0x276a
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x272e
jmp 0x2757
cmpq $0x0, -0x28(%rbp)
je 0x273e
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x2755
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1ed0
movq %rax, -0x28(%rbp)
jmp 0x2766
jmp 0x2757
callq 0x2330
movl $0x1, %edi
callq 0x1200
jmp 0x2768
jmp 0x276a
jmp 0x276c
jmp 0x276e
jmp 0x2770
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2697
cmpq $0x0, -0x30(%rbp)
je 0x2796
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x27a1
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2060
cmpl $0x0, %eax
je 0x27c7
leaq 0xed2d(%rip), %rax      # 0x114ee
movq %rax, -0x30(%rbp)
jmp 0x2809
movq -0x28(%rbp), %rdi
movl $0x2f, %esi
callq 0x10e0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x27f4
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2807
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0xece8(%rip), %rax      # 0x114eb
movq %rax, -0x28(%rbp)
jmp 0x2809
cmpl $0x0, -0x18(%rbp)
jne 0x2873
leaq -0x60(%rbp), %rsi
leaq 0xecd1(%rip), %rdi      # 0x114eb
leaq -0x64(%rbp), %rdx
callq 0xa350
cmpl $0x0, %eax
jne 0x2873
cmpb $0x0, -0x60(%rbp)
je 0x2842
leaq -0x60(%rbp), %rsi
leaq 0xecc0(%rip), %rdi      # 0x114f9
movb $0x0, %al
callq 0x10d0
jmp 0x2850
leaq 0xecc3(%rip), %rdi      # 0x1150c
movb $0x0, %al
callq 0x10d0
movl -0x64(%rbp), %esi
shrl $0x10, %esi
andl $0xffff, %esi           # imm = 0xFFFF
movl -0x64(%rbp), %edx
andl $0xffff, %edx           # imm = 0xFFFF
leaq 0xecb6(%rip), %rdi      # 0x11522
movb $0x0, %al
callq 0x10d0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %r8d
leaq -0x70(%rbp), %r9
leaq -0x78(%rbp), %r10
leaq -0x6c(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2370
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x68(%rbp)
jne 0x2927
cmpl $0x0, -0x18(%rbp)
jne 0x2927
movl -0x70(%rbp), %eax
addl -0x6c(%rbp), %eax
cmpl $0x0, %eax
jne 0x28c7
leaq 0xe83c(%rip), %rdi      # 0x110fc
movb $0x0, %al
callq 0x10d0
leaq 0xec1c(%rip), %rdi      # 0x114ea
movb $0x0, %al
callq 0x10d0
movq -0x28(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x90c0
movl -0x70(%rbp), %esi
movq -0x78(%rbp), %rdx
leaq 0xec4f(%rip), %rdi      # 0x11546
movb $0x0, %al
callq 0x10d0
movl -0x6c(%rbp), %esi
movl -0x7c(%rbp), %eax
movl %eax, %edx
movq -0x88(%rbp), %rax
movzwl 0xa(%rax), %eax
imulq %rax, %rdx
shlq $0x9, %rdx
leaq 0xec44(%rip), %rdi      # 0x11564
movb $0x0, %al
callq 0x10d0
movl -0x68(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)