// File: /workspace/github_c_makefile_star2_O3/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 $0xc88, %rsp            # imm = 0xC88
movq %rsi, %r12
movq %rdi, %rbx
cmpq $0x0, 0x6c9a(%rip)      # 0xb1e8
je 0x4773
leaq 0x20(%rsp), %rdi
callq 0x2180
testl %eax, %eax
jne 0x497d
leaq 0x8(%rsp), %rdi
callq 0x2180
testl %eax, %eax
jne 0x497d
callq 0x2350
testl %eax, %eax
je 0x488d
cmpl $-0x1, %eax
je 0x49b9
movl 0x20(%rsp), %edi
callq 0x2170
movl 0xc(%rsp), %edi
callq 0x2170
movl 0x24(%rsp), %edi
leaq 0x4490(%rip), %rsi      # 0x8a3b
callq 0x2260
testq %rax, %rax
je 0x49ce
movq %rax, %r14
movl 0x8(%rsp), %edi
leaq 0x3d09(%rip), %rsi      # 0x82d0
callq 0x2260
testq %rax, %rax
je 0x49e3
movq %rax, %r15
leaq 0x60(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %rax, %rdx
callq 0x21c0
testq %rax, %rax
je 0x4a00
cmpw $0x4b4f, 0x60(%rsp)     # imm = 0x4B4F
jne 0x4a0a
leaq 0x4492(%rip), %rsi      # 0x8a99
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x4968
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x4968
leaq 0x60(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %r15, %rdx
callq 0x21c0
testq %rax, %rax
je 0x499b
cmpw $0x4b4f, 0x60(%rsp)     # imm = 0x4B4F
jne 0x49b0
leaq 0x4493(%rip), %rsi      # 0x8aee
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x4968
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x4968
leaq 0x60(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %r15, %rdx
callq 0x21c0
testq %rax, %rax
je 0x499b
movl 0x60(%rsp), %eax
cmpl $0x20525245, %eax       # imm = 0x20525245
je 0x4a13
movzwl %ax, %ecx
cmpl $0x4b4f, %ecx           # imm = 0x4B4F
je 0x4909
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
cmpl $0x2044, %ecx           # imm = 0x2044
jne 0x49b0
shrl $0x10, %eax
xorl %r15d, %r15d
leaq 0x443c(%rip), %r12      # 0x8b15
xorl %r14d, %r14d
testb %al, %al
je 0x48fc
movzbl %al, %ecx
cmpl $0xa, %ecx
je 0x48fc
cmpq $0x3ff, %r15            # imm = 0x3FF
je 0x48f6
cmpb $0x25, %al
jne 0x475f
movsbl 0x63(%rsp,%r14), %esi
testl %esi, %esi
je 0x495c
movsbl 0x64(%rsp,%r14), %ebp
testl %ebp, %ebp
je 0x495c
movl $0x10, %edx
movq %r12, %rdi
callq 0x21a0
movq %rax, %r13
movl $0x10, %edx
movq %r12, %rdi
movl %ebp, %esi
callq 0x21a0
testq %r13, %r13
je 0x495c
testq %rax, %rax
je 0x495c
addq $0x2, %r14
subl %r12d, %r13d
shll $0x4, %r13d
subl %r12d, %eax
addl %r13d, %eax
movb %al, (%rbx,%r15)
incq %r15
movb 0x63(%rsp,%r14), %al
incq %r14
jmp 0x46dc
leaq 0x427c(%rip), %rdi      # 0x89f6
movl $0x2, %esi
xorl %eax, %eax
callq 0x22b0
cmpl $-0x1, %eax
je 0x494f
movl %eax, %ebp
movb $0xa, 0x8(%rsp)
movq %r12, %rdi
callq 0x2110
movl %ebp, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4992
leaq 0x60(%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 0x20(%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 0x4842
movzbl (%r15), %eax
cmpl $0xa, %eax
je 0x4842
cmpl $0xd, %eax
je 0x4842
incq %r12
cmpq $0x3ff, %r12            # imm = 0x3FF
jne 0x4809
movl $0x3ff, %r12d           # imm = 0x3FF
movb $0x0, (%rbx,%r12)
leaq 0x60(%rsp), %rdx
movl %ebp, %edi
xorl %esi, %esi
callq 0x22a0
leaq 0x8(%rsp), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x20f0
cmpq $-0x1, %rax
je 0x4992
movl %ebp, %edi
callq 0x2170
cmpl $0x0, (%r14)
je 0x493d
leaq 0x414f(%rip), %rdi      # 0x89d7
jmp 0x4a1a
movl 0x24(%rsp), %edi
callq 0x2170
movl 0x8(%rsp), %edi
callq 0x2170
movl 0x20(%rsp), %edi
xorl %esi, %esi
callq 0x2120
movl 0xc(%rsp), %edi
movl $0x1, %esi
callq 0x2120
movq 0x6929(%rip), %rdi      # 0xb1e8
movq %rdi, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2330
testl %eax, %eax
je 0x493d
movq 0x6912(%rip), %rbx      # 0xb1e8
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x417f(%rip), %rdi      # 0x8a68
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3ea8
movl $0x3ff, %r15d           # imm = 0x3FF
addq %r15, %rbx
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r15
movb $0x0, (%rbx)
leaq 0x41fd(%rip), %rsi      # 0x8b10
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x4968
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x4968
movq %r15, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
addq $0xc88, %rsp            # imm = 0xC88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %rbx, %rsi
callq 0x24cb
jmp 0x493d
leaq 0x41c3(%rip), %rdi      # 0x8b26
jmp 0x4a1a
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x412c(%rip), %rdi      # 0x8aa7
jmp 0x49f6
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x406f(%rip), %rdi      # 0x89ff
jmp 0x49f6
leaq 0x4022(%rip), %rdi      # 0x89bb
jmp 0x4a1a
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x4110(%rip), %rdi      # 0x8abe
jmp 0x49f6
leaq 0x411d(%rip), %rdi      # 0x8ad4
jmp 0x4a1a
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x4052(%rip), %rdi      # 0x8a1e
jmp 0x49f6
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x405c(%rip), %rdi      # 0x8a3d
jmp 0x49f6
callq 0x2070
movl (%rax), %edi
callq 0x2340
leaq 0x405c(%rip), %rdi      # 0x8a52
movq %rax, %rsi
xorl %eax, %eax
callq 0x3ea8
movl $0x1, %edi
callq 0x2300
leaq 0x406f(%rip), %rdi      # 0x8a80
jmp 0x4a1a
leaq 0x40dc(%rip), %rdi      # 0x8af6
xorl %eax, %eax
callq 0x3ea8