// File: menhits[P]phplus/src/Actions/BranchAction.cpp
// Function: branchAction(std::shared_ptr<ActionData>, std::shared_ptr<ActionData>, std::shared_ptr<ActionData>)
Action branchAction(Action leftInputIn, Action actionIn, Action rightInputIn)
{
	//return Action(new BranchAction(leftInputIn, actionIn, rightInputIn));
	
	
	if (leftInputIn->getReturnType()->isVoid())
	{
		if (rightInputIn->getReturnType()->isVoid())
		{
			return actionIn;
		}
		else
		{
			return Action(new RightBranchAction(actionIn, rightInputIn));
		}
	}
	else
	{
		if (rightInputIn->getReturnType()->isVoid())
		{
			return Action(new LeftBranchAction(leftInputIn, actionIn));
		}
		else
		{
			return Action(new BranchAction(leftInputIn, actionIn, rightInputIn));
		}
	}
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rcx, 0x70(%rsp)
movq %rdx, 0x78(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdi, %rax
movq 0x80(%rsp), %rdi
movq %rax, 0x88(%rsp)
movq %rax, %rsi
movq %rsi, 0x90(%rsp)
movq %rax, 0x140(%rsp)
movq %rdi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movq %rcx, 0x128(%rsp)
callq 0x1bb50
movq %rax, %rdi
callq 0x1bed0
movq %rax, %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb $0x1, %al
jne 0xb38be
jmp 0xb39e2
movq 0x70(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
callq 0x1bed0
movq %rax, %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb $0x1, %al
jne 0xb38e7
jmp 0xb38fe
movq 0x78(%rsp), %rsi
movq 0x88(%rsp), %rdi
callq 0x225e0
jmp 0xb3c0c
movl $0x98, %edi
callq 0xb390
movq 0x78(%rsp), %rsi
movq %rax, 0x58(%rsp)
movq %rax, 0x50(%rsp)
movb $0x1, 0xfb(%rsp)
leaq 0x118(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x1ac60
movq 0x70(%rsp), %rsi
leaq 0x108(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x1ac60
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0xb3c30
jmp 0xb395e
movq 0x50(%rsp), %rsi
movq 0x88(%rsp), %rdi
movb $0x0, 0xfb(%rsp)
callq 0xb4610
jmp 0xb397a
leaq 0x108(%rsp), %rdi
callq 0x1acc0
leaq 0x118(%rsp), %rdi
callq 0x1acc0
jmp 0xb3c0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x1acc0
leaq 0x118(%rsp), %rdi
callq 0x1acc0
testb $0x1, 0xfb(%rsp)
jne 0xb39d3
jmp 0xb39dd
movq 0x50(%rsp), %rdi
callq 0xb350
jmp 0xb3c1c
movq 0x70(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
callq 0x1bed0
movq %rax, %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb $0x1, %al
jne 0xb3a0e
jmp 0xb3af5
movl $0x98, %edi
callq 0xb390
movq 0x80(%rsp), %rsi
movq %rax, 0x38(%rsp)
movq %rax, 0x30(%rsp)
movb $0x1, 0xd7(%rsp)
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x1ac60
movq 0x78(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x1ac60
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0xb4640
jmp 0xb3a71
movq 0x30(%rsp), %rsi
movq 0x88(%rsp), %rdi
movb $0x0, 0xd7(%rsp)
callq 0xb4fd0
jmp 0xb3a8d
leaq 0xd8(%rsp), %rdi
callq 0x1acc0
leaq 0xe8(%rsp), %rdi
callq 0x1acc0
jmp 0xb3c0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x1acc0
leaq 0xe8(%rsp), %rdi
callq 0x1acc0
testb $0x1, 0xd7(%rsp)
jne 0xb3ae6
jmp 0xb3af0
movq 0x30(%rsp), %rdi
callq 0xb350
jmp 0xb3c1c
movl $0xa8, %edi
callq 0xb390
movq 0x80(%rsp), %rsi
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movb $0x1, 0x9f(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1ac60
movq 0x78(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1ac60
movq 0x70(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x1ac60
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0xb5000
jmp 0xb3b74
movq 0x8(%rsp), %rsi
movq 0x88(%rsp), %rdi
movb $0x0, 0x9f(%rsp)
callq 0xb60b0
jmp 0xb3b90
leaq 0xa0(%rsp), %rdi
callq 0x1acc0
leaq 0xb0(%rsp), %rdi
callq 0x1acc0
leaq 0xc0(%rsp), %rdi
callq 0x1acc0
jmp 0xb3c0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x1acc0
leaq 0xb0(%rsp), %rdi
callq 0x1acc0
leaq 0xc0(%rsp), %rdi
callq 0x1acc0
testb $0x1, 0x9f(%rsp)
jne 0xb3c00
jmp 0xb3c0a
movq 0x8(%rsp), %rdi
callq 0xb350
jmp 0xb3c1c
movq 0x90(%rsp), %rax
addq $0x148, %rsp            # imm = 0x148
retq
movq 0x100(%rsp), %rdi
callq 0xb680
nopl (%rax)