// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/symbol_table.c
// Function: prv_symbol_table_insert
static const subtilis_symbol_t *
prv_symbol_table_insert(subtilis_symbol_table_t *st, const char *key,
			const subtilis_type_t *id_type,
			const subtilis_type_t *sub_type, size_t size,
			size_t level, bool no_rc, subtilis_error_t *err)

{
	subtilis_symbol_t *sym;
	size_t align_bytes;
	size_t required_alignment;
	char *key_dup = NULL;

	sym = subtilis_hashtable_find(st->h, key);
	if (sym)
		return sym;

	key_dup = malloc(strlen(key) + 1);
	if (!key_dup) {
		subtilis_error_set_oom(err);
		goto on_error;
	}
	(void)strcpy(key_dup, key);

	/*
	 * TODO:  This can leave holes in our global data.  It would
	 * be good to keep track of those holes so we could plug them
	 * with bytes variables.
	 */

	if (size > 0) {
		required_alignment = subtilis_type_if_align(id_type, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		align_bytes = st->allocated % required_alignment;
		if (align_bytes > 0)
			st->allocated += required_alignment - align_bytes;
	}

	sym = prv_symbol_new(key_dup, st->allocated, id_type, sub_type, size,
			     false, no_rc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	prv_ensure_symbol_level(st, level, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;
	st->levels[level].symbols[st->levels[level].size++] = sym;

	(void)subtilis_hashtable_insert(st->h, key_dup, sym, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	st->allocated += sym->size;
	if (st->allocated > st->max_allocated)
		st->max_allocated = st->allocated;

	return sym;

on_error:
	free(key_dup);
	prv_symbol_delete(sym);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x18(%rbp), %rax
movb 0x10(%rbp), %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
andb $0x1, %al
movb %al, -0x39(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x300(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3baf0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x3c560
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3c740
movq -0x18(%rbp), %rdi
callq 0x120d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x121b0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x3c59f
movq 0x18(%rbp), %rdi
movl $0x1, %esi
leaq 0x6ed86(%rip), %rdx     # 0xab316
movl $0xb7, %ecx
callq 0x158e0
jmp 0x3c726
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12060
cmpq $0x0, -0x30(%rbp)
jbe 0x3c60c
movq -0x20(%rbp), %rdi
movq 0x18(%rbp), %rsi
callq 0x47490
movq %rax, -0x58(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3c5d2
jmp 0x3c726
movq -0x10(%rbp), %rax
movq 0x308(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x58(%rbp)
movq %rdx, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jbe 0x3c60a
movq -0x58(%rbp), %rcx
subq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x308(%rax), %rcx
movq %rcx, 0x308(%rax)
jmp 0x3c60c
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x308(%rax), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movb -0x39(%rbp), %r10b
movq 0x18(%rbp), %rax
xorl %r9d, %r9d
andb $0x1, %r10b
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x3cde0
movq %rax, -0x48(%rbp)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3c65a
jmp 0x3c726
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq 0x18(%rbp), %rdx
callq 0x3cf50
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3c679
jmp 0x3c726
movq -0x48(%rbp), %rdx
movq -0x10(%rbp), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rsi
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x300(%rax), %rdi
movq -0x60(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x18(%rbp), %rcx
callq 0x3bbf0
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3c6d1
jmp 0x3c726
movq -0x48(%rbp), %rax
movq 0x2a0(%rax), %rcx
movq -0x10(%rbp), %rax
addq 0x308(%rax), %rcx
movq %rcx, 0x308(%rax)
movq -0x10(%rbp), %rax
movq 0x308(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x310(%rcx), %rax
jbe 0x3c71c
movq -0x10(%rbp), %rax
movq 0x308(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x310(%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3c740
movq -0x60(%rbp), %rdi
callq 0x12290
movq -0x48(%rbp), %rdi
callq 0x3c260
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)