// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofCreatePipes
int aofCreatePipes(void) {
    int fds[6] = {-1, -1, -1, -1, -1, -1};
    int j;

    if (pipe(fds) == -1) goto error; /* parent -> children data. */
    if (pipe(fds+2) == -1) goto error; /* children -> parent ack. */
    if (pipe(fds+4) == -1) goto error; /* children -> parent ack. */
    /* Parent -> children data is non blocking. */
    if (anetNonBlock(NULL,fds[0]) != ANET_OK) goto error;
    if (anetNonBlock(NULL,fds[1]) != ANET_OK) goto error;
    if (aeCreateFileEvent(server.el, fds[2], AE_READABLE, aofChildPipeReadable, NULL) == AE_ERR) goto error;

    server.aof_pipe_write_data_to_child = fds[1];
    server.aof_pipe_read_data_from_parent = fds[0];
    server.aof_pipe_write_ack_to_parent = fds[3];
    server.aof_pipe_read_ack_from_child = fds[2];
    server.aof_pipe_write_ack_to_child = fds[5];
    server.aof_pipe_read_ack_from_parent = fds[4];
    server.aof_stop_sending_diff = 0;
    return C_OK;

error:
    serverLog(LL_WARNING,"Error opening /setting AOF rewrite IPC pipes: %s",
        strerror(errno));
    for (j = 0; j < 6; j++) if(fds[j] != -1) close(fds[j]);
    return C_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0xcb2d1(%rip), %rax     # 0x13f320
movq %rax, -0x20(%rbp)
movq 0xcb2ce(%rip), %rax     # 0x13f328
movq %rax, -0x18(%rbp)
movq 0xcb2cb(%rip), %rax     # 0x13f330
movq %rax, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x265f0
cmpl $-0x1, %eax
jne 0x7407c
jmp 0x7417b
leaq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x265f0
cmpl $-0x1, %eax
jne 0x74093
jmp 0x7417b
leaq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x265f0
cmpl $-0x1, %eax
jne 0x740aa
jmp 0x7417b
movl -0x20(%rbp), %esi
xorl %eax, %eax
movl %eax, %edi
callq 0x2b860
cmpl $0x0, %eax
je 0x740c0
jmp 0x7417b
movl -0x1c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edi
callq 0x2b860
cmpl $0x0, %eax
je 0x740d6
jmp 0x7417b
leaq 0x1040fb(%rip), %rax    # 0x1781d8
movq 0x40(%rax), %rdi
movl -0x18(%rbp), %esi
movl $0x1, %edx
leaq -0x180(%rip), %rcx      # 0x73f70
xorl %eax, %eax
movl %eax, %r8d
callq 0x2a8f0
cmpl $-0x1, %eax
jne 0x74101
jmp 0x7417b
movl -0x1c(%rbp), %ecx
leaq 0x1040cd(%rip), %rax    # 0x1781d8
movl %ecx, 0x6f8(%rax)
movl -0x20(%rbp), %ecx
leaq 0x1040bd(%rip), %rax    # 0x1781d8
movl %ecx, 0x6fc(%rax)
movl -0x14(%rbp), %ecx
leaq 0x1040ad(%rip), %rax    # 0x1781d8
movl %ecx, 0x700(%rax)
movl -0x18(%rbp), %ecx
leaq 0x10409d(%rip), %rax    # 0x1781d8
movl %ecx, 0x704(%rax)
movl -0xc(%rbp), %ecx
leaq 0x10408d(%rip), %rax    # 0x1781d8
movl %ecx, 0x708(%rax)
movl -0x10(%rbp), %ecx
leaq 0x10407d(%rip), %rax    # 0x1781d8
movl %ecx, 0x70c(%rax)
leaq 0x104070(%rip), %rax    # 0x1781d8
movl $0x0, 0x710(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x741d6
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq %rax, %rdx
movl $0x3, %edi
leaq 0xcbbd0(%rip), %rsi     # 0x13fd66
movb $0x0, %al
callq 0x2fc60
movl $0x0, -0x24(%rbp)
cmpl $0x6, -0x24(%rbp)
jge 0x741cf
movslq -0x24(%rbp), %rax
cmpl $-0x1, -0x20(%rbp,%rax,4)
je 0x741c2
movslq -0x24(%rbp), %rax
movl -0x20(%rbp,%rax,4), %edi
callq 0x26180
jmp 0x741c4
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x741a4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop