// File: /workspace/github_cpp_makefile_star2_O1/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 0x32cc
leaq 0x4b4(%rip), %rcx       # 0x2e35
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x1, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x5a3(%rip), %rcx       # 0x2f41
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x2, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x52b(%rip), %rcx       # 0x2ee6
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x3, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x4d3(%rip), %rcx       # 0x2eab
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x5, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x55a(%rip), %rcx       # 0x2f4f
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x4, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x47b(%rip), %rcx       # 0x2e8d
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x6, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x452(%rip), %rcx       # 0x2e81
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x8, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x421(%rip), %rcx       # 0x2e6d
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x7, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x4e8(%rip), %rcx       # 0x2f51
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x9, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x4bf(%rip), %rcx       # 0x2f45
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xa, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x4dd(%rip), %rcx       # 0x2f80
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xb, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x3fd(%rip), %rcx       # 0x2ebd
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xc, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x36e(%rip), %rcx       # 0x2e4b
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xd, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x33d(%rip), %rcx       # 0x2e37
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xe, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x3b7(%rip), %rcx       # 0x2ece
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0xf, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x4c9(%rip), %rcx       # 0x2ffd
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x10, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x2bf(%rip), %rcx       # 0x2e10
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x11, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x2b7(%rip), %rcx       # 0x2e25
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x12, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x3d3(%rip), %rcx       # 0x2f5e
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x13, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x41d(%rip), %rcx       # 0x2fc5
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x14, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x32f(%rip), %rcx       # 0x2ef4
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x15, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x3ab(%rip), %rcx       # 0x2f8d
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x17, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x299(%rip), %rcx       # 0x2e98
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x18, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x24c(%rip), %rcx       # 0x2e68
movq %rcx, (%rax)
movq %rsp, %rsi
movl $0x16, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x32cc
leaq 0x27c(%rip), %rcx       # 0x2eb5
movq %rcx, (%rax)
xorl %r12d, %r12d
leaq 0x345a(%rip), %r13      # 0x60a0
leaq 0x28(%rsp), %r14
leaq 0x24(%rsp), %r15
movl (%r12,%r13), %eax
movl %eax, 0x24(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3330
cmpq $0x0, (%rax)
je 0x2cca
addq $0x4, %r12
cmpq $0x64, %r12
jne 0x2c50
movq (%rbx), %r14
movq 0x8(%rbx), %r12
cmpq %r12, %r14
je 0x2c9f
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3394
movq (%rax), %rax
movq %rax, 0x8(%r14)
addq $0x10, %r14
cmpq %r12, %r14
jne 0x2c84
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 0x3874
leaq 0x3396(%rip), %rsi      # 0x6082
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 0x2d17
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x2d23
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 0x627f(%rip), %rsi      # 0x8fd0
movq 0x6260(%rip), %rdx      # 0x8fb8
movq %r14, %rdi
callq 0x22d0
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
jmp 0x2e08
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2dcd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2dcd
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2df0
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2df0
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3033
movq %r14, %rdi
callq 0x2150
jmp 0x3033
jmp 0x2e08
movq %rax, %rbx
jmp 0x3033
cmpb $0x0, (%rbx)
je 0x2ff5
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 0x2e19
movq 0x619a(%rip), %rdi      # 0x8fd8
movq %rbx, %rsi
callq 0x2210
movq %r15, %rax
jmp 0x2e25
movb (%rbx), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq 0x6167(%rip), %rdi      # 0x8fc0
movl $0x1, %edx
callq 0x21e0
jmp 0x2ff5
movb $0x0, (%rbx)
jmp 0x2e85
jmp 0x2e77
movswq 0x4(%r15), %rax
addq %rax, %rbx
cmpb $0x0, (%rbx)
jne 0x2e6f
jmp 0x2ff5
movb $0x0, 0x1(%rbx)
incq %rbx
jmp 0x2ff5
movb 0x4(%r15), %al
addb %al, (%rbx)
jmp 0x2ff5
cmpb $0x0, (%rbx)
je 0x2ff5
movw $0x0, (%rbx)
jmp 0x2ff5
movb (%rbx), %al
movswq 0x4(%r15), %rcx
addb %al, (%rbx,%rcx)
movb $0x0, (%rbx)
jmp 0x2ff5
movb 0x4(%r15), %al
movswq -0xc(%r15), %rcx
addb %al, (%rbx,%rcx)
jmp 0x2ff5
movswq 0x4(%r15), %rax
movb (%rbx,%rax), %al
addb %al, (%rbx)
movswq 0x4(%r15), %rax
movb $0x0, (%rbx,%rax)
jmp 0x2ff5
cmpb $0x0, (%rbx)
jne 0x2ff5
jmp 0x2e19
cmpb $0x0, (%rbx)
je 0x2ff5
movswq -0x4c(%r15), %rax
movb -0x5c(%r15), %cl
movb -0x3c(%r15), %dl
movswq -0x2c(%r15), %rsi
movb -0x1c(%r15), %dil
movswq -0xc(%r15), %r8
leaq (%rax,%rsi), %r9
leaq (%r9,%r8), %r10
movq %rbx, %r11
addb %cl, (%rbx)
addb %dl, (%rbx,%rax)
addq %rax, %rbx
addb %dil, (%r11,%r9)
addq %rsi, %rbx
addq %r8, %rbx
cmpb $0x0, (%r11,%r10)
jne 0x2f20
jmp 0x2ff5
decb (%rbx)
jmp 0x2f51
movswq 0x4(%r15), %rax
decb (%rbx,%rax)
jmp 0x2f88
incb (%rbx)
movswq 0x4(%r15), %rax
addq %rax, %rbx
jmp 0x2ff5
cmpb $0x0, (%rbx)
je 0x2ff5
movswq -0x1c(%r15), %rax
movswq -0xc(%r15), %rcx
decb (%rbx)
incb (%rbx,%rax)
incb (%rbx,%rcx)
cmpb $0x0, (%rbx)
jne 0x2f71
jmp 0x2ff5
movswq 0x4(%r15), %rax
incb (%rbx,%rax)
addq %rax, %rbx
jmp 0x2ff5
cmpb $0x0, (%rbx)
je 0x2ff5
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 0x2fa8
jmp 0x2ff5
cmpb $0x0, (%rbx)
je 0x2ff5
movswq -0x2c(%r15), %rax
movb -0x3c(%r15), %cl
movb -0x1c(%r15), %dl
movswq -0xc(%r15), %rsi
leaq (%rax,%rsi), %rdi
movq %rbx, %r8
addb %cl, (%rbx)
addb %dl, (%rbx,%rax)
addq %rax, %rbx
addq %rsi, %rbx
cmpb $0x0, (%r8,%rdi)
jne 0x2fe0
movq %r15, %rax
jmp 0x2e25
movl $0x7530, %esi           # imm = 0x7530
movq %r14, %rdi
callq 0x21b0
leaq 0x28(%rsp), %rdi
callq 0x368c
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 0x368c
movq %rbx, %rdi
callq 0x22e0