// File: /workspace/github_c_makefile_star2_O2/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, 0x70a2(%rip)      # 0xb1e8
je 0x4374
leaq 0x20(%rsp), %rdi
callq 0x2180
testl %eax, %eax
jne 0x45cd
leaq 0x8(%rsp), %rdi
callq 0x2180
testl %eax, %eax
jne 0x45cd
callq 0x2360
testl %eax, %eax
je 0x4486
cmpl $-0x1, %eax
je 0x4609
movl 0x20(%rsp), %edi
callq 0x2170
movl 0xc(%rsp), %edi
callq 0x2170
movl 0x24(%rsp), %edi
leaq 0x3891(%rip), %rsi      # 0x7a34
callq 0x2270
testq %rax, %rax
je 0x461e
movq %rax, %r14
movl 0x8(%rsp), %edi
leaq 0x310a(%rip), %rsi      # 0x72c9
callq 0x2270
testq %rax, %rax
je 0x4633
movq %rax, %r15
leaq 0x60(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %rax, %rdx
callq 0x21c0
testq %rax, %rax
je 0x4650
cmpw $0x4b4f, 0x60(%rsp)     # imm = 0x4B4F
jne 0x4658
leaq 0x3893(%rip), %rsi      # 0x7a92
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x45b8
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x45b8
leaq 0x60(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %r15, %rdx
callq 0x21c0
testq %rax, %rax
je 0x45eb
cmpw $0x4b4f, 0x60(%rsp)     # imm = 0x4B4F
jne 0x4600
leaq 0x3894(%rip), %rsi      # 0x7ae7
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x45b8
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x45b8
leaq 0x60(%rsp), %rdi
movl $0xc20, %esi            # imm = 0xC20
movq %r15, %rdx
callq 0x21c0
testq %rax, %rax
je 0x45eb
movl 0x60(%rsp), %eax
cmpl $0x20525245, %eax       # imm = 0x20525245
je 0x4661
cmpw $0x4b4f, %ax            # imm = 0x4B4F
je 0x4500
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movzwl %ax, %ecx
cmpl $0x2044, %ecx           # imm = 0x2044
jne 0x4600
shrl $0x10, %eax
xorl %r13d, %r13d
xorl %r14d, %r14d
testb %al, %al
je 0x44f3
movzbl %al, %ecx
cmpl $0xa, %ecx
je 0x44f3
cmpq $0x3ff, %r13            # imm = 0x3FF
je 0x44ed
cmpb $0x25, %al
jne 0x4360
movsbl 0x63(%rsp,%r14), %esi
testl %esi, %esi
je 0x45ac
movsbl 0x64(%rsp,%r14), %r15d
testl %r15d, %r15d
je 0x45ac
movq %rbx, %r12
leaq 0x37f7(%rip), %rdi      # 0x7b0e
pushq $0x10
popq %rbx
movq %rbx, %rdx
callq 0x21a0
movq %rax, %rbp
leaq 0x37e2(%rip), %rdi      # 0x7b0e
movl %r15d, %esi
movq %rbx, %rdx
callq 0x21a0
testq %rbp, %rbp
je 0x45ac
testq %rax, %rax
je 0x45ac
addq $0x2, %r14
leaq 0x37ba(%rip), %rcx      # 0x7b0e
subl %ecx, %ebp
shll $0x4, %ebp
subl %ecx, %eax
addl %ebp, %eax
movq %r12, %rbx
movb %al, (%rbx,%r13)
incq %r13
movb 0x63(%rsp,%r14), %al
incq %r14
jmp 0x42cb
leaq 0x3674(%rip), %rdi      # 0x79ef
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x22c0
cmpl $-0x1, %eax
je 0x454e
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 0x45e2
leaq 0x60(%rsp), %r14
movl %ebp, %edi
movq %r14, %rsi
callq 0x22a0
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 %r13d, %r13d
movl %ebp, %edi
xorl %esi, %esi
callq 0x22b0
callq 0x2070
movq %rax, %r14
andl $0x0, (%rax)
pushq $0x1
popq %r15
cmpq $0x3ff, %r13            # imm = 0x3FF
je 0x443d
leaq (%rbx,%r13), %r12
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x21b0
cmpq $0x1, %rax
jne 0x443d
movzbl (%r12), %eax
cmpl $0xa, %eax
je 0x443d
cmpl $0xd, %eax
je 0x443d
incq %r13
jmp 0x4409
movb $0x0, (%rbx,%r13)
leaq 0x60(%rsp), %rdx
movl %ebp, %edi
xorl %esi, %esi
callq 0x22b0
leaq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
movl %ebp, %edi
callq 0x20f0
cmpq $-0x1, %rax
je 0x45e2
movl %ebp, %edi
callq 0x2170
cmpl $0x0, (%r14)
je 0x453c
leaq 0x354f(%rip), %rdi      # 0x79d0
jmp 0x4668
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
pushq $0x1
popq %rsi
callq 0x2120
movq 0x6d32(%rip), %rdi      # 0xb1e8
movq %rdi, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2340
testl %eax, %eax
je 0x453c
movq 0x6d1b(%rip), %rbx      # 0xb1e8
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x3581(%rip), %rdi      # 0x7a61
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3af1
movl $0x3ff, %r13d           # imm = 0x3FF
addq %r13, %rbx
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r15
movb $0x0, (%rbx)
leaq 0x35ff(%rip), %rsi      # 0x7b09
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
testl %eax, %eax
js 0x45b8
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
js 0x45b8
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
leaq 0x35e5(%rip), %rdi      # 0x7b3a
xorl %eax, %eax
callq 0x4c25
movq 0x6a95(%rip), %r14      # 0xaff8
movq (%r14), %rsi
movq %r12, %rdi
callq 0x2150
movq (%r14), %rdi
callq 0x2240
movq 0x6a5b(%rip), %rax      # 0xafd8
movq (%rax), %rdx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x21c0
testq %rax, %rax
je 0x466f
movq %rbx, %rdi
callq 0x2110
cmpb $0x1f, -0x1(%rbx,%rax)
jg 0x453c
movb $0x0, -0x1(%rbx,%rax)
jmp 0x453c
leaq 0x356c(%rip), %rdi      # 0x7b1f
jmp 0x4668
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x34d5(%rip), %rdi      # 0x7aa0
jmp 0x4646
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x3418(%rip), %rdi      # 0x79f8
jmp 0x4646
leaq 0x33cb(%rip), %rdi      # 0x79b4
jmp 0x4668
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x34b9(%rip), %rdi      # 0x7ab7
jmp 0x4646
leaq 0x34c6(%rip), %rdi      # 0x7acd
jmp 0x4668
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x33fb(%rip), %rdi      # 0x7a17
jmp 0x4646
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x3405(%rip), %rdi      # 0x7a36
jmp 0x4646
callq 0x2070
movl (%rax), %edi
callq 0x2350
leaq 0x3405(%rip), %rdi      # 0x7a4b
movq %rax, %rsi
xorl %eax, %eax
callq 0x3af1
pushq $0x1
popq %rdi
callq 0x2310
leaq 0x341a(%rip), %rdi      # 0x7a79
jmp 0x4668
leaq 0x3487(%rip), %rdi      # 0x7aef
xorl %eax, %eax
callq 0x3af1
leaq 0x34ec(%rip), %rdi      # 0x7b62
jmp 0x4668