// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc78, %rsp            # imm = 0xC78
movq %rsi, %r12
movq %rdi, %rbx
cmpq $0x0, 0x6b75(%rip)      # 0xb1e8
je 0x488a
leaq 0x10(%rsp), %rdi
callq 0x2180
testl %eax, %eax
jne 0x4a8a
movq %rsp, %rdi
callq 0x2180
testl %eax, %eax
jne 0x4a8a
callq 0x2350
testl %eax, %eax
je 0x49a1
cmpl $-0x1, %eax
je 0x4ac6
movl 0x10(%rsp), %edi
callq 0x2170
movl 0x4(%rsp), %edi
callq 0x2170
movl 0x14(%rsp), %edi
leaq 0x4356(%rip), %rsi      # 0x8a24
callq 0x2260
testq %rax, %rax
je 0x4adb
movq %rax, %r14
movl (%rsp), %edi
leaq 0x3bd0(%rip), %rsi      # 0x82b9
callq 0x2260
testq %rax, %rax
je 0x4af0
movq %rax, %r15
leaq 0x50(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %rax, %rdx
callq 0x21c0
testq %rax, %rax
je 0x4b0d
cmpw $0x4b4f, 0x50(%rsp)     # imm = 0x4B4F
jne 0x4b17
leaq 0x4359(%rip), %rsi      # 0x8a82
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x4a75
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x4a75
leaq 0x50(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %r15, %rdx
callq 0x21c0
testq %rax, %rax
je 0x4aa8
cmpw $0x4b4f, 0x50(%rsp)     # imm = 0x4B4F
jne 0x4abd
leaq 0x435a(%rip), %rsi      # 0x8ad7
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x4a75
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x4a75
leaq 0x50(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %r15, %rdx
callq 0x21c0
testq %rax, %rax
je 0x4aa8
cmpl $0x20525245, 0x50(%rsp) # imm = 0x20525245
je 0x4b20
movzwl 0x50(%rsp), %eax
cmpl $0x4b4f, %eax           # imm = 0x4B4F
je 0x4a16
movq %r15, 0x8(%rsp)
cmpl $0x2044, %eax           # imm = 0x2044
jne 0x4abd
xorl %ebp, %ebp
leaq 0x430d(%rip), %r12      # 0x8afe
xorl %r15d, %r15d
movzbl 0x52(%rsp,%r15), %eax
testl %eax, %eax
je 0x4a0e
cmpl $0xa, %eax
je 0x4a0e
cmpq $0x3ff, %rbp            # imm = 0x3FF
je 0x4a09
cmpb $0x25, %al
jne 0x487c
movsbl 0x53(%rsp,%r15), %esi
testl %esi, %esi
je 0x4a69
cmpb $0x0, 0x54(%rsp,%r15)
je 0x4a69
movl $0x10, %edx
movq %r12, %rdi
callq 0x21a0
movq %rax, %r13
movsbl 0x54(%rsp,%r15), %esi
movl $0x10, %edx
movq %r12, %rdi
callq 0x21a0
testq %r13, %r13
je 0x4a69
testq %rax, %rax
je 0x4a69
addq $0x2, %r15
subl %r12d, %r13d
shll $0x4, %r13d
subl %r12d, %eax
addl %r13d, %eax
movb %al, (%rbx,%rbp)
incq %rbp
incq %r15
jmp 0x47f4
leaq 0x414e(%rip), %rdi      # 0x89df
movl $0x2, %esi
xorl %eax, %eax
callq 0x22b0
cmpl $-0x1, %eax
je 0x4a5c
movl %eax, %ebp
movb $0xa, (%rsp)
movq %r12, %rdi
callq 0x2110
movl %ebp, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4a9f
leaq 0x50(%rsp), %r14
movl %ebp, %edi
movq %r14, %rsi
callq 0x2290
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x2c(%r14), %xmm3
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm1, 0x10(%rdx)
movaps %xmm2, 0x20(%rdx)
movups %xmm3, 0x2c(%rdx)
andb $-0x9, 0xc(%rdx)
xorl %r12d, %r12d
movl %ebp, %edi
xorl %esi, %esi
callq 0x22a0
callq 0x2070
movq %rax, %r14
movl $0x0, (%rax)
leaq (%rbx,%r12), %r15
movl $0x1, %edx
movl %ebp, %edi
movq %r15, %rsi
callq 0x21b0
cmpq $0x1, %rax
jne 0x4958
movzbl (%r15), %eax
cmpl $0xa, %eax
je 0x4958
cmpl $0xd, %eax
je 0x4958
incq %r12
cmpq $0x3ff, %r12            # imm = 0x3FF
jne 0x491f
movl $0x3ff, %r12d           # imm = 0x3FF
movb $0x0, (%rbx,%r12)
leaq 0x50(%rsp), %rdx
movl %ebp, %edi
xorl %esi, %esi
callq 0x22a0
movq %rsp, %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x20f0
cmpq $-0x1, %rax
je 0x4a9f
movl %ebp, %edi
callq 0x2170
cmpl $0x0, (%r14)
je 0x4a4a
leaq 0x4024(%rip), %rdi      # 0x89c0
jmp 0x4b27
movl 0x14(%rsp), %edi
callq 0x2170
movl (%rsp), %edi
callq 0x2170
movl 0x10(%rsp), %edi
xorl %esi, %esi
callq 0x2120
movl 0x4(%rsp), %edi
movl $0x1, %esi
callq 0x2120
movq 0x6816(%rip), %rdi      # 0xb1e8
movq %rdi, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2330
testl %eax, %eax
je 0x4a4a
movq 0x67ff(%rip), %rbx      # 0xb1e8
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x4055(%rip), %rdi      # 0x8a51
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3fa5
movl $0x3ff, %ebp            # imm = 0x3FF
addq %rbp, %rbx
movq 0x8(%rsp), %r15
movb $0x0, (%rbx)
leaq 0x40d9(%rip), %rsi      # 0x8af9
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x4a75
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x4a75
movq %r15, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
addq $0xc78, %rsp            # imm = 0xC78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rbx, %rsi
callq 0x24a4
jmp 0x4a4a
leaq 0x409f(%rip), %rdi      # 0x8b0f
jmp 0x4b27
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x4008(%rip), %rdi      # 0x8a90
jmp 0x4b03
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x3f4b(%rip), %rdi      # 0x89e8
jmp 0x4b03
leaq 0x3efe(%rip), %rdi      # 0x89a4
jmp 0x4b27
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x3fec(%rip), %rdi      # 0x8aa7
jmp 0x4b03
leaq 0x3ff9(%rip), %rdi      # 0x8abd
jmp 0x4b27
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x3f2e(%rip), %rdi      # 0x8a07
jmp 0x4b03
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x3f38(%rip), %rdi      # 0x8a26
jmp 0x4b03
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x3f38(%rip), %rdi      # 0x8a3b
movq %rax, %rsi
xorl %eax, %eax
callq 0x3fa5
movl $0x1, %edi
callq 0x2300
leaq 0x3f4b(%rip), %rdi      # 0x8a69
jmp 0x4b27
leaq 0x3fb8(%rip), %rdi      # 0x8adf
xorl %eax, %eax
callq 0x3fa5