LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x2fc17
cmpq $-0x1, %rax
je 0x2fedc
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x2fe6a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2ff0e
movq %rdi, %rbx
addq $0x8, %rdi
leaq -0x1(%r14), %rsi
callq 0x2fe6a
movq 0x20(%rbx), %rcx
leaq (%r14,%r14,2), %rdx
addl -0xc(%rcx,%rdx,8), %eax
jmp 0x2ff10
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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
je 0x2ff86
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movl $0x1, %r13d
xorl %ebx, %ebx
movl $0x800270, %ebp         # imm = 0x800270
movl (%r14), %eax
cmpl $0x17, %eax
ja 0x2ff88
btl %eax, %ebp
jae 0x2ff73
cmpq %r15, %r13
setae %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x2ff47
jmp 0x2ff88
cmpl $0x16, %eax
jne 0x2ff88
movq %r14, %rdi
callq 0x2ff1c
testb %al, %al
jne 0x2ff54
jmp 0x2ff88
movb $0x1, %bl
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_O3/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
je 0x30000
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movl $0x1, %r13d
xorl %ebx, %ebx
movl (%r14), %eax
leal -0x4(%rax), %ecx
cmpl $0x3, %ecx
jb 0x2ffe1
cmpl $0x17, %eax
je 0x2ffe1
cmpl $0x16, %eax
jne 0x30002
movq %r14, %rdi
callq 0x2ff9c
testb %al, %al
je 0x30002
cmpq %r15, %r13
setae %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x2ffc0
jmp 0x30002
movb $0x1, %bl
andb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
je 0x30077
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movl $0x1, %r13d
xorl %ebx, %ebx
movl (%r14), %eax
leal -0x4(%rax), %ecx
cmpl $0x4, %ecx
jae 0x3005f
cmpq %r15, %r13
setae %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x30035
jmp 0x30079
cmpl $0x17, %eax
je 0x30040
cmpl $0x16, %eax
jne 0x30079
movq %r14, %rdi
callq 0x30011
testb %al, %al
jne 0x30040
jmp 0x30079
movb $0x1, %bl
andb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x300e8
movq %rdi, %rbx
movq 0x18(%rdi), %r15
movl $0xc, %r13d
xorl %r14d, %r14d
movl (%r15), %eax
leal -0x4(%rax), %ecx
cmpl $0x4, %ecx
jae 0x300d2
movq 0x20(%rbx), %rax
movl (%rax,%r13), %eax
addq %rax, %r14
addq $0x148, %r15            # imm = 0x148
addq $0x18, %r13
decq %r12
jne 0x300aa
jmp 0x300eb
cmpl $0x16, %eax
je 0x300de
cmpl $0x17, %eax
je 0x300b5
jmp 0x300c0
movq %r15, %rdi
callq 0x30088
jmp 0x300bd
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/type.c
// Function: prv_rec_need_ref_count
static size_t prv_rec_need_ref_count(const subtilis_type_t *typ)
{
	subtilis_type_t *field;
	size_t i;
	const subtilis_type_rec_t *rec = &typ->params.rec;
	size_t num = 0;
	size_t rec_num;

	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:
		case SUBTILIS_TYPE_FN:
			break;
		case SUBTILIS_TYPE_REC:
			rec_num = prv_rec_need_ref_count(field);
			if (rec_num >= 4)
				rec_num = 1;
			num += rec_num;
			break;
		default:
			num++;
			break;
		}
	}

	return num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x30163
