// File: DoubleString[P]RtConverter/src/RtConverter/RtConverter.cpp
// Function: bamboo::RtConverter::inputObs(bamboo::RtConvItem&)
int RtConverter::inputObs(RtConvItem& item) {
	def_lock(&_mutex);
	if (obsqueue.empty()) {
		obsqueue.push_back(item);
		def_unlock(&_mutex);
		return 1;
	}
	RtConvItem& front = this->obsqueue.front();
	RtConvItem& end = this->obsqueue.back();
	if (item.curt.time < front.curt.time) {
		def_unlock(&_mutex);
		return 0;
	}
	if (item.curt.time > end.curt.time) {
		this->obsqueue.push_back(item);
		def_unlock(&_mutex);
		return 1;
	}
	list<RtConvItem>::iterator itrlist;
	for (itrlist = obsqueue.begin(); itrlist != obsqueue.end(); ++itrlist) {
		if (item.curt.time <= (*itrlist).curt.time)
			break;
	}
	if ((*itrlist).curt.time != item.curt.time) {
		obsqueue.insert(itrlist, item);
		def_unlock(&_mutex);
		return 1;
	}
	/// queue already exist the same time,will add into the memory
	std::map<std::string, std::map<std::string, RtSatObs> >::iterator itr, obitr_in = item.obslist.begin();
	std::map<std::string, std::map<std::string, RtSatObs> >::iterator obitr_mem = (*itrlist).obslist.begin();
	while (obitr_in != item.obslist.end()) {
		itr = (*itrlist).obslist.find((*obitr_in).first);
		if (itr != (*itrlist).obslist.end()) {
			++obitr_in;
			continue;
		}
		(*itrlist).obslist[(*obitr_in).first] = (*obitr_in).second;
		++obitr_in;
	}
	def_unlock(&_mutex);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x88(%rbp)
addq $0xa0f40, %rdi          # imm = 0xA0F40
callq 0x9ad0
movq -0x88(%rbp), %rdi
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
callq 0x54120
testb $0x1, %al
jne 0x51b63
jmp 0x51b99
movq -0x88(%rbp), %rdi
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
movq -0x18(%rbp), %rsi
callq 0x54140
movq -0x88(%rbp), %rdi
addq $0xa0f40, %rdi          # imm = 0xA0F40
callq 0x95a0
movl $0x1, -0x4(%rbp)
jmp 0x51e7b
movq -0x88(%rbp), %rdi
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
callq 0x54180
movq -0x88(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
callq 0x541b0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x51bf8
movq -0x88(%rbp), %rdi
addq $0xa0f40, %rdi          # imm = 0xA0F40
callq 0x95a0
movl $0x0, -0x4(%rbp)
jmp 0x51e7b
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jle 0x51c40
movq -0x88(%rbp), %rdi
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
movq -0x18(%rbp), %rsi
callq 0x54140
movq -0x88(%rbp), %rdi
addq $0xa0f40, %rdi          # imm = 0xA0F40
callq 0x95a0
movl $0x1, -0x4(%rbp)
jmp 0x51e7b
leaq -0x30(%rbp), %rdi
callq 0x541f0
movq -0x88(%rbp), %rdi
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
callq 0x54210
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x88(%rbp), %rdi
addq $0xa0ec8, %rdi          # imm = 0xA0EC8
callq 0x54270
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x54240
testb $0x1, %al
jne 0x51c92
jmp 0x51cc9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x542a0
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq 0x8(%rcx), %rax
jg 0x51cbc
jmp 0x51cc9
jmp 0x51cbe
leaq -0x30(%rbp), %rdi
callq 0x542c0
jmp 0x51c68
leaq -0x30(%rbp), %rdi
callq 0x542a0
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x51d38
movq -0x88(%rbp), %rax
addq $0xa0ec8, %rax          # imm = 0xA0EC8
movq %rax, -0x98(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x54350
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x48(%rbp), %rsi
callq 0x542e0
movq -0x88(%rbp), %rdi
movq %rax, -0x50(%rbp)
addq $0xa0f40, %rdi          # imm = 0xA0F40
callq 0x95a0
movl $0x1, -0x4(%rbp)
jmp 0x51e7b
leaq -0x58(%rbp), %rdi
callq 0x54370
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x54390
movq %rax, -0x60(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x542a0
movq %rax, %rdi
addq $0x18, %rdi
callq 0x54390
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x4c010
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x543c0
testb $0x1, %al
jne 0x51d92
jmp 0x51e61
leaq -0x30(%rbp), %rdi
callq 0x542a0
addq $0x18, %rax
movq %rax, -0xa0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4c060
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x543f0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x542a0
movq %rax, %rdi
addq $0x18, %rdi
callq 0x4c010
movq %rax, -0x80(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x543c0
testb $0x1, %al
jne 0x51df6
jmp 0x51e04
leaq -0x60(%rbp), %rdi
callq 0x4cc90
jmp 0x51d6b
leaq -0x60(%rbp), %rdi
callq 0x4c060
addq $0x20, %rax
movq %rax, -0xa8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x542a0
addq $0x18, %rax
movq %rax, -0xb0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4c060
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x459c0
movq -0xa8(%rbp), %rsi
movq %rax, %rdi
callq 0x45aa0
leaq -0x60(%rbp), %rdi
callq 0x4cc90
jmp 0x51d6b
movq -0x88(%rbp), %rdi
addq $0xa0f40, %rdi          # imm = 0xA0F40
callq 0x95a0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)