// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/os.c
// Function: os_execute_env
static EnvBlock os_execute_env(int32_t argc, const Janet *argv) {
    if (argc <= 2) return NULL;
    JanetDictView dict = janet_getdictionary(argv, 2);
#ifdef JANET_WINDOWS
    JanetBuffer *temp = janet_buffer(10);
    for (int32_t i = 0; i < dict.cap; i++) {
        const JanetKV *kv = dict.kvs + i;
        if (!janet_checktype(kv->key, JANET_STRING)) continue;
        if (!janet_checktype(kv->value, JANET_STRING)) continue;
        const uint8_t *keys = janet_unwrap_string(kv->key);
        const uint8_t *vals = janet_unwrap_string(kv->value);
        janet_buffer_push_bytes(temp, keys, janet_string_length(keys));
        janet_buffer_push_u8(temp, '=');
        janet_buffer_push_bytes(temp, vals, janet_string_length(vals));
        janet_buffer_push_u8(temp, '\0');
    }
    janet_buffer_push_u8(temp, '\0');
    char *ret = janet_smalloc(temp->count);
    memcpy(ret, temp->data, temp->count);
    return ret;
#else
    char **envp = janet_smalloc(sizeof(char *) * ((size_t)dict.len + 1));
    int32_t j = 0;
    for (int32_t i = 0; i < dict.cap; i++) {
        const JanetKV *kv = dict.kvs + i;
        if (!janet_checktype(kv->key, JANET_STRING)) continue;
        if (!janet_checktype(kv->value, JANET_STRING)) continue;
        const uint8_t *keys = janet_unwrap_string(kv->key);
        const uint8_t *vals = janet_unwrap_string(kv->value);
        int32_t klen = janet_string_length(keys);
        int32_t vlen = janet_string_length(vals);
        /* Check keys has no embedded 0s or =s. */
        int skip = 0;
        for (int32_t k = 0; k < klen; k++) {
            if (keys[k] == '\0' || keys[k] == '=') {
                skip = 1;
                break;
            }
        }
        if (skip) continue;
        char *envitem = janet_smalloc((size_t) klen + (size_t) vlen + 2);
        memcpy(envitem, keys, klen);
        envitem[klen] = '=';
        memcpy(envitem + klen + 1, vals, vlen);
        envitem[klen + vlen + 1] = 0;
        envp[j++] = envitem;
    }
    envp[j] = NULL;
    return envp;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
cmpl $0x2, -0xc(%rbp)
jg 0x4ece2
movq $0x0, -0x8(%rbp)
jmp 0x4ef1f
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x1ccb0
movq %rax, -0x28(%rbp)
movq %rdx, -0x20(%rbp)
movslq -0x20(%rbp), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
callq 0x3a870
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x4ef07
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x4ed42
jmp 0x4ed6e
movq -0x40(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x4ed57
jmp 0x4ed93
movq -0x40(%rbp), %rax
movq (%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x4ed93
jmp 0x4ed8e
movq -0x40(%rbp), %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx), %rax
movabsq $-0x6000000000000, %rcx # imm = 0xFFFA000000000000
cmpq %rcx, %rax
je 0x4ed93
jmp 0x4eef9
xorl %eax, %eax
testb $0x1, %al
jne 0x4ed9b
jmp 0x4edc9
movq -0x40(%rbp), %rax
movsd 0x8(%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x4edb1
jmp 0x4edef
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x4edef
jmp 0x4edea
movq -0x40(%rbp), %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq 0x8(%rcx), %rax
movabsq $-0x6000000000000, %rcx # imm = 0xFFFA000000000000
cmpq %rcx, %rax
je 0x4edef
jmp 0x4eef9
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x7b260
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7b260
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl -0x8(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movl -0x8(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x4ee72
movq -0x48(%rbp), %rax
movslq -0x60(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x4ee5c
movq -0x48(%rbp), %rax
movslq -0x60(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
jne 0x4ee65
movl $0x1, -0x5c(%rbp)
jmp 0x4ee72
jmp 0x4ee67
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x4ee32
cmpl $0x0, -0x5c(%rbp)
je 0x4ee7a
jmp 0x4eef9
movslq -0x54(%rbp), %rdi
movslq -0x58(%rbp), %rax
addq %rax, %rdi
addq $0x2, %rdi
callq 0x3a870
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq -0x48(%rbp), %rsi
movslq -0x54(%rbp), %rdx
callq 0x12680
movq -0x68(%rbp), %rax
movslq -0x54(%rbp), %rcx
movb $0x3d, (%rax,%rcx)
movq -0x68(%rbp), %rdi
movslq -0x54(%rbp), %rax
addq %rax, %rdi
addq $0x1, %rdi
movq -0x50(%rbp), %rsi
movslq -0x58(%rbp), %rdx
callq 0x12680
movq -0x68(%rbp), %rax
movl -0x54(%rbp), %ecx
addl -0x58(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x68(%rbp), %rdx
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x34(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x4ed1b
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)