// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $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 0xcbd0
leaq 0x38(%r13), %rdx
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0xe16a
leaq 0x28(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcd48
movq %r15, %rdi
callq 0xcd72
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
decq %rsi
movq %rbx, %rdi
callq 0xfac6
jmp 0xcc57
movq %r13, 0x18(%rsp)
leaq 0x8(%r13), %rsi
leaq 0x28(%rsp), %rdi
callq 0xea34
movq %rsp, %rbp
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %rax
notq %rax
orq %r13, %rax
je 0xcc52
leaq 0x10(%r13), %rsi
movq %r12, %rdi
callq 0xfaf8
testq %rdx, %rdx
je 0xcc46
movq %rax, %r15
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
movq 0x10(%r13), %rcx
movq %rcx, (%rsp)
movq 0x18(%r13), %rcx
movq %rcx, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
callq 0xe658
movq %r15, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xebe0
leaq 0x28(%rsp), %rdi
callq 0xe424
jmp 0xcbe6
movq 0x18(%rsp), %r13
addq $0x68, %r13
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0xea86
movq %rsp, %r15
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %rax
notq %rax
orq %r13, %rax
je 0xcd04
movq %r13, %r12
addq $0x10, %r13
movq %r13, %rdi
pushq $0x3d
popq %rsi
xorl %edx, %edx
callq 0x44c0
movq 0x10(%r12), %rcx
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xead8
testq %rax, %rax
je 0xccc3
movl 0x18(%rax), %eax
movq (%r13), %rcx
movq (%rbx), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0xccf5
movq (%rbx), %rbp
movq 0x8(%rbx), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0xeb08
subq %rbp, %r12
shrq $0x3, %r12
movl %r12d, (%rax)
movq (%r13), %rax
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
callq 0xebe0
leaq 0x28(%rsp), %rdi
callq 0xe482
jmp 0xcc6b
leaq 0x28(%rsp), %rsi
andq $0x0, (%rsi)
movq %rbx, %rdi
callq 0xebe0
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcd35
jmp 0xcd35
jmp 0xcd35
jmp 0xcd35
jmp 0xcd35
jmp 0xcd35
jmp 0xcd35
movq %rax, %r14
movq %rbx, %rdi
callq 0xcd72
movq %r14, %rdi
callq 0x4620