// File: /workspace/github_c_makefile_star2_O1/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, 0x8(%rsp)
leaq 0x40(%rsp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x23bd
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 %rbp
movq 0xec31(%rip), %r13      # 0x10ff8
pushq $0x2
popq %rbx
movq %r12, 0x20(%rsp)
leaq 0x130(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, 0x10(%rsp)
movq (%r13), %rdi
movq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2210
movq (%r13), %rcx
leaq 0x9ddf(%rip), %rdi      # 0xc1e8
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2240
movq 0xebbd(%rip), %r14      # 0x10fd8
movq (%r14), %rdi
callq 0x21d0
movq (%r13), %rdi
callq 0x21d0
movq (%r14), %rdx
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rsi
callq 0x2160
testq %rax, %rax
je 0x24dd
movq %rax, %r14
movzbl (%r14), %eax
cmpl $0x20, %eax
je 0x2456
cmpl $0x9, %eax
jne 0x245b
incq %r14
jmp 0x2448
movq %r14, %rdi
leaq 0x9d8c(%rip), %rsi      # 0xc1f1
movq %rbx, %r15
pushq $0x3
popq %rbx
movq %rbx, %rdx
callq 0x21c0
movq %rbx, %rdx
movq %r15, %rbx
pushq $0x1
popq %rcx
testl %eax, %eax
je 0x24ec
movq %r14, %rdi
leaq 0x9d6b(%rip), %rsi      # 0xc1f5
movq %rbx, %rdx
callq 0x21c0
testl %eax, %eax
je 0x24e7
movq %r14, %rdi
leaq 0x9d58(%rip), %rsi      # 0xc1f8
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x21c0
movq %rbx, %rdx
movq %r15, %rbx
leaq 0x40(%rsp), %r12
pushq $0x1
popq %rcx
testl %eax, %eax
je 0x24ec
movq %r14, %rdi
leaq 0x9d33(%rip), %rsi      # 0xc1fa
pushq $0x1
popq %rdx
callq 0x21c0
xorl %edx, %edx
testl %eax, %eax
sete %dl
cmovel %eax, %ebp
movl %ebp, %ecx
jmp 0x24ec
movl $0x0, 0x4(%rsp)
jmp 0x250d
xorl %ecx, %ecx
movq %rbx, %rdx
addq %rdx, %r14
movzbl (%r14), %eax
cmpl $0x9, %eax
je 0x24fd
cmpl $0x20, %eax
jne 0x2502
incq %r14
jmp 0x24ef
cmpl $0xa, %eax
jne 0x2519
movl %ecx, 0x4(%rsp)
movl %ecx, %ebp
pushq $0x1
popq %rax
testl %eax, %eax
jne 0x254e
jmp 0x23ca
movzbl (%r14), %eax
testl %eax, %eax
je 0x2531
cmpl $0xa, %eax
je 0x252e
movsbl %al, %ecx
incq %r14
jmp 0x2519
pushq $0xa
popq %rcx
movl %ecx, %ebp
cmpl $-0x1, %ebp
je 0x254a
cmpl $0xa, %ebp
je 0x2546
callq 0x2180
movl %eax, %ebp
jmp 0x2533
xorl %eax, %eax
jmp 0x2510
pushq $0x2
jmp 0x250f
cmpl $0x2, %eax
jne 0x2557
xorl %eax, %eax
jmp 0x255b
movl 0x4(%rsp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq