// File: /workspace/github_cpp_makefile_star2_O3/JohnCGriffin[P]BrainForked/bf_main.cpp
// Function: bf::execute(std::vector<bf::Instruction, std::allocator<bf::Instruction>>&)
static void execute(Instructions&  _instructions)
    {
	std::map<Action,void*> addrs;

	// Note that initialization in modern manner chokes clang/g++
	// when in c++14/17.  Direct assignment one by one seems to work.
	addrs[ADVANCE]	    = &&_ADVANCE;
	addrs[DECR1MX]	    = &&_DECR1MX;
	addrs[FALSEJUMP]    = &&_FALSEJUMP;
	addrs[GIVE]	    = &&_GIVE;
	addrs[INCR1MX]	    = &&_INCR1MX;
	addrs[INCR]	    = &&_INCR;
	addrs[M1ZERO]	    = &&_M1ZERO;
	addrs[MOVEWHILE]    = &&_MOVEWHILE;
	addrs[MOVE]	    = &&_MOVE;
	addrs[MXDECR1]	    = &&_MXDECR1;
	addrs[MXINCR1]	    = &&_MXINCR1;
	addrs[OFFINCR]	    = &&_OFFINCR;
	addrs[PRINT]	    = &&_PRINT;
	addrs[READ]	    = &&_READ;
	addrs[TAKE]	    = &&_TAKE;
	addrs[TERMINATE]    = &&_TERMINATE;
	addrs[TRUEJUMP]	    = &&_TRUEJUMP;
	addrs[VALUE]	    = &&_VALUE;
	addrs[WHILEDECROI2] = &&_WHILEDECROI2;
	addrs[WHILEIM2]	    = &&_WHILEIM2;
	addrs[WHILEIM3]	    = &&_WHILEIM3;
	addrs[WHILEMGM]	    = &&_WHILEMGM;
	addrs[ZERO2IF]	    = &&_ZERO2IF;
	addrs[ZEROM1]	    = &&_ZEROM1;
	addrs[ZERO]	    = &&_ZERO;

	for(auto a : ENUMERATED_ACTIONS){
	    if(!addrs[a]){
		throw std::logic_error(to_string(a) + " not in address table");
	    }
	}

	for(auto& instr : _instructions){
	    instr.jump = addrs.at(instr.action);
	}

#ifdef PROFILER
	for(int i=0; i<_instructions.size(); i++){
	    _instructions.at(i).ndx = i;
	}
#endif

	std::vector<char> characters(30000);
	char* ptr = characters.data();
	auto BEGIN = _instructions.data();
	auto IP = BEGIN;

	// initial JUMP.  The remainder happen via the LOOP macro.
	goto *(IP->jump);

#define LOOP() IP++; goto *(IP->jump)

    _TRUEJUMP:
	if(*ptr){
	    IP += IP->val;
	}
	LOOP();

    _FALSEJUMP:
	if(!(*ptr)){
	    IP += IP->val;
	}
#ifdef PROFILER
	else {
	    current_loop = IP->ndx;
	}
#endif
	LOOP();

    _DECR1MX:
	ptr[0]--;
	ptr += IP->val;
	LOOP();

    _INCR1MX:
	ptr[0]++;
	ptr += IP->val;
	LOOP();

    _MXINCR1:
	ptr += IP->val;
	ptr[0]++;
	LOOP();

    _MXDECR1:
	ptr += IP->val;
	ptr[0]--;
	LOOP();

    _WHILEDECROI2:
	if(ptr[0]){
	    const int o1 = IP[-2].val;
	    const int o2 = IP[-1].val;
	    do {
		ptr[0]--;
		ptr[o1]++;
		ptr[o2]++;
	    } while(ptr[0]);
	}
	LOOP();

    _WHILEMGM:
	if(ptr[0]){
	    const int m1 = IP[-2].val;
	    const int g = IP[-1].val;
	    const int m2 = IP->val;
	    do {
		ptr += m1;
		ptr[g] += ptr[0];
		ptr[0] = 0;
		ptr += m2;
	    } while(ptr[0]);
	}
	LOOP();

    _WHILEIM3:
	if(ptr[0]){
	    const auto a = IP[-6].val;
	    const auto b = IP[-5].val;
	    const auto c = IP[-4].val;
	    const auto d = IP[-3].val;
	    const auto e = IP[-2].val;
	    const auto f = IP[-1].val;
	    do {
		ptr[0] += a;
		ptr += b;
		ptr[0] += c;
		ptr += d;
		ptr[0] += e;
		ptr += f;
	    } while(ptr[0]);
	}
	LOOP();

    _WHILEIM2:
	if(ptr[0]){
	    const auto a = IP[-4].val;
	    const auto b = IP[-3].val;
	    const auto c = IP[-2].val;
	    const auto d = IP[-1].val;
	    do {
		ptr[0] += a;
		ptr += b;
		ptr[0] += c;
		ptr += d;
	    } while(ptr[0]);
	}
	LOOP();

    _OFFINCR:
	ptr[IP[-1].val] += IP->val;
	LOOP();


    _ADVANCE:
	IP += IP->val;
	LOOP();

    _VALUE:
	LOOP();

    _GIVE:
	ptr[IP->val] += (ptr[0] + 256);
	ptr[0] = 0;
	LOOP();

    _TAKE:
	ptr[0] += (ptr[IP->val] + 256);
	ptr[IP->val] = 0;
	LOOP();

    _MOVE:
	ptr += IP->val;
	LOOP();

    _INCR:
	*ptr += IP->val;
	LOOP();

    _MOVEWHILE:
	while(ptr[0]){
	    ptr += IP->val;
	}
	LOOP();

    _ZERO2IF:
	if(ptr[0]){
	    ptr[0] = ptr[1] = 0;
	}
	LOOP();

    _ZEROM1:
	*ptr++ = 0;
	LOOP();

    _M1ZERO:
	*(++ptr) = 0;
	LOOP();

    _ZERO:
	ptr[0] = 0;
	LOOP();


    _PRINT:
#ifndef PROFILER
	std::cout << (*ptr);
#endif
	LOOP();

    _READ:
	std::cin.get(*ptr);
	LOOP();

    _TERMINATE:
	return;

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rsp, %rsi
movl %ecx, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x4e6(%rip), %rcx       # 0x2e9d
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x1, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x5db(%rip), %rcx       # 0x2faf
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x2, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x55d(%rip), %rcx       # 0x2f4e
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x3, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x505(%rip), %rcx       # 0x2f13
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x5, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x592(%rip), %rcx       # 0x2fbd
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x4, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x4ad(%rip), %rcx       # 0x2ef5
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x6, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x484(%rip), %rcx       # 0x2ee9
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x8, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x453(%rip), %rcx       # 0x2ed5
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x7, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x520(%rip), %rcx       # 0x2fbf
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x9, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x4f7(%rip), %rcx       # 0x2fb3
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xa, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x519(%rip), %rcx       # 0x2ff2
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xb, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x42f(%rip), %rcx       # 0x2f25
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xc, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x3a0(%rip), %rcx       # 0x2eb3
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xd, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x36f(%rip), %rcx       # 0x2e9f
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xe, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x3e9(%rip), %rcx       # 0x2f36
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xf, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x507(%rip), %rcx       # 0x3071
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x10, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x2f1(%rip), %rcx       # 0x2e78
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x11, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x2e9(%rip), %rcx       # 0x2e8d
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x12, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x40b(%rip), %rcx       # 0x2fcc
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x13, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x459(%rip), %rcx       # 0x3037
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x14, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x361(%rip), %rcx       # 0x2f5c
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x15, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x3e7(%rip), %rcx       # 0x2fff
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x17, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x2cb(%rip), %rcx       # 0x2f00
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x18, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x27e(%rip), %rcx       # 0x2ed0
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x16, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x3340
leaq 0x2ae(%rip), %rcx       # 0x2f1d
movq %rcx, (%rax)
xorl %r12d, %r12d
leaq 0x3440(%rip), %r13      # 0x60bc
leaq 0x28(%rsp), %r14
leaq 0x24(%rsp), %r15
movl (%r12,%r13), %eax
movl %eax, 0x24(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x33a6
cmpq $0x0, (%rax)
je 0x2d00
addq $0x4, %r12
cmpq $0x64, %r12
jne 0x2c86
movq (%rbx), %r14
movq 0x8(%rbx), %r12
cmpq %r12, %r14
je 0x2cd5
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x340c
movq (%rax), %rax
movq %rax, 0x8(%r14)
addq $0x10, %r14
cmpq %r12, %r14
jne 0x2cba
movl $0x7530, %edi           # imm = 0x7530
callq 0x21a0
movq %rax, %r14
movl $0x7530, %edx           # imm = 0x7530
movq %rax, %rdi
xorl %esi, %esi
callq 0x20e0
movq (%rbx), %r15
leaq 0x8(%r15), %rcx
movq %r14, %rbx
movq %r15, %rax
jmpq *(%rcx)
movl $0x10, %edi
callq 0x20b0
movq %rax, %r14
movl 0x24(%rsp), %esi
leaq 0x58(%rsp), %rdi
callq 0x38e4
leaq 0x337c(%rip), %rsi      # 0x609e
leaq 0x58(%rsp), %rdi
callq 0x2300
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x2d4d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x2d59
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x2260
xorl %ebp, %ebp
movq 0x6249(%rip), %rsi      # 0x8fd0
movq 0x622a(%rip), %rdx      # 0x8fb8
movq %r14, %rdi
callq 0x22d0
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
jmp 0x2e70
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2e19
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e34
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
testb %bpl, %bpl
jne 0x2e61
jmp 0x30a7
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e61
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2e61
movq %rax, %rbx
movq %r14, %rdi
callq 0x2150
jmp 0x30a7
jmp 0x2e70
movq %rax, %rbx
jmp 0x30a7
cmpb $0x0, (%rbx)
je 0x3069
movswq 0x4(%r15), %rax
shlq $0x4, %rax
addq %r15, %rax
leaq 0x10(%rax), %r15
movq %rax, %rcx
addq $0x18, %rcx
movq %r15, %rax
jmpq *(%rcx)
jmp 0x2e81
movq 0x6132(%rip), %rdi      # 0x8fd8
movq %rbx, %rsi
callq 0x2210
movq %r15, %rax
jmp 0x2e8d
movb (%rbx), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq 0x60ff(%rip), %rdi      # 0x8fc0
movl $0x1, %edx
callq 0x21e0
jmp 0x3069
movb $0x0, (%rbx)
jmp 0x2eed
jmp 0x2edf
movswq 0x4(%r15), %rax
addq %rax, %rbx
cmpb $0x0, (%rbx)
jne 0x2ed7
jmp 0x3069
movb $0x0, 0x1(%rbx)
incq %rbx
jmp 0x3069
movb 0x4(%r15), %al
addb %al, (%rbx)
jmp 0x3069
cmpb $0x0, (%rbx)
je 0x3069
movw $0x0, (%rbx)
jmp 0x3069
movb (%rbx), %al
movswq 0x4(%r15), %rcx
addb %al, (%rbx,%rcx)
movb $0x0, (%rbx)
jmp 0x3069
movb 0x4(%r15), %al
movswq -0xc(%r15), %rcx
addb %al, (%rbx,%rcx)
jmp 0x3069
movswq 0x4(%r15), %rax
movb (%rbx,%rax), %al
addb %al, (%rbx)
movswq 0x4(%r15), %rax
movb $0x0, (%rbx,%rax)
jmp 0x3069
cmpb $0x0, (%rbx)
jne 0x3069
jmp 0x2e81
movb (%rbx), %r8b
testb %r8b, %r8b
je 0x3069
movswq -0x4c(%r15), %rax
movb -0x5c(%r15), %cl
movb -0x3c(%r15), %dl
movswq -0x2c(%r15), %rsi
movb -0x1c(%r15), %dil
movswq -0xc(%r15), %r9
leaq (%rax,%rsi), %r10
leaq (%r10,%r9), %r11
addb %cl, %r8b
movb %r8b, (%rbx)
addb %dl, (%rbx,%rax)
addb %dil, (%rbx,%r10)
movb (%rbx,%r11), %r8b
addq %rax, %rbx
addq %rsi, %rbx
addq %r9, %rbx
testb %r8b, %r8b
jne 0x2f8b
jmp 0x3069
decb (%rbx)
jmp 0x2fbf
movswq 0x4(%r15), %rax
decb (%rbx,%rax)
jmp 0x2ffa
incb (%rbx)
movswq 0x4(%r15), %rax
addq %rax, %rbx
jmp 0x3069
movb (%rbx), %al
testb %al, %al
je 0x3069
movswq -0x1c(%r15), %rcx
movswq -0xc(%r15), %rdx
decb %al
movb %al, (%rbx)
incb (%rbx,%rcx)
incb (%rbx,%rdx)
movb (%rbx), %al
testb %al, %al
jne 0x2fe0
jmp 0x3069
movswq 0x4(%r15), %rax
incb (%rbx,%rax)
addq %rax, %rbx
jmp 0x3069
cmpb $0x0, (%rbx)
je 0x3069
movswq -0x1c(%r15), %rax
movswq -0xc(%r15), %rcx
movswq 0x4(%r15), %rdx
leaq (%rax,%rdx), %rsi
addq %rax, %rcx
movq %rbx, %rdi
addq %rax, %rbx
movb (%rdi,%rax), %r8b
addb %r8b, (%rdi,%rcx)
movb $0x0, (%rdi,%rax)
addq %rdx, %rbx
cmpb $0x0, (%rdi,%rsi)
jne 0x301a
jmp 0x3069
movb (%rbx), %dl
testb %dl, %dl
je 0x3069
movswq -0x2c(%r15), %rax
movb -0x3c(%r15), %cl
movb -0x1c(%r15), %sil
movswq -0xc(%r15), %rdi
leaq (%rax,%rdi), %r8
addb %cl, %dl
movb %dl, (%rbx)
addb %sil, (%rbx,%rax)
movb (%rbx,%r8), %dl
addq %rax, %rbx
addq %rdi, %rbx
testb %dl, %dl
jne 0x3053
movq %r15, %rax
jmp 0x2e8d
movl $0x7530, %esi           # imm = 0x7530
movq %r14, %rdi
callq 0x21b0
leaq 0x28(%rsp), %rdi
callq 0x36fc
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x7530, %esi           # imm = 0x7530
movq %r14, %rdi
callq 0x21b0
leaq 0x28(%rsp), %rdi
callq 0x36fc
movq %rbx, %rdi
callq 0x22e0