// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/compile.c
// Function: table_compile_from_file
struct table* table_compile_from_file(const char *file_name)
{
	FILE *file;
	struct table table_auto;
	char attrs_chars_default[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
	int file_name_len, i;

	file = fopen(file_name, "r");
	if(!file)
		return NULL;

	table = &table_auto;
	table_init(table);

	file_name_len = strlen(file_name);
	table->file_name = MALLOC(file_name_len + 1);
	LOG_ALLOCATE_FAIL_RETURN_NULL(table->file_name)
	strcpy(table->file_name, file_name);

	rule_attrs = 0;
	rule_filter_forward =
	rule_filter_backward = NULL;
	variables = NULL;
	macros = NULL;
	var_enum = 0;
	macro_depth = 0;
	include_depth = -1;

	/*   set defaults   */
	table->marker_user      = TABLE_MARKER_USER;
	table->marker_begin     = TABLE_MARKER_BEGIN;
	table->marker_end       = TABLE_MARKER_END;
	table->marker_modifier  = TABLE_MARKER_MODIFIER;
	table->marker_hard      = TABLE_MARKER_HARD;
	table->marker_soft      = TABLE_MARKER_SOFT;
	table->marker_internal  = TABLE_MARKER_INTERNAL;
	for(i = 0; i < 32; i++)
		table->attrs_chars[i] = attrs_chars_default[i];

	file_read(file, table->file_name);
	fclose(file);

	variable_free(variables);
	variables = NULL;
	macro_free(macros);
	macros = NULL;

	/*   this could happen if file_name was a directory
	     or an empty file   */
	if(!table_file_lines[0])
	{
		FREE(table->file_name);
		return NULL;
	}

	table = table_allocate();
	*table = table_auto;

#ifdef DEBUG

	if(!table->nocontract_set)
	{
		ASSERT(!table->nocontract.begin_len)
		ASSERT(!table->nocontract.end_len)
		ASSERT(!table->nocontract.word_len)
		ASSERT(!table->nocontract.term_len)
		ASSERT(!table->nocontract.symbol_len)
	}
	if(!table->capital_set)
	{
		ASSERT(!table->capital.begin_len)
		ASSERT(!table->capital.end_len)
		ASSERT(!table->capital.word_len)
		ASSERT(!table->capital.term_len)
		ASSERT(!table->capital.symbol_len)
	}
	if(!table->numeric_set)
	{
		ASSERT(!table->numeric.begin_len)
		ASSERT(!table->numeric.end_len)
		ASSERT(!table->numeric.word_len)
		ASSERT(!table->numeric.term_len)
		ASSERT(!table->numeric.symbol_len)
	}

#endif

	return table;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x10(%rbp)
leaq -0x360(%rbp), %rdi
leaq 0x199c3(%rip), %rsi     # 0x1e300
movl $0x21, %edx
callq 0x1150
movq -0x10(%rbp), %rdi
leaq 0x1a67c(%rip), %rsi     # 0x1efce
callq 0x1190
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x496f
movq $0x0, -0x8(%rbp)
jmp 0x4d1e
leaq -0x338(%rbp), %rax
movq %rax, 0x1f7e3(%rip)     # 0x24160
movq 0x1f7dc(%rip), %rdi     # 0x24160
callq 0x1ef0
movq -0x10(%rbp), %rdi
callq 0x10a0
movl %eax, -0x364(%rbp)
movl -0x364(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x1160
movq %rax, %rcx
movq 0x1f7ad(%rip), %rax     # 0x24160
movq %rcx, 0x10(%rax)
movq 0x1f7a2(%rip), %rax     # 0x24160
cmpq $0x0, 0x10(%rax)
jne 0x49f1
movl $0x7, %edi
leaq 0x198a7(%rip), %rsi     # 0x1e278
leaq 0x19949(%rip), %rdx     # 0x1e321
movl $0x847, %ecx            # imm = 0x847
movb $0x0, %al
callq 0xf610
movq $0x0, -0x8(%rbp)
jmp 0x4d1e
movq 0x1f768(%rip), %rax     # 0x24160
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1070
movl $0x0, 0x1f759(%rip)     # 0x24168
movq $0x0, 0x1f756(%rip) # 0x24170
movq $0x0, 0x1f753(%rip) # 0x24178
movq $0x0, 0x1f750(%rip) # 0x24180
movq $0x0, 0x1f74d(%rip) # 0x24188
movl $0x0, 0x1f74b(%rip)     # 0x24190
movl $0x0, 0x1f745(%rip)     # 0x24194
movl $0xffffffff, 0x1f73f(%rip) # imm = 0xFFFFFFFF
movq 0x1f700(%rip), %rax     # 0x24160
movw $0xf001, 0x1e8(%rax)    # imm = 0xF001
movq 0x1f6f0(%rip), %rax     # 0x24160
movw $0xf002, 0x1ea(%rax)    # imm = 0xF002
movq 0x1f6e0(%rip), %rax     # 0x24160
movw $0xf003, 0x1ec(%rax)    # imm = 0xF003
movq 0x1f6d0(%rip), %rax     # 0x24160
movw $0xf004, 0x1ee(%rax)    # imm = 0xF004
movq 0x1f6c0(%rip), %rax     # 0x24160
movw $0xf005, 0x1f0(%rax)    # imm = 0xF005
movq 0x1f6b0(%rip), %rax     # 0x24160
movw $0xf006, 0x1f2(%rax)    # imm = 0xF006
movq 0x1f6a0(%rip), %rax     # 0x24160
movw $0xf007, 0x1f4(%rax)    # imm = 0xF007
movl $0x0, -0x368(%rbp)
cmpl $0x20, -0x368(%rbp)
jge 0x4b0d
movslq -0x368(%rbp), %rax
movb -0x360(%rbp,%rax), %dl
movq 0x1f66f(%rip), %rax     # 0x24160
movslq -0x368(%rbp), %rcx
movb %dl, 0x30(%rax,%rcx)
movl -0x368(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x368(%rbp)
jmp 0x4ad3
movq -0x18(%rbp), %rdi
movq 0x1f648(%rip), %rax     # 0x24160
movq 0x10(%rax), %rsi
callq 0x4d30
movq -0x18(%rbp), %rdi
callq 0x1090
movq 0x1f64f(%rip), %rdi     # 0x24180
callq 0x5310
movq $0x0, 0x1f63f(%rip) # 0x24180
movq 0x1f640(%rip), %rdi     # 0x24188
callq 0x5360
movq $0x0, 0x1f630(%rip) # 0x24188
cmpl $0x0, 0x1f641(%rip)     # 0x241a0
jne 0x4b7e
movq 0x1f5f8(%rip), %rax     # 0x24160
movq 0x10(%rax), %rdi
callq 0x1040
movq $0x0, -0x8(%rbp)
jmp 0x4d1e
callq 0x27e0
movq %rax, 0x1f5d6(%rip)     # 0x24160
movq 0x1f5cf(%rip), %rdi     # 0x24160
leaq -0x338(%rbp), %rsi
movl $0x320, %edx            # imm = 0x320
callq 0x1150
movq 0x1f5b7(%rip), %rax     # 0x24160
cmpl $0x0, 0x1d8(%rax)
jne 0x4c1d
movq 0x1f5a7(%rip), %rax     # 0x24160
cmpl $0x0, 0xa4(%rax)
je 0x4bc7
callq 0x1050
movq 0x1f592(%rip), %rax     # 0x24160
cmpl $0x0, 0xa8(%rax)
je 0x4bdc
callq 0x1050
movq 0x1f57d(%rip), %rax     # 0x24160
cmpl $0x0, 0xac(%rax)
je 0x4bf1
callq 0x1050
movq 0x1f568(%rip), %rax     # 0x24160
cmpl $0x0, 0xb0(%rax)
je 0x4c06
callq 0x1050
movq 0x1f553(%rip), %rax     # 0x24160
cmpl $0x0, 0xb4(%rax)
je 0x4c1b
callq 0x1050
jmp 0x4c1d
movq 0x1f53c(%rip), %rax     # 0x24160
cmpl $0x0, 0x1dc(%rax)
jne 0x4c98
movq 0x1f52c(%rip), %rax     # 0x24160
cmpl $0x0, 0x124(%rax)
je 0x4c42
callq 0x1050
movq 0x1f517(%rip), %rax     # 0x24160
cmpl $0x0, 0x128(%rax)
je 0x4c57
callq 0x1050
movq 0x1f502(%rip), %rax     # 0x24160
cmpl $0x0, 0x12c(%rax)
je 0x4c6c
callq 0x1050
movq 0x1f4ed(%rip), %rax     # 0x24160
cmpl $0x0, 0x130(%rax)
je 0x4c81
callq 0x1050
movq 0x1f4d8(%rip), %rax     # 0x24160
cmpl $0x0, 0x134(%rax)
je 0x4c96
callq 0x1050
jmp 0x4c98
movq 0x1f4c1(%rip), %rax     # 0x24160
cmpl $0x0, 0x1e0(%rax)
jne 0x4d13
movq 0x1f4b1(%rip), %rax     # 0x24160
cmpl $0x0, 0x1a4(%rax)
je 0x4cbd
callq 0x1050
movq 0x1f49c(%rip), %rax     # 0x24160
cmpl $0x0, 0x1a8(%rax)
je 0x4cd2
callq 0x1050
movq 0x1f487(%rip), %rax     # 0x24160
cmpl $0x0, 0x1ac(%rax)
je 0x4ce7
callq 0x1050
movq 0x1f472(%rip), %rax     # 0x24160
cmpl $0x0, 0x1b0(%rax)
je 0x4cfc
callq 0x1050
movq 0x1f45d(%rip), %rax     # 0x24160
cmpl $0x0, 0x1b4(%rax)
je 0x4d11
callq 0x1050
jmp 0x4d13
movq 0x1f446(%rip), %rax     # 0x24160
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopl (%rax,%rax)