// File: sopanpatra160[P]OOO_Superscalar_Processor_Simulator/cache.cc
// Function: cache::write(unsigned int)
unsigned int cache::write(unsigned int addr){

	unsigned int addr_ev;
	num_w++;
	calc_tag_ind(addr);
		
	if(lev == 1){
		//#1 check for the element in all the blocks of that set	
		for (unsigned int j=0; j<a; j++){
			if((tag_store[ind][j]==tag) && (valid_store[ind][j]==1)){
				if(rp==2)
					lru_update(ind,j);
				else if(rp==3) 
					lfu_update_block(ind,j,1);
				if(wp==0){
					dirty_store[ind][j]=1;
				}
				return 1;
			}
		}
		if(vptr != NULL){
			unsigned int tag_vc = vptr->calc_tag(addr);
			unsigned int found_loc;
			unsigned int found_vc = 0;
			for (unsigned int j=0; j<vptr->a; j++){
				
				if((vptr->tag_store[0][j]==tag_vc) && (vptr->valid_store[0][j]==1)){
					found_vc = 1;
					found_loc = j;
				}
			}
			if(found_vc==1){
				num_swap++;
				swap(found_loc,1);
				return 1;
			}
		}

		num_miss_w++;
		
		//#2 MISS in L1 but invalid case
		for (unsigned int j=0; j<a; j++){
			if(valid_store[ind][j]==0){
				if(next!=NULL)
					next->read(addr);
				tag_store[ind][j]=tag;
				valid_store[ind][j]=1;
				dirty_store[ind][j]=1;
				if(rp==2)
					lru_update(ind,j);
				else 
					lfu_update_block(ind,j,0);
				return 0;
			}
		}
		
		//#3 MISS IN L1 FOR ALL BITS VALID : EVICTION
		//LRU
		if(rp==2){
			ev_blk= lru_block2evict(ind);
		}
		//LFU policy
		else if(rp==3){
			ev_blk= lfu_block2evict(ind);
		}


		if(vptr != NULL){
			addr_ev = ev_blk_addr(ind,tag_store[ind][ev_blk]);
			vptr->insert_vc(addr_ev,dirty_store[ind][ev_blk]);
			if(next!=NULL)
				next->read(addr);
			tag_store[ind][ev_blk]=tag;
			dirty_store[ind][ev_blk]=1;
			

		}
		else if(vptr == NULL){
			if(dirty_store[ind][ev_blk]==0){
				if(next!=NULL)
					next->read(addr);
				tag_store[ind][ev_blk]=tag;
				dirty_store[ind][ev_blk]=1;
			}
			else if(dirty_store[ind][ev_blk]==1){
				num_wb+=1;
				addr_ev = ev_blk_addr(ind,tag_store[ind][ev_blk]);
				if(next!=NULL)
					next->write(addr_ev);
				if(next!=NULL)
					next->read(addr);
				tag_store[ind][ev_blk]=tag;
				dirty_store[ind][ev_blk]=1;
			}
		}

		if(rp==2){
			lru_update(ind,ev_blk);
		}
		else if(rp==3){
			lfu_update_set(ind,ev_blk);
			lfu_update_block(ind,ev_blk,0);
		}
		return 0;

	}	
		
	if(lev == 2){
		//#1 check for the element in all the blocks of that set
		for (unsigned int j=0; j<a; j++){
			if((tag_store[ind][j]==tag) && (valid_store[ind][j]==1)){

				if(rp==2)
					lru_update(ind,j);
				else if(rp==3) 
					lfu_update_block(ind,j,1);
				if(wp==0){
					dirty_store[ind][j]=1;
				}

				return 1;
			}
		}

		num_miss_w+=1;

		//#2 MISS in L1 but invalid case	
		for (unsigned int j=0; j<a; j++){
			if(valid_store[ind][j]==0){
				if(wp == 0){
					tag_store[ind][j]=tag;
					valid_store[ind][j]=1;
					dirty_store[ind][j]=1;
					if(rp==2)
						lru_update(ind,j);
					else 
						lfu_update_block(ind,j,0);
				}

				return 0;
			}
		}
		
		//#3 MISS IN L1 FOR ALL BITS VALID : EVICTION	
		//LRU policy
		if(rp==2){
			ev_blk= lru_block2evict(ind);
		}
		//LFU policy
		else if(rp==3){
			ev_blk= lfu_block2evict(ind);
		}

		//update dirty according to write policy
		//WB policy
		if(wp == 0){
			if(dirty_store[ind][ev_blk]==0){
				tag_store[ind][ev_blk]=tag;
				dirty_store[ind][ev_blk]=1;
				if(rp==2){
					lru_update(ind,ev_blk);
				}
				else if(rp==3){
					lfu_update_set(ind,ev_blk);
					lfu_update_block(ind,ev_blk,0);
				}
			}
			else if(dirty_store[ind][ev_blk]==1){
				num_wb+=1;
				tag_store[ind][ev_blk]=tag;
				if(rp==2){
					lru_update(ind,ev_blk);
				}
				else if(rp==3){
					lfu_update_set(ind,ev_blk);
					lfu_update_block(ind,ev_blk,0);
				}
			}
		}
		return 0;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x40(%rbp)
movl 0x88(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x88(%rdi)
movl -0x14(%rbp), %esi
callq 0x2170
movq -0x40(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jne 0x2cb0
movl $0x0, -0x1c(%rbp)
movq -0x40(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x28c3
movq -0x40(%rbp), %rcx
movq 0x28(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl -0x1c(%rbp), %edx
movl (%rax,%rdx,4), %eax
cmpl 0x64(%rcx), %eax
jne 0x28b3
movq -0x40(%rbp), %rcx
movq 0x30(%rcx), %rax
movl 0x68(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
cmpl $0x1, (%rax,%rcx,4)
jne 0x28b3
movq -0x40(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jne 0x2864
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x1c(%rbp), %edx
callq 0x21b0
jmp 0x2884
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2882
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x1c(%rbp), %edx
movl $0x1, %ecx
callq 0x2250
jmp 0x2884
movq -0x40(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x28a7
movq -0x40(%rbp), %rcx
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movl $0x1, -0x4(%rbp)
jmp 0x2fcc
jmp 0x28b5
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2803
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x297d
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x22c0
movl %eax, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x40(%rbp), %rcx
movl -0x2c(%rbp), %eax
movq 0x8(%rcx), %rcx
cmpl 0x18(%rcx), %eax
jae 0x294f
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x20(%rbp), %eax
jne 0x2942
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
cmpl $0x1, (%rax,%rcx,4)
jne 0x2942
movl $0x1, -0x28(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x2944
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28f3
cmpl $0x1, -0x28(%rbp)
jne 0x297b
movq -0x40(%rbp), %rdi
movl 0x7c(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rdi)
movl -0x24(%rbp), %esi
movl $0x1, %edx
callq 0x22f0
movl $0x1, -0x4(%rbp)
jmp 0x2fcc
jmp 0x297d
movq -0x40(%rbp), %rax
movl 0x8c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8c(%rax)
movl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rcx
movl -0x30(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x2a62
movq -0x40(%rbp), %rcx
movq 0x30(%rcx), %rax
movl 0x68(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl -0x30(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x2a52
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0x29dc
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x19f0
movq -0x40(%rbp), %rax
movl 0x64(%rax), %esi
movq 0x28(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x30(%rbp), %edx
movl %esi, (%rcx,%rdx,4)
movq 0x30(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x30(%rbp), %edx
movl $0x1, (%rcx,%rdx,4)
movq 0x38(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x30(%rbp), %edx
movl $0x1, (%rcx,%rdx,4)
cmpl $0x2, 0x1c(%rax)
jne 0x2a35
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x30(%rbp), %edx
callq 0x21b0
jmp 0x2a46
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x30(%rbp), %edx
xorl %ecx, %ecx
callq 0x2250
movl $0x0, -0x4(%rbp)
jmp 0x2fcc
jmp 0x2a54
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2997
movq -0x40(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jne 0x2a83
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
callq 0x2490
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x2aa4
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2aa2
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
callq 0x2500
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x2aa4
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2b3f
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movq 0x28(%rdi), %rax
movl 0x68(%rdi), %ecx
movq (%rax,%rcx,8), %rax
movl 0x6c(%rdi), %ecx
movl (%rax,%rcx,4), %edx
callq 0x2570
movq -0x40(%rbp), %rcx
movl %eax, -0x18(%rbp)
movq 0x8(%rcx), %rdi
movl -0x18(%rbp), %esi
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
movl (%rax,%rcx,4), %edx
callq 0x25b0
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2b0d
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x19f0
movq -0x40(%rbp), %rcx
movl 0x64(%rcx), %esi
movq 0x28(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %edx
movl %esi, (%rax,%rdx,4)
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
movl $0x1, (%rax,%rcx,4)
jmp 0x2c5d
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x2c5b
movq -0x40(%rbp), %rcx
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x2bb1
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2b7f
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x19f0
movq -0x40(%rbp), %rcx
movl 0x64(%rcx), %esi
movq 0x28(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %edx
movl %esi, (%rax,%rdx,4)
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
movl $0x1, (%rax,%rcx,4)
jmp 0x2c59
movq -0x40(%rbp), %rcx
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
cmpl $0x1, (%rax,%rcx,4)
jne 0x2c57
movq -0x40(%rbp), %rdi
movl 0x74(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x74(%rdi)
movl 0x68(%rdi), %esi
movq 0x28(%rdi), %rax
movl 0x68(%rdi), %ecx
movq (%rax,%rcx,8), %rax
movl 0x6c(%rdi), %ecx
movl (%rax,%rcx,4), %edx
callq 0x2570
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, -0x18(%rbp)
cmpq $0x0, (%rax)
je 0x2c11
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl -0x18(%rbp), %esi
callq 0x27c0
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2c2a
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x19f0
movq -0x40(%rbp), %rcx
movl 0x64(%rcx), %esi
movq 0x28(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %edx
movl %esi, (%rax,%rdx,4)
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
movl $0x1, (%rax,%rcx,4)
jmp 0x2c59
jmp 0x2c5b
jmp 0x2c5d
movq -0x40(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jne 0x2c78
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
callq 0x21b0
jmp 0x2ca4
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2ca2
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
callq 0x2fe0
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
xorl %ecx, %ecx
callq 0x2250
jmp 0x2ca4
movl $0x0, -0x4(%rbp)
jmp 0x2fcc
movq -0x40(%rbp), %rax
cmpl $0x2, 0x24(%rax)
jne 0x2fc5
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x2d85
movq -0x40(%rbp), %rcx
movq 0x28(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl -0x34(%rbp), %edx
movl (%rax,%rdx,4), %eax
cmpl 0x64(%rcx), %eax
jne 0x2d75
movq -0x40(%rbp), %rcx
movq 0x30(%rcx), %rax
movl 0x68(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl -0x34(%rbp), %ecx
cmpl $0x1, (%rax,%rcx,4)
jne 0x2d75
movq -0x40(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jne 0x2d26
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x34(%rbp), %edx
callq 0x21b0
jmp 0x2d46
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2d44
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x34(%rbp), %edx
movl $0x1, %ecx
callq 0x2250
jmp 0x2d46
movq -0x40(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x2d69
movq -0x40(%rbp), %rcx
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl -0x34(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movl $0x1, -0x4(%rbp)
jmp 0x2fcc
jmp 0x2d77
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2cc5
movq -0x40(%rbp), %rax
movl 0x8c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8c(%rax)
movl $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x2e5d
movq -0x40(%rbp), %rcx
movq 0x30(%rcx), %rax
movl 0x68(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl -0x38(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x2e4d
movq -0x40(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x2e41
movq -0x40(%rbp), %rax
movl 0x64(%rax), %esi
movq 0x28(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x38(%rbp), %edx
movl %esi, (%rcx,%rdx,4)
movq 0x30(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x38(%rbp), %edx
movl $0x1, (%rcx,%rdx,4)
movq 0x38(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl -0x38(%rbp), %edx
movl $0x1, (%rcx,%rdx,4)
cmpl $0x2, 0x1c(%rax)
jne 0x2e2e
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x38(%rbp), %edx
callq 0x21b0
jmp 0x2e3f
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl -0x38(%rbp), %edx
xorl %ecx, %ecx
callq 0x2250
jmp 0x2e41
movl $0x0, -0x4(%rbp)
jmp 0x2fcc
jmp 0x2e4f
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2d9f
movq -0x40(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jne 0x2e7e
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
callq 0x2490
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x2e9f
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2e9d
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
callq 0x2500
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x2e9f
movq -0x40(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x2fbc
movq -0x40(%rbp), %rcx
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x2f3a
movq -0x40(%rbp), %rax
movl 0x64(%rax), %esi
movq 0x28(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x6c(%rax), %edx
movl %esi, (%rcx,%rdx,4)
movq 0x38(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x6c(%rax), %edx
movl $0x1, (%rcx,%rdx,4)
cmpl $0x2, 0x1c(%rax)
jne 0x2f09
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
callq 0x21b0
jmp 0x2f35
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2f33
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
callq 0x2fe0
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
xorl %ecx, %ecx
callq 0x2250
jmp 0x2f35
jmp 0x2fba
movq -0x40(%rbp), %rcx
movq 0x38(%rcx), %rax
movl 0x68(%rcx), %edx
movq (%rax,%rdx,8), %rax
movl 0x6c(%rcx), %ecx
cmpl $0x1, (%rax,%rcx,4)
jne 0x2fb8
movq -0x40(%rbp), %rax
movl 0x74(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x74(%rax)
movl 0x64(%rax), %esi
movq 0x28(%rax), %rcx
movl 0x68(%rax), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x6c(%rax), %edx
movl %esi, (%rcx,%rdx,4)
cmpl $0x2, 0x1c(%rax)
jne 0x2f8a
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
callq 0x21b0
jmp 0x2fb6
movq -0x40(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
jne 0x2fb4
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
callq 0x2fe0
movq -0x40(%rbp), %rdi
movl 0x68(%rdi), %esi
movl 0x6c(%rdi), %edx
xorl %ecx, %ecx
callq 0x2250
jmp 0x2fb6
jmp 0x2fb8
jmp 0x2fba
jmp 0x2fbc
movl $0x0, -0x4(%rbp)
jmp 0x2fcc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)