// File: /workspace/github_c_makefile_star2_O0/martincameron[P]towntalk/towntalk.c
// Function: evaluate_arithmetic_expression
enum result evaluate_arithmetic_expression( struct expression *this,
	struct variables *vars, struct variable *result ) {
	struct expression *parameter = this->parameters;
	number lhs, rhs;
	if( !evaluate_number( parameter, vars, &lhs ) ) {
		return EXCEPTION;
	}
	while( parameter->next ) {
		parameter = parameter->next;
		if( !evaluate_number( parameter, vars, &rhs ) ) {
			return EXCEPTION;
		}
		switch( this->index ) {
			case '!': lhs = lhs != rhs; break;
			case '%':
				if( rhs != 0 ) {
					lhs = ( long_int ) lhs % ( long_int ) rhs;
				} else {
					return throw( vars, this, 0, "Modulo division by zero." );
				}
				break;
			case '&': lhs = ( long_int ) lhs & ( long_int ) rhs; break;
			case '(': lhs = lhs <= rhs; break;
			case ')': lhs = lhs >= rhs; break;
			case '*': lhs = lhs  * rhs; break;
			case '+': lhs = lhs  + rhs; break;
			case '-': lhs = lhs  - rhs; break;
			case '/':
				if( rhs != 0 ) {
					lhs = ( long_int ) lhs / ( long_int ) rhs;
				} else {
					return throw( vars, this, 0, "Integer division by zero." );
				}
				break;
			case '0': lhs = lhs / rhs; break;
			case '1': lhs = ( long_int ) lhs << ( long_int ) rhs; break;
			case '2': lhs = ( long_int ) lhs >> ( long_int ) rhs; break;
			case '3': lhs = ( long_int ) lhs  ^ ( long_int ) rhs; break;
			case ':': lhs = ( long_int ) lhs  | ( long_int ) rhs; break;
			case '<': lhs = lhs  < rhs; break;
			case '=': lhs = lhs == rhs; break;
			case '>': lhs = lhs  > rhs; break;
			default :
				return throw( vars, this, 0, "Unhandled integer operator." );
		}
	}
	result->number_value = lhs;
	return OKAY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x5340
cmpl $0x0, %eax
jne 0x5b82
movl $0x0, -0x4(%rbp)
jmp 0x5d7b
jmp 0x5b84
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x5d6b
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x5340
cmpl $0x0, %eax
jne 0x5bc1
movl $0x0, -0x4(%rbp)
jmp 0x5d7b
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x1d, %eax
ja 0x5d4b
movq -0x38(%rbp), %rax
leaq 0x154d7(%rip), %rcx     # 0x1b0bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
cmpl $0x0, -0x30(%rbp)
je 0x5c16
movl -0x2c(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %edx, -0x2c(%rbp)
jmp 0x5c34
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
leaq 0x15a95(%rip), %rcx     # 0x1b6bc
callq 0x4330
movl %eax, -0x4(%rbp)
jmp 0x5d7b
jmp 0x5d66
movl -0x2c(%rbp), %eax
andl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
setle %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
setge %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
imull -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
cmpl $0x0, -0x30(%rbp)
je 0x5cb0
movl -0x2c(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x5cce
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
leaq 0x15a14(%rip), %rcx     # 0x1b6d5
callq 0x4330
movl %eax, -0x4(%rbp)
jmp 0x5d7b
jmp 0x5d66
movl -0x2c(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
shll %cl, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
sarl %cl, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
xorl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
orl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5d66
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
leaq 0x15993(%rip), %rcx     # 0x1b6ef
callq 0x4330
movl %eax, -0x4(%rbp)
jmp 0x5d7b
jmp 0x5b84
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)