// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/dosfs.c
// Function: dosattrib
FRESULT dosattrib(int argc, const char **argv)
{
  FRESULT res;
  BYTE aset = 0;
  BYTE aclr = 0;
  int dflag = 0;
  int sflag = 0;
  int na = 0;
  int nf = 0;
  int i;

  for (i=1; i < argc; i++)
    {
      BYTE *pflag = 0;
      if (argv[i][0] == '+')
        pflag = &aset;
      else if (argv[i][0] == '-')
        pflag = &aclr;
      if (pflag) {
        if (!strcmp(argv[i],"-d"))
          dflag = 1;
        else if (!strcmp(argv[i],"-s"))
          sflag = 1;
        else if (argv[i][2]) {
        usage:
          dosattribhelp();
          exit(EXIT_FAILURE);
        } else {
          switch(argv[i][1]) {
          case 'A': *pflag |= AM_ARC; break;
          case 'R': *pflag |= AM_RDO; break;
          case 'H': *pflag |= AM_HID; break;
          case 'S': *pflag |= AM_SYS; break;
          default: goto usage;
          }
        }
      } else {
        char *path = fix_path(argv[i]);
        char *pattern = strrchr(path, '/');
        if (dir_p(path) && dflag != 1 && (aset | aclr) == 0) {
          pattern = "*";
        } else if (pattern) {
          *pattern = 0;
          pattern += 1;
        } else {
          pattern = path;
          path = "";
        }
        na += 1;
        res = rattrib(path, pattern, aset, aclr, dflag, sflag, &nf);
        if (res != FR_OK)
          return res;
      }
    }
  if (na == 0 && (aset | aclr) == 0) {
    res = rattrib("", "*", aset, aclr, dflag, sflag, &nf);
    if (res != FR_OK)
      return res;
  }
  if (nf == 0)
    fatal("File not found\n");
  return FR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, -0x16(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x3df1
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x3bfc
leaq -0x15(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3c1a
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3c18
leaq -0x16(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3c1a
cmpq $0x0, -0x38(%rbp)
je 0x3d11
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xdb9e(%rip), %rsi      # 0x117d6
callq 0x1140
cmpl $0x0, %eax
jne 0x3c4e
movl $0x1, -0x1c(%rbp)
jmp 0x3d0c
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd892(%rip), %rsi      # 0x114f3
callq 0x1140
cmpl $0x0, %eax
jne 0x3c77
movl $0x1, -0x20(%rbp)
jmp 0x3d0a
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpb $0x0, 0x2(%rax)
je 0x3c9a
jmp 0x3c8b
callq 0x3780
movl $0x1, %edi
callq 0x1200
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x12, %eax
ja 0x3d04
movq -0x50(%rbp), %rax
leaq 0xd3a5(%rip), %rcx      # 0x11068
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl $0x20, %ecx
movb %cl, (%rax)
jmp 0x3d06
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl $0x1, %ecx
movb %cl, (%rax)
jmp 0x3d06
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl $0x2, %ecx
movb %cl, (%rax)
jmp 0x3d06
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl $0x4, %ecx
movb %cl, (%rax)
jmp 0x3d06
jmp 0x3c8b
jmp 0x3d08
jmp 0x3d0a
jmp 0x3d0c
jmp 0x3de1
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1ed0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl $0x2f, %esi
callq 0x10e0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2060
cmpl $0x0, %eax
je 0x3d68
cmpl $0x1, -0x1c(%rbp)
je 0x3d68
movzbl -0x15(%rbp), %eax
movzbl -0x16(%rbp), %ecx
orl %ecx, %eax
cmpl $0x0, %eax
jne 0x3d68
leaq 0xd78c(%rip), %rax      # 0x114ee
movq %rax, -0x48(%rbp)
jmp 0x3d99
cmpq $0x0, -0x48(%rbp)
je 0x3d84
movq -0x48(%rbp), %rax
movb $0x0, (%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x3d97
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0xd758(%rip), %rax      # 0x114eb
movq %rax, -0x40(%rbp)
jmp 0x3d99
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movb -0x15(%rbp), %dl
movb -0x16(%rbp), %cl
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
leaq -0x28(%rbp), %rax
movzbl %dl, %edx
movzbl %cl, %ecx
movq %rax, (%rsp)
callq 0x37c0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x3ddf
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3e63
jmp 0x3de1
jmp 0x3de3
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3bca
cmpl $0x0, -0x24(%rbp)
jne 0x3e48
movzbl -0x15(%rbp), %eax
movzbl -0x16(%rbp), %ecx
orl %ecx, %eax
cmpl $0x0, %eax
jne 0x3e48
movb -0x15(%rbp), %dl
movb -0x16(%rbp), %cl
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
leaq 0xd6d0(%rip), %rdi      # 0x114eb
leaq 0xd6cc(%rip), %rsi      # 0x114ee
leaq -0x28(%rbp), %rax
movzbl %dl, %edx
movzbl %cl, %ecx
movq %rax, (%rsp)
callq 0x37c0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x3e46
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3e63
jmp 0x3e48
cmpl $0x0, -0x28(%rbp)
jne 0x3e5c
leaq 0xd2a7(%rip), %rdi      # 0x110fc
movb $0x0, %al
callq 0x1330
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)