// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/dosfs.c
// Function: dosmove
FRESULT dosmove(int argc, const char **argv)
{
  int i;
  int qflag = 0;
  int nargc = 0;
  int dirp = 0;
  char *dest = 0;
  FRESULT res;
  FILINFO info;
  DIR dir;

  for (i = nargc = 1; i < argc; i++)
    if (! strcmp(argv[i], "-q"))
      qflag = 1;
    else if (argv[i][0] == '-')
      goto usage;
    else 
      argv[nargc++] = argv[i];
  if (nargc < 3) {
  usage:
    dosmovehelp();
    exit(EXIT_FAILURE);
  }
  dest = fix_path(argv[argc-1]);
  if (! (dirp = dir_p(dest)))
    if (nargc > 3 || pattern_p(argv[1]))
      fatal("Moving multiple files: Destination must be an existing directory\n");
  for (i = 1; i < nargc - 1; i++) {
    char *src = fix_path(argv[i]);
    char *pattern = strrchr(src, '/');
    if (pattern) {
      *pattern = 0;
      pattern ++;
    } else {
      pattern = src;
      src = "";
    }
    res = f_findfirst(&dir, &info, src, pattern);
    if (res != FR_OK && res != FR_NO_FILE)
      return res;
    while (res == FR_OK && info.fname[0])
      {
        char *from = strconcat(src, "/", info.fname, 0);
        char *to = (dirp) ? strconcat(dest, "/", info.fname, 0) : strdup(dest);
        while (to[0] == '/')
          to += 1;
        if (file_p(to))
          if (qflag || prompt("[%s]:/%s, Replace", sfn, to))
            f_unlink(to);
        res = f_rename(from, to);
        free(from);
        free(to);
        if (res != FR_OK)
          break;
        res = f_findnext(&dir, &info);
      }
    f_closedir(&dir);
    if (res != FR_OK)
      return res;
  }
  return FR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x34a2
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe366(%rip), %rsi      # 0x117ae
callq 0x1140
cmpl $0x0, %eax
jne 0x345b
movl $0x1, -0x18(%rbp)
jmp 0x3495
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3471
jmp 0x34aa
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x3495
jmp 0x3497
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x342d
cmpl $0x3, -0x1c(%rbp)
jge 0x34b9
jmp 0x34aa
callq 0x33b0
movl $0x1, %edi
callq 0x1200
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1ed0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2060
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jne 0x350c
cmpl $0x3, -0x1c(%rbp)
jg 0x34fc
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1fc0
cmpl $0x0, %eax
je 0x350a
leaq 0xe83b(%rip), %rdi      # 0x11d3e
movb $0x0, %al
callq 0x1330
jmp 0x350c
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x375e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1ed0
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdi
movl $0x2f, %esi
callq 0x10e0
movq %rax, -0x1c0(%rbp)
cmpq $0x0, -0x1c0(%rbp)
je 0x357c
movq -0x1c0(%rbp), %rax
movb $0x0, (%rax)
movq -0x1c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c0(%rbp)
jmp 0x3598
movq -0x1b8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq 0xdf5a(%rip), %rax      # 0x114eb
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdx
movq -0x1c0(%rbp), %rcx
leaq -0x1b0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x8fc0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x35d3
cmpl $0x4, -0x2c(%rbp)
je 0x35d3
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3765
jmp 0x35d5
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x1d1(%rbp)
jne 0x35f6
movsbl -0x136(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x1d1(%rbp)
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x3605
jmp 0x3734
movq -0x1b8(%rbp), %rdi
leaq -0x150(%rbp), %rdx
addq $0x1a, %rdx
leaq 0xdece(%rip), %rsi      # 0x114ec
xorl %ecx, %ecx
movb $0x0, %al
callq 0x1c90
movq %rax, -0x1c8(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x365c
movq -0x28(%rbp), %rdi
leaq -0x150(%rbp), %rdx
addq $0x1a, %rdx
leaq 0xdea2(%rip), %rsi      # 0x114ec
xorl %ecx, %ecx
movb $0x0, %al
callq 0x1c90
movq %rax, -0x1e0(%rbp)
jmp 0x366c
movq -0x28(%rbp), %rdi
callq 0x1220
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x369d
movq -0x1d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1d0(%rbp)
jmp 0x367a
movq -0x1d0(%rbp), %rdi
callq 0x2000
cmpl $0x0, %eax
je 0x36e3
cmpl $0x0, -0x18(%rbp)
jne 0x36d5
movq 0x12b6d(%rip), %rsi     # 0x16228
movq -0x1d0(%rbp), %rdx
leaq 0xe6b7(%rip), %rdi      # 0x11d80
movb $0x0, %al
callq 0x15b0
cmpl $0x0, %eax
je 0x36e1
movq -0x1d0(%rbp), %rdi
callq 0x9560
jmp 0x36e3
movq -0x1c8(%rbp), %rdi
movq -0x1d0(%rbp), %rsi
callq 0x9c80
movl %eax, -0x2c(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x1030
movq -0x1d0(%rbp), %rdi
callq 0x1030
cmpl $0x0, -0x2c(%rbp)
je 0x3719
jmp 0x3734
leaq -0x1b0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x8da0
movl %eax, -0x2c(%rbp)
jmp 0x35d5
leaq -0x1b0(%rbp), %rdi
callq 0x8450
cmpl $0x0, -0x2c(%rbp)
je 0x374e
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3765
jmp 0x3750
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3513
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopw %cs:(%rax,%rax)