// File: /workspace/github_c_makefile_star2_O2/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 0x25d6
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 0xea02(%rip), %r15      # 0x10ff8
leaq 0x10(%rsp), %rdx
pushq $0x8
popq %rbx
pushq $0x1
popq %r13
movq 0xe9cf(%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 0x8bad(%rip), %rdi      # 0xb1e8
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 0x27a5
movq %rax, %r15
movq %r14, %r13
movq %rax, %r12
incq %r12
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x2687
cmpl $0x9, %eax
jne 0x268c
incq %r15
jmp 0x2676
movq %r15, %rdi
leaq 0x8b5b(%rip), %rsi      # 0xb1f1
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 0x2719
movq %r15, %rdi
leaq 0x8b39(%rip), %rsi      # 0xb1f5
movq %r14, %rdx
callq 0x21b0
testl %eax, %eax
je 0x2714
movq %r15, %rdi
leaq 0x8b26(%rip), %rsi      # 0xb1f8
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 0x2719
movq %r15, %rdi
leaq 0x8b00(%rip), %rsi      # 0xb1fa
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 0x2719
xorl %eax, %eax
movq %r14, %rdx
addq %rdx, %r15
addq %rdx, %r12
movzbl (%r15), %ecx
cmpl $0x9, %ecx
je 0x272d
cmpl $0x20, %ecx
jne 0x2735
incq %r15
incq %r12
jmp 0x271f
cmpl $0xa, %ecx
je 0x27a7
testb %cl, %cl
je 0x2755
movzbl %cl, %eax
cmpl $0xa, %eax
je 0x2752
movsbl %cl, %eax
movb (%r12), %cl
incq %r12
jmp 0x273a
pushq $0xa
popq %rax
movq 0xe89c(%rip), %r15      # 0x10ff8
cmpl $-0x1, %eax
je 0x27a5
cmpl $0xa, %eax
je 0x276d
callq 0x2170
jmp 0x275c
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 0x2617
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq