// File: /workspace/github_cpp_makefile_star2_O1/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, %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 0x11a2f
leaq 0x38(%r15), %rdx
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x12f1c
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x14d5a
leaq 0x30(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x46e0
movq %r12, %rdi
callq 0x14d9a
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x11a14
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x43a0
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
decq %rsi
movq %rbx, %rdi
callq 0x14898
jmp 0x11b2f
movq %r15, 0x68(%rsp)
leaq 0x8(%r15), %rsi
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x13840
movq 0x8(%r13), %r15
movq 0x10(%r13), %rax
notq %rax
orq %r15, %rax
je 0x11b2a
movq %rsp, %r13
leaq 0x10(%r15), %rsi
movq %r12, %rdi
callq 0x148ca
testq %rdx, %rdx
je 0x11aaa
movq %rax, %rbp
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
movq 0x10(%r15), %rcx
movq %rcx, (%rsp)
movq 0x18(%r15), %rcx
movq %rcx, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x1347c
movq %rbp, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13b0e
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq %rdi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq (%rdx), %rsi
leaq (%rax,%rax,2), %rcx
leaq (%rsi,%rcx,8), %rcx
cmpq %rcx, %rdi
jne 0x11b14
movq 0x8(%rdx), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incq %rax
cmpq %rdx, %rax
jae 0x11b01
movq 0x18(%rcx), %rsi
addq $0x18, %rcx
cmpq %rsi, %rcx
je 0x11aea
jmp 0x11b0a
movq $-0x1, %rax
xorl %esi, %esi
movq %rsi, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rax
notq %rax
orq %r15, %rax
jne 0x11a5c
movq 0x68(%rsp), %r15
addq $0x68, %r15
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x138c8
movq 0x8(%r12), %rbp
movq 0x10(%r12), %rax
notq %rax
orq %rbp, %rax
je 0x11c4d
movq %rsp, %r15
leaq 0x10(%rbp), %r13
movq %r13, %rdi
movl $0x3d, %esi
xorl %edx, %edx
callq 0x44b0
movq 0x10(%rbp), %rcx
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x13950
testq %rax, %rax
je 0x11b9c
movl 0x18(%rax), %eax
movq (%r13), %rcx
movq (%rbx), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0x11bcd
movq (%rbx), %r12
movq 0x8(%rbx), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x139fc
subq %r12, %rbp
shrq $0x3, %rbp
movl %ebp, (%rax)
movq (%r13), %rax
movq %rax, 0x70(%rsp)
movq %rbx, %rdi
leaq 0x70(%rsp), %rsi
callq 0x13b0e
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq %rdi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq (%rdx), %rsi
leaq (%rax,%rax,2), %rcx
leaq (%rsi,%rcx,8), %rcx
cmpq %rcx, %rdi
jne 0x11c37
movq 0x8(%rdx), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incq %rax
cmpq %rdx, %rax
jae 0x11c24
movq 0x18(%rcx), %rsi
addq $0x18, %rcx
cmpq %rsi, %rcx
je 0x11c0d
jmp 0x11c2d
movq $-0x1, %rax
xorl %esi, %esi
movq %rsi, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %rax
notq %rax
orq %rbp, %rax
jne 0x11b5c
leaq 0x18(%rsp), %rsi
movq $0x0, (%rsi)
movq %rbx, %rdi
callq 0x13b0e
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11c89
movq %rax, %rdi
callq 0xfd03
jmp 0x11c89
jmp 0x11c89
jmp 0x11c89
jmp 0x11c89
jmp 0x11c89
jmp 0x11c89
movq %rax, %r14
movq %rbx, %rdi
callq 0x11c9c
movq %r14, %rdi
callq 0x4630