// File: /workspace/github_c_makefile_star2_O0/jelaas[P]egetty/egetty.c
// Function: main
int main(int argc, char **argv, char **arge)
{
	int s;
	struct sockaddr_ll from;
	socklen_t fromlen = sizeof(from);
	int ifindex=-1;
	uint8_t *buf, *p;
	ssize_t n;
	unsigned int len;
	int count=1;
	int timeout = -1;
	int loginfd = -1;
	pid_t pid=-1;
	struct sk_buff *skb;
	
	envp = arge;
	conf.debug = 0;
	conf.device = "eth0";
	conf.devsocket = -1;
	
	while(--argc > 0) {
		if(strcmp(argv[argc], "debug")==0) {
			printf("Debug mode\n");
			conf.debug = 1;
			continue;
		}
		if(strcmp(argv[argc], "console")==0) {
			conf.kmsg = 1;
			continue;
		}
		if(strcmp(argv[argc], "waitif")==0) {
			conf.waitif = 1;
			continue;
		}
		if( (strlen(argv[argc]) < 3) && isdigit(*argv[argc])) {
			conf.console = atoi(argv[argc]);
			continue;
		}
		conf.device = argv[argc];
	}

	conf.devsocket = devsocket();
	
	if(conf.waitif) {
		/* wait for interface to become available */
		while(check_flag(conf.device, (IFF_UP | IFF_RUNNING))) {
			sleep(1);
		}
	} else {
		/* active interface */
		while(set_flag(conf.device, (IFF_UP | IFF_RUNNING))) {
			sleep(1);
		}
	}
	
	memset(conf.client.sll_addr, 255, 6);
	
	s = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_EGETTY));
	if(s == -1)
	{
		fprintf(stderr, "socket(): %s\n", strerror(errno));
		exit(1);
	}
	
	if(conf.device)
	{
		ifindex = if_nametoindex(conf.device);
		if(!ifindex)
		{
			fprintf(stderr, "Not an interface\n");
			exit(1);
		}
	}
	
	
	if(ifindex >= 0)
	{
		struct sockaddr_ll addr;
		memset(&addr, 0, sizeof(addr));
		
		addr.sll_family = AF_PACKET;
		addr.sll_protocol = htons(ETH_P_EGETTY);
		addr.sll_ifindex = ifindex;
		
		if(bind(s, (const struct sockaddr *)&addr, sizeof(addr)))
		{
			fprintf(stderr, "bind() to interface failed\n");
			exit(1);
		}
	}
	
	skb = alloc_skb(1500);

	skb_reset(skb);
	skb_reserve(skb, 4);
	console_hello(s, ifindex, skb);
	
	while(count)
	{
		struct pollfd fds[2];

		if(pid) {
			int status;
			if(waitpid(-1, &status, WNOHANG)>0) {
				pid = -1;
				close(loginfd);
			}
		}
		if(pid == -1) {
			pid = login(&loginfd);
			if(pid == -1)
				exit(1);
			if(conf.debug) {
				printf("child pid = %d\n", pid);
				printf("loginfd = %d\n", loginfd);
			}
		}
		
		fds[0].fd = s;
		fds[0].events = POLLIN;
		fds[0].revents = 0;
		
		fds[1].fd = loginfd;
		fds[1].events = POLLIN;
		fds[1].revents = 0;

		n = poll(fds, 2, timeout);
		if(n == 0) {
			printf("timeout\n");
			exit(1);
		}

		if(fds[1].revents & POLLIN) {
			if(conf.debug) printf("POLLIN child\n");
			skb_reset(skb);
			skb_reserve(skb, 4);
			buf = skb_put(skb, 0);
			n = read(loginfd, buf, skb_tailroom(skb));
			if(n == -1) {
				fprintf(stderr, "read() failed\n");
				exit(1);
			}
			
			buf[n] = 0;
			if(conf.debug)
				printf("child: %d bytes\n", n);
			skb_put(skb, n);
			console_put(s, ifindex, skb);
		}
		if(fds[0].revents) {
			skb_reset(skb);
			buf = skb_put(skb, 0);
			n = recvfrom(s, buf, skb_tailroom(skb), 0, (struct sockaddr *)&from, &fromlen);
			if(n == -1) {
				fprintf(stderr, "recvfrom() failed. ifconfig up?\n");
				exit(1);
			}

			skb_put(skb, n);
			if(conf.debug) printf("received packet %d bytes\n", skb->len);
			
			if(ntohs(from.sll_protocol) == ETH_P_EGETTY) {
				if(conf.debug)
					printf("Received EGETTY\n");
				
				p = skb->data;
				if(*p == EGETTY_HUP) {
					if(pid != -1) kill(pid, 9);
					continue;
				}
				
				if(*p == EGETTY_SCAN) {
					skb_reset(skb);
					skb_reserve(skb, 4);
					console_hello(s, ifindex, skb);
					continue;
				}
				
				if(*p == EGETTY_WINCH) {
					p++;
					if(*p != conf.console) {
						if(conf.debug)
							printf("Wrong console %d not %d\n", *p, conf.console);
						continue;
					}
					p++;
					{
						struct winsize winp;
						winp.ws_row = *p++;
						winp.ws_col = *p++;
						winp.ws_xpixel = 0;
						winp.ws_ypixel = 0;
						ioctl(loginfd, TIOCSWINSZ, &winp);
						if(conf.debug)
							printf("WINCH to %d, %d\n", winp.ws_row, winp.ws_col);
					}
					continue;
				}
				
				if(*p != EGETTY_IN) {
					if(conf.debug)
						printf("Not EGETTY_IN: %d\n", *p);
					continue;
				}
				p++;
				if(*p != conf.console) {
					if(conf.debug)
						printf("Wrong console %d not %d\n", *p, conf.console);
					continue;
				}
				memcpy(conf.client.sll_addr, from.sll_addr, 6);
				p++;
				len = *p++ << 8;
				len += *p;
				if(len > n) {
					printf("Length field too long: %d\n", len);
					continue;
				}
				skb_trim(skb, len);
				skb_pull(skb, 4);
				if(conf.debug) printf("Sent %d bytes to child\n", skb->len);
				write(loginfd, skb->data, skb->len);
				continue;
			}
		}
		
	}
  exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x14, -0x34(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x58(%rbp)
movl $0xffffffff, -0x5c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x60(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq %rax, 0xd370e(%rip)     # 0x4d5360
movl $0x0, 0xd36e4(%rip)     # 0x4d5340
leaq 0xa041c(%rip), %rax     # 0x4a207f
movq %rax, 0xd36c6(%rip)     # 0x4d5330
movl $0xffffffff, 0xd36e4(%rip) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
jle 0x401d85
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa62bc(%rip), %rsi     # 0x4a7f55
callq 0x4010b0
cmpl $0x0, %eax
jne 0x401cbd
leaq 0xa03da(%rip), %rdi     # 0x4a2084
movb $0x0, %al
callq 0x40d110
movl $0x1, 0xd3685(%rip)     # 0x4d5340
jmp 0x401c74
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa03c0(%rip), %rsi     # 0x4a2090
callq 0x4010b0
cmpl $0x0, %eax
jne 0x401ce6
movl $0x1, 0xd3654(%rip)     # 0x4d5338
jmp 0x401c74
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa039f(%rip), %rsi     # 0x4a2098
callq 0x4010b0
cmpl $0x0, %eax
jne 0x401d12
movl $0x1, 0xd362f(%rip)     # 0x4d533c
jmp 0x401c74
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4010d8
cmpq $0x3, %rax
jae 0x401d6d
callq 0x405850
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x401d6d
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x40b430
movl %eax, 0xd35c0(%rip)     # 0x4d5328
jmp 0x401c74
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xd35b0(%rip)     # 0x4d5330
jmp 0x401c74
callq 0x4024b0
movl %eax, 0xd35c8(%rip)     # 0x4d5358
cmpl $0x0, 0xd35a5(%rip)     # 0x4d533c
je 0x401dbf
jmp 0x401d9b
movq 0xd358e(%rip), %rdi     # 0x4d5330
movl $0x41, %esi
callq 0x402510
cmpl $0x0, %eax
je 0x401dbd
movl $0x1, %edi
callq 0x450380
jmp 0x401d9b
jmp 0x401de5
jmp 0x401dc1
movq 0xd3568(%rip), %rdi     # 0x4d5330
movl $0x41, %esi
callq 0x402590
cmpl $0x0, %eax
je 0x401de3
movl $0x1, %edi
callq 0x450380
jmp 0x401dc1
jmp 0x401de5
leaq 0xd353c(%rip), %rdi     # 0x4d5328
addq $0x1c, %rdi
addq $0xc, %rdi
movl $0xff, %esi
movl $0x6, %edx
callq 0x4010a0
movl $0x6811, %edi           # imm = 0x6811
callq 0x453ff0
movzwl %ax, %edx
movl $0x11, %edi
movl $0x2, %esi
callq 0x453c60
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x401e67
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
callq 0x405690
movl (%rax), %edi
callq 0x423810
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
leaq 0xa0249(%rip), %rsi     # 0x4a209f
movb $0x0, %al
callq 0x40d050
movl $0x1, %edi
callq 0x40bfb0
cmpq $0x0, 0xd34c1(%rip)     # 0x4d5330
je 0x401eaa
movq 0xd34b8(%rip), %rdi     # 0x4d5330
callq 0x454000
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x401ea8
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rdi
leaq 0xa0216(%rip), %rsi     # 0x4a20ad
movb $0x0, %al
callq 0x40d050
movl $0x1, %edi
callq 0x40bfb0
jmp 0x401eaa
cmpl $0x0, -0x38(%rbp)
jl 0x401f20
leaq -0x84(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x4010a0
movw $0x11, -0x84(%rbp)
movl $0x6811, %edi           # imm = 0x6811
callq 0x453ff0
movw %ax, -0x82(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x1c(%rbp), %edi
leaq -0x84(%rbp), %rsi
movl $0x14, %edx
callq 0x453a90
cmpl $0x0, %eax
je 0x401f1e
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rdi
leaq 0xa01b2(%rip), %rsi     # 0x4a20bf
movb $0x0, %al
callq 0x40d050
movl $0x1, %edi
callq 0x40bfb0
jmp 0x401f20
movl $0x5dc, %edi            # imm = 0x5DC
callq 0x402640
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x4026f0
movq -0x70(%rbp), %rdi
movl $0x4, %esi
callq 0x402a10
movl -0x1c(%rbp), %edi
movl -0x38(%rbp), %esi
movq -0x70(%rbp), %rdx
callq 0x401b30
cmpl $0x0, -0x58(%rbp)
je 0x4024a8
cmpl $0x0, -0x64(%rbp)
je 0x401f90
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
leaq -0xa4(%rbp), %rsi
movl $0x1, %edx
callq 0x4502c0
cmpl $0x0, %eax
jle 0x401f8e
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
movl -0x60(%rbp), %edi
callq 0x450fb0
jmp 0x401f90
cmpl $-0x1, -0x64(%rbp)
jne 0x401fdf
leaq -0x60(%rbp), %rdi
callq 0x401730
movl %eax, -0x64(%rbp)
cmpl $-0x1, -0x64(%rbp)
jne 0x401fb2
movl $0x1, %edi
callq 0x40bfb0
cmpl $0x0, 0xd3387(%rip)     # 0x4d5340
je 0x401fdd
movl -0x64(%rbp), %esi
leaq 0xa0116(%rip), %rdi     # 0x4a20db
movb $0x0, %al
callq 0x40d110
movl -0x60(%rbp), %esi
leaq 0xa0115(%rip), %rdi     # 0x4a20eb
movb $0x0, %al
callq 0x40d110
jmp 0x401fdf
movl -0x1c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movw $0x1, -0x9c(%rbp)
movw $0x0, -0x9a(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x98(%rbp)
movw $0x1, -0x94(%rbp)
movw $0x0, -0x92(%rbp)
leaq -0xa0(%rbp), %rdi
movl -0x5c(%rbp), %edx
movl $0x2, %esi
callq 0x451760
cltq
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x40204e
leaq 0xa00bc(%rip), %rdi     # 0x4a20f9
movb $0x0, %al
callq 0x40d110
movl $0x1, %edi
callq 0x40bfb0
movswl -0x92(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x402142
cmpl $0x0, 0xd32d8(%rip)     # 0x4d5340
je 0x402078
leaq 0xa0091(%rip), %rdi     # 0x4a2102
movb $0x0, %al
callq 0x40d110
movq -0x70(%rbp), %rdi
callq 0x4026f0
movq -0x70(%rbp), %rdi
movl $0x4, %esi
callq 0x402a10
movq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x402a70
movq %rax, -0x40(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x70(%rbp), %rdi
callq 0x402a50
movl -0xc4(%rbp), %edi
movq -0xc0(%rbp), %rsi
movslq %eax, %rdx
callq 0x450e40
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x4020fd
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rdi
leaq 0xa0024(%rip), %rsi     # 0x4a2110
movb $0x0, %al
callq 0x40d050
movl $0x1, %edi
callq 0x40bfb0
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x0, 0xd3230(%rip)     # 0x4d5340
je 0x402124
movq -0x50(%rbp), %rsi
leaq 0xa0002(%rip), %rdi     # 0x4a211f
movb $0x0, %al
callq 0x40d110
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %esi
callq 0x402a70
movl -0x1c(%rbp), %edi
movl -0x38(%rbp), %esi
movq -0x70(%rbp), %rdx
callq 0x401a60
cmpw $0x0, -0x9a(%rbp)
je 0x4024a3
movq -0x70(%rbp), %rdi
callq 0x4026f0
movq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x402a70
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x70(%rbp), %rdi
callq 0x402a50
movl -0xd4(%rbp), %edi
movq -0xd0(%rbp), %rsi
movslq %eax, %rdx
xorl %ecx, %ecx
leaq -0x30(%rbp), %r8
leaq -0x34(%rbp), %r9
callq 0x453ac0
movq %rax, -0x50(%rbp)
cmpq $-0x1, -0x50(%rbp)
jne 0x4021d1
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rdi
leaq 0x9ff70(%rip), %rsi     # 0x4a2130
movb $0x0, %al
callq 0x40d050
movl $0x1, %edi
callq 0x40bfb0
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %esi
callq 0x402a70
cmpl $0x0, 0xd3159(%rip)     # 0x4d5340
je 0x4021fd
movq -0x70(%rbp), %rax
movl (%rax), %esi
leaq 0x9ff5b(%rip), %rdi     # 0x4a2151
movb $0x0, %al
callq 0x40d110
movzwl -0x2e(%rbp), %edi
callq 0x453ff0
movzwl %ax, %eax
cmpl $0x6811, %eax           # imm = 0x6811
jne 0x4024a1
cmpl $0x0, 0xd3125(%rip)     # 0x4d5340
je 0x40222b
leaq 0x9ff47(%rip), %rdi     # 0x4a216b
movb $0x0, %al
callq 0x40d110
movq -0x70(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x40225b
cmpl $-0x1, -0x64(%rbp)
je 0x402256
movl -0x64(%rbp), %edi
movl $0x9, %esi
callq 0x40b400
jmp 0x401f54
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x402292
movq -0x70(%rbp), %rdi
callq 0x4026f0
movq -0x70(%rbp), %rdi
movl $0x4, %esi
callq 0x402a10
movl -0x1c(%rbp), %edi
movl -0x38(%rbp), %esi
movq -0x70(%rbp), %rdx
callq 0x401b30
jmp 0x401f54
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x6, %eax
jne 0x402376
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl 0xd306d(%rip), %eax     # 0x4d5328
je 0x4022e6
cmpl $0x0, 0xd307c(%rip)     # 0x4d5340
je 0x4022e1
movq -0x48(%rbp), %rax
movzbl (%rax), %esi
movl 0xd3055(%rip), %edx     # 0x4d5328
leaq 0x9fea2(%rip), %rdi     # 0x4a217c
movb $0x0, %al
callq 0x40d110
jmp 0x401f54
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movzbl (%rax), %eax
movw %ax, -0xac(%rbp)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movzbl (%rax), %eax
movw %ax, -0xaa(%rbp)
movw $0x0, -0xa8(%rbp)
movw $0x0, -0xa6(%rbp)
movl -0x60(%rbp), %edi
movl $0x5414, %esi           # imm = 0x5414
leaq -0xac(%rbp), %rdx
movb $0x0, %al
callq 0x451b90
cmpl $0x0, 0xd2fed(%rip)     # 0x4d5340
je 0x402371
movzwl -0xac(%rbp), %esi
movzwl -0xaa(%rbp), %edx
leaq 0x9fe2b(%rip), %rdi     # 0x4a2195
movb $0x0, %al
callq 0x40d110
jmp 0x401f54
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x4, %eax
je 0x4023a5
cmpl $0x0, 0xd2fb7(%rip)     # 0x4d5340
je 0x4023a0
movq -0x48(%rbp), %rax
movzbl (%rax), %esi
leaq 0x9fe0d(%rip), %rdi     # 0x4a21a6
movb $0x0, %al
callq 0x40d110
jmp 0x401f54
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl 0xd2f6a(%rip), %eax     # 0x4d5328
je 0x4023e9
cmpl $0x0, 0xd2f79(%rip)     # 0x4d5340
je 0x4023e4
movq -0x48(%rbp), %rax
movzbl (%rax), %esi
movl 0xd2f52(%rip), %edx     # 0x4d5328
leaq 0x9fd9f(%rip), %rdi     # 0x4a217c
movb $0x0, %al
callq 0x40d110
jmp 0x401f54
movl -0x24(%rbp), %eax
movl %eax, 0xd2f5e(%rip)     # 0x4d5350
movw -0x20(%rbp), %ax
movw %ax, 0xd2f57(%rip)      # 0x4d5354
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x50(%rbp), %rax
jle 0x40244d
movl -0x54(%rbp), %esi
leaq 0x9fd78(%rip), %rdi     # 0x4a21b9
movb $0x0, %al
callq 0x40d110
jmp 0x401f54
movq -0x70(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x402b20
movq -0x70(%rbp), %rdi
movl $0x4, %esi
callq 0x402af0
cmpl $0x0, 0xd2ed2(%rip)     # 0x4d5340
je 0x402484
movq -0x70(%rbp), %rax
movl (%rax), %esi
leaq 0x9fd57(%rip), %rdi     # 0x4a21d4
movb $0x0, %al
callq 0x40d110
movl -0x60(%rbp), %edi
movq -0x70(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x70(%rbp), %rax
movl (%rax), %eax
movl %eax, %edx
callq 0x450ee0
jmp 0x401f54
jmp 0x4024a3
jmp 0x401f54
xorl %edi, %edi
callq 0x40bfb0
nop