// File: /workspace/github_cpp_makefile_star2_O2/JohnCGriffin[P]BrainForked/bf_io.cpp
// Function: bf::read_instructions(std::istream&)
Instructions read_instructions(std::istream& is)
    {
	static std::map<char,int> direction = {{'>', 1}, {'<', -1}, {'+', 1}, {'-', -1}};
	static std::map<char,Action>
	    charActions = {{ '>', MOVE },
			   { '<', MOVE },
			   { '+', INCR },
			   { '-', INCR },
			   { '[', FALSEJUMP },
			   { ']', TRUEJUMP },
			   { '.', PRINT },
			   { ',', READ }};

	Instructions instructions;
	char c;

	while(is >> c){
	    switch(c){
	    case '<':
	    case '>':
	    case '+':
	    case '-':
		{
		    int increment = direction.at(c);
		    Action action = charActions.at(c);
		    if(instructions.empty() || instructions.back().action != action){
			instructions.push_back({ action });
		    }
		    instructions.back().val += increment;
		}
		break;
	    case '.':
	    case ',':
	    case '[':
	    case ']':
		instructions.push_back({ charActions.at(c) });
		break;
	    }
	}

	return instructions;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb 0x58fa(%rip), %al       # 0x91d0
testb %al, %al
je 0x39ea
movb 0x5924(%rip), %al       # 0x9208
testb %al, %al
je 0x3a5c
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0xe(%rsp), %r15
leaq 0x58d5(%rip), %r13      # 0x91d8
leaq 0x2982(%rip), %r12      # 0x628c
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x39d8
movzbl 0xe(%rsp), %eax
leal -0x2b(%rax), %ecx
cmpl $0x3, %ecx
jbe 0x394a
cmpl $0x3c, %eax
je 0x3953
cmpl $0x3e, %eax
je 0x3953
cmpl $0x5b, %eax
je 0x39a9
cmpl $0x5d, %eax
jne 0x390a
jmp 0x39a9
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x5846(%rip), %rdi      # 0x91a0
movq %r15, %rsi
callq 0x3bb4
movl (%rax), %ebp
movq %r13, %rdi
movq %r15, %rsi
callq 0x3bec
movl (%rax), %ecx
movq 0x8(%rbx), %rax
cmpq %rax, (%rbx)
je 0x397f
cmpl %ecx, -0x10(%rax)
je 0x39a0
movl %ecx, 0x10(%rsp)
andw $0x0, 0x14(%rsp)
andq $0x0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30ba
movq 0x8(%rbx), %rax
addw %bp, -0xc(%rax)
jmp 0x390a
movq %r13, %rdi
movq %r15, %rsi
callq 0x3bec
movl (%rax), %eax
movl %eax, 0x10(%rsp)
andw $0x0, 0x14(%rsp)
andq $0x0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30ba
jmp 0x390a
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57df(%rip), %rdi      # 0x91d0
callq 0x22d0
testl %eax, %eax
je 0x38de
movups 0x28e7(%rip), %xmm0     # 0x62ec
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0x28c7(%rip), %xmm0     # 0x62dc
movaps %xmm0, (%rsi)
leaq 0x5781(%rip), %rdi      # 0x91a0
pushq $0x4
popq %rdx
leaq 0xe(%rsp), %rcx
leaq 0xf(%rsp), %r8
callq 0x3b1c
leaq 0x12a(%rip), %rdi       # 0x3b62
leaq 0x5761(%rip), %rsi      # 0x91a0
leaq 0x573a(%rip), %rdx      # 0x9180
callq 0x2150
leaq 0x577e(%rip), %rdi      # 0x91d0
callq 0x2100
jmp 0x38de
leaq 0x57a5(%rip), %rdi      # 0x9208
callq 0x22d0
testl %eax, %eax
je 0x38ec
movups 0x2855(%rip), %xmm0     # 0x62cc
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x30(%rsi)
movups 0x2835(%rip), %xmm0     # 0x62bc
movaps %xmm0, 0x20(%rsi)
movups 0x281a(%rip), %xmm0     # 0x62ac
movaps %xmm0, 0x10(%rsi)
movups 0x27ff(%rip), %xmm0     # 0x629c
movaps %xmm0, (%rsi)
leaq 0x5731(%rip), %rdi      # 0x91d8
pushq $0x8
popq %rdx
leaq 0xe(%rsp), %rcx
leaq 0xf(%rsp), %r8
callq 0x3b68
leaq 0xee(%rip), %rdi        # 0x3bae
leaq 0x5711(%rip), %rsi      # 0x91d8
leaq 0x56b2(%rip), %rdx      # 0x9180
callq 0x2150
leaq 0x572e(%rip), %rdi      # 0x9208
callq 0x2100
jmp 0x38ec
movq %rax, %r14
leaq 0x571a(%rip), %rdi      # 0x9208
jmp 0x3afa
movq %rax, %r14
leaq 0x56d6(%rip), %rdi      # 0x91d0
callq 0x20f0
jmp 0x3b14
jmp 0x3b09
jmp 0x3b09
jmp 0x3b09
jmp 0x3b09
movq %rax, %r14
movq %rbx, %rdi
callq 0x37c8
movq %r14, %rdi
callq 0x22c0