// File: /workspace/github_cpp_makefile_star2_O1/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 0x44b7(%rip), %rsi      # 0x84ca
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x4166
leaq 0x44bd(%rip), %rsi      # 0x84e7
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x41cc
leaq 0x44b0(%rip), %rsi      # 0x84f1
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x4217
leaq 0x44a2(%rip), %rsi      # 0x84fa
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x41ec
leaq 0x448f(%rip), %rsi      # 0x84fe
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x41ec
leaq 0x448b(%rip), %rsi      # 0x8511
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x4299
leaq 0x447a(%rip), %rsi      # 0x8517
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x42ec
leaq 0x4479(%rip), %rsi      # 0x852d
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x431f
leaq 0x4406(%rip), %rsi      # 0x84d1
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x4352
leaq 0x43f4(%rip), %rsi      # 0x84d6
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x43a5
leaq 0x43e2(%rip), %rsi      # 0x84db
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x43e7
leaq 0x43d1(%rip), %rsi      # 0x84e1
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
jne 0x445c
leaq 0x440d(%rip), %rsi      # 0x8534
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x415d
leaq 0x43ff(%rip), %rsi      # 0x8539
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x415d
leaq 0x43f1(%rip), %rsi      # 0x853e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4429
orb $0x8, 0x11(%rbx)
jmp 0x428f
leaq 0x4364(%rip), %rsi      # 0x84d1
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x428b
leaq 0x4352(%rip), %rsi      # 0x84d6
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4256
leaq 0x4340(%rip), %rsi      # 0x84db
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4283
leaq 0x432f(%rip), %rsi      # 0x84e1
movq %r14, %rdi
callq 0x2050
movl $0x1, %ecx
testl %eax, %eax
je 0x4288
jmp 0x4429
leaq 0x4319(%rip), %rsi      # 0x84ec
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x443b
orb $0x2, 0x10(%rbx)
jmp 0x428f
leaq 0x4313(%rip), %rsi      # 0x8506
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x425d
leaq 0x4305(%rip), %rsi      # 0x850b
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4261
jmp 0x4429
movq (%r14), %rdi
leaq 0x42d6(%rip), %rsi      # 0x84f7
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x2120
cmpl $0x1, %eax
jne 0x4429
movl 0xc(%rsp), %eax
cmpl $0x10, %eax
jae 0x4429
movl $0xf0, %ecx
andl 0xc(%rbx), %ecx
orl %eax, %ecx
movl %ecx, 0xc(%rbx)
orb $0x4, 0x10(%rbx)
jmp 0x428f
movl $0x3, %ecx
jmp 0x4288
orb $0x4, 0xc(%rbx)
leaq 0x4292(%rip), %rsi      # 0x84fa
movq %r15, %rdi
callq 0x2050
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal 0x8(,%rcx,8), %eax
orl %eax, 0x10(%rbx)
jmp 0x428f
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 0x4254(%rip), %rsi      # 0x84f7
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x2120
cmpl $0x1, %eax
jne 0x4429
movl 0x8(%rsp), %eax
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
jae 0x4429
leal -0x8(,%rax,8), %eax
movd %eax, %xmm0
movsd 0xc(%rbx), %xmm1
movaps 0x40a1(%rip), %xmm2     # 0x8380
movss %xmm0, %xmm2            # xmm2 = xmm0[0],xmm2[1,2,3]
orps %xmm1, %xmm2
movlps %xmm2, 0xc(%rbx)
jmp 0x428f
leaq 0x4229(%rip), %rsi      # 0x851c
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4398
leaq 0x421b(%rip), %rsi      # 0x8525
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x439c
jmp 0x4429
leaq 0x41e0(%rip), %rsi      # 0x8506
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4349
leaq 0x41d2(%rip), %rsi      # 0x850b
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4429
orb $-0x80, 0x10(%rbx)
jmp 0x428f
leaq 0x41db(%rip), %rsi      # 0x8534
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x438f
leaq 0x41cd(%rip), %rsi      # 0x8539
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x438f
leaq 0x41bf(%rip), %rsi      # 0x853e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4429
orb $0x1, 0x11(%rbx)
jmp 0x428f
orb $0x8, 0xc(%rbx)
orb $0x40, 0x10(%rbx)
jmp 0x428f
leaq 0x4188(%rip), %rsi      # 0x8534
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x43de
leaq 0x417a(%rip), %rsi      # 0x8539
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x43de
leaq 0x416c(%rip), %rsi      # 0x853e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4429
orb $0x2, 0x11(%rbx)
jmp 0x428f
leaq 0x4146(%rip), %rsi      # 0x8534
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4420
leaq 0x4138(%rip), %rsi      # 0x8539
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x4420
leaq 0x412a(%rip), %rsi      # 0x853e
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
jne 0x4429
orb $0x4, 0x11(%rbx)
jmp 0x428f
movl $0x4, %edi
callq 0x20a0
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
jmp 0x444b
movl $0x4, %edi
callq 0x20a0
movl $0xfffffff7, (%rax)     # imm = 0xFFFFFFF7
movq 0x7b76(%rip), %rsi      # 0xbfc8
movq %rax, %rdi
xorl %edx, %edx
callq 0x2210
movq %r15, %rdi
callq 0x2382