// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/dinitctl.cc
// Function: print_failure_details(stopped_reason_t, unsigned short, int, int, int)
static void print_failure_details(stopped_reason_t stop_reason, uint16_t launch_stage,
        int exit_status, int exit_si_code, int exit_si_status)
{
    using std::cout;

    switch (stop_reason) {
        case stopped_reason_t::DEPFAILED:
            cout << "Reason: a dependency of the service failed to start. "
                    "Check dinit log.\n";
            break;
        case stopped_reason_t::TIMEDOUT:
            cout << "Reason: start timed out.\n";
            break;
        case stopped_reason_t::EXECFAILED:
            cout << "Reason: execution of service process failed:\n";
            cout << "        Stage: " << exec_stage_descriptions[launch_stage] << "\n";
            cout << "        Error: " << strerror(exit_status) << "\n";
            break;
        case stopped_reason_t::FAILED:
            cout << "Reason: service process terminated before ready: ";
            if (exit_si_code != 0 || exit_si_status != 0) {
                print_termination_details(exit_si_code, exit_si_status);
            }
            else {
                print_termination_details(exit_status);
            }
            cout << "\n";
            break;
        default:
            cout << "Reason unknown/unrecognised. Check dinit log.\n";
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
addl $-0x2, %edi
cmpl $0x3, %edi
ja 0xd5a2
movl %ecx, %r15d
movl %edx, %ebx
leaq 0x7bb5(%rip), %rax      # 0x15088
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0xfac5(%rip), %rdi      # 0x1cfa8
leaq 0x8e68(%rip), %rsi      # 0x16352
movl $0x46, %edx
jmp 0xd66d
movl %esi, %ebp
movq 0xfaab(%rip), %r14      # 0x1cfa8
leaq 0x8eaf(%rip), %rsi      # 0x163b3
movl $0x2d, %edx
movq %r14, %rdi
callq 0x4330
leaq 0x8ec9(%rip), %rsi      # 0x163e1
movl $0xf, %edx
movq %r14, %rdi
callq 0x4330
movzwl %bp, %eax
leaq -0xd(%rax), %rcx
cmpq $0x4, %rcx
ja 0xd5ba
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x44c0
jmp 0xd5df
movq 0xfa4e(%rip), %rdi      # 0x1cfa8
leaq 0x8e38(%rip), %rsi      # 0x16399
movl $0x19, %edx
jmp 0xd66d
movl %r8d, %r14d
movq 0xfa33(%rip), %rdi      # 0x1cfa8
leaq 0x8e85(%rip), %rsi      # 0x16401
movl $0x31, %edx
callq 0x4330
movl %r14d, %eax
orl %r15d, %eax
je 0xd653
movl %r15d, %edi
movl %r14d, %esi
callq 0xde13
jmp 0xd65a
movq 0xf9ff(%rip), %rdi      # 0x1cfa8
leaq 0x8e83(%rip), %rsi      # 0x16433
movl $0x2e, %edx
jmp 0xd66d
leaq 0xf67f(%rip), %rcx      # 0x1cc40
movq (%rcx,%rax,8), %r14
movq %r14, %rdi
callq 0x4150
movq 0xf9d4(%rip), %rdi      # 0x1cfa8
movq %r14, %rsi
movq %rax, %rdx
callq 0x4330
movq 0xf9c2(%rip), %r14      # 0x1cfa8
leaq 0x9513(%rip), %rsi      # 0x16b00
movl $0x1, %edx
movq %r14, %rdi
callq 0x4330
leaq 0x8df0(%rip), %rsi      # 0x163f1
movl $0xf, %edx
movq %r14, %rdi
callq 0x4330
movl %ebx, %edi
callq 0x40f0
testq %rax, %rax
je 0xd639
movq %rax, %rbx
movq %rax, %rdi
callq 0x4150
movq 0xf97c(%rip), %rdi      # 0x1cfa8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4330
jmp 0xd65a
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x44c0
jmp 0xd65a
movl %ebx, %edi
callq 0xde83
movq 0xf947(%rip), %rdi      # 0x1cfa8
leaq 0x9498(%rip), %rsi      # 0x16b00
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4330