// File: /workspace/github_c_makefile_star2_O0/skeeto[P]enchive/src/enchive.c
// Function: pinentry_unix
static void
pinentry_unix(char *buf, size_t len, char *prompt)
{
    int pin[2];
    int pout[2];
    pid_t pid;

    if (pipe(pin) != 0)
        fatal("could not start pinentry -- %s", strerror(errno));
    if (pipe(pout) != 0)
        fatal("could not start pinentry -- %s", strerror(errno));

    pid = fork();
    if (pid == -1)
        fatal("pinentry fork() failed -- %s", strerror(errno));
    if (pid) {
        FILE *pfi, *pfo;

        close(pin[0]);
        close(pout[1]);

        if (!(pfi = fdopen(pin[1], "w")))
            fatal("fdopen() input -- %s", strerror(errno));
        if (!(pfo = fdopen(pout[0], "r")))
            fatal("fdopen() output -- %s", strerror(errno));

        pinentry(pfi, pfo, buf, len, prompt);

        fclose(pfo);
        fclose(pfi);
    } else {
        close(pin[1]);
        close(pout[0]);
        dup2(pin[0], STDIN_FILENO);
        dup2(pout[1], STDOUT_FILENO);
        if (execlp(pinentry_path, pinentry_path, (char *)0))
            fatal("exec(\"%s\") failed -- %s",
                  pinentry_path, strerror(errno));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2180
cmpl $0x0, %eax
je 0x5a9f
callq 0x2070
movl (%rax), %edi
callq 0x2350
movq %rax, %rsi
leaq 0x6040(%rip), %rdi      # 0xbad8
movb $0x0, %al
callq 0x3340
leaq -0x28(%rbp), %rdi
callq 0x2180
cmpl $0x0, %eax
je 0x5aca
callq 0x2070
movl (%rax), %edi
callq 0x2350
movq %rax, %rsi
leaq 0x6015(%rip), %rdi      # 0xbad8
movb $0x0, %al
callq 0x3340
callq 0x2360
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x5af5
callq 0x2070
movl (%rax), %edi
callq 0x2350
movq %rax, %rsi
leaq 0x6009(%rip), %rdi      # 0xbaf7
movb $0x0, %al
callq 0x3340
cmpl $0x0, -0x2c(%rbp)
je 0x5ba8
movl -0x20(%rbp), %edi
callq 0x2170
movl -0x24(%rbp), %edi
callq 0x2170
movl -0x1c(%rbp), %edi
leaq 0x5ffb(%rip), %rsi      # 0xbb14
callq 0x2270
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x5b45
callq 0x2070
movl (%rax), %edi
callq 0x2350
movq %rax, %rsi
leaq 0x5fd8(%rip), %rdi      # 0xbb16
movb $0x0, %al
callq 0x3340
movl -0x28(%rbp), %edi
leaq 0x585a(%rip), %rsi      # 0xb3a9
callq 0x2270
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x5b7b
callq 0x2070
movl (%rax), %edi
callq 0x2350
movq %rax, %rsi
leaq 0x5fb7(%rip), %rdi      # 0xbb2b
movb $0x0, %al
callq 0x3340
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
callq 0x5ce0
movq -0x40(%rbp), %rdi
callq 0x2100
movq -0x38(%rbp), %rdi
callq 0x2100
jmp 0x5c1b
movl -0x1c(%rbp), %edi
callq 0x2170
movl -0x28(%rbp), %edi
callq 0x2170
movl -0x20(%rbp), %edi
xorl %esi, %esi
callq 0x2120
movl -0x24(%rbp), %edi
movl $0x1, %esi
callq 0x2120
movq 0x96d2(%rip), %rdi      # 0xf2a8
movq 0x96cb(%rip), %rsi      # 0xf2a8
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x2340
cmpl $0x0, %eax
je 0x5c19
movq 0x96b4(%rip), %rax      # 0xf2a8
movq %rax, -0x48(%rbp)
callq 0x2070
movl (%rax), %edi
callq 0x2350
movq -0x48(%rbp), %rsi
movq %rax, %rdx
leaq 0x5f2f(%rip), %rdi      # 0xbb41
movb $0x0, %al
callq 0x3340
jmp 0x5c1b
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)