// File: martinda3[P]Compiler/src/TCparser.cpp
// Function: toyc::TCparser::IfStatement()
ASstatement* TCparser::IfStatement() // WIP
	{
		// IfStatement --> IF LPAREN Expression RPAREN Statement [ ELSE Statement ]
		enteringDEBUG("If Statement");
		ASexpression* operand = NULL;
		ASstatement* operand2 = NULL;
		ASstatement* operand3 = NULL;
		accept(IF);
		accept(LPAREN);
		operand = Expression();
		accept(RPAREN);
		operand2 = Statement();
		if (buff->getTokenType() == ELSE)
		{
			enteringDEBUG("If Statement Additional");
			accept(ELSE);
			operand3 = Statement();
			exitingDEBUG("If Statement Additional");
			exitingDEBUG("If Statement");
			return new ASifState(operand, operand2, operand3);
		}
		exitingDEBUG("If Statement");
		return new ASifState(operand, operand2);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x95c0
movq -0x108(%rbp), %rdx
leaq 0x22f27(%rip), %rsi     # 0x332bf
leaq -0x30(%rbp), %rdi
callq 0x13550
jmp 0x103a3
leaq -0x30(%rbp), %rdi
callq 0xd790
jmp 0x103ae
leaq -0x30(%rbp), %rdi
callq 0x9658
leaq -0x31(%rbp), %rdi
callq 0x93b0
movq -0x110(%rbp), %rdi
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x1, %esi
callq 0xe670
movq -0x110(%rbp), %rdi
movl $0x1e, %esi
callq 0xe670
movq -0x110(%rbp), %rdi
callq 0xfe60
movq -0x110(%rbp), %rdi
movq %rax, -0x50(%rbp)
movl $0x1f, %esi
callq 0xe670
movq -0x110(%rbp), %rdi
callq 0x10270
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq 0x8(%rax), %rdi
callq 0x1be60
cmpl $0x4, %eax
jne 0x1068d
leaq -0x81(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x95c0
movq -0x118(%rbp), %rdx
leaq 0x22e64(%rip), %rsi     # 0x332cc
leaq -0x80(%rbp), %rdi
callq 0x13550
jmp 0x10473
leaq -0x80(%rbp), %rdi
callq 0xd790
jmp 0x1047e
leaq -0x80(%rbp), %rdi
callq 0x9658
leaq -0x81(%rbp), %rdi
callq 0x93b0
movq -0x110(%rbp), %rdi
movl $0x4, %esi
callq 0xe670
movq -0x110(%rbp), %rdi
callq 0x10270
movq %rax, -0x60(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x95c0
movq -0x120(%rbp), %rdx
leaq 0x22df7(%rip), %rsi     # 0x332cc
leaq -0xa8(%rbp), %rdi
callq 0x13550
jmp 0x104e3
leaq -0xa8(%rbp), %rdi
callq 0xda50
jmp 0x104f1
leaq -0xa8(%rbp), %rdi
callq 0x9658
leaq -0xa9(%rbp), %rdi
callq 0x93b0
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x95c0
movq -0x128(%rbp), %rdx
leaq 0x22d95(%rip), %rsi     # 0x332bf
leaq -0xd0(%rbp), %rdi
callq 0x13550
jmp 0x10538
leaq -0xd0(%rbp), %rdi
callq 0xda50
jmp 0x10546
leaq -0xd0(%rbp), %rdi
callq 0x9658
leaq -0xd1(%rbp), %rdi
callq 0x93b0
movl $0x50, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x130(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0xcc50
jmp 0x10588
movq -0x130(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10768
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x105bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x9658
leaq -0x31(%rbp), %rdi
callq 0x93b0
jmp 0x10775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x105ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x9658
leaq -0x81(%rbp), %rdi
callq 0x93b0
jmp 0x10775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x10623
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x9658
leaq -0xa9(%rbp), %rdi
callq 0x93b0
jmp 0x10775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1065a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x9658
leaq -0xd1(%rbp), %rdi
callq 0x93b0
jmp 0x10775
movq -0x130(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x50, %esi
callq 0x9360
jmp 0x10775
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x95c0
movq -0x138(%rbp), %rdx
leaq 0x22c11(%rip), %rsi     # 0x332bf
leaq -0xf8(%rbp), %rdi
callq 0x13550
jmp 0x106bc
leaq -0xf8(%rbp), %rdi
callq 0xda50
jmp 0x106ca
leaq -0xf8(%rbp), %rdi
callq 0x9658
leaq -0xf9(%rbp), %rdi
callq 0x93b0
movl $0x50, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x140(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0xcce0
jmp 0x10708
movq -0x140(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10768
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1073b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x9658
leaq -0xf9(%rbp), %rdi
callq 0x93b0
jmp 0x10775
movq -0x140(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x50, %esi
callq 0x9360
jmp 0x10775
movq -0x8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x95b0
nop