// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/dosfs.c
// Function: rdir
FRESULT rdir(char *path, char *pattern, int sflag, int bflag, int xflag,
             int *pnfiles, FSIZE_t *psfiles, int *pndirs)
{
  int ndirs;
  DIR dir;
  FILINFO info;
  FRESULT res;

  while (path[0] == '/')
    path += 1;
  if (! bflag)
    printf("\n Directory of [%s]:/%s\n\n", sfn, path);
  res = f_findfirst(&dir, &info, path, pattern);
  if (res != FR_OK && res != FR_NO_FILE)
    return res;
  while (res == FR_OK && info.fname[0])
    {
      if (info.fattrib & AM_DIR) {
        *pndirs += 1;
      } else {
        *pnfiles += 1;
        *psfiles += info.fsize;
      }
      if (bflag) {
        if (! (info.fattrib & AM_DIR))
          printf("%s%s/%s\n", path[0] ? "/" : "", path, info.fname);
      } else {
        print_filinfo(&info, xflag);
      }
      res = f_findnext(&dir, &info);
    }
  f_closedir(&dir);
  if (sflag) {
    res = f_findfirst(&dir, &info, path, "*");
    if (res != FR_OK && res != FR_NO_FILE)
      return res;
    while (res == FR_OK && info.fname[0]) {
      if (info.fattrib & AM_DIR) {
        char *npath = strconcat(path, "/", info.fname, 0);
        rdir(npath, pattern, sflag, bflag, xflag, pnfiles, psfiles, pndirs);
        free(npath);
      }
      res = f_findnext(&dir, &info);
    }
  }
  f_closedir(&dir);
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x23b3
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x2399
cmpl $0x0, -0x20(%rbp)
jne 0x23d2
movq 0x13e68(%rip), %rsi     # 0x16228
movq -0x10(%rbp), %rdx
leaq 0xf107(%rip), %rdi      # 0x114d2
movb $0x0, %al
callq 0x10d0
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x8fc0
movl %eax, -0x1bc(%rbp)
cmpl $0x0, -0x1bc(%rbp)
je 0x2413
cmpl $0x4, -0x1bc(%rbp)
je 0x2413
movl -0x1bc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2631
jmp 0x2415
xorl %eax, %eax
cmpl $0x0, -0x1bc(%rbp)
movb %al, -0x1c9(%rbp)
jne 0x2439
movsbl -0x19e(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x1c9(%rbp)
movb -0x1c9(%rbp), %al
testb $0x1, %al
jne 0x2448
jmp 0x24fd
movzbl -0x1ac(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x2464
movq 0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x2480
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x1b8(%rbp), %rcx
movq 0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
cmpl $0x0, -0x20(%rbp)
je 0x24d0
movzbl -0x1ac(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x24ce
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
leaq 0xf048(%rip), %rsi      # 0x114eb
leaq 0xf042(%rip), %rax      # 0x114ec
cmpl $0x0, %ecx
cmovneq %rax, %rsi
movq -0x10(%rbp), %rdx
leaq -0x1b8(%rbp), %rcx
addq $0x1a, %rcx
leaq 0xfb17(%rip), %rdi      # 0x11fde
movb $0x0, %al
callq 0x10d0
jmp 0x24df
movl -0x24(%rbp), %esi
leaq -0x1b8(%rbp), %rdi
callq 0x2250
leaq -0x98(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x8da0
movl %eax, -0x1bc(%rbp)
jmp 0x2415
leaq -0x98(%rbp), %rdi
callq 0x8450
cmpl $0x0, -0x1c(%rbp)
je 0x261c
movq -0x10(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq 0xefc2(%rip), %rcx      # 0x114ee
callq 0x8fc0
movl %eax, -0x1bc(%rbp)
cmpl $0x0, -0x1bc(%rbp)
je 0x2557
cmpl $0x4, -0x1bc(%rbp)
je 0x2557
movl -0x1bc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2631
jmp 0x2559
xorl %eax, %eax
cmpl $0x0, -0x1bc(%rbp)
movb %al, -0x1ca(%rbp)
jne 0x257d
movsbl -0x19e(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x1ca(%rbp)
movb -0x1ca(%rbp), %al
testb $0x1, %al
jne 0x258c
jmp 0x261a
movzbl -0x1ac(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x25fc
movq -0x10(%rbp), %rdi
leaq -0x1b8(%rbp), %rdx
addq $0x1a, %rdx
leaq 0xef3b(%rip), %rsi      # 0x114ec
xorl %ecx, %ecx
movb $0x0, %al
callq 0x1c90
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2370
movq -0x1c8(%rbp), %rdi
callq 0x1030
leaq -0x98(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x8da0
movl %eax, -0x1bc(%rbp)
jmp 0x2559
jmp 0x261c
leaq -0x98(%rbp), %rdi
callq 0x8450
movl -0x1bc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopl (%rax)