// File: davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::bring_up()
bool base_process_service::bring_up() noexcept
{
    if (!open_socket()) {
        return false;
    }

    bool start_success;
    if (in_auto_restart) {
        start_success = restart_ps_process();
    }
    else {
        restart_interval_count = 0;
        start_success = start_ps_process(exec_arg_parts,
                onstart_flags.starts_on_console || onstart_flags.shares_console);
        // start_ps_process updates last_start_time, use it also for restart_interval_time:
        restart_interval_time = last_start_time;

        // Arm start timer. (For restarts, this is only done once the restart interval expires).
        if (start_success) {
            if (start_timeout != time_val(0,0)) {
                process_timer.arm_timer_rel(event_loop, start_timeout);
                waiting_stopstart_timer = true;
            }
            else if (waiting_stopstart_timer) {
                process_timer.stop_timer(event_loop);
                waiting_stopstart_timer = false;
            }
        }
    }

    return start_success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x54fe0
testb $0x1, %al
jne 0x54e46
movb $0x0, -0x1(%rbp)
jmp 0x54fce
movq -0x40(%rbp), %rax
movl 0x10c(%rax), %eax
shrl $0x11, %eax
andl $0x1, %eax
testl $0x1, %eax
je 0x54e70
movq -0x40(%rbp), %rdi
callq 0x54d30
andb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x54fc6
movq -0x40(%rbp), %rax
movl $0x0, 0x458(%rax)
movq %rax, %rcx
addq $0x218, %rcx            # imm = 0x218
movq %rcx, -0x50(%rbp)
movw 0x2e(%rax), %cx
shrw $0x3, %cx
andw $0x1, %cx
movb $0x1, %al
testw $0x1, %cx
movb %al, -0x41(%rbp)
jne 0x54eb7
movq -0x40(%rbp), %rax
movw 0x2e(%rax), %ax
shrw $0x4, %ax
andw $0x1, %ax
movb %al, -0x41(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movb -0x41(%rbp), %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x55400
movb %al, %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, -0x11(%rbp)
movq 0x438(%rax), %rcx
movq %rcx, 0x448(%rax)
movq 0x440(%rax), %rcx
movq %rcx, 0x450(%rax)
testb $0x1, -0x11(%rbp)
je 0x54fc4
movq -0x40(%rbp), %rax
addq $0x498, %rax            # imm = 0x498
movq %rax, -0x58(%rbp)
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1c100
movq -0x58(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x52e50
testb $0x1, %al
jne 0x54f30
jmp 0x54f81
movq -0x40(%rbp), %rdi
movq %rdi, %rax
addq $0x3b0, %rax            # imm = 0x3B0
movq %rax, -0x60(%rbp)
addq $0x498, %rdi            # imm = 0x498
callq 0x153b0
movq -0x60(%rbp), %rdi
movq %rax, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
leaq 0x53c00(%rip), %rsi     # 0xa8b60
leaq -0x38(%rbp), %rdx
callq 0x18220
movq -0x40(%rbp), %rax
movb 0x4f4(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x4f4(%rax)
jmp 0x54fc2
movq -0x40(%rbp), %rax
movb 0x4f4(%rax), %al
shrb %al
andb $0x1, %al
testb $0x1, %al
je 0x54fc0
movq -0x40(%rbp), %rdi
addq $0x3b0, %rdi            # imm = 0x3B0
leaq 0x53bbb(%rip), %rsi     # 0xa8b60
callq 0x529f0
movq -0x40(%rbp), %rax
movb 0x4f4(%rax), %cl
andb $-0x3, %cl
orb $0x0, %cl
movb %cl, 0x4f4(%rax)
jmp 0x54fc2
jmp 0x54fc4
jmp 0x54fc6
movb -0x11(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)