movq 0x18(%rdi), %r14
xorl %ebx, %ebx
movl $0x800270, %ebp         # imm = 0x800270
movl $0x1, %r12d
movl (%r14), %eax
cmpl $0x17, %eax
ja 0x3015e
btl %eax, %ebp
jae 0x30144
addq $0x148, %r14            # imm = 0x148
decq %r15
jne 0x30129
jmp 0x30165
cmpl $0x16, %eax
jne 0x3015e
movq %r14, %rdi
callq 0x30107
cmpq $0x4, %rax
cmovaeq %r12, %rax
addq %rax, %rbx
jmp 0x30136
incq %rbx
jmp 0x30136
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_need_deref
bool subtilis_type_rec_need_deref(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:
		case SUBTILIS_TYPE_FN:
			continue;
		case SUBTILIS_TYPE_REC:
			if (subtilis_type_rec_need_deref(field))
				return true;
			break;
		default:
			return true;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x301db
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movb $0x1, %bl
movl $0x1, %r13d
movl $0x800270, %ebp         # imm = 0x800270
movl (%r14), %eax
cmpl $0x17, %eax
ja 0x301dd
btl %eax, %ebp
jae 0x301c8
cmpq %r15, %r13
setb %bl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
cmpq $0x1, %rax
jne 0x3019c
jmp 0x301dd
cmpl $0x16, %eax
jne 0x301dd
movq %r14, %rdi
callq 0x30171
testb %al, %al
je 0x301a9
jmp 0x301dd
xorl %ebx, %ebx
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_O3/markdryan[P]subtilis/common/type.c
// Function: subtilis_type_rec_need_zero_alloc
bool subtilis_type_rec_need_zero_alloc(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_ARRAY_REAL:
		case SUBTILIS_TYPE_ARRAY_INTEGER:
		case SUBTILIS_TYPE_ARRAY_BYTE:
		case SUBTILIS_TYPE_ARRAY_STRING:
		case SUBTILIS_TYPE_ARRAY_FN:
		case SUBTILIS_TYPE_ARRAY_REC:
			return true;
		case SUBTILIS_TYPE_VECTOR_REAL:
		case SUBTILIS_TYPE_VECTOR_INTEGER:
		case SUBTILIS_TYPE_VECTOR_BYTE:
		case SUBTILIS_TYPE_VECTOR_STRING:
		case SUBTILIS_TYPE_VECTOR_FN:
		case SUBTILIS_TYPE_VECTOR_REC:
			if (rec->fields[i].vec_dim != -1)
				return true;
			break;
		case SUBTILIS_TYPE_REC:
			if (subtilis_type_rec_need_zero_alloc(field))
				return true;
			break;
		default:
			break;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x3027b
movq 0x18(%rdi), %r14
movq %r15, %r12
negq %r12
movb $0x1, %bpl
movl $0x1, %r13d
movl $0x10, %ebx
movq %rdi, (%rsp)
movl (%r14), %eax
leal -0x10(%rax), %ecx
cmpl $0x6, %ecx
jae 0x3025a
movq 0x20(%rdi), %rax
cmpl $-0x1, (%rax,%rbx)
jne 0x3027d
cmpq %r15, %r13
setb %bpl
leaq (%r12,%r13), %rax
incq %rax
incq %r13
addq $0x148, %r14            # imm = 0x148
addq $0x18, %rbx
cmpq $0x1, %rax
jne 0x30221
jmp 0x3027d
cmpl $0x16, %eax
je 0x30269
addl $-0xa, %eax
cmpl $0x6, %eax
jae 0x30236
jmp 0x3027d
movq %r14, %rdi
callq 0x301f1
movq (%rsp), %rdi
testb %al, %al
je 0x30236
jmp 0x3027d
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/type.c
// Function: prv_fn_type_name
static void prv_fn_type_name(const subtilis_type_fn_t *fn_type,
			     subtilis_buffer_t *buf, subtilis_error_t *err)
{
	size_t i;

	if (fn_type->ret_val) {
		subtilis_buffer_append_string(buf, "FN", err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		prv_full_type_name(fn_type->ret_val, buf, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		subtilis_buffer_append_string(buf, "(", err);
	} else {
		subtilis_buffer_append_string(buf, "PROC(", err);
	}
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	for (i = 0; i < fn_type->num_params; i++) {
		prv_full_type_name(fn_type->params[i], buf, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		if (i == fn_type->num_params - 1)
			break;
		subtilis_buffer_append_string(buf, ",", err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}
	subtilis_buffer_append_string(buf, ")", err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, (%rdi)
je 0x302dd
leaq 0x43214(%rip), %rsi     # 0x734c5
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
jne 0x302f4
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2f605
cmpl $0x0, (%rbx)
jne 0x302f4
leaq 0x43f57(%rip), %rsi     # 0x74232
jmp 0x302e4
leaq 0x44efa(%rip), %rsi     # 0x751de
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
je 0x302fe
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpq $0x0, 0x8(%r15)
je 0x3034c
xorl %r13d, %r13d
leaq 0x43283(%rip), %r12     # 0x73592
movq 0x10(%r15,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2f605
cmpl $0x0, (%rbx)
jne 0x302f4
movq 0x8(%r15), %rax
decq %rax
cmpq %rax, %r13
je 0x3034c
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
jne 0x302f4
incq %r13
cmpq 0x8(%r15), %r13
jb 0x3030f
leaq 0x437b2(%rip), %rsi     # 0x73b05
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x14b8a
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/common/type.c
// Function: prv_rec_type_name
static void prv_rec_type_name(const subtilis_type_rec_t *rec_type,
			      subtilis_buffer_t *buf, subtilis_error_t *err)
{
	size_t i;

	subtilis_buffer_append_string(buf, rec_type->name, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_buffer_append_string(buf, "(", err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	i = 0;
	if (rec_type->num_fields > 0) {
		for (; i < rec_type->num_fields - 1; i++) {
			subtilis_buffer_append_string(
			    buf, subtilis_type_name(&rec_type->field_types[i]),
			    err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			subtilis_buffer_append_string(buf, ",", err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
		}
	}
	subtilis_buffer_append_string(
	    buf, subtilis_type_name(&rec_type->field_types[i]), err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	subtilis_buffer_append_string(buf, ")", err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rsi
movq %r14, %rdi
callq 0x14b8a
cmpl $0x0, (%rbx)
jne 0x303a3
leaq 0x43e9f(%rip), %rsi     # 0x74232
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
je 0x303b2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x2, 0x20(%r15)
jae 0x303be
xorl %r13d, %r13d
jmp 0x30433
movl $0x10, %ebp
xorl %r13d, %r13d
leaq 0x431c5(%rip), %r12     # 0x73592
movq 0x10(%r15), %rax
movl -0x10(%rax,%rbp), %ecx
cmpq $0x16, %rcx
jne 0x303e0
addq %rbp, %rax
jmp 0x303f7
leaq 0x44cef(%rip), %rsi     # 0x750d6
cmpl $0x18, %ecx
ja 0x303fa
leaq 0x6d1ed(%rip), %rax     # 0x9d5e0
leaq (%rax,%rcx,8), %rax
movq (%rax), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
jne 0x303a3
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
jne 0x303a3
incq %r13
movq 0x20(%r15), %rax
decq %rax
addq $0x148, %rbp            # imm = 0x148
cmpq %rax, %r13
jb 0x303cd
movq 0x10(%r15), %rax
imulq $0x148, %r13, %rdx      # imm = 0x148
movl (%rax,%rdx), %ecx
cmpq $0x16, %rcx
jne 0x30450
addq %rdx, %rax
addq $0x10, %rax
jmp 0x30460
cmpl $0x18, %ecx
ja 0x30465
leaq 0x6d184(%rip), %rax     # 0x9d5e0
leaq (%rax,%rcx,8), %rax
movq (%rax), %rsi
jmp 0x3046c
leaq 0x44c6a(%rip), %rsi     # 0x750d6
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14b8a
cmpl $0x0, (%rbx)
jne 0x303a3
leaq 0x4367e(%rip), %rsi     # 0x73b05
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14b8a
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_helper.c
// Function: subtilis_builtin_memset_i32
void subtilis_builtin_memset_i32(subtilis_parser_t *p, size_t base_reg,
				 size_t size_reg, size_t val_reg,
				 subtilis_error_t *err)
{
	subtilis_ir_arg_t *args;
	char *name = NULL;
	static const char memset[] = "_memseti32";

	name = malloc(sizeof(memset));
	if (!name) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(name, memset);

	args = malloc(sizeof(*args) * 3);
	if (!args) {
		free(name);
		subtilis_error_set_oom(err);
		return;
	}

	args[0].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[0].reg = base_reg;
	args[1].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[1].reg = size_reg;
	args[2].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[2].reg = val_reg;

	(void)subtilis_exp_add_call(p, name, SUBTILIS_BUILTINS_MEMSETI32, NULL,
				    args, &subtilis_type_void, 3, true, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movl $0xb, %edi
callq 0x121d0
testq %rax, %rax
je 0x3074c
movq %rax, %r12
movabsq $0x697465736d656d5f, %rax # imm = 0x697465736D656D5F
movq %rax, (%r12)
movl $0x323369, 0x7(%r12)    # imm = 0x323369
movl $0x48, %edi
callq 0x121d0
testq %rax, %rax
je 0x30762
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rbp, 0x8(%rax)
movl %ecx, 0x18(%rax)
movq %r13, 0x20(%rax)
movl %ecx, 0x30(%rax)
movq %r15, 0x38(%rax)
subq $0x8, %rsp
leaq 0x445cd(%rip), %r9      # 0x74cf0
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rax, %r8
pushq %rbx
pushq $0x1
pushq $0x3
callq 0x2b1aa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44ae9(%rip), %rdx     # 0x7523c
movq %rbx, %rdi
movl $0x1, %esi
movl $0x23, %ecx
jmp 0x3077e
movq %r12, %rdi
callq 0x122c0
leaq 0x44acb(%rip), %rdx     # 0x7523c
movq %rbx, %rdi
movl $0x1, %esi
movl $0x2b, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145a4
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_helper.c
// Function: subtilis_builtin_memset_i8
void subtilis_builtin_memset_i8(subtilis_parser_t *p, size_t base_reg,
				size_t size_reg, size_t val_reg,
				subtilis_error_t *err)
{
	subtilis_ir_arg_t *args;
	char *name = NULL;
	static const char memset[] = "_memseti8";

	name = malloc(sizeof(memset));
	if (!name) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(name, memset);

	args = malloc(sizeof(*args) * 3);
	if (!args) {
		free(name);
		subtilis_error_set_oom(err);
		return;
	}

	args[0].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[0].reg = base_reg;
	args[1].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[1].reg = size_reg;
	args[2].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[2].reg = val_reg;

	(void)subtilis_exp_add_call(p, name, SUBTILIS_BUILTINS_MEMSETI8, NULL,
				    args, &subtilis_type_void, 3, true, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movl $0xa, %edi
callq 0x121d0
testq %rax, %rax
je 0x3082c
movq %rax, %r12
movabsq $0x697465736d656d5f, %rax # imm = 0x697465736D656D5F
movq %rax, (%r12)
movw $0x38, 0x8(%r12)
movl $0x48, %edi
callq 0x121d0
testq %rax, %rax
je 0x30842
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rbp, 0x8(%rax)
movl %ecx, 0x18(%rax)
movq %r13, 0x20(%rax)
movl %ecx, 0x30(%rax)
movq %r15, 0x38(%rax)
subq $0x8, %rsp
leaq 0x444ed(%rip), %r9      # 0x74cf0
movq %r14, %rdi
movq %r12, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movq %rax, %r8
pushq %rbx
pushq $0x1
pushq $0x3
callq 0x2b1aa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44a09(%rip), %rdx     # 0x7523c
movq %rbx, %rdi
movl $0x1, %esi
movl $0x44, %ecx
jmp 0x3085e
movq %r12, %rdi
callq 0x122c0
leaq 0x449eb(%rip), %rdx     # 0x7523c
movq %rbx, %rdi
movl $0x1, %esi
movl $0x4c, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145a4
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_helper.c
// Function: subtilis_builtin_memset_i64
void subtilis_builtin_memset_i64(subtilis_parser_t *p, size_t base_reg,
				 size_t size_reg, size_t val_reg_low,
				 size_t val_reg_high, subtilis_error_t *err)
{
	subtilis_ir_arg_t *args;
	char *name = NULL;
	static const char memset[] = "_memseti64";

	name = malloc(sizeof(memset));
	if (!name) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(name, memset);

	args = malloc(sizeof(*args) * 4);
	if (!args) {
		free(name);
		subtilis_error_set_oom(err);
		return;
	}

	args[0].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[0].reg = base_reg;
	args[1].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[1].reg = size_reg;
	args[2].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[2].reg = val_reg_low;
	args[3].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[3].reg = val_reg_high;

	(void)subtilis_exp_add_call(p, name, SUBTILIS_BUILTINS_MEMSETI64, NULL,
				    args, &subtilis_type_void, 4, true, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, (%rsp)
movl $0xb, %edi
callq 0x121d0
testq %rax, %rax
je 0x3091a
movq %rax, %r12
movabsq $0x697465736d656d5f, %rax # imm = 0x697465736D656D5F
movq %rax, (%r12)
movl $0x343669, 0x7(%r12)    # imm = 0x343669
movl $0x60, %edi
callq 0x121d0
testq %rax, %rax
je 0x30930
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %r14, 0x8(%rax)
movl %ecx, 0x18(%rax)
movq %rbp, 0x20(%rax)
movl %ecx, 0x30(%rax)
movq %r13, 0x38(%rax)
movl %ecx, 0x48(%rax)
movq %r15, 0x50(%rax)
subq $0x8, %rsp
leaq 0x44401(%rip), %r9      # 0x74cf0
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movl $0x8, %edx
xorl %ecx, %ecx
movq %rax, %r8
pushq %rbx
pushq $0x1
pushq $0x4
callq 0x2b1aa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4491b(%rip), %rdx     # 0x7523c
movq %rbx, %rdi
movl $0x1, %esi
movl $0x65, %ecx
jmp 0x3094c
movq %r12, %rdi
callq 0x122c0
leaq 0x448fd(%rip), %rdx     # 0x7523c
movq %rbx, %rdi
movl $0x1, %esi
movl $0x6d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145a4
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_helper.c
// Function: subtilis_builtin_bzero_reg
void subtilis_builtin_bzero_reg(subtilis_parser_t *p, size_t base_reg,
				size_t loc, size_t size_reg,
				subtilis_error_t *err)
{
	subtilis_exp_t *val_exp = NULL;

	val_exp = subtilis_exp_new_int32(0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	val_exp = subtilis_type_if_exp_to_var(p, val_exp, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	base_reg = subtilis_reference_get_pointer(p, base_reg, loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_builtin_memset_i8(p, base_reg, size_reg,
				   val_exp->exp.ir_op.reg, err);

cleanup:

	subtilis_exp_delete(val_exp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r12
xorl %edi, %edi
movq %r8, %rsi
callq 0x2b7af
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x309d2
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x36119
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x309d2
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x4d71f
cmpl $0x0, (%r14)
jne 0x309d2
movq 0x148(%rbx), %rcx
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r14, %r8
callq 0x30791
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b166
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_helper.c
// Function: subtilis_builtin_bzero
void subtilis_builtin_bzero(subtilis_parser_t *p, size_t base_reg, size_t loc,
			    size_t size, subtilis_error_t *err)
{
	subtilis_exp_t *size_exp = NULL;
	subtilis_exp_t *val_exp = NULL;

	size_exp = subtilis_exp_new_int32((int32_t)size, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	size_exp = subtilis_type_if_exp_to_var(p, size_exp, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	val_exp = subtilis_exp_new_int32(0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	val_exp = subtilis_type_if_exp_to_var(p, val_exp, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	base_reg = subtilis_reference_get_pointer(p, base_reg, loc, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	if (size & 3)
		subtilis_builtin_memset_i8(p, base_reg, size_exp->exp.ir_op.reg,
					   val_exp->exp.ir_op.reg, err);
	else
		subtilis_builtin_memset_i32(p, base_reg,
					    size_exp->exp.ir_op.reg,
					    val_exp->exp.ir_op.reg, err);
cleanup:

	subtilis_exp_delete(val_exp);
	subtilis_exp_delete(size_exp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r15
movl %r12d, %edi
movq %r8, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
jne 0x30a27
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x36119
cmpl $0x0, (%r14)
je 0x30a36
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
xorl %edi, %edi
movq %r14, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
jne 0x30aa9
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x36119
cmpl $0x0, (%r14)
jne 0x30aa9
movq %rax, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x4d71f
cmpl $0x0, (%r14)
jne 0x30aa5
movq 0x148(%rbx), %rdx
movq (%rsp), %rcx
movq 0x148(%rcx), %rcx
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %r8
testb $0x3, %r12b
je 0x30aa0
callq 0x30791
jmp 0x30aa5
callq 0x306b0
movq (%rsp), %rax
movq %rax, %rdi
callq 0x2b166
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b166
nop
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtins_ir_basic_rnd
subtilis_exp_t *subtilis_builtins_ir_basic_rnd(subtilis_parser_t *p,
					       subtilis_error_t *err)
{
	subtilis_exp_t *e = NULL;
	subtilis_exp_t *a = NULL;
	subtilis_exp_t *c = NULL;

	a = subtilis_exp_new_int32(1664525, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	c = subtilis_exp_new_int32(1013904223, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_var_lookup_var(p, subtilis_rnd_hidden_var, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_mul(p, a, e, err);
	a = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return subtilis_exp_add(p, e, c, err);

cleanup:

	subtilis_exp_delete(e);
	subtilis_exp_delete(a);
	subtilis_exp_delete(c);

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r12
movl $0x19660d, %edi         # imm = 0x19660D
callq 0x2b7af
cmpl $0x0, (%r15)
jne 0x30d53
movq %rax, %r14
movl $0x3c6ef35f, %edi       # imm = 0x3C6EF35F
movq %r15, %rsi
callq 0x2b7af
movq %rax, %rbx
cmpl $0x0, (%r15)
je 0x30d06
xorl %eax, %eax
jmp 0x30d3b
leaq 0x75463(%rip), %rax     # 0xa6170
movq (%rax), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x35c45
cmpl $0x0, (%r15)
jne 0x30d3b
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x36bc7
cmpl $0x0, (%r15)
je 0x30d61
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x2b166
movq %r14, %rdi
callq 0x2b166
movq %rbx, %rdi
callq 0x2b166
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2ba37
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtins_ir_rnd_0
subtilis_exp_t *subtilis_builtins_ir_rnd_0(subtilis_parser_t *p,
					   subtilis_error_t *err)
{
	subtilis_exp_t *e = NULL;
	subtilis_exp_t *top_bit = NULL;
	subtilis_exp_t *top_bit_dup = NULL;

	e = subtilis_var_lookup_var(p, subtilis_rnd_hidden_var, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit = subtilis_exp_new_int32((int32_t)0x7fffffff, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit_dup = subtilis_type_if_dup(top_bit, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_and(p, e, top_bit, err);
	top_bit = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_divr(p, e, top_bit_dup, err);
	top_bit_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_exp_handle_errors(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return e;

cleanup:

	subtilis_exp_delete(e);
	subtilis_exp_delete(top_bit);
	subtilis_exp_delete(top_bit_dup);

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x753dd(%rip), %rax     # 0xa6170
movq (%rax), %rsi
movq %r14, %rdx
callq 0x35c45
movq %rax, %rbx
cmpl $0x0, (%r14)
je 0x30dac
xorl %r15d, %r15d
jmp 0x30dc2
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq %r14, %rsi
callq 0x2b7af
movq %rax, %r15
cmpl $0x0, (%r14)
je 0x30dec
xorl %r13d, %r13d
movq %rbx, %rdi
callq 0x2b166
movq %r15, %rdi
callq 0x2b166
movq %r13, %rdi
callq 0x2b166
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x36182
movq %rax, %r13
cmpl $0x0, (%r14)
jne 0x30dc5
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x36c60
movq %rax, %rbx
cmpl $0x0, (%r14)
je 0x30e1f
xorl %r15d, %r15d
jmp 0x30dc5
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x36f2e
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x30da7
movq %r12, %rdi
movq %r14, %rsi
callq 0x2b01f
cmpl $0x0, (%r14)
jne 0x30da7
jmp 0x30ddf
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtins_ir_rnd_1
subtilis_exp_t *subtilis_builtins_ir_rnd_1(subtilis_parser_t *p,
					   subtilis_error_t *err)
{
	subtilis_exp_t *e;
	subtilis_exp_t *e_dup = NULL;
	subtilis_exp_t *top_bit = NULL;

	e = subtilis_builtins_ir_basic_rnd(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e_dup = subtilis_type_if_dup(e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_var_assign_hidden(p, subtilis_rnd_hidden_var,
				   &subtilis_type_integer, e_dup, err);
	e_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit = subtilis_exp_new_int32((int32_t)0x7fffffff, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_and(p, e, top_bit, err);
	top_bit = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit = subtilis_exp_new_int32((int32_t)0x7fffffff, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_divr(p, e, top_bit, err);
	top_bit = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_exp_handle_errors(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return e;

cleanup:

	subtilis_exp_delete(top_bit);
	subtilis_exp_delete(e_dup);
	subtilis_exp_delete(e);

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x30ccb
movq %rax, %rbx
cmpl $0x0, (%r14)
je 0x30e75
xorl %r12d, %r12d
jmp 0x30e89
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36182
movq %rax, %r12
cmpl $0x0, (%r14)
je 0x30eb4
xorl %eax, %eax
movq %rax, %rdi
callq 0x2b166
movq %r12, %rdi
callq 0x2b166
movq %rbx, %rdi
callq 0x2b166
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x752b5(%rip), %rax     # 0xa6170
movq (%rax), %rsi
leaq 0x43a53(%rip), %rdx     # 0x74918
movq %r15, %rdi
movq %r12, %rcx
movq %r14, %r8
callq 0x35b78
cmpl $0x0, (%r14)
jne 0x30e70
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq %r14, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
je 0x30ef1
xorl %r12d, %r12d
jmp 0x30e8b
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x36c60
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x30e70
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq %r14, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
jne 0x30eec
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x36f2e
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x30e70
movq %r15, %rdi
movq %r14, %rsi
callq 0x2b01f
cmpl $0x0, (%r14)
jne 0x30e70
jmp 0x30ea5
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtins_ir_rnd_pos
subtilis_exp_t *subtilis_builtins_ir_rnd_pos(subtilis_parser_t *p, int32_t val,
					     subtilis_error_t *err)
{
	subtilis_exp_t *e;
	subtilis_exp_t *m;
	subtilis_exp_t *e_dup = NULL;
	subtilis_exp_t *top_bit = NULL;

	e = subtilis_builtins_ir_basic_rnd(p, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	e_dup = subtilis_type_if_dup(e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_var_assign_hidden(p, subtilis_rnd_hidden_var,
				   &subtilis_type_integer, e_dup, err);
	e_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	top_bit = subtilis_exp_new_int32((int32_t)0x7fffffff, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_and(p, e, top_bit, err);
	top_bit = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	m = subtilis_exp_new_int32(val, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	e = subtilis_type_if_mod(p, e, m, err);
	m = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	m = subtilis_exp_new_int32(1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return subtilis_exp_add(p, e, m, err);

cleanup:

	subtilis_exp_delete(top_bit);
	subtilis_exp_delete(e_dup);
	subtilis_exp_delete(e);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movq %rdx, %rsi
callq 0x30ccb
cmpl $0x0, (%r14)
jne 0x30fd1
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x36182
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0x30fb7
leaq 0x751da(%rip), %rax     # 0xa6170
movq (%rax), %rsi
leaq 0x43978(%rip), %rdx     # 0x74918
movq %r15, %rdi
movq %r12, %rcx
movq %r14, %r8
callq 0x35b78
cmpl $0x0, (%r14)
je 0x30fdc
xorl %r12d, %r12d
xorl %eax, %eax
movq %rax, %rdi
callq 0x2b166
movq %r12, %rdi
callq 0x2b166
movq %rbx, %rdi
callq 0x2b166
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq %r14, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
je 0x30ff4
xorl %r12d, %r12d
jmp 0x30fb9
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x36c60
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x30fb4
movl %ebp, %edi
movq %r14, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
jne 0x30fb4
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x36eae
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x30fb4
movl $0x1, %edi
movq %r14, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
jne 0x30fb4
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2ba37
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtins_ir_rnd_neg
subtilis_exp_t *subtilis_builtins_ir_rnd_neg(subtilis_parser_t *p, int32_t val,
					     subtilis_error_t *err)
{
	subtilis_exp_t *e;
	subtilis_exp_t *e_dup = NULL;

	e = subtilis_exp_new_int32(-val, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	e_dup = subtilis_type_if_dup(e, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_var_assign_hidden(p, subtilis_rnd_hidden_var,
				   &subtilis_type_integer, e_dup, err);
	e_dup = NULL;
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	return e;

cleanup:

	subtilis_exp_delete(e_dup);
	subtilis_exp_delete(e);

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %r15
negl %esi
movl %esi, %edi
movq %rdx, %rsi
callq 0x2b7af
cmpl $0x0, (%r14)
jne 0x310d4
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x36182
cmpl $0x0, (%r14)
jne 0x310c4
leaq 0x750cc(%rip), %rcx     # 0xa6170
movq (%rcx), %rsi
leaq 0x4386a(%rip), %rdx     # 0x74918
movq %r15, %rdi
movq %rax, %rcx
movq %r14, %r8
callq 0x35b78
cmpl $0x0, (%r14)
je 0x310d6
xorl %eax, %eax
movq %rax, %rdi
callq 0x2b166
movq %rbx, %rdi
callq 0x2b166
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: prv_find_first_stop
static size_t
prv_find_first_stop(subtilis_parser_t *p, subtilis_ir_operand_t str_data,
		    subtilis_ir_operand_t str_len,
		    subtilis_ir_operand_t max_digit, bool immediate_digit,
		    subtilis_ir_operand_t end_str,
		    subtilis_ir_operand_t end_label,
		    subtilis_ir_operand_t *minus, subtilis_error_t *err)
{
	subtilis_ir_operand_t skip_sign_label;
	subtilis_ir_operand_t first_end_label;
	subtilis_ir_operand_t condee;
	size_t ptr;
	subtilis_ir_operand_t byte;

	skip_sign_label.label = subtilis_ir_section_new_label(p->current);
	first_end_label.label = subtilis_ir_section_new_label(p->current);

	ptr = prv_find_first_stop_prolog(
	    p, str_data, str_len, max_digit, immediate_digit, end_str, &byte,
	    skip_sign_label, first_end_label, end_label, minus, &condee, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC_NF,
					  condee, first_end_label,
					  skip_sign_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_ir_section_add_label(p->current, first_end_label.label, err);

	return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, (%rsp)
movq %r8, %rbp
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
movq 0x48(%rdi), %rdi
callq 0x2cc99
movq %rax, %r12
movq 0x48(%r14), %rdi
callq 0x2cc99
subq $0x8, %rsp
leaq 0x10(%rsp), %r10
leaq 0x18(%rsp), %r9
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rax, %r15
movl %ebx, %ecx
movq 0x58(%rsp), %rbx
movq %rbp, %r8
pushq %rbx
pushq %r10
pushq 0x18(%rsp)
pushq %rax
pushq %r12
callq 0x34d4c
addq $0x30, %rsp
movq $-0x1, %rbp
cmpl $0x0, (%rbx)
jne 0x32808
movq %rax, %r13
movq 0x48(%r14), %rdi
movq 0x8(%rsp), %rdx
movl $0x44, %esi
movq %r15, %rcx
movq %r12, %r8
movq %rbx, %r9
callq 0x2bd42
cmpl $0x0, (%rbx)
jne 0x32808
movq 0x48(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2cca6
movq %r13, %rbp
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtin_ir_call_fp_to_str
subtilis_exp_t *subtilis_builtin_ir_call_fp_to_str(subtilis_parser_t *p,
						   size_t val_reg,
						   size_t buf_reg,
						   subtilis_error_t *err)
{
	subtilis_ir_section_t *fn;

	const subtilis_type_t *ptype[2];

	ptype[0] = &subtilis_type_real;
	ptype[1] = &subtilis_type_integer;

	fn = prv_add_args(p, "_fp_to_str", 2, ptype, &subtilis_type_integer,
			  err);
	if (err->type != SUBTILIS_ERROR_OK) {
		if (err->type != SUBTILIS_ERROR_ALREADY_DEFINED)
			return NULL;
		subtilis_error_init(err);
	} else {
		subtilis_builtins_ir_fp_to_str(p, fn, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;
	}

	return subtilis_parser_call_2_arg_fn(
	    p, "_fp_to_str", val_reg, buf_reg, SUBTILIS_IR_REG_TYPE_REAL,
	    SUBTILIS_IR_REG_TYPE_INTEGER, &subtilis_type_integer, false, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x40f17(%rip), %rax     # 0x747d0
movq %rsp, %rcx
movq %rax, (%rcx)
leaq 0x41052(%rip), %r14     # 0x74918
movq %r14, 0x8(%rcx)
subq $0x8, %rsp
leaq 0x419cd(%rip), %rsi     # 0x752a2
movl $0x2, %edx
movq %r14, %r8
xorl %r9d, %r9d
pushq %rbx
callq 0x34176
addq $0x10, %rsp
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x338ff
cmpl $0x20, %ecx
jne 0x33912
movq %rbx, %rdi
callq 0x143b4
jmp 0x3391a
movq %r13, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x31642
cmpl $0x0, (%rbx)
je 0x3391a
xorl %eax, %eax
addq $0x10, %rsp
jmp 0x33945
subq $0x8, %rsp
leaq 0x4197d(%rip), %rsi     # 0x752a2
movq %r13, %rdi
movq %r12, %rdx
movq %r15, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq $0x0
pushq %r14
callq 0x1eb59
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtin_ir_call_str_to_fp
subtilis_exp_t *subtilis_builtin_ir_call_str_to_fp(subtilis_parser_t *p,
						   size_t str_reg,
						   subtilis_error_t *err)
{
	subtilis_ir_section_t *fn;

	const subtilis_type_t *ptype[1];

	ptype[0] = &subtilis_type_integer;

	fn = prv_add_args(p, "_str_to_fp", 1, ptype, &subtilis_type_real, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		if (err->type != SUBTILIS_ERROR_ALREADY_DEFINED)
			return NULL;
		subtilis_error_init(err);
	} else {
		subtilis_builtins_ir_str_to_fp(p, fn, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;
	}

	return subtilis_parser_call_1_arg_fn(
	    p, "_str_to_fp", str_reg, SUBTILIS_BUILTINS_MAX,
	    SUBTILIS_IR_REG_TYPE_INTEGER, &subtilis_type_real, true, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x40fb0(%rip), %rax     # 0x74918
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
subq $0x8, %rsp
leaq 0x41932(%rip), %rsi     # 0x752ad
leaq 0x40e4e(%rip), %r8      # 0x747d0
movl $0x1, %edx
xorl %r9d, %r9d
pushq %rbx
callq 0x34176
addq $0x10, %rsp
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x339a9
cmpl $0x20, %ecx
jne 0x339bc
movq %rbx, %rdi
callq 0x143b4
jmp 0x339c4
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x32421
cmpl $0x0, (%rbx)
je 0x339c4
xorl %eax, %eax
addq $0x10, %rsp
jmp 0x339ec
leaq 0x418e2(%rip), %rsi     # 0x752ad
leaq 0x40dfe(%rip), %r9      # 0x747d0
movq %r15, %rdi
movq %r14, %rdx
movl $0x9, %ecx
xorl %r8d, %r8d
pushq %rbx
pushq $0x1
callq 0x1ea76
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: prv_add_args_ci
static subtilis_ir_section_t *prv_add_args_ci(subtilis_parser_t *p,
					      const char *name,
					      size_t arg_count,
					      const subtilis_type_t **ptype,
					      const subtilis_type_t *rtype,
					      size_t *call_index,
					      subtilis_error_t *err)
{
	subtilis_type_section_t *ts;
	subtilis_type_t *params;
	subtilis_ir_section_t *current = NULL;
	size_t j;
	size_t i = 0;

	params = malloc(sizeof(subtilis_type_t) * arg_count);
	if (!params) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	for (; i < arg_count; i++) {
		subtilis_type_init_copy(&params[i], ptype[i], err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}
	ts = subtilis_type_section_new(rtype, arg_count, params, NULL, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	current = subtilis_ir_prog_section_new(
	    p->prog, name, 0, ts, SUBTILIS_BUILTINS_MAX, "builtin", 0,
	    p->eflag_offset, p->error_offset, call_index, err);

cleanup:

	for (j = 0; j < i; j++)
		subtilis_type_free(&params[j]);
	free(params);

	return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, 0x20(%rsp)
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
movq 0x60(%rsp), %r13
imulq $0x148, %rdx, %rdi      # imm = 0x148
callq 0x121d0
testq %rax, %rax
je 0x34263
movq %rax, %rbp
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
testq %r15, %r15
je 0x341f5
movq %rbp, %rbx
xorl %r14d, %r14d
movq (%r12,%r14,8), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x2f457
cmpl $0x0, (%r13)
jne 0x34281
incq %r14
addq $0x148, %rbx            # imm = 0x148
cmpq %r14, %r15
jne 0x341cc
xorl %r12d, %r12d
movq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
movq %r13, %r8
callq 0x2f284
cmpl $0x0, (%r13)
jne 0x3425e
movq 0x18(%rsp), %rcx
movq 0x58(%rcx), %rdi
movl 0xb0(%rcx), %r10d
movl 0xb4(%rcx), %r11d
subq $0x8, %rsp
leaq 0x3f8fa(%rip), %r9      # 0x73b30
movq 0x10(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
movl $0x9, %r8d
pushq %r13
pushq 0x20(%rsp)
pushq %r11
pushq %r10
pushq $0x0
callq 0x2c1a2
addq $0x30, %rsp
movq %rax, %r12
movq %r15, %r14
jmp 0x34284
leaq 0x40fff(%rip), %rdx     # 0x75269
movq %r13, %rdi
movl $0x1, %esi
movl $0xc2c, %ecx            # imm = 0xC2C
callq 0x145a4
xorl %r12d, %r12d
jmp 0x342a8
xorl %r12d, %r12d
testq %r14, %r14
je 0x342a0
movq %rbp, %rbx
movq %rbx, %rdi
callq 0x2f56e
addq $0x148, %rbx            # imm = 0x148
decq %r14
jne 0x3428c
movq %rbp, %rdi
callq 0x122c0
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtin_ir_deref_array_recs
size_t subtilis_builtin_ir_deref_array_recs(subtilis_parser_t *p,
					    const subtilis_type_t *el_type,
					    subtilis_error_t *err)
{
	char *name;
	size_t call_index;

	name = prv_get_deref_array_recs_name(el_type, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	call_index = prv_ir_deref_array_recs_create(p, el_type, name, err);

	free(name);
	return call_index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x3435b
cmpl $0x0, (%rbx)
je 0x3432d
movq $-0x1, %rax
jmp 0x3434f
movq %rax, %r14
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x343c3
movq %rax, %rbx
movq %r14, %rdi
callq 0x122c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: prv_get_deref_array_recs_name
static char *prv_get_deref_array_recs_name(const subtilis_type_t *el_type,
					   subtilis_error_t *err)
{
	char *name;
	const char *base_name = "_deref_array_";
	const char *el_type_name = subtilis_type_name(el_type);

	name = malloc(strlen(base_name) + strlen(el_type_name) + 1);
	if (!name) {
		subtilis_error_set_oom(err);
		return NULL;
	}

	sprintf(name, "%s%s", base_name, el_type_name);

	return name;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
callq 0x2f5ad
movq %rax, %r14
movq %rax, %rdi
callq 0x120f0
leaq 0xe(%rax), %rdi
callq 0x121d0
movq %rax, %rbx
testq %rax, %rax
je 0x343a1
leaq 0x423bf(%rip), %rsi     # 0x7674a
leaq 0x40f75(%rip), %rdx     # 0x75307
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x12280
jmp 0x343ba
leaq 0x40ec1(%rip), %rdx     # 0x75269
movq %r15, %rdi
movl $0x1, %esi
movl $0xd40, %ecx            # imm = 0xD40
callq 0x145a4
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq