// File: /workspace/github_c_makefile_star2_O2/sasairc[P]clangsay/src/msg.c
// Function: recursive_msg
static
int recursive_msg(MSG** msg, int n)
{
    int     status  = 0,
            fd[2]   = {0};

    while (n > 1) {
        if (pipe(fd) < 0) {
            status = -1; goto ERR;
        }
        switch (fork()) {
            case    -1:
                status = -2; goto ERR;
            case    0:
                close(fd[0]);
                dup2(fd[1], STDOUT_FILENO);
                close(fd[1]);
                (*msg)->print(*msg);
                (*msg)->release(*msg);
                exit(0);
            default:
                close(fd[1]);
                if (read_recursive_msg(&(*msg), fd[0]) < 0) {
                    status = -3; goto ERR;
                }
                close(fd[0]);
        }
        wait(&status);
        n--;
    }

    return 0;

ERR:
    switch (status) {
        case    -1:
            fprintf(stderr, "%s: pipe(): %s\n",
                    PROGNAME, strerror(errno));
            break;
        case    -2:
            fprintf(stderr, "%s: fork(): %s\n",
                    PROGNAME, strerror(errno));
            break;
        case    -3:
            break;
    }

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
andl $0x0, (%r14)
leaq 0x10(%rsp), %r15
andq $0x0, (%r15)
leaq 0x14c6(%rip), %r12      # 0xb820
cmpl $0x2, %ebp
jl 0xa40f
movq %r15, %rdi
callq 0x2240
testl %eax, %eax
js 0xa420
callq 0x2400
cmpl $-0x1, %eax
je 0xa444
testl %eax, %eax
je 0xa4fc
movl 0x14(%rsp), %edi
callq 0x2060
movl 0x10(%rsp), %r13d
movq (%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa3b5
movl 0x8(%rax), %esi
callq 0x448f
movq (%rbx), %rax
andl $0x0, 0x8(%rax)
andq $0x0, (%rax)
movl %r13d, %edi
movq %r12, %rsi
callq 0x2220
testq %rax, %rax
je 0xa47f
movq %rax, %r13
movq (%rbx), %rdi
movl $0x100, %esi            # imm = 0x100
movl $0x200, %edx            # imm = 0x200
movq %rax, %rcx
callq 0x374c
movq (%rbx), %rcx
movl %eax, 0x8(%rcx)
testl %eax, %eax
js 0xa4b2
movq %r13, %rdi
callq 0x23e0
movl 0x10(%rsp), %edi
callq 0x2060
movq %r14, %rdi
callq 0x2070
decl %ebp
jmp 0xa35a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
orl $-0x1, 0xc(%rsp)
movq 0x6bb4(%rip), %rax      # 0x10fe0
movq (%rax), %rbx
callq 0x2390
movl (%rax), %edi
callq 0x2280
leaq 0x1418(%rip), %rsi      # 0xb85a
jmp 0xa469
movl $0xfffffffe, 0xc(%rsp)  # imm = 0xFFFFFFFE
movq 0x6b8d(%rip), %rax      # 0x10fe0
movq (%rax), %rbx
callq 0x2390
movl (%rax), %edi
callq 0x2280
leaq 0x1401(%rip), %rsi      # 0xb86a
leaq 0xdad(%rip), %rdx       # 0xb21d
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2450
jmp 0xa4f3
movq 0x6b5a(%rip), %rax      # 0x10fe0
movq (%rax), %rbx
callq 0x2390
movl (%rax), %edi
callq 0x2280
leaq 0x13de(%rip), %rsi      # 0xb87a
leaq 0xd7a(%rip), %rdx       # 0xb21d
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2450
jmp 0xa4eb
movq 0x6b27(%rip), %rax      # 0x10fe0
movq (%rax), %rbx
callq 0x2390
movl (%rax), %edi
callq 0x2280
leaq 0x13d2(%rip), %rsi      # 0xb8a1
leaq 0xd47(%rip), %rdx       # 0xb21d
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2450
movq %r13, %rdi
callq 0x23e0
movl $0xfffffffd, 0xc(%rsp)  # imm = 0xFFFFFFFD
movl 0xc(%rsp), %eax
jmp 0xa411
movl 0x10(%rsp), %edi
callq 0x2060
movl 0x14(%rsp), %edi
pushq $0x1
popq %rsi
callq 0x2040
movl 0x14(%rsp), %edi
callq 0x2060
movq (%rbx), %rdi
callq *0x20(%rdi)
movq (%rbx), %rdi
callq *0x28(%rdi)
xorl %edi, %edi
callq 0x20c0