// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_common.c
// Function: moduleAddSource
void moduleAddSource(Modules *modules, const char *path, const char *source, bool trusted)
{
    if (modules->numModuleSources >= MAX_MODULES)
        modules->error->handler(modules->error->context, "Too many module sources");

    char folder[DEFAULT_STR_LEN + 1] = "";
    char name  [DEFAULT_STR_LEN + 1] = "";

    moduleNameFromPath(modules, path, folder, name, DEFAULT_STR_LEN + 1);

    ModuleSource *moduleSource = storageAdd(modules->storage, sizeof(ModuleSource));

    strncpy(moduleSource->path, path, DEFAULT_STR_LEN);
    moduleSource->path[DEFAULT_STR_LEN] = 0;

    strncpy(moduleSource->folder, folder, DEFAULT_STR_LEN);
    moduleSource->folder[DEFAULT_STR_LEN] = 0;

    strncpy(moduleSource->name, name, DEFAULT_STR_LEN);
    moduleSource->name[DEFAULT_STR_LEN] = 0;

    int sourceLen = strlen(source);
    moduleSource->source = storageAdd(modules->storage, sourceLen + 1);
    strcpy(moduleSource->source, source);

    moduleSource->pathHash = hash(path);
    moduleSource->trusted = trusted;

    modules->moduleSource[modules->numModuleSources++] = moduleSource;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x400, 0x4004(%rax)    # imm = 0x400
jl 0x5966
movq -0x8(%rbp), %rax
movq 0x4118(%rax), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x4118(%rax), %rax
movq 0x20(%rax), %rdi
leaq 0x1ce9f3(%rip), %rsi    # 0x1d4355
movb $0x0, %al
callq *%rcx
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3190
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3190
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x120(%rbp), %rdx
leaq -0x220(%rbp), %rcx
movl $0x100, %r8d            # imm = 0x100
callq 0x50a0
movq -0x8(%rbp), %rax
movq 0x4110(%rax), %rdi
movl $0x318, %esi            # imm = 0x318
callq 0x4b20
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0xff, %edx
callq 0x3080
movq -0x228(%rbp), %rax
movb $0x0, 0xff(%rax)
movq -0x228(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq -0x120(%rbp), %rsi
movl $0xff, %edx
callq 0x3080
movq -0x228(%rbp), %rax
movb $0x0, 0x1ff(%rax)
movq -0x228(%rbp), %rdi
addq $0x200, %rdi            # imm = 0x200
leaq -0x220(%rbp), %rsi
movl $0xff, %edx
callq 0x3080
movq -0x228(%rbp), %rax
movb $0x0, 0x2ff(%rax)
movq -0x18(%rbp), %rdi
callq 0x3120
movl %eax, -0x22c(%rbp)
movq -0x8(%rbp), %rax
movq 0x4110(%rax), %rdi
movl -0x22c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4b20
movq %rax, %rcx
movq -0x228(%rbp), %rax
movq %rcx, 0x308(%rax)
movq -0x228(%rbp), %rax
movq 0x308(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x30a0
movq -0x10(%rbp), %rdi
callq 0x5330
movl %eax, %ecx
movq -0x228(%rbp), %rax
movl %ecx, 0x300(%rax)
movb -0x19(%rbp), %cl
movq -0x228(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x310(%rax)
movq -0x228(%rbp), %rdx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rsi
movl 0x4004(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x4004(%rsi)
movslq %ecx, %rcx
movq %rdx, 0x2000(%rax,%rcx,8)
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax,%rax)