// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser.c
// Function: subtilis_parser_new
subtilis_parser_t *subtilis_parser_new(subtilis_lexer_t *l,
				       const subtilis_backend_t *backend,
				       const subtilis_settings_t *settings,
				       subtilis_error_t *err)
{
	const subtilis_symbol_t *s;
	subtilis_parser_t *p = calloc(1, sizeof(*p));
	subtilis_type_section_t *stype = NULL;

	if (!p) {
		subtilis_error_set_oom(err);
		goto on_error;
	}

	p->settings = *settings;

	p->st = subtilis_symbol_table_new(err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	p->main_st = subtilis_symbol_table_new(err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;
	p->local_st = p->main_st;

	p->prog = subtilis_ir_prog_new(&p->settings, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	stype =
	    subtilis_type_section_new(&subtilis_type_void, 0, NULL, NULL, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	/*
	 * We pre-seed the symbol table here to ensure that these variables
	 * have offsets 0 and 0 + sizeof(INT).
	 */

	s = subtilis_symbol_table_insert(p->st, subtilis_eflag_hidden_var,
					 &subtilis_type_integer, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	p->eflag_offset = (int32_t)s->loc;
	p->error_offset = s->size;
	s = subtilis_symbol_table_insert(p->st, subtilis_err_hidden_var,
					 &subtilis_type_integer, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;

	p->current = subtilis_ir_prog_section_new(
	    p->prog, SUBTILIS_MAIN_FN, 0, stype, SUBTILIS_BUILTINS_MAX,
	    l->stream->name, l->line, p->eflag_offset, p->error_offset, NULL,
	    err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto on_error;
	stype = NULL;
	p->main = p->current;

	p->l = l;
	p->backend = *backend;
	p->level = 0;

	return p;

on_error:

	subtilis_type_section_delete(stype);
	subtilis_parser_delete(p);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movl $0x1, %edi
movl $0xc0, %esi
callq 0x12130
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1686a
movq -0x30(%rbp), %rdi
movl $0x1, %esi
leaq 0x93c60(%rip), %rdx     # 0xaa4bb
movl $0x36, %ecx
callq 0x158e0
jmp 0x16a90
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movw (%rcx), %dx
movw %dx, 0xb8(%rax)
movb 0x2(%rcx), %cl
movb %cl, 0xba(%rax)
movq -0x30(%rbp), %rdi
callq 0x3c180
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x168a7
jmp 0x16a90
movq -0x30(%rbp), %rdi
callq 0x3c180
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x168c9
jmp 0x16a90
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x40(%rbp), %rdi
addq $0xb8, %rdi
movq -0x30(%rbp), %rsi
callq 0x38a80
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16906
jmp 0x16a90
movq -0x30(%rbp), %r8
leaq 0x95397(%rip), %rdi     # 0xabca8
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x3dc00
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16932
jmp 0x16a90
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rdi
leaq 0xbdef7(%rip), %rax     # 0xd4838
movq (%rax), %rsi
movq -0x30(%rbp), %rcx
leaq 0x94f81(%rip), %rdx     # 0xab8d0
callq 0x3c480
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16966
jmp 0x16a90
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xb0(%rax)
movq -0x38(%rbp), %rax
movq 0x2a0(%rax), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xb4(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rdi
leaq 0xbdea1(%rip), %rax     # 0xd4840
movq (%rax), %rsi
movq -0x30(%rbp), %rcx
leaq 0x94f23(%rip), %rdx     # 0xab8d0
callq 0x3c480
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x169c4
jmp 0x16a90
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %r9
movq -0x18(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %ebx
movq -0x40(%rbp), %rax
movl 0xb0(%rax), %r11d
movq -0x40(%rbp), %rax
movl 0xb4(%rax), %r10d
movq -0x30(%rbp), %rax
leaq 0x93acb(%rip), %rsi     # 0xaa4cd
xorl %edx, %edx
movl $0x9, %r8d
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x38bd0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16a41
jmp 0x16a90
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
movl $0x40, %edx
callq 0x12190
movq -0x40(%rbp), %rax
movq $0x0, 0x78(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x16aaa
movq -0x48(%rbp), %rdi
callq 0x3e040
movq -0x40(%rbp), %rdi
callq 0x16ac0
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)