// File: /workspace/github_c_makefile_star2_O0/skeeto[P]enchive/src/enchive.c
// Function: get_passphrase
static void
get_passphrase(char *buf, size_t len, char *prompt)
{
    int tty;

    if (pinentry_path) {
        pinentry_unix(buf, len, prompt);
        return;
    }

    tty = open("/dev/tty", O_RDWR);
    if (tty == -1) {
        get_passphrase_dumb(buf, len, prompt);
    } else {
        char newline = '\n';
        size_t i = 0;
        struct termios old, new;
        if (write(tty, prompt, strlen(prompt)) == -1)
            fatal("error asking for passphrase");
        tcgetattr(tty, &old);
        new = old;
        new.c_lflag &= ~ECHO;
        tcsetattr(tty, TCSANOW, &new);
        errno = 0;
        while (i < len - 1 && read(tty, buf + i, 1) == 1) {
            if (buf[i] == '\n' || buf[i] == '\r')
                break;
            i++;
        }
        buf[i] = 0;
        tcsetattr(tty, TCSANOW, &old);
        if (write(tty, &newline, 1) == -1)
            fatal("error asking for passphrase");
        close(tty);
        if (errno)
            fatal("could not read passphrase from /dev/tty");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, 0xab59(%rip)      # 0xf2a8
je 0x4767
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x5a60
jmp 0x4911
leaq 0x7361(%rip), %rdi      # 0xbacf
movl $0x2, %esi
movb $0x0, %al
callq 0x22c0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x4799
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x5c30
jmp 0x4911
movb $0xa, -0x1d(%rbp)
movq $0x0, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2110
movl -0xac(%rbp), %edi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
jne 0x47eb
leaq 0x72b0(%rip), %rdi      # 0xba94
movb $0x0, %al
callq 0x3340
movl -0x1c(%rbp), %edi
leaq -0x64(%rbp), %rsi
callq 0x22a0
leaq -0xa0(%rbp), %rdi
leaq -0x64(%rbp), %rsi
movl $0x3c, %edx
callq 0x2230
movl -0x94(%rbp), %eax
andl $-0x9, %eax
movl %eax, -0x94(%rbp)
movl -0x1c(%rbp), %edi
xorl %esi, %esi
leaq -0xa0(%rbp), %rdx
callq 0x22b0
callq 0x2070
movl $0x0, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
subq $0x1, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0xad(%rbp)
jae 0x4872
movl -0x1c(%rbp), %edi
movq -0x8(%rbp), %rsi
addq -0x28(%rbp), %rsi
movl $0x1, %edx
callq 0x21b0
cmpq $0x1, %rax
sete %al
movb %al, -0xad(%rbp)
movb -0xad(%rbp), %al
testb $0x1, %al
jne 0x487e
jmp 0x48b0
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0x48a0
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xd, %eax
jne 0x48a2
jmp 0x48b0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4837
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x1c(%rbp), %edi
xorl %esi, %esi
leaq -0x64(%rbp), %rdx
callq 0x22b0
movl -0x1c(%rbp), %edi
leaq -0x1d(%rbp), %rsi
movl $0x1, %edx
callq 0x20f0
cmpq $-0x1, %rax
jne 0x48ef
leaq 0x71ac(%rip), %rdi      # 0xba94
movb $0x0, %al
callq 0x3340
movl -0x1c(%rbp), %edi
callq 0x2170
callq 0x2070
cmpl $0x0, (%rax)
je 0x490f
leaq 0x71a8(%rip), %rdi      # 0xbab0
movb $0x0, %al
callq 0x3340
jmp 0x4911
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)