// File: /workspace/github_cpp_makefile_star2_O3/davmac314[P]dinit/src/includes/dinit-env.h
// Function: environment::build(environment const&) const
env_map build(const environment &parent_env) const
    {
        env_map mapping;

        // first build base: variables from the parent(s) excluding those specifically excluded
        if (keep_parent_env) {
            mapping = parent_env.build(undefine);
            // remove final null entry:
            mapping.env_list.resize(mapping.env_list.size() - 1);
        }
        else {
            // import only those specifically chosen
            for (const std::string &import_name : import_from_parent) {
                string_view name_and_val = parent_env.get(import_name);
                if (name_and_val.empty()) continue;
                mapping.var_map.insert({import_name, mapping.env_list.size()});
                mapping.env_list.push_back(name_and_val.data());
            }
        }

        // add our own (excluding exclude set)
        for (const std::string &set_var : set_vars) {
            size_t eq_pos = set_var.find('=');
            string_view set_var_name = string_view(set_var.data(), eq_pos);
            auto iter = mapping.var_map.find(set_var_name);
            if (iter != mapping.var_map.end()) {
                unsigned pos = iter->second;
                mapping.env_list[pos] = set_var.c_str();
            }
            else {
                mapping.var_map[set_var_name] = mapping.env_list.size();
                mapping.env_list.push_back(set_var.c_str());
            }
        }
        mapping.env_list.push_back(nullptr);

        return mapping;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x18(%rdi), %r14
leaq 0x48(%rdi), %rax
movq %rax, 0x18(%rdi)
movq $0x1, 0x20(%rdi)
movups %xmm0, 0x28(%rdi)
movl $0x3f800000, 0x38(%rdi) # imm = 0x3F800000
movups %xmm0, 0x40(%rdi)
cmpb $0x1, (%rsi)
jne 0x11cfb
leaq 0x38(%r15), %rdx
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x13126
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x11cb1
subq %rdi, %rsi
callq 0x43a0
leaq 0x38(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x46e0
movq %r12, %rdi
callq 0x14ed4
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x11ce0
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x43a0
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
decq %rsi
movq %rbx, %rdi
callq 0x14a0c
jmp 0x11dfd
movq %r15, 0x78(%rsp)
leaq 0x8(%r15), %rsi
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x13a38
movq 0x8(%r13), %r15
movq 0x10(%r13), %rax
notq %rax
orq %r15, %rax
je 0x11df8
leaq 0x8(%rsp), %r13
leaq 0x10(%r15), %rsi
movq %r12, %rdi
callq 0x14a3e
testq %rdx, %rdx
je 0x11d7a
movq %rax, %rbp
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
movq 0x10(%r15), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%r15), %rcx
movq %rcx, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x1367e
movq %rbp, 0x8(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13cba
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rax
movq (%rax), %r15
movq %r15, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq (%rdx), %rsi
leaq (%rax,%rax,2), %rcx
leaq (%rsi,%rcx,8), %rcx
cmpq %rcx, %r15
jne 0x11de5
movq 0x8(%rdx), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incq %rax
cmpq %rdx, %rax
jae 0x11dd1
movq 0x18(%rcx), %r15
addq $0x18, %rcx
cmpq %r15, %rcx
je 0x11dba
jmp 0x11ddb
movq $-0x1, %rax
xorl %r15d, %r15d
movq %r15, 0x28(%rsp)
movq %rax, 0x30(%rsp)
cmpq $-0x1, %rax
jne 0x11d2a
testq %r15, %r15
jne 0x11d2a
movq 0x78(%rsp), %r15
addq $0x68, %r15
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x13a9e
movq 0x8(%r12), %rbp
movq 0x10(%r12), %rax
notq %rax
orq %rbp, %rax
je 0x11f21
leaq 0x8(%rsp), %r15
leaq 0x10(%rbp), %r13
movq %r13, %rdi
movl $0x3d, %esi
xorl %edx, %edx
callq 0x44b0
movq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x13b04
testq %rax, %rax
je 0x11e6d
movl 0x18(%rax), %eax
movq (%r13), %rcx
movq (%rbx), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0x11ea4
movq (%rbx), %r12
movq 0x8(%rbx), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x13bb0
subq %r12, %rbp
shrq $0x3, %rbp
movl %ebp, (%rax)
movq (%r13), %rax
movq %rax, 0x80(%rsp)
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
callq 0x13cba
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rax
movq (%rax), %rbp
movq %rbp, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq (%rdx), %rsi
leaq (%rax,%rax,2), %rcx
leaq (%rsi,%rcx,8), %rcx
cmpq %rcx, %rbp
jne 0x11f0e
movq 0x8(%rdx), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incq %rax
cmpq %rdx, %rax
jae 0x11efb
movq 0x18(%rcx), %rbp
addq $0x18, %rcx
cmpq %rbp, %rcx
je 0x11ee4
jmp 0x11f04
movq $-0x1, %rax
xorl %ebp, %ebp
movq %rbp, 0x28(%rsp)
movq %rax, 0x30(%rsp)
cmpq $-0x1, %rax
jne 0x11e2c
testq %rbp, %rbp
jne 0x11e2c
leaq 0x20(%rsp), %rsi
movq $0x0, (%rsi)
movq %rbx, %rdi
callq 0x13cba
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11f60
movq %rax, %rdi
callq 0x1002f
jmp 0x11f60
jmp 0x11f60
jmp 0x11f60
jmp 0x11f60
jmp 0x11f60
jmp 0x11f60
movq %rax, %r14
movq %rbx, %rdi
callq 0x11f74
movq %r14, %rdi
callq 0x4630
nop