// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: prompt
int prompt(const char *fmt, ...)
{
  int res = -1;
  char buffer[16];
  char *s;

  for(;;) {
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
    fprintf(stderr, " (Y/N)? ");
    fflush(stdin);
    fflush(stderr);
    if (! (s = fgets(buffer, sizeof(buffer), stdin)))
      return 0;
    while (*s == '\t' || *s == ' ')
      s++;
    if (! strncasecmp(s, "yes", 3)) {
      res = 1; s += 3;
    } else if (! strncasecmp(s, "no", 2)) {
      res = 0; s += 2;
    } else if (! strncasecmp(s, "y", 1)) {
      res = 1; s += 1;
    } else if (! strncasecmp(s, "n", 1)) {
      res = 0; s += 1;
    } 
    while (*s == '\t' || *s == ' ')
      s++;
    if (*s == '\n')
      return res;
    for(; *s; s++)
      if ((res = *s) == '\n')
        break;;
    while (res != '\n' && res != EOF)
      res = getchar();
    if (res == EOF)
      break;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %r10
leaq 0x40(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x23a6
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
leaq 0x130(%rsp), %rax
movabsq $0x3000000008, %rcx     # imm = 0x3000000008
movq 0xec32(%rip), %r15      # 0x10ff8
leaq 0x10(%rsp), %rdx
pushq $0x8
popq %rbx
pushq $0x1
popq %r13
movq 0xebff(%rip), %r14      # 0x10fd8
leaq 0x30(%rsp), %rbp
pushq $0x10
popq %r12
movq %r10, 0x8(%rsp)
movq %rdi, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq (%r15), %rdi
movq %r10, %rsi
callq 0x2200
movq (%r15), %rcx
leaq 0x9ddd(%rip), %rdi      # 0xc1e8
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2230
movq (%r14), %rdi
callq 0x21c0
movq (%r15), %rdi
callq 0x21c0
movq (%r14), %rdx
movq %rbp, %rdi
movl %r12d, %esi
callq 0x2150
testq %rax, %rax
je 0x2575
movq %rax, %r15
movq %r14, %r13
movq %rax, %r12
incq %r12
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x2457
cmpl $0x9, %eax
jne 0x245c
incq %r15
jmp 0x2446
movq %r15, %rdi
leaq 0x9d8b(%rip), %rsi      # 0xc1f1
pushq $0x3
popq %r14
movq %r14, %rdx
callq 0x21b0
movl %eax, %ecx
movq %r14, %rdx
pushq $0x1
popq %rax
testl %ecx, %ecx
pushq $0x2
popq %r14
je 0x24e9
movq %r15, %rdi
leaq 0x9d69(%rip), %rsi      # 0xc1f5
movq %r14, %rdx
callq 0x21b0
testl %eax, %eax
je 0x24e4
movq %r15, %rdi
leaq 0x9d56(%rip), %rsi      # 0xc1f8
movq %r13, %r14
pushq $0x1
popq %r13
movq %r13, %rdx
callq 0x21b0
movl %eax, %ecx
movq %r13, %rdx
movq %r14, %r13
pushq $0x1
popq %rax
testl %ecx, %ecx
je 0x24e9
movq %r15, %rdi
leaq 0x9d30(%rip), %rsi      # 0xc1fa
pushq $0x1
popq %rdx
callq 0x21b0
xorl %edx, %edx
testl %eax, %eax
sete %dl
movl 0x4(%rsp), %ecx
cmovel %eax, %ecx
movl %ecx, %eax
jmp 0x24e9
xorl %eax, %eax
movq %r14, %rdx
addq %rdx, %r15
addq %rdx, %r12
movzbl (%r15), %ecx
cmpl $0x9, %ecx
je 0x24fd
cmpl $0x20, %ecx
jne 0x2505
incq %r15
incq %r12
jmp 0x24ef
cmpl $0xa, %ecx
je 0x2577
testb %cl, %cl
je 0x2525
movzbl %cl, %eax
cmpl $0xa, %eax
je 0x2522
movsbl %cl, %eax
movb (%r12), %cl
incq %r12
jmp 0x250a
pushq $0xa
popq %rax
movq 0xeacc(%rip), %r15      # 0x10ff8
cmpl $-0x1, %eax
je 0x2575
cmpl $0xa, %eax
je 0x253d
callq 0x2170
jmp 0x252c
pushq $0xa
popq %rax
movl %eax, 0x4(%rsp)
leaq 0x130(%rsp), %rax
movq 0x8(%rsp), %r10
movabsq $0x3000000008, %rcx     # imm = 0x3000000008
leaq 0x10(%rsp), %rdx
leaq 0x40(%rsp), %rdi
movq %r13, %r14
pushq $0x1
popq %r13
pushq $0x10
popq %r12
jmp 0x23e7
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq