// File: davmac314[P]dinit/src/baseproc-service.cc
// Function: base_process_service::base_process_service(service_set*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, service_type_t, ha_string&&, std::__cxx11::list<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>> const&, std::__cxx11::list<prelim_dep, std::allocator<prelim_dep>> const&)
base_process_service::base_process_service(service_set *sset, string name,
        service_type_t service_type_p, ha_string &&command,
        const std::list<std::pair<unsigned,unsigned>> &command_offsets,
        const std::list<prelim_dep> &deplist_p)
     : service_record(sset, name, service_type_p, deplist_p), child_listener(this),
       child_status_listener(this), process_timer(this), log_output_listener(this)
{
    program_name = std::move(command);
    exec_arg_parts = separate_args(program_name, command_offsets);

    restart_interval_count = 0;
    restart_interval_time = {0, 0};
    process_timer.service = this;
    process_timer.add_timer(event_loop);

    // By default, allow a maximum of 3 restarts within 10.0 seconds:
    restart_interval.seconds() = 10;
    restart_interval.nseconds() = 0;
    max_restart_interval_count = 3;

    waiting_restart_timer = false;
    waiting_stopstart_timer = false;
    reserved_child_watch = false;
    tracking_child = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %ecx
movq 0x10(%rbp), %r8
callq 0x2fdd0
movq -0x78(%rbp), %rdi
leaq 0x513ef(%rip), %rax     # 0xa7888
movq %rax, (%rdi)
addq $0x208, %rdi            # imm = 0x208
movq %rdi, -0x70(%rbp)
callq 0x32f90
jmp 0x564ae
movq -0x78(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movq %rdi, -0x88(%rbp)
callq 0x15570
movq -0x78(%rbp), %rdi
addq $0x230, %rdi            # imm = 0x230
movq %rdi, -0x80(%rbp)
callq 0x32f90
jmp 0x564db
movq -0x78(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq %rdi, -0xd8(%rbp)
callq 0x15570
movq -0x78(%rbp), %rdi
addq $0x258, %rdi            # imm = 0x258
movq %rdi, -0xd0(%rbp)
callq 0xaa40
movq -0x78(%rbp), %rdi
addq $0x278, %rdi            # imm = 0x278
movq %rdi, -0xc8(%rbp)
callq 0xaa40
movq -0x78(%rbp), %rdi
movl $0x0, 0x298(%rdi)
addq $0x2a0, %rdi            # imm = 0x2A0
movq %rdi, -0xc0(%rbp)
callq 0xaa40
movq -0x78(%rbp), %rdi
movl $0x0, 0x2c0(%rdi)
movl $0xffffffff, 0x2c4(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x2c8(%rdi) # imm = 0xFFFFFFFF
movl $0x0, 0x2cc(%rdi)
movl $0x0, 0x2d0(%rdi)
addq $0x2d8, %rdi            # imm = 0x2D8
movq %rdi, -0xb8(%rbp)
callq 0x57690
movq -0x78(%rbp), %rdi
movb $0x0, 0x2f0(%rdi)
movb $0x0, 0x2f8(%rdi)
movw $0x0, 0x2fa(%rdi)
addq $0x300, %rdi            # imm = 0x300
movq %rdi, -0xb0(%rbp)
callq 0x330e0
movq -0x78(%rbp), %rdi
addq $0x318, %rdi            # imm = 0x318
movq %rdi, -0xa8(%rbp)
callq 0xaa40
movq -0x78(%rbp), %rsi
movq %rsi, %rdi
addq $0x338, %rdi            # imm = 0x338
movq %rdi, -0xa0(%rbp)
callq 0x576b0
movq -0x78(%rbp), %rsi
movq %rsi, %rdi
addq $0x380, %rdi            # imm = 0x380
movq %rdi, -0x98(%rbp)
callq 0x57700
movq -0x78(%rbp), %rsi
movq %rsi, %rdi
addq $0x3b0, %rdi            # imm = 0x3B0
movq %rdi, -0x90(%rbp)
callq 0x57740
jmp 0x5661f
movq -0x78(%rbp), %rsi
movq %rsi, %rdi
addq $0x408, %rdi            # imm = 0x408
movq %rdi, -0xf8(%rbp)
callq 0x57780
movq -0x78(%rbp), %rdi
addq $0x438, %rdi            # imm = 0x438
callq 0x18380
movq -0x78(%rbp), %rdi
addq $0x448, %rdi            # imm = 0x448
callq 0x18380
movq -0x78(%rbp), %rdi
addq $0x460, %rdi            # imm = 0x460
callq 0x18380
movq -0x78(%rbp), %rdi
addq $0x478, %rdi            # imm = 0x478
callq 0x18380
movq -0x78(%rbp), %rdi
addq $0x488, %rdi            # imm = 0x488
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0xf0(%rbp)
movl $0xa, %esi
callq 0x1c100
movq -0xf0(%rbp), %rdx
movq -0x78(%rbp), %rdi
addq $0x498, %rdi            # imm = 0x498
movl $0x3c, %esi
callq 0x1c100
movq -0x78(%rbp), %rdi
movl $0xffffffff, 0x4a8(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4ac(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4b0(%rdi) # imm = 0xFFFFFFFF
addq $0x4b8, %rdi            # imm = 0x4B8
movq %rdi, -0xe8(%rbp)
callq 0xaa40
movq -0x78(%rbp), %rdi
movl $0xffffffff, 0x4d8(%rdi) # imm = 0xFFFFFFFF
addq $0x4dc, %rdi            # imm = 0x4DC
callq 0x3dd70
movq -0x78(%rbp), %rdi
movl $0xffffffff, 0x4e4(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4e8(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4ec(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4f0(%rdi) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rsi
addq $0x208, %rdi            # imm = 0x208
movq %rdi, -0xe0(%rbp)
callq 0x42b80
movq -0xe0(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x4f230
jmp 0x5675d
movq -0x78(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
leaq -0x58(%rbp), %rsi
movq %rsi, -0x100(%rbp)
callq 0x3bec0
movq -0x100(%rbp), %rdi
callq 0x177c0
movq -0x78(%rbp), %rax
movl $0x0, 0x458(%rax)
xorl %eax, %eax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
movq %rdx, %rsi
callq 0x1c100
movq -0x78(%rbp), %rax
movups -0x68(%rbp), %xmm0
movups %xmm0, 0x448(%rax)
movq %rax, %rdi
addq $0x3b0, %rdi            # imm = 0x3B0
movq %rax, 0x400(%rax)
leaq 0x52397(%rip), %rsi     # 0xa8b60
movl $0x1, %edx
movl $0x32, %ecx
callq 0xf700
jmp 0x567da
movq -0x78(%rbp), %rdi
addq $0x460, %rdi            # imm = 0x460
callq 0x18670
movq -0x78(%rbp), %rdi
movq $0xa, (%rax)
addq $0x460, %rdi            # imm = 0x460
callq 0x18630
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq $0x0, (%rcx)
movl $0x3, 0x470(%rax)
movb 0x4f4(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x4f4(%rax)
movb 0x4f4(%rax), %cl
andb $-0x3, %cl
orb $0x0, %cl
movb %cl, 0x4f4(%rax)
movb 0x4f4(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x4f4(%rax)
movb 0x4f4(%rax), %cl
andb $-0x9, %cl
orb $0x0, %cl
movb %cl, 0x4f4(%rax)
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x56954
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5693f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x568ca
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0xade8
movq -0xf8(%rbp), %rdi
callq 0x53a00
movq -0x90(%rbp), %rdi
callq 0x53a20
movq -0x98(%rbp), %rdi
callq 0x53a40
movq -0xa0(%rbp), %rdi
callq 0x53a60
movq -0xa8(%rbp), %rdi
callq 0xade8
movq -0xb0(%rbp), %rdi
callq 0x42dc0
movq -0xb8(%rbp), %rdi
callq 0x18ff0
movq -0xc0(%rbp), %rdi
callq 0xade8
movq -0xc8(%rbp), %rdi
callq 0xade8
movq -0xd0(%rbp), %rdi
callq 0xade8
movq -0xd8(%rbp), %rdi
callq 0x177c0
movq -0x80(%rbp), %rdi
callq 0x33120
movq -0x88(%rbp), %rdi
callq 0x177c0
movq -0x70(%rbp), %rdi
callq 0x33120
movq -0x78(%rbp), %rdi
callq 0x3cdc0
movq -0x38(%rbp), %rdi
callq 0xacc0
nopw %cs:(%rax,%rax)