// File: /workspace/github_cpp_makefile_star2_O1/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 0x58c2(%rip), %al       # 0x91e0
testb %al, %al
je 0x3a81
movb 0x58ec(%rip), %al       # 0x9218
testb %al, %al
je 0x3af5
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0xe(%rsp), %r15
leaq 0x290a(%rip), %rbp      # 0x6258
leaq 0x5893(%rip), %r13      # 0x91e8
movq %r14, %rdi
movq %r15, %rsi
callq 0x21f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3a6f
movzbl 0xe(%rsp), %eax
cmpl $0x3b, %eax
jg 0x398e
addl $-0x2b, %eax
cmpl $0x3, %eax
ja 0x3955
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
cmpl $0x5a, %eax
jg 0x39f7
cmpl $0x3c, %eax
je 0x399d
cmpl $0x3e, %eax
jne 0x3955
leaq 0x580c(%rip), %rdi      # 0x91b0
movq %r15, %rsi
callq 0x3cd4
movl (%rax), %r12d
movq %r13, %rdi
movq %r15, %rsi
callq 0x3d20
movl (%rax), %eax
movq 0x8(%rbx), %rsi
cmpq %rsi, (%rbx)
je 0x39ce
cmpl %eax, -0x10(%rsi)
je 0x3a61
movl %eax, 0x10(%rsp)
movw $0x0, 0x14(%rsp)
movq $0x0, 0x18(%rsp)
cmpq 0x10(%rbx), %rsi
je 0x3a54
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x3a61
cmpl $0x5b, %eax
je 0x3a05
cmpl $0x5d, %eax
jne 0x3955
movq %r13, %rdi
movq %r15, %rsi
callq 0x3d20
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movw $0x0, 0x14(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x3a42
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x3955
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0x318c
jmp 0x3955
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0x318c
movq 0x8(%rbx), %rax
addw %r12w, -0xc(%rax)
jmp 0x3955
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5758(%rip), %rdi      # 0x91e0
callq 0x22f0
testl %eax, %eax
je 0x3926
movups 0x281c(%rip), %xmm0     # 0x62b8
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0x27fc(%rip), %xmm0     # 0x62a8
movaps %xmm0, (%rsi)
leaq 0x56fa(%rip), %rdi      # 0x91b0
leaq 0xe(%rsp), %rcx
leaq 0xf(%rsp), %r8
movl $0x4, %edx
callq 0x3bc4
leaq 0x175(%rip), %rdi       # 0x3c46
leaq 0x56d8(%rip), %rsi      # 0x91b0
leaq 0x56b1(%rip), %rdx      # 0x9190
callq 0x2170
leaq 0x56f5(%rip), %rdi      # 0x91e0
callq 0x2110
jmp 0x3926
leaq 0x571c(%rip), %rdi      # 0x9218
callq 0x22f0
testl %eax, %eax
je 0x3934
movups 0x2788(%rip), %xmm0     # 0x6298
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x30(%rsi)
movups 0x2768(%rip), %xmm0     # 0x6288
movaps %xmm0, 0x20(%rsi)
movups 0x274d(%rip), %xmm0     # 0x6278
movaps %xmm0, 0x10(%rsi)
movups 0x2732(%rip), %xmm0     # 0x6268
movaps %xmm0, (%rsi)
leaq 0x56a8(%rip), %rdi      # 0x91e8
leaq 0xe(%rsp), %rcx
leaq 0xf(%rsp), %r8
movl $0x8, %edx
callq 0x3c4c
leaq 0x173(%rip), %rdi       # 0x3cce
leaq 0x5686(%rip), %rsi      # 0x91e8
leaq 0x5627(%rip), %rdx      # 0x9190
callq 0x2170
leaq 0x56a3(%rip), %rdi      # 0x9218
callq 0x2110
jmp 0x3934
movq %rax, %r14
leaq 0x568f(%rip), %rdi      # 0x9218
jmp 0x3b95
movq %rax, %r14
leaq 0x564b(%rip), %rdi      # 0x91e0
callq 0x2100
jmp 0x3bbb
jmp 0x3ba4
jmp 0x3ba4
jmp 0x3ba4
jmp 0x3ba4
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3bbb
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x22e0
nop