LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: prv_symbol_delete
static void prv_symbol_delete(void *s)
{
	subtilis_symbol_t *sym = s;

	if (!sym)
		return;

	subtilis_type_free(&sym->sub_t);
	subtilis_type_free(&sym->t);
	free(sym);
}

// Assembly:
testq %rdi, %rdi
je 0x2e5e6
pushq %rbx
movq %rdi, %rbx
addq $0x150, %rdi            # imm = 0x150
callq 0x2f843
leaq 0x8(%rbx), %rdi
callq 0x2f843
movq %rbx, %rdi
popq %rbx
jmp 0x122c0
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_delete
void subtilis_symbol_table_delete(subtilis_symbol_table_t *st)
{
	size_t i;

	if (!st)
		return;
	for (i = 0; i < SUBTILIS_SYMBOL_MAX_LEVELS; i++)
		free(st->levels[i].symbols);
	subtilis_hashtable_delete(st->h);
	free(st);
}

// Assembly:
testq %rdi, %rdi
je 0x2e62a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %r14d
movq (%rbx,%r14), %rdi
callq 0x122c0
addq $0x18, %r14
cmpq $0x310, %r14            # imm = 0x310
jne 0x2e5f9
movq 0x300(%rbx), %rdi
callq 0x2e160
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x122c0
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_level_down
void subtilis_symbol_table_level_down(subtilis_symbol_table_t *st,
				      subtilis_error_t *err)
{
	size_t i;
	subtilis_symbol_level_t *level;

	if (st->level == 0) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	level = &st->levels[st->level];
	for (i = 0; i < level->size; i++)
		subtilis_symbol_table_remove(st, level->symbols[i]->key);
	level->size = 0;
	st->level--;
}

