// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: parse_if_statement
static struct element* parse_if_statement( struct element *elem,
	struct function *func, struct variables *vars, struct statement *prev, char *message ) {
	struct expression expr;
	struct element *next = elem->next;
	struct statement block = { 0 }, *stmt = calloc( 1, sizeof( struct block_statement ) );
	if( stmt ) {
		stmt->dispose = dispose_block_statement;
		prev->next = stmt;
		expr.next = NULL;
		next = parse_expression( next, func, vars, &expr, message );
		if( expr.next ) {
			stmt->source = expr.next;
			stmt->execute = execute_if_statement;
			if( expr.next->evaluate == evaluate_arithmetic_expression
				&& strchr( "!<(=)>", expr.next->index ) && expr.next->parameters->evaluate == evaluate_local ) {
					if( expr.next->parameters->next->evaluate == evaluate_local ) {
						stmt->local = expr.next->parameters->index;
						( ( struct block_statement * ) stmt )->rhs = expr.next->parameters->next->index;
						( ( struct block_statement * ) stmt )->oper = expr.next->index;
						stmt->execute = execute_if_local_statement;
					} else if( expr.next->parameters->next->evaluate == evaluate_number_literal_expression ) {
						stmt->local = expr.next->parameters->index;
						( ( struct block_statement * ) stmt )->num = ( ( struct value_expression * ) expr.next->parameters->next )->num;
						( ( struct block_statement * ) stmt )->oper = expr.next->index;
						stmt->execute = execute_if_const_statement;
					}
			} else if( expr.next->evaluate == evaluate_local ) {
				stmt->local = expr.next->index;
				stmt->execute = execute_if_const_statement;
			}
			if( next->child ) {
				parse_keywords_indexed( func->env->statements_index, next->child, func, vars, &block, message );
				( ( struct block_statement * ) stmt )->if_block = block.next;
			}
			if( message[ 0 ] == 0 ) {
				next = next->next;
				if( next && is_keyword( next->str.string, "else" ) ) {
					if( next->next && ( next->next->str.string[ 0 ] == '{' || is_keyword( next->next->str.string, "if" ) ) ) {
						next = next->next;
						block.next = NULL;
						if( next->child ) {
							parse_keywords_indexed( func->env->statements_index, next->child, func, vars, &block, message );
							if( message[ 0 ] == 0 ) {
								next = next->next;
							}
						} else {
							validate_syntax( "x{", next->next, next, func->env, message );
							if( message[ 0 ] == 0 ) {
								next = parse_if_statement( next, func, vars, &block, message );
							}
						}
						( ( struct block_statement * ) stmt )->else_block = block.next;
					} else {
						sprintf( message, "Expected '{' or 'if' after 'else' on line %d.", next->line );
					}
				}
			}
		}
	} else {
		strcpy( message, OUT_OF_MEMORY );
	}
	return next;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x30f0
movl $0x1, %edi
movl $0x48, %esi
callq 0x3120
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0xdf07
movq -0x80(%rbp), %rax
leaq -0x8cf4(%rip), %rcx     # 0x4ed0
movq %rcx, 0x18(%rax)
movq -0x80(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
leaq -0x48(%rbp), %rcx
callq 0x60c0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xdf05
movq -0x38(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x80(%rbp), %rax
leaq 0x1d35(%rip), %rcx      # 0xf950
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
leaq -0x80ea(%rip), %rcx     # 0x5b40
cmpq %rcx, 0x18(%rax)
jne 0xdd2a
movq -0x38(%rbp), %rax
movl 0x4(%rax), %esi
leaq 0xe680(%rip), %rdi      # 0x1c2c2
callq 0x30d0
cmpq $0x0, %rax
je 0xdd2a
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
leaq -0x90a0(%rip), %rcx     # 0x4bc0
cmpq %rcx, 0x18(%rax)
jne 0xdd2a
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
leaq -0x90bd(%rip), %rcx     # 0x4bc0
cmpq %rcx, 0x18(%rax)
jne 0xdcc9
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x4(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x38(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x80(%rbp), %rax
leaq 0x1d5d(%rip), %rcx      # 0xfa20
movq %rcx, 0x10(%rax)
jmp 0xdd28
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
leaq -0x9f5c(%rip), %rcx     # 0x3d80
cmpq %rcx, 0x18(%rax)
jne 0xdd26
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x4(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movl 0x28(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x38(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x80(%rbp), %rax
leaq 0x1ede(%rip), %rcx      # 0xfc00
movq %rcx, 0x10(%rax)
jmp 0xdd28
jmp 0xdd59
movq -0x38(%rbp), %rax
leaq -0x9175(%rip), %rcx     # 0x4bc0
cmpq %rcx, 0x18(%rax)
jne 0xdd57
movq -0x38(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, (%rax)
movq -0x80(%rbp), %rax
leaq 0x1ead(%rip), %rcx      # 0xfc00
movq %rcx, 0x10(%rax)
jmp 0xdd59
movq -0x50(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdd9c
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
addq $0x80, %rdi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %r9
leaq -0x78(%rbp), %r8
callq 0x9050
movq -0x58(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xdf03
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xdf01
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe4f7(%rip), %rsi      # 0x1c2c9
callq 0x83b0
cmpl $0x0, %eax
je 0xdf01
movq -0x50(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xdee6
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
je 0xde24
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xe366(%rip), %rsi      # 0x1c17c
callq 0x83b0
cmpl $0x0, %eax
je 0xdee6
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x50(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xde89
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
addq $0x80, %rdi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %r9
leaq -0x78(%rbp), %r8
callq 0x9050
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xde87
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0xded8
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x50(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x28(%rbp), %r8
leaq 0xe2d7(%rip), %rdi      # 0x1c17f
callq 0x8430
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xded6
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
leaq -0x78(%rbp), %rcx
callq 0xdb60
movq %rax, -0x50(%rbp)
jmp 0xded8
movq -0x58(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xdeff
movq -0x28(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0xe3d6(%rip), %rsi      # 0x1c2ce
movb $0x0, %al
callq 0x31f0
jmp 0xdf01
jmp 0xdf03
jmp 0xdf05
jmp 0xdf17
movq -0x28(%rbp), %rdi
movq 0x1324e(%rip), %rsi     # 0x21160
callq 0x3070
movq -0x50(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)