// File: /workspace/github_cpp_makefile_star2_O3/kipa00[P]AplusB-mc/compiler/chunk.cpp
// Function: chunk::feed(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void chunk::feed(string attr, string val) {
	if (attr == "facing") {
		if (val == "east") {
			this->block |= EAST;
		} else if (val == "west") {
			this->block |= WEST;
		} else if (val == "south") {
			this->block |= SOUTH;
		} else if (val == "north") {
			this->block |= NORTH;
		} else {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_FACING;
	} else if (attr == "face") {
		if (val != "wall") {
			throw NOT_SUPPORTED_LEVER;
		}
		this->attr |= ATTR_FACE;
	} else if (attr == "power") {
		int power;
		if (sscanf(val.c_str(), "%d", &power) != 1 || !(0 <= power && power <= 15)) {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		(this->block &= 240) |= power;
		this->attr |= ATTR_POWER;
	} else if (attr == "lit" || attr == "powered") {
		if (val == "true") {
			this->block |= POWERED;
		} else if (val != "false") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= attr == "lit" ? ATTR_LIT : ATTR_POWERED;
	} else if (attr == "delay") {
		int delay;
		if (sscanf(val.c_str(), "%d", &delay) != 1 || !(1 <= delay && delay <= 4)) {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->block |= (delay - 1) << 3;
		this->attr |= ATTR_DELAY;
	} else if (attr == "mode") {
		if (val == "subtract") {
			this->block |= SUBTRACT;
		} else if (val != "compare") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_MODE;
	} else if (attr == "locked") {
		if (val != "true" && val != "false") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_LOCKED;
	} else if (attr == "east") {
		if (val != "none" && val != "side" && val != "up") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_EAST;
	} else if (attr == "west") {
		if (val != "none" && val != "side" && val != "up") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_WEST;
	} else if (attr == "south") {
		if (val != "none" && val != "side" && val != "up") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_SOUTH;
	} else if (attr == "north") {
		if (val != "none" && val != "side" && val != "up") {
			throw ATTR_VALUE_MISMATCH_ERROR;
		}
		this->attr |= ATTR_NORTH;
	} else {
		fprintf(stderr, "Error: unknown attribute name '%s'\n", attr.c_str());
		throw UNKNOWN_ATTR_ERROR;
	}
#ifdef CHUNK_DEBUG
	printf("    %s : %s\n", attr.c_str(), val.c_str());
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4557(%rip), %rsi      # 0x84ba
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x40b6
leaq 0x455d(%rip), %rsi      # 0x84d7
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x411c
leaq 0x4550(%rip), %rsi      # 0x84e1
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x4167
leaq 0x4542(%rip), %rsi      # 0x84ea
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x413c
leaq 0x452f(%rip), %rsi      # 0x84ee
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x413c
leaq 0x452b(%rip), %rsi      # 0x8501
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x41e9
leaq 0x451a(%rip), %rsi      # 0x8507
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x423c
leaq 0x4519(%rip), %rsi      # 0x851d
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x426f
leaq 0x44a6(%rip), %rsi      # 0x84c1
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x42a2
leaq 0x4494(%rip), %rsi      # 0x84c6
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x42f5
leaq 0x4482(%rip), %rsi      # 0x84cb
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x4337
leaq 0x4471(%rip), %rsi      # 0x84d1
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
jne 0x43ac
leaq 0x44ad(%rip), %rsi      # 0x8524
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x40ad
leaq 0x449f(%rip), %rsi      # 0x8529
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x40ad
leaq 0x4491(%rip), %rsi      # 0x852e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4379
orb $0x8, 0x11(%rbx)
jmp 0x41df
leaq 0x4404(%rip), %rsi      # 0x84c1
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x41db
leaq 0x43f2(%rip), %rsi      # 0x84c6
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x41a6
leaq 0x43e0(%rip), %rsi      # 0x84cb
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x41d3
leaq 0x43cf(%rip), %rsi      # 0x84d1
movq %r14, %rdi
callq 0x2050
movl $0x1, %ecx
testl %eax, %eax
je 0x41d8
jmp 0x4379
leaq 0x43b9(%rip), %rsi      # 0x84dc
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x438b
orb $0x2, 0x10(%rbx)
jmp 0x41df
leaq 0x43b3(%rip), %rsi      # 0x84f6
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x41ad
leaq 0x43a5(%rip), %rsi      # 0x84fb
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x41b1
jmp 0x4379
movq (%r14), %rdi
leaq 0x4376(%rip), %rsi      # 0x84e7
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x2120
cmpl $0x1, %eax
jne 0x4379
movl 0xc(%rsp), %eax
cmpl $0x10, %eax
jae 0x4379
movl $0xf0, %ecx
andl 0xc(%rbx), %ecx
orl %eax, %ecx
movl %ecx, 0xc(%rbx)
orb $0x4, 0x10(%rbx)
jmp 0x41df
movl $0x3, %ecx
jmp 0x41d8
orb $0x4, 0xc(%rbx)
leaq 0x4332(%rip), %rsi      # 0x84ea
movq %r15, %rdi
callq 0x2050
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal 0x8(,%rcx,8), %eax
orl %eax, 0x10(%rbx)
jmp 0x41df
movl $0x2, %ecx
orl %ecx, 0xc(%rbx)
orb $0x1, 0x10(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
leaq 0x42f4(%rip), %rsi      # 0x84e7
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x2120
cmpl $0x1, %eax
jne 0x4379
movl 0x8(%rsp), %eax
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
jae 0x4379
leal -0x8(,%rax,8), %eax
movd %eax, %xmm0
movsd 0xc(%rbx), %xmm1
movaps 0x4141(%rip), %xmm2     # 0x8370
movss %xmm0, %xmm2            # xmm2 = xmm0[0],xmm2[1,2,3]
orps %xmm1, %xmm2
movlps %xmm2, 0xc(%rbx)
jmp 0x41df
leaq 0x42c9(%rip), %rsi      # 0x850c
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x42e8
leaq 0x42bb(%rip), %rsi      # 0x8515
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x42ec
jmp 0x4379
leaq 0x4280(%rip), %rsi      # 0x84f6
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4299
leaq 0x4272(%rip), %rsi      # 0x84fb
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4379
orb $-0x80, 0x10(%rbx)
jmp 0x41df
leaq 0x427b(%rip), %rsi      # 0x8524
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x42df
leaq 0x426d(%rip), %rsi      # 0x8529
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x42df
leaq 0x425f(%rip), %rsi      # 0x852e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4379
orb $0x1, 0x11(%rbx)
jmp 0x41df
orb $0x8, 0xc(%rbx)
orb $0x40, 0x10(%rbx)
jmp 0x41df
leaq 0x4228(%rip), %rsi      # 0x8524
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x432e
leaq 0x421a(%rip), %rsi      # 0x8529
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x432e
leaq 0x420c(%rip), %rsi      # 0x852e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4379
orb $0x2, 0x11(%rbx)
jmp 0x41df
leaq 0x41e6(%rip), %rsi      # 0x8524
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4370
leaq 0x41d8(%rip), %rsi      # 0x8529
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4370
leaq 0x41ca(%rip), %rsi      # 0x852e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4379
orb $0x4, 0x11(%rbx)
jmp 0x41df
movl $0x4, %edi
callq 0x20a0
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
jmp 0x439b
movl $0x4, %edi
callq 0x20a0
movl $0xfffffff7, (%rax)     # imm = 0xFFFFFFF7
movq 0x7c26(%rip), %rsi      # 0xbfc8
movq %rax, %rdi
xorl %edx, %edx
callq 0x2210
movq %r15, %rdi
callq 0x236f