// File: davmac314[P]dinit/src/includes/load-service.h
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> dinit_load::read_include_path<enable_disable_service(int, cpbuffer<1024u>&, service_dir_opt&, char const*, char const*, bool, bool, unsigned short)::$_1>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, file_pos_ref, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, char const*, enable_disable_service(int, cpbuffer<1024u>&, service_dir_opt&, char const*, char const*, bool, bool, unsigned short)::$_1 const&)
inline string read_include_path(string const &svcname, string const &meta_cmd, file_pos_ref input_pos,
        string_iterator &i, string_iterator end, const char *argval,  const resolve_var_t &resolve_var)
{
    string rval;
    std::list<std::pair<unsigned,unsigned>> parts;

    read_setting_value(rval, setting_op_t::ASSIGN, input_pos, i, end, &parts);
    if (parts.size() != 1) {
        throw service_description_exc(svcname, "'@" + meta_cmd + "' requires a single argument", input_pos);
    }

    std::list<std::pair<unsigned,unsigned>> offsets;
    offsets.emplace_back(0, rval.size());
    value_var_subst(meta_cmd.c_str(), rval, offsets, resolve_var, argval);
    return rval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x100(%rbp)
movq %rdi, %rax
movq %rax, -0x110(%rbp)
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x10(%rbp)
movq %rax, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
callq 0x55c0
leaq -0x58(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x1a420
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdi
movups -0x18(%rbp), %xmm0
movaps %xmm0, -0x70(%rbp)
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x70(%rbp), %edx
movq -0x68(%rbp), %rcx
movq -0x78(%rbp), %r9
movq %rsp, %rax
movq %rsi, (%rax)
movl $0x20, 0x8(%rax)
xorl %esi, %esi
callq 0x1a440
jmp 0xe8ef
leaq -0x58(%rbp), %rdi
callq 0x1a940
cmpq $0x1, %rax
je 0xea19
movb $0x1, -0xc9(%rbp)
movl $0x70, %edi
callq 0x51c0
movq %rax, -0x120(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x30(%rbp), %rdx
leaq 0x1658b(%rip), %rsi     # 0x24ebb
leaq -0xc8(%rbp), %rdi
callq 0x1a970
jmp 0xe93e
leaq 0x16579(%rip), %rdx     # 0x24ebe
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x19af0
jmp 0xe95a
movq -0x118(%rbp), %rsi
movq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x19cd0
jmp 0xe97a
movq -0x120(%rbp), %rdi
movb $0x0, -0xc9(%rbp)
leaq 0x23361(%rip), %rsi     # 0x31cf0
leaq 0xabda(%rip), %rdx      # 0x19570
callq 0x56b0
jmp 0xeb06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0xeaca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0xe9fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0xe9f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x5280
leaq -0xc8(%rbp), %rdi
callq 0x5280
testb $0x1, -0xc9(%rbp)
jne 0xea08
jmp 0xea14
movq -0x120(%rbp), %rdi
callq 0x52f0
jmp 0xeaca
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x1a420
movq -0x100(%rbp), %rdi
movl $0x0, -0xec(%rbp)
callq 0x52c0
movq -0x128(%rbp), %rdi
movq %rax, -0xf8(%rbp)
leaq -0xec(%rbp), %rsi
leaq -0xf8(%rbp), %rdx
callq 0x1aa80
jmp 0xea65
movq -0x30(%rbp), %rdi
callq 0x5160
movq -0x100(%rbp), %rsi
movq %rax, %rdi
movq 0x20(%rbp), %rcx
movq 0x18(%rbp), %r8
leaq -0xe8(%rbp), %rdx
callq 0xee90
jmp 0xea8e
movb $0x1, -0x39(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x1aad0
leaq -0x58(%rbp), %rdi
callq 0x1aad0
testb $0x1, -0x39(%rbp)
jne 0xeaed
jmp 0xeae1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x1aad0
leaq -0x58(%rbp), %rdi
callq 0x1aad0
movq -0x100(%rbp), %rdi
callq 0x5280
jmp 0xeafd
movq -0x100(%rbp), %rdi
callq 0x5280
movq -0x110(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x56f0
nopw %cs:(%rax,%rax)