// Assembly:
movq 0x318(%rdi), %rax
testq %rax, %rax
je 0x2e6c3
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %r14
cmpq $0x0, (%r14)
je 0x2e6af
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x298(%rax), %rsi
movq 0x300(%rbx), %rdi
callq 0x2e2e2
incq %r15
cmpq (%r14), %r15
jb 0x2e68c
movq $0x0, (%r14)
decq 0x318(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x45be8(%rip), %rdx     # 0x742b2
movq %rsi, %rdi
movl $0xf, %esi
movl $0x74, %ecx
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_create_local_buf
const subtilis_symbol_t *
subtilis_symbol_table_create_local_buf(subtilis_symbol_table_t *st, size_t size,
				       subtilis_error_t *err)
{
	char buf[64];

	/*
	 * Everything on the stack needs to be 32 bit word aligned.
	 */

	if (size & 3) {
		subtilis_error_set_assertion_failed(err);
		return NULL;
	}

	/*
	 * Subtilis identifiers cannot start with a number so there'll be no
	 * clash here.
	 */

	sprintf(buf, "%zu", st->tmp_count++);
	return prv_symbol_table_insert(st, buf, &subtilis_type_local_buffer,
				       NULL, size, 0, false, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
testb $0x3, %r14b
je 0x2e978
leaq 0x45950(%rip), %rdx     # 0x742b2
movq %rbx, %rdi
movl $0xf, %esi
movl $0x10e, %ecx            # imm = 0x10E
callq 0x145f4
xorl %eax, %eax
jmp 0x2e9c2
movq %rdi, %r15
movq 0x320(%rdi), %rdx
leaq 0x1(%rdx), %rax
movq %rax, 0x320(%rdi)
leaq 0x4589c(%rip), %rsi     # 0x74230
movq %rsp, %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x12280
leaq 0x46470(%rip), %rdx     # 0x74e18
movq %r15, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
movq %r14, %r8
xorl %r9d, %r9d
pushq %rbx
pushq $0x0
callq 0x2e73e
addq $0x10, %rsp
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_insert_tmp
const subtilis_symbol_t *
subtilis_symbol_table_insert_tmp(subtilis_symbol_table_t *st,
				 const subtilis_type_t *id_type,
				 char **tmp_name, subtilis_error_t *err)
{
	const subtilis_symbol_t *s;
	char *name = NULL;
	char buf[64];

	/*
	 * Subtilis identifiers cannot start with a number so there'll be no
	 * clash here.
	 */

	sprintf(buf, "%zu", st->tmp_count++);
	if (tmp_name) {
		name = malloc(strlen(buf) + 1);
		if (!name) {
			subtilis_error_set_oom(err);
			return NULL;
		}
		strcpy(name, buf);
	}

	s = subtilis_symbol_table_insert(st, buf, id_type, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		free(name);
		return NULL;
	}

	if (tmp_name)
		*tmp_name = name;

	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x320(%rdi), %rdx
leaq 0x1(%rdx), %rax
movq %rax, 0x320(%rdi)
leaq 0x457ec(%rip), %rsi     # 0x74230
xorl %r13d, %r13d
movq %rsp, %rdi
xorl %eax, %eax
callq 0x12280
testq %rbx, %rbx
je 0x2ea7a
movq %rsp, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
testq %rax, %rax
je 0x2eaa5
movq %rax, %r13
movq %rsp, %rsi
movq %rax, %rdi
callq 0x12070
movq %rsp, %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2e6e8
cmpl $0x0, (%r14)
je 0x2ea9b
movq %r13, %rdi
callq 0x122c0
jmp 0x2eabe
testq %rbx, %rbx
je 0x2eac0
movq %r13, (%rbx)
jmp 0x2eac0
leaq 0x45806(%rip), %rdx     # 0x742b2
movq %r14, %rdi
movl $0x1, %esi
movl $0x140, %ecx            # imm = 0x140
callq 0x145f4
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_insert_type
void subtilis_symbol_table_insert_type(subtilis_symbol_table_t *st,
				       const char *name,
				       const subtilis_type_t *type,
				       subtilis_error_t *err)
{
	if (subtilis_hashtable_find(st->h, name)) {
		subtilis_error_set_type_already_defined(err);
		return;
	}
	(void)prv_symbol_table_insert(st, name, &subtilis_type_typedef, type, 0,
				      st->level, false, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x300(%rdi), %rdi
callq 0x2e1f3
testq %rax, %rax
je 0x2eb17
leaq 0x457b8(%rip), %rdx     # 0x742b2
movq %rbx, %rdi
movl $0x68, %esi
movl $0x158, %ecx            # imm = 0x158
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x145f4
movq 0x318(%r12), %r9
leaq 0x4643a(%rip), %rdx     # 0x74f60
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
xorl %r8d, %r8d
pushq %rbx
pushq $0x0
callq 0x2e73e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_promote_tmp
const subtilis_symbol_t *subtilis_symbol_table_promote_tmp(
	subtilis_symbol_table_t *st, const subtilis_type_t *id_type,
	const char *tmp_name, const char *new_name, subtilis_error_t *err)
/* clang-format on */

{
	subtilis_symbol_t *s;
	char *name = NULL;

	s = subtilis_hashtable_extract(st->h, tmp_name);
	if (!s) {
		subtilis_error_set_assertion_failed(err);
		return NULL;
	}

	if (!subtilis_type_eq(id_type, &s->t)) {
		subtilis_error_set_assertion_failed(err);
		return NULL;
	}

	name = malloc(strlen(new_name) + 1);
	if (!name) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	strcpy(name, new_name);
	s->key = name;

	(void)subtilis_hashtable_insert(st->h, name, s, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		free(s);
		free(name);
		return NULL;
	}

	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r14
movq %rcx, %r12
movq %rsi, %r13
movq %rdi, %r15
movq 0x300(%rdi), %rdi
movq %rdx, %rsi
callq 0x2e36b
testq %rax, %rax
je 0x2ebda
movq %rax, %rbx
leaq 0x8(%rax), %rsi
movq %r13, %rdi
callq 0x2f3e4
testb %al, %al
je 0x2ebf0
movq %r12, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
testq %rax, %rax
je 0x2ec06
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x12070
movq %r13, 0x298(%rbx)
movq 0x300(%r15), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2e248
cmpl $0x0, (%r14)
je 0x2ec21
movq %rbx, %rdi
callq 0x122c0
movq %r13, %rdi
callq 0x122c0
jmp 0x2ec1f
leaq 0x456d1(%rip), %rdx     # 0x742b2
movq %r14, %rdi
movl $0xf, %esi
movl $0x16b, %ecx            # imm = 0x16B
jmp 0x2ec1a
leaq 0x456bb(%rip), %rdx     # 0x742b2
movq %r14, %rdi
movl $0xf, %esi
movl $0x170, %ecx            # imm = 0x170
jmp 0x2ec1a
leaq 0x456a5(%rip), %rdx     # 0x742b2
movq %r14, %rdi
movl $0x1, %esi
movl $0x176, %ecx            # imm = 0x176
callq 0x145f4
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: subtilis_symbol_table_insert_reg
const subtilis_symbol_t *
subtilis_symbol_table_insert_reg(subtilis_symbol_table_t *st, const char *key,
				 const subtilis_type_t *id_type, size_t reg_num,
				 subtilis_error_t *err)
{
	subtilis_symbol_t *sym;
	size_t size;
	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);

	size = subtilis_type_if_size(id_type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;
	sym = prv_symbol_new(key_dup, reg_num, id_type, NULL, size, true, false,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

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

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

	return sym;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movq 0x300(%rdi), %rdi
callq 0x2e1f3
movq %rax, %r12
testq %rax, %rax
jne 0x2ecc8
movq %rbx, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
movq %rax, %r12
testq %rax, %rax
je 0x2ec96
movq %r12, %rdi
movq %rbx, %rsi
callq 0x12070
movq %r13, %rdi
movq %r14, %rsi
callq 0x35ed8
cmpl $0x0, (%r14)
je 0x2ecda
movq %r12, %rbx
jmp 0x2ecb2
movq %r12, %rbx
leaq 0x45612(%rip), %rdx     # 0x742b2
movq %r14, %rdi
movl $0x1, %esi
movl $0x195, %ecx            # imm = 0x195
callq 0x145f4
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x122c0
movq %r12, %rdi
callq 0x2e5bf
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rbx
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq %rax, %r8
movl $0x1, %r9d
pushq %r14
pushq $0x0
callq 0x2ed63
addq $0x10, %rsp
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0x2ecb5
movq 0x318(%r15), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2ee67
cmpl $0x0, (%r14)
jne 0x2ecb5
movq 0x318(%r15), %rax
leaq (%rax,%rax,2), %rax
movq (%r15,%rax,8), %rcx
movq 0x10(%r15,%rax,8), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r15,%rax,8)
movq %r12, (%rdx,%rcx,8)
movq 0x300(%r15), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x2e248
cmpl $0x0, (%r14)
jne 0x2ecb5
jmp 0x2ecc8
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: prv_symbol_new
static subtilis_symbol_t *prv_symbol_new(const char *key, size_t loc,
					 const subtilis_type_t *id_type,
					 const subtilis_type_t *sub_type,
					 size_t size, bool is_reg, bool no_rc,
					 subtilis_error_t *err)
{
	subtilis_symbol_t *sym;

	sym = malloc(sizeof(*sym));
	if (!sym) {
		subtilis_error_set_oom(err);
		return NULL;
	}

	subtilis_type_init_copy(&sym->t, id_type, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		free(sym);
		return NULL;
	}

	sym->sub_t.type = SUBTILIS_TYPE_VOID;
	if (sub_type) {
		subtilis_type_init_copy(&sym->sub_t, sub_type, err);
		if (err->type != SUBTILIS_ERROR_OK) {
			prv_symbol_delete(sym);
			return NULL;
		}
	}

	sym->size = size;
	sym->key = key;
	sym->loc = loc;
	sym->is_reg = is_reg;
	sym->no_rc = no_rc;

	return sym;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r14d
movq %r8, 0x10(%rsp)
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
movq 0x58(%rsp), %r13
movl $0x2b0, %edi            # imm = 0x2B0
callq 0x121d0
testq %rax, %rax
je 0x2edc6
movq %rax, %rbx
movl %r14d, 0x4(%rsp)
leaq 0x8(%rax), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2f72e
cmpl $0x0, (%r13)
je 0x2edf3
movq %rbx, %rdi
callq 0x122c0
jmp 0x2eddf
leaq 0x454e5(%rip), %rdx     # 0x742b2
movq %r13, %rdi
movl $0x1, %esi
movl $0x89, %ecx
callq 0x145f4
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, 0x150(%rbx)
testq %rbp, %rbp
je 0x2ee33
movq %rbx, %r15
addq $0x150, %r15            # imm = 0x150
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2f72e
cmpl $0x0, (%r13)
je 0x2ee33
movq %r15, %rdi
callq 0x2f843
movq %r14, %rdi
callq 0x2f843
jmp 0x2edbc
movb 0x50(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x2a0(%rbx)
movq %r12, 0x298(%rbx)
movq 0x8(%rsp), %rcx
movq %rcx, (%rbx)
movl 0x4(%rsp), %ecx
movb %cl, 0x2a8(%rbx)
movb %al, 0x2a9(%rbx)
jmp 0x2ede1
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/symbol_table.c
// Function: prv_ensure_symbol_level
static void prv_ensure_symbol_level(subtilis_symbol_table_t *st,
				    size_t level_idx, subtilis_error_t *err)
{
	size_t new_size;
	subtilis_symbol_level_t *level = &st->levels[level_idx];
	const subtilis_symbol_t **new_symbols;

	if (level->size < level->max_size)
		return;

	new_size = level->size + SUBTILIS_SYMBOL_MAX_LEVELS;
	new_symbols = realloc(level->symbols, new_size * sizeof(*new_symbols));
	if (!new_symbols) {
		subtilis_error_set_oom(err);
		return;
	}
	level->symbols = new_symbols;
	level->max_size = new_size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq (%rsi,%rsi,2), %rax
movq (%rdi,%rax,8), %r14
cmpq 0x8(%rdi,%rax,8), %r14
jb 0x2eea4
movq %rdx, %rbx
leaq (%rdi,%rax,8), %r15
movq 0x10(%r15), %rdi
leaq 0x100(,%r14,8), %rsi
callq 0x12210
testq %rax, %rax
je 0x2eeaa
addq $0x20, %r14
movq %rax, 0x10(%r15)
movq %r14, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x45401(%rip), %rdx     # 0x742b2
movq %rbx, %rdi
movl $0x1, %esi
movl $0x5a, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/constant_pool.c
// Function: subtilis_constant_pool_new
subtilis_constant_pool_t *subtilis_constant_pool_new(subtilis_error_t *err)
{
	subtilis_constant_pool_t *pool;

	pool = calloc(1, sizeof(*pool));
	if (!pool) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	pool->ref = 1;
	return pool;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x20, %esi
callq 0x12150
testq %rax, %rax
je 0x2ef2a
movq $0x1, 0x18(%rax)
jmp 0x2ef45
leaq 0x45399(%rip), %rdx     # 0x742ca
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1c, %ecx
callq 0x145f4
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/constant_pool.c
// Function: subtilis_constant_pool_delete
void subtilis_constant_pool_delete(subtilis_constant_pool_t *pool)
{
	size_t i;

	if (!pool)
		return;

	if (pool->ref > 1) {
		pool->ref--;
		return;
	}

	for (i = 0; i < pool->size; i++)
		free(pool->data[i].data);
	free(pool->data);
	free(pool);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x2ef6d
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq $0x1, %rax
jbe 0x2ef73
decq %rax
movq %rax, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
cmpq $0x0, (%rbx)
je 0x2ef9b
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x122c0
incq %r15
addq $0x18, %r14
cmpq (%rbx), %r15
jb 0x2ef82
movq 0x10(%rbx), %rdi
callq 0x122c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x122c0
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/constant_pool.c
// Function: subtilis_constant_pool_dump
void subtilis_constant_pool_dump(subtilis_constant_pool_t *pool)
{
	size_t i;
	size_t j;
	size_t count;

	for (i = 0; i < pool->size; i++) {
		printf("[%zu]:\n", i);
		count = 0;
		for (;;) {
			for (j = 0; j < 16; j++) {
				if (count == pool->data[i].data_size)
					goto next;
				printf("%x ", pool->data[i].data[count++]);
			}
			printf("\n");
		}
	/* clang-format off */
next:
	/* clang-format off */

		printf("\n");
	}
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x2f044
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x45319(%rip), %r15     # 0x742e9
xorl %r12d, %r12d
leaq 0x45307(%rip), %rdi     # 0x742e1
movq %r12, %rsi
xorl %eax, %eax
callq 0x12110
leaq (%r12,%r12,2), %r13
xorl %ebp, %ebp
movl $0x10, %r14d
movq 0x10(%rbx), %rax
cmpq (%rax,%r13,8), %rbp
je 0x2f024
leaq (%rax,%r13,8), %rax
movq 0x8(%rax), %rax
movzbl (%rax,%rbp), %esi
incq %rbp
movq %r15, %rdi
xorl %eax, %eax
callq 0x12110
decq %r14
jne 0x2eff0
movl $0xa, %edi
callq 0x12030
jmp 0x2efea
movl $0xa, %edi
callq 0x12030
incq %r12
cmpq (%rbx), %r12
jb 0x2efd3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/constant_pool.c
// Function: subtilis_constant_pool_add
size_t subtilis_constant_pool_add(subtilis_constant_pool_t *pool, uint8_t *data,
				  size_t data_size, bool dbl,
				  subtilis_error_t *err)
{
	size_t i;
	size_t new_max_size;
	subtilis_constant_data_t *new_data;

	for (i = 0; i < pool->size; i++) {
		if (dbl != pool->data[i].dbl)
			continue;
		if (data_size != pool->data[i].data_size)
			continue;
		if (!memcmp(data, pool->data[i].data, data_size)) {
			free(data);
			return i;
		}
	}

	if (pool->size == pool->max_size) {
		new_max_size = pool->size + SUBTILIS_CONFIG_CONSTANT_POOL_GRAN;
		new_data =
		    realloc(pool->data, sizeof(*new_data) * new_max_size);
		if (!new_data) {
			subtilis_error_set_oom(err);
			return SIZE_MAX;
		}
		pool->max_size = new_max_size;
		pool->data = new_data;
	}

	pool->data[pool->size].data = data;
	pool->data[pool->size].dbl = dbl;
	pool->data[pool->size++].data_size = data_size;

	return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
movq (%rdi), %r13
testq %r13, %r13
je 0x2f0b7
movq %r12, 0x10(%rsp)
movq 0x10(%r15), %r12
addq $0x10, %r12
xorl %ebx, %ebx
cmpb %bpl, (%r12)
jne 0x2f0a1
cmpq %r14, -0x10(%r12)
jne 0x2f0a1
movq -0x8(%r12), %rsi
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x121e0
testl %eax, %eax
je 0x2f13d
incq %rbx
addq $0x18, %r12
cmpq %rbx, %r13
jne 0x2f07a
movq %r13, %rbx
movq 0x10(%rsp), %r12
jmp 0x2f0b9
xorl %ebx, %ebx
cmpq 0x8(%r15), %r13
jne 0x2f0e5
movq 0x10(%r15), %rdi
leaq 0x100(,%r13,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x12210
testq %rax, %rax
je 0x2f11b
addq $0x20, %r13
movq %r13, 0x8(%r15)
movq %rax, 0x10(%r15)
movq (%r15), %rax
movq 0x10(%r15), %rcx
leaq (%rax,%rax,2), %rdx
movq 0x8(%rsp), %rsi
movq %rsi, 0x8(%rcx,%rdx,8)
movb %bpl, 0x10(%rcx,%rdx,8)
incq %rax
movq %rax, (%r15)
movq %r14, (%rcx,%rdx,8)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x451a8(%rip), %rdx     # 0x742ca
movq %r12, %rdi
movl $0x1, %esi
movl $0x6d, %ecx
callq 0x145f4
movq $-0x1, %rbx
jmp 0x2f109
movq 0x8(%rsp), %rdi
callq 0x122c0
jmp 0x2f109
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/constant_pool.c
// Function: subtilis_constant_pool_mem_size
size_t subtilis_constant_pool_mem_size(subtilis_constant_pool_t *pool,
				       size_t **ptrs, subtilis_error_t *err)
{
	size_t i;
	size_t mem_size = 0;
	size_t *constants;

	constants = malloc(sizeof(*constants) * pool->size);
	if (!constants) {
		subtilis_error_set_oom(err);
		return 0;
	}

	for (i = 0; i < pool->size; i++) {
		constants[i] = mem_size;
		mem_size += pool->data[i].data_size;
	}

	*ptrs = constants;

	return mem_size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r12
leaq (,%r12,8), %rdi
callq 0x121d0
testq %rax, %rax
je 0x2f191
testq %r12, %r12
je 0x2f1ae
movq 0x10(%r14), %rdx
xorl %ecx, %ecx
xorl %esi, %esi
movq %rcx, (%rax,%rsi,8)
addq (%rdx), %rcx
incq %rsi
addq $0x18, %rdx
cmpq %rsi, %r12
jne 0x2f17c
jmp 0x2f1b0
leaq 0x45132(%rip), %rdx     # 0x742ca
movq %r15, %rdi
movl $0x1, %esi
movl $0x84, %ecx
callq 0x145f4
xorl %ecx, %ecx
jmp 0x2f1b3
xorl %ecx, %ecx
movq %rax, (%rbx)
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/string_pool.c
// Function: subtilis_string_pool_new
subtilis_string_pool_t *subtilis_string_pool_new(subtilis_error_t *err)
{
	subtilis_string_pool_t *pool;

	pool = calloc(1, sizeof(*pool));
	if (!pool)
		subtilis_error_set_oom(err);
	pool->ref = 1;
	return pool;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x12150
movq %rax, %rbx
testq %rax, %rax
jne 0x2f1fb
leaq 0x45104(%rip), %rdx     # 0x742ed
movq %r14, %rdi
movl $0x1, %esi
movl $0x1c, %ecx
callq 0x145f4
movq $0x1, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/string_pool.c
// Function: subtilis_string_pool_find
bool subtilis_string_pool_find(subtilis_string_pool_t *pool, const char *str,
			       size_t *index)
{
	size_t i;

	for (i = 0; i < pool->length; i++) {
		if (!strcmp(pool->strings[i], str))
			break;
	}

	if (i == pool->length)
		return false;

	*index = i;
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq 0x8(%rdi), %r15
testq %r15, %r15
je 0x2f252
movq %rsi, %r14
movq (%rdi), %r13
xorl %r12d, %r12d
movq (%r13,%r12,8), %rdi
movq %r14, %rsi
callq 0x12160
testl %eax, %eax
je 0x2f255
incq %r12
cmpq %r12, %r15
jne 0x2f234
movq %r15, %r12
jmp 0x2f255
xorl %r12d, %r12d
cmpq %r15, %r12
je 0x2f25d
movq %r12, (%rbx)
cmpq %r15, %r12
setne %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/string_pool.c
// Function: subtilis_string_pool_register
size_t subtilis_string_pool_register(subtilis_string_pool_t *pool,
				     const char *str, subtilis_error_t *err)
{
	size_t i;
	char **new_pool;
	size_t new_max;
	char *str_dup = NULL;

	if (subtilis_string_pool_find(pool, str, &i))
		return i;

	i = pool->length;
	str_dup = malloc(strlen(str) + 1);
	if (!str_dup) {
		subtilis_error_set_oom(err);
		return 0;
	}
	(void)strcpy(str_dup, str);

	if (pool->length == pool->max_length) {
		new_max = pool->max_length + SUBTILIS_CONFIG_PROC_GRAN;
		new_pool =
		    realloc(pool->strings, new_max * sizeof(*pool->strings));
		if (!new_pool) {
			subtilis_error_set_oom(err);
			goto cleanup;
		}
		pool->max_length = new_max;
		pool->strings = new_pool;
	}

	pool->strings[i] = str_dup;
	pool->length++;

	return i;

cleanup:

	free(str_dup);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
leaq 0x8(%rsp), %rdx
callq 0x2f216
testb %al, %al
je 0x2f29b
movq 0x8(%rsp), %rbx
jmp 0x2f33c
movq 0x8(%r14), %rbx
movq %rbx, 0x8(%rsp)
movq %r13, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
testq %rax, %rax
je 0x2f2fe
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x12070
movq 0x10(%r14), %r13
cmpq %r13, %rbx
jne 0x2f2f1
movq (%r14), %rdi
leaq 0x200(,%r13,8), %rsi
callq 0x12210
testq %rax, %rax
je 0x2f319
addq $0x40, %r13
movq %r13, 0x10(%r14)
movq %rax, (%r14)
movq (%r14), %rax
movq %r12, (%rax,%rbx,8)
incq 0x8(%r14)
jmp 0x2f33c
leaq 0x44fe8(%rip), %rdx     # 0x742ed
movq %r15, %rdi
movl $0x1, %esi
movl $0x46, %ecx
callq 0x145f4
jmp 0x2f33a
leaq 0x44fcd(%rip), %rdx     # 0x742ed
movq %r15, %rdi
movl $0x1, %esi
movl $0x50, %ecx
callq 0x145f4
movq %r12, %rdi
callq 0x122c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/string_pool.c
// Function: subtilis_string_pool_delete
void subtilis_string_pool_delete(subtilis_string_pool_t *pool)
{
	size_t i;

	if (!pool)
		return;

	if (pool->ref > 1) {
		pool->ref--;
		return;
	}

	for (i = 0; i < pool->length; i++)
		free(pool->strings[i]);
	free(pool->strings);
	free(pool);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2f36a
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq $0x1, %rax
jbe 0x2f372
decq %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpq $0x0, 0x8(%rbx)
je 0x2f391
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x122c0
incq %r14
cmpq 0x8(%rbx), %r14
jb 0x2f37c
movq (%rbx), %rdi
callq 0x122c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x122c0
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_eq
bool subtilis_type_eq(const subtilis_type_t *a, const subtilis_type_t *b)
{
	if (a->type != b->type)
		return false;
	switch (a->type) {
	case SUBTILIS_TYPE_ARRAY_REAL:
	case SUBTILIS_TYPE_ARRAY_INTEGER:
	case SUBTILIS_TYPE_ARRAY_STRING:
	case SUBTILIS_TYPE_ARRAY_BYTE:
	case SUBTILIS_TYPE_ARRAY_FN:
	case SUBTILIS_TYPE_VECTOR_FN: /* fn vectors need extra checks */
	case SUBTILIS_TYPE_ARRAY_REC:
	case SUBTILIS_TYPE_VECTOR_REC: /* rec vectors need extra checks */
		return prv_array_type_match(a, b);
	case SUBTILIS_TYPE_FN:
		return prv_fn_type_match(&a->params.fn, &b->params.fn);
	case SUBTILIS_TYPE_REC:
		return prv_rec_type_match(&a->params.rec, &b->params.rec);
	default:
		return true;
	}
}

// Assembly:
movl (%rdi), %ecx
cmpl (%rsi), %ecx
jne 0x2f447
movb $0x1, %al
cmpl $0x16, %ecx
ja 0x2f449
movl $0x30fc00, %edx         # imm = 0x30FC00
btl %ecx, %edx
jae 0x2f44a
movslq 0x8(%rdi), %rdx
cmpl 0x8(%rsi), %edx
jne 0x2f447
testl %edx, %edx
je 0x2f425
xorl %r8d, %r8d
movl 0xc(%rdi,%r8,4), %r9d
cmpl $-0x1, %r9d
je 0x2f41d
cmpl 0xc(%rsi,%r8,4), %r9d
jne 0x2f447
incq %r8
cmpq %r8, %rdx
jne 0x2f40b
addl $-0xe, %ecx
cmpl $0x7, %ecx
ja 0x2f449
leaq 0x44edc(%rip), %rdx     # 0x74310
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addq $0x38, %rdi
addq $0x38, %rsi
jmp 0x2f472
xorl %eax, %eax
retq
cmpl $0x9, %ecx
je 0x2f468
cmpl $0x16, %ecx
jne 0x2f449
addq $0x8, %rdi
addq $0x8, %rsi
jmp 0x2f4d8
addq $0x38, %rdi
addq $0x38, %rsi
jmp 0x2f4d8
addq $0x8, %rdi
addq $0x8, %rsi
jmp 0x2f472
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: prv_fn_type_match
static bool prv_fn_type_match(const subtilis_type_fn_t *t1,
			      const subtilis_type_fn_t *t2)
{
	size_t i;

	if (!subtilis_type_eq(t1->ret_val, t2->ret_val))
		return false;

	if (t1->num_params != t2->num_params)
		return false;

	for (i = 0; i < t1->num_params; i++)
		if (!subtilis_type_eq(t1->params[i], t2->params[i]))
			return false;

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq (%rsi), %rsi
callq 0x2f3e4
testb %al, %al
je 0x2f4c6
movq 0x8(%r14), %r15
cmpq 0x8(%rbx), %r15
jne 0x2f4c6
testq %r15, %r15
je 0x2f4d4
decq %r15
xorl %r12d, %r12d
movq 0x10(%r14,%r12,8), %rdi
movq 0x10(%rbx,%r12,8), %rsi
callq 0x2f3e4
testb %al, %al
je 0x2f4c8
leaq 0x1(%r12), %rcx
cmpq %r12, %r15
movq %rcx, %r12
jne 0x2f4a4
jmp 0x2f4c8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movb $0x1, %al
jmp 0x2f4c8
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: prv_rec_type_match
static bool prv_rec_type_match(const subtilis_type_rec_t *t1,
			       const subtilis_type_rec_t *t2)
{
	size_t i;

	if (strcmp(t1->name, t2->name))
		return false;

	if (t1->num_fields != t2->num_fields)
		return false;

	for (i = 0; i < t1->num_fields; i++) {
		if (strcmp(t1->fields[i].name, t2->fields[i].name))
			return false;
		if (!subtilis_type_eq(&t1->field_types[i], &t2->field_types[i]))
			return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0x12160
testl %eax, %eax
jne 0x2f569
movq 0x20(%r15), %r12
cmpq 0x20(%r14), %r12
jne 0x2f569
movb $0x1, %bl
testq %r12, %r12
je 0x2f56b
movq 0x18(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%r14), %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
movq (%rax,%r13), %rdi
movq 0x8(%rsp), %rax
movq (%rax,%r13), %rsi
callq 0x12160
testl %eax, %eax
jne 0x2f569
movq 0x10(%r15), %rdi
addq %rbp, %rdi
movq 0x10(%r14), %rsi
addq %rbp, %rsi
callq 0x2f3e4
testb %al, %al
je 0x2f569
addq $0x148, %rbp            # imm = 0x148
addq $0x18, %r13
decq %r12
jne 0x2f525
jmp 0x2f56b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_init_copy
void subtilis_type_init_copy(subtilis_type_t *dst, const subtilis_type_t *src,
			     subtilis_error_t *err)
{
	if (src->type == SUBTILIS_TYPE_FN) {
		dst->type = src->type;
		prv_init_copy_fn(&dst->params.fn, &src->params.fn, err);
	} else if (src->type == SUBTILIS_TYPE_REC) {
		dst->type = src->type;
		prv_init_copy_rec(&dst->params.rec, &src->params.rec, err);
	} else if ((src->type == SUBTILIS_TYPE_ARRAY_FN) ||
		   (src->type == SUBTILIS_TYPE_VECTOR_FN)) {
		dst->type = src->type;
		dst->params.array.num_dims = src->params.array.num_dims;
		memcpy(dst->params.array.dims, src->params.array.dims,
		       sizeof(src->params.array.dims));
		prv_init_copy_fn(&dst->params.array.params.fn,
				 &src->params.array.params.fn, err);
	} else if ((src->type == SUBTILIS_TYPE_ARRAY_REC) ||
		   (src->type == SUBTILIS_TYPE_VECTOR_REC)) {
		dst->type = src->type;
		dst->params.array.num_dims = src->params.array.num_dims;
		memcpy(dst->params.array.dims, src->params.array.dims,
		       sizeof(src->params.array.dims));
		prv_init_copy_rec(&dst->params.array.params.rec,
				  &src->params.array.params.rec, err);
	} else {
		*dst = *src;
	}
}

// Assembly:
movl (%rsi), %eax
leal -0x9(%rax), %ecx
cmpl $0xd, %ecx
ja 0x2f7a2
leaq 0x44bf1(%rip), %r8      # 0x74330
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
movl %eax, (%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movups 0xc(%rsi), %xmm0
movups 0x1c(%rsi), %xmm1
movups %xmm0, 0xc(%rdi)
movups %xmm1, 0x1c(%rdi)
movq 0x2c(%rsi), %rax
movq %rax, 0x2c(%rdi)
addq $0x38, %rdi
addq $0x38, %rsi
jmp 0x2fa8c
movl %eax, (%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movups 0xc(%rsi), %xmm0
movups 0x1c(%rsi), %xmm1
movups %xmm0, 0xc(%rdi)
movups %xmm1, 0x1c(%rdi)
movq 0x2c(%rsi), %rax
movq %rax, 0x2c(%rdi)
addq $0x38, %rdi
addq $0x38, %rsi
jmp 0x2fb77
movl $0x148, %edx            # imm = 0x148
jmp 0x121b0
movl $0x9, (%rdi)
addq $0x8, %rdi
addq $0x8, %rsi
jmp 0x2fa8c
movl $0x16, (%rdi)
addq $0x8, %rdi
addq $0x8, %rsi
jmp 0x2fb77
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_section_delete
void subtilis_type_section_delete(subtilis_type_section_t *stype)
{
	size_t i;

	if (!stype)
		return;

	stype->ref_count--;
	if (stype->ref_count != 0)
		return;
	subtilis_type_free(&stype->type);
	if (stype->check_args) {
		for (i = 0; i < stype->type.params.fn.num_params; i++)
			free(stype->check_args[i].arg_name);
		free(stype->check_args);
	}
	free(stype);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x2f7e8
movq %rdi, %rbx
decq 0x150(%rdi)
je 0x2f7ee
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x2f843
cmpq $0x0, 0x148(%rbx)
je 0x2f836
cmpq $0x0, 0x10(%rbx)
je 0x2f82a
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x148(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x122c0
incq %r15
addq $0x10, %r14
cmpq 0x10(%rbx), %r15
jb 0x2f80d
movq 0x148(%rbx), %rdi
callq 0x122c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x122c0
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_free
void subtilis_type_free(subtilis_type_t *typ)
{
	if (typ->type == SUBTILIS_TYPE_FN)
		prv_fn_type_free(&typ->params.fn);
	else if (typ->type == SUBTILIS_TYPE_REC)
		prv_rec_type_free(&typ->params.rec);
	else if ((typ->type == SUBTILIS_TYPE_ARRAY_FN) ||
		 (typ->type == SUBTILIS_TYPE_VECTOR_FN))
		prv_fn_type_free(&typ->params.array.params.fn);
	else if ((typ->type == SUBTILIS_TYPE_ARRAY_REC) ||
		 (typ->type == SUBTILIS_TYPE_VECTOR_REC))
		prv_rec_type_free(&typ->params.array.params.rec);
}

// Assembly:
movl (%rdi), %eax
addl $-0x9, %eax
cmpl $0xd, %eax
ja 0x2f86f
leaq 0x44b14(%rip), %rcx     # 0x74368
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x38, %rdi
jmp 0x2f9ab
addq $0x38, %rdi
jmp 0x2f9f1
retq
addq $0x8, %rdi
jmp 0x2f9ab
addq $0x8, %rdi
jmp 0x2f9f1
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_name
const char *subtilis_type_name(const subtilis_type_t *typ)
{
	size_t index;

	if (typ->type == SUBTILIS_TYPE_REC)
		return typ->params.rec.name;

	index = (size_t)typ->type;

	if (index < SUBTILIS_TYPE_MAX)
		return prv_fixed_type_names[index];

	return "unknown";
}

// Assembly:
movl (%rdi), %eax
cmpq $0x16, %rax
jne 0x2f890
addq $0x10, %rdi
jmp 0x2f8a0
cmpl $0x18, %eax
ja 0x2f8a4
leaq 0x6dd44(%rip), %rcx     # 0x9d5e0
leaq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
retq
leaq 0x4580b(%rip), %rax     # 0x750b6
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: prv_full_type_name
static void prv_full_type_name(const subtilis_type_t *typ,
			       subtilis_buffer_t *buf, subtilis_error_t *err)
{
	const char *vec_of = "vector of ";
	const char *array_of = "array of ";

	switch (typ->type) {
	case SUBTILIS_TYPE_FN:
		prv_fn_type_name(&typ->params.fn, buf, err);
		return;
	case SUBTILIS_TYPE_REC:
		prv_rec_type_name(&typ->params.rec, buf, err);
		return;
	case SUBTILIS_TYPE_ARRAY_FN:
		subtilis_buffer_append_string(buf, array_of, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		prv_fn_type_name(&typ->params.array.params.fn, buf, err);
		return;
	case SUBTILIS_TYPE_VECTOR_FN:
		subtilis_buffer_append_string(buf, vec_of, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		prv_fn_type_name(&typ->params.array.params.fn, buf, err);
		return;
	case SUBTILIS_TYPE_ARRAY_REC:
		subtilis_buffer_append_string(buf, array_of, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		prv_rec_type_name(&typ->params.array.params.rec, buf, err);
		return;
	case SUBTILIS_TYPE_VECTOR_REC:
		subtilis_buffer_append_string(buf, vec_of, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		prv_rec_type_name(&typ->params.array.params.rec, buf, err);
		return;
	default:
		break;
	}

	subtilis_buffer_append_string(buf, subtilis_type_name(typ), err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl (%rdi), %eax
leal -0x9(%rax), %ecx
cmpl $0xd, %ecx
ja 0x2f917
movq %rdi, %r15
leaq 0x44aa7(%rip), %rdx     # 0x743a0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addq $0x8, %r15
jmp 0x2f94d
leaq 0x458a5(%rip), %rsi     # 0x751b4
jmp 0x2f967
addq $0x8, %r15
jmp 0x2f981
cmpl $0x18, %eax
ja 0x2f994
leaq 0x6dcbd(%rip), %rcx     # 0x9d5e0
movq (%rcx,%rax,8), %rsi
jmp 0x2f99b
leaq 0x45884(%rip), %rsi     # 0x751b4
jmp 0x2f939
leaq 0x45870(%rip), %rsi     # 0x751a9
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14bd4
cmpl $0x0, (%rbx)
jne 0x2f977
addq $0x38, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x30539
leaq 0x45842(%rip), %rsi     # 0x751a9
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14bd4
cmpl $0x0, (%rbx)
je 0x2f97d
popq %rbx
popq %r14
popq %r15
retq
addq $0x38, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x3060e
leaq 0x4571b(%rip), %rsi     # 0x750b6
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x14bd4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: prv_fn_type_free
static void prv_fn_type_free(subtilis_type_fn_t *typ)
{
	size_t i;

	subtilis_type_free(typ->ret_val);
	free(typ->ret_val);
	for (i = 0; i < typ->num_params; i++) {
		subtilis_type_free(typ->params[i]);
		free(typ->params[i]);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2f843
movq (%rbx), %rdi
callq 0x122c0
cmpq $0x0, 0x8(%rbx)
je 0x2f9e9
xorl %r14d, %r14d
movq 0x10(%rbx,%r14,8), %rdi
callq 0x2f843
movq 0x10(%rbx,%r14,8), %rdi
callq 0x122c0
incq %r14
cmpq 0x8(%rbx), %r14
jb 0x2f9cc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: prv_rec_type_free
static void prv_rec_type_free(subtilis_type_rec_t *typ)
{
	size_t i;

	free(typ->name);
	for (i = 0; i < typ->num_fields; i++) {
		free(typ->fields[i].name);
		subtilis_type_free(&typ->field_types[i]);
	}
	free(typ->fields);
	free(typ->field_types);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x122c0
cmpq $0x0, 0x20(%rbx)
je 0x2fa42
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x122c0
movq 0x10(%rbx), %rdi
addq %r15, %rdi
callq 0x2f843
incq %r12
addq $0x148, %r15            # imm = 0x148
addq $0x18, %r14
cmpq 0x20(%rbx), %r12
jb 0x2fa15
movq 0x18(%rbx), %rdi
callq 0x122c0
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x122c0
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: prv_init_copy_fn
static void prv_init_copy_fn(subtilis_type_fn_t *dst,
			     const subtilis_type_fn_t *src,
			     subtilis_error_t *err)
{
	size_t i;

	dst->ret_val = calloc(1, sizeof(*dst->ret_val));
	if (!dst->ret_val) {
		subtilis_error_set_oom(err);
		return;
	}
	dst->num_params = 0;
	subtilis_type_init_copy(dst->ret_val, src->ret_val, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;
	for (i = 0; i < src->num_params; i++) {
		dst->params[i] = calloc(1, sizeof(*dst->params[i]));
		if (!dst->params[i]) {
			subtilis_error_set_oom(err);
			goto cleanup;
		}
		subtilis_type_init_copy(dst->params[i], src->params[i], err);
		dst->num_params++;
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}
	return;

cleanup:
	prv_fn_type_free(dst);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0x1, %edi
movl $0x148, %esi            # imm = 0x148
callq 0x12150
movq %rax, (%rbx)
testq %rax, %rax
je 0x2fae3
movq $0x0, 0x8(%rbx)
movq (%r15), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2f72e
cmpl $0x0, (%r14)
je 0x2fb07
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2f9ab
leaq 0x455be(%rip), %rdx     # 0x750a8
movq %r14, %rdi
movl $0x1, %esi
movl $0x1ca, %ecx            # imm = 0x1CA
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x145f4
cmpq $0x0, 0x8(%r15)
je 0x2fb4d
xorl %r12d, %r12d
movl $0x1, %edi
movl $0x148, %esi            # imm = 0x148
callq 0x12150
movq %rax, 0x10(%rbx,%r12,8)
testq %rax, %rax
je 0x2fb59
movq 0x10(%r15,%r12,8), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2f72e
incq 0x8(%rbx)
cmpl $0x0, (%r14)
jne 0x2fad0
incq %r12
cmpq 0x8(%r15), %r12
jb 0x2fb11
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x45548(%rip), %rdx     # 0x750a8
movq %r14, %rdi
movl $0x1, %esi
movl $0x1d4, %ecx            # imm = 0x1D4
callq 0x145f4
jmp 0x2fad0
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_init_rec
void subtilis_type_init_rec(subtilis_type_t *dst, const char *name,
			    subtilis_error_t *err)
{
	dst->type = SUBTILIS_TYPE_REC;
	dst->params.rec.alignment = 1;
	dst->params.rec.num_fields = 0;
	dst->params.rec.max_fields = 0;
	dst->params.rec.field_types = NULL;
	dst->params.rec.fields = NULL;
	dst->params.rec.name = malloc(strlen(name) + 1);
	if (!dst->params.rec.name) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(dst->params.rec.name, name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movl $0x16, (%rdi)
movl $0x1, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movq %rsi, %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x2fecd
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x12070
leaq 0x451d4(%rip), %rdx     # 0x750a8
movq %r14, %rdi
movl $0x1, %esi
movl $0x28a, %ecx            # imm = 0x28A
popq %rbx
popq %r14
popq %r15
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_field_offset_id
uint32_t subtilis_type_rec_field_offset_id(const subtilis_type_rec_t *rec,
					   size_t id)
{
	size_t i;
	uint32_t align;
	uint32_t adjust;
	uint32_t offset = 0;

	for (i = 0; i < id; i++) {
		align = rec->fields[i].alignment;
		adjust = offset & (align - 1);
		if (adjust != 0)
			offset += align - adjust;
		offset += rec->fields[i].size;
	}
	align = rec->fields[i].alignment;
	adjust = offset & (align - 1);
	if (adjust != 0)
		offset += align - adjust;

	return offset;
}

// Assembly:
testq %rsi, %rsi
je 0x3014f
movq 0x18(%rdi), %rax
addq $0xc, %rax
xorl %ecx, %ecx
movq %rsi, %rdx
movl -0x4(%rax), %r8d
leal -0x1(%r8), %r9d
andl %ecx, %r9d
subl %r9d, %r8d
testl %r9d, %r9d
cmovel %r9d, %r8d
addl (%rax), %ecx
addl %r8d, %ecx
addq $0x18, %rax
decq %rdx
jne 0x3012a
jmp 0x30153
xorl %esi, %esi
xorl %ecx, %ecx
movq 0x18(%rdi), %rax
leaq (%rsi,%rsi,2), %rdx
movl 0x8(%rax,%rdx,8), %eax
leal -0x1(%rax), %edx
andl %ecx, %edx
subl %edx, %eax
testl %edx, %edx
cmovel %edx, %eax
addl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_field_offset
uint32_t subtilis_type_rec_field_offset(subtilis_type_t *typ, const char *name)
{
	subtilis_type_rec_t *rec = &typ->params.rec;
	size_t id = subtilis_type_rec_find_field(rec, name);

	if (id == SIZE_MAX)
		return UINT32_MAX;

	return subtilis_type_rec_field_offset_id(rec, id);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x2feeb
cmpq $-0x1, %rax
je 0x30190
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x30118
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_size
size_t subtilis_type_rec_size(const subtilis_type_t *typ)
{
	size_t id;
	const subtilis_type_rec_t *rec = &typ->params.rec;

	if (rec->num_fields == 0)
		return 0;

	id = rec->num_fields - 1;
	return subtilis_type_rec_field_offset_id(rec, id) +
	       rec->fields[id].size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x301c2
movq %rdi, %rbx
addq $0x8, %rdi
leaq -0x1(%r14), %rsi
callq 0x30118
movq 0x20(%rbx), %rcx
leaq (%r14,%r14,2), %rdx
addl -0xc(%rcx,%rdx,8), %eax
jmp 0x301c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_is_scalar
bool subtilis_type_rec_is_scalar(const subtilis_type_t *typ)
{
	subtilis_type_t *field;
	size_t i;
	const subtilis_type_rec_t *rec = &typ->params.rec;

	for (i = 0; i < rec->num_fields; i++) {
		field = &rec->field_types[i];
		switch (field->type) {
		case SUBTILIS_TYPE_REAL:
		case SUBTILIS_TYPE_INTEGER:
		case SUBTILIS_TYPE_BYTE:
		case SUBTILIS_TYPE_FN:
		case SUBTILIS_TYPE_LOCAL_BUFFER:
			continue;
		case SUBTILIS_TYPE_REC:
			if (subtilis_type_rec_is_scalar(field))
				continue;
			break;
		default:
			break;
		}
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r15
testq %r15, %r15
sete %bl
je 0x30239
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movl $0x1, %r13d
movl $0x800270, %ebp         # imm = 0x800270
movl (%r14), %eax
cmpl $0x17, %eax
ja 0x30239
btl %eax, %ebp
jae 0x30228
cmpq %r15, %r13
setae %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x301fc
jmp 0x30239
cmpl $0x16, %eax
jne 0x30239
movq %r14, %rdi
callq 0x301d0
testb %al, %al
jne 0x30209
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_serializable
bool subtilis_type_rec_serializable(const subtilis_type_t *typ)
{
	subtilis_type_t *field;
	size_t i;
	const subtilis_type_rec_t *rec = &typ->params.rec;

	for (i = 0; i < rec->num_fields; i++) {
		field = &rec->field_types[i];
		switch (field->type) {
		case SUBTILIS_TYPE_REAL:
		case SUBTILIS_TYPE_INTEGER:
		case SUBTILIS_TYPE_BYTE:
		case SUBTILIS_TYPE_LOCAL_BUFFER:
			continue;
		case SUBTILIS_TYPE_REC:
			if (subtilis_type_rec_serializable(field))
				continue;
			break;
		default:
			break;
		}
		return false;
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x28(%rdi), %r15
testq %r15, %r15
sete %bl
je 0x302b0
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movl $0x1, %r13d
movl (%r14), %eax
leal -0x4(%rax), %ecx
cmpl $0x3, %ecx
jb 0x30293
cmpl $0x17, %eax
je 0x30293
cmpl $0x16, %eax
jne 0x302b0
movq %r14, %rdi
callq 0x3024d
testb %al, %al
je 0x302b0
cmpq %r15, %r13
setae %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x30272
andb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_can_zero_fill
bool subtilis_type_rec_can_zero_fill(const subtilis_type_t *typ)
{
	subtilis_type_t *field;
	size_t i;
	const subtilis_type_rec_t *rec = &typ->params.rec;

	for (i = 0; i < rec->num_fields; i++) {
		field = &rec->field_types[i];
		switch (field->type) {
		case SUBTILIS_TYPE_REAL:
		case SUBTILIS_TYPE_INTEGER:
		case SUBTILIS_TYPE_BYTE:
		case SUBTILIS_TYPE_STRING:
		case SUBTILIS_TYPE_LOCAL_BUFFER:
			break;
		case SUBTILIS_TYPE_REC:
			if (!subtilis_type_rec_can_zero_fill(field))
				return false;
			break;
		default:
			return false;
		}
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x28(%rdi), %r15
testq %r15, %r15
sete %bl
je 0x30324
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movl $0x1, %r13d
movl (%r14), %eax
leal -0x4(%rax), %ecx
cmpl $0x4, %ecx
jae 0x3030e
cmpq %r15, %r13
setae %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x302e4
jmp 0x30324
cmpl $0x17, %eax
je 0x302ef
cmpl $0x16, %eax
jne 0x30324
movq %r14, %rdi
callq 0x302bf
testb %al, %al
jne 0x302ef
andb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_zero_fill_size
size_t subtilis_type_rec_zero_fill_size(const subtilis_type_t *typ)
{
	subtilis_type_t *field;
	size_t i;
	size_t size = 0;
	const subtilis_type_rec_t *rec = &typ->params.rec;

	for (i = 0; i < rec->num_fields; i++) {
		field = &rec->field_types[i];
		switch (field->type) {
		case SUBTILIS_TYPE_REAL:
		case SUBTILIS_TYPE_INTEGER:
		case SUBTILIS_TYPE_BYTE:
		case SUBTILIS_TYPE_STRING:
		case SUBTILIS_TYPE_LOCAL_BUFFER:
			size += rec->fields[i].size;
			break;
		case SUBTILIS_TYPE_REC:
			size += subtilis_type_rec_zero_fill_size(field);
			break;
		default:
			break;
		}
	}

	return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x28(%rdi), %r12
testq %r12, %r12
je 0x30393
movq %rdi, %rbx
movq 0x18(%rdi), %r15
movl $0xc, %r13d
xorl %r14d, %r14d
movl (%r15), %eax
leal -0x4(%rax), %ecx
cmpl $0x4, %ecx
jae 0x3037d
movq 0x20(%rbx), %rax
movl (%rax,%r13), %eax
addq %rax, %r14
addq $0x148, %r15            # imm = 0x148
addq $0x18, %r13
decq %r12
jne 0x30355
jmp 0x30396
cmpl $0x16, %eax
je 0x30389
cmpl $0x17, %eax
je 0x30360
jmp 0x3036b
movq %r15, %rdi
callq 0x30333
jmp 0x30368
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq