// File: /workspace/github_c_makefile_star2_O2/wtarreau[P]httpterm/httpterm.c
// Function: cfg_parse_listen
int cfg_parse_listen(const char *file, int linenum, char **args) {
    static struct proxy *curproxy = NULL;
    struct server *newsrv = NULL;

    if (!strcmp(args[0], "listen")) {  /* new proxy */
	if (!*args[1]) {
	    Alert("parsing [%s:%d] : '%s' expects an <id> argument and\n"
		  "  optionnally supports [addr1]:port1[-end1]{,[addr]:port[-end]}...\n",
		  file, linenum, args[0]);
	    return -1;
	}
	
	if ((curproxy = (struct proxy *)calloc(1, sizeof(struct proxy))) == NULL) {
	    Alert("parsing [%s:%d] : out of memory.\n", file, linenum);
	    return -1;
	}
	
	curproxy->next = proxy;
	proxy = curproxy;

	curproxy->id = strdup(args[1]);

	/* parse the listener address if any */
	if (*args[2]) {
	    curproxy->listen = str2listener(args[2], curproxy->listen);
	    if (!curproxy->listen)
		return -1;
	    global.maxsock++;
	}

	/* set default values */
	curproxy->state = defproxy.state;
	curproxy->maxconn = defproxy.maxconn;
	curproxy->options = defproxy.options;

	if (defproxy.errmsg.msg400)
	    curproxy->errmsg.msg400 = strdup(defproxy.errmsg.msg400);
	curproxy->errmsg.len400 = defproxy.errmsg.len400;

	if (defproxy.errmsg.msg403)
	    curproxy->errmsg.msg403 = strdup(defproxy.errmsg.msg403);
	curproxy->errmsg.len403 = defproxy.errmsg.len403;

	if (defproxy.errmsg.msg408)
	    curproxy->errmsg.msg408 = strdup(defproxy.errmsg.msg408);
	curproxy->errmsg.len408 = defproxy.errmsg.len408;

	if (defproxy.errmsg.msg500)
	    curproxy->errmsg.msg500 = strdup(defproxy.errmsg.msg500);
	curproxy->errmsg.len500 = defproxy.errmsg.len500;

	if (defproxy.errmsg.msg502)
	    curproxy->errmsg.msg502 = strdup(defproxy.errmsg.msg502);
	curproxy->errmsg.len502 = defproxy.errmsg.len502;

	if (defproxy.errmsg.msg503)
	    curproxy->errmsg.msg503 = strdup(defproxy.errmsg.msg503);
	curproxy->errmsg.len503 = defproxy.errmsg.len503;

	if (defproxy.errmsg.msg504)
	    curproxy->errmsg.msg504 = strdup(defproxy.errmsg.msg504);
	curproxy->errmsg.len504 = defproxy.errmsg.len504;

	curproxy->clitimeout = defproxy.clitimeout;
	curproxy->grace  = defproxy.grace;
	return 0;
    }
    else if (!strcmp(args[0], "defaults")) {  /* use this one to assign default values */
	/* some variables may have already been initialized earlier */
	if (defproxy.errmsg.msg400) free(defproxy.errmsg.msg400);
	if (defproxy.errmsg.msg403) free(defproxy.errmsg.msg403);
	if (defproxy.errmsg.msg408) free(defproxy.errmsg.msg408);
	if (defproxy.errmsg.msg500) free(defproxy.errmsg.msg500);
	if (defproxy.errmsg.msg502) free(defproxy.errmsg.msg502);
	if (defproxy.errmsg.msg503) free(defproxy.errmsg.msg503);
	if (defproxy.errmsg.msg504) free(defproxy.errmsg.msg504);

	init_default_instance();
	curproxy = &defproxy;
	return 0;
    }
    else if (curproxy == NULL) {
	Alert("parsing [%s:%d] : 'listen' or 'defaults' expected.\n", file, linenum);
	return -1;
    }

    /* ignore disabled listeners so that we don't fail on missing files */
    if (curproxy->state == PR_STSTOPPED)
	return 0;

    if (!strcmp(args[0], "bind")) {  /* new listen addresses */
	if (curproxy == &defproxy) {
	    Alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
	    return -1;
	}

	if (strchr(args[1], ':') == NULL) {
	    Alert("parsing [%s:%d] : '%s' expects [addr1]:port1[-end1]{,[addr]:port[-end]}... as arguments.\n",
		  file, linenum, args[0]);
	    return -1;
	}
	curproxy->listen = str2listener(args[1], curproxy->listen);
	if (!curproxy->listen)
	    return -1;
	global.maxsock++;
	return 0;
    }
    else if (!strcmp(args[0], "disabled")) {  /* disables this proxy */
	curproxy->state = PR_STSTOPPED;
    }
    else if (!strcmp(args[0], "enabled")) {  /* enables this proxy (used to revert a disabled default) */
	curproxy->state = PR_STNEW;
    }
    else if (!strcmp(args[0], "clitimeout")) {  /*  client timeout */
	if (curproxy->clitimeout != defproxy.clitimeout) {
	    Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n",
		  file, linenum, args[0]);
	    return 0;
	}
	if (*(args[1]) == 0) {
	    Alert("parsing [%s:%d] : '%s' expects an integer <time_in_ms> as argument.\n",
		  file, linenum, args[0]);
	    return -1;
	}
	curproxy->clitimeout = atol(args[1]);
    }
    else if (!strcmp(args[0], "option")) {
	if (*(args[1]) == 0) {
	    Alert("parsing [%s:%d] : '%s' expects an option name.\n", file, linenum, args[0]);
	    return -1;
	}
	if (!strcmp(args[1], "httpclose"))
	    /* force connection: close in both directions in HTTP mode */
	    curproxy->options |= PR_O_HTTP_CLOSE;
	else if (!strcmp(args[1], "forceclose"))
	    /* force connection: close in both directions in HTTP mode and enforce end of session */
	    curproxy->options |= PR_O_FORCE_CLO | PR_O_HTTP_CLOSE;
	else if (!strcmp(args[1], "tcpka")) {
	    /* enable TCP keep-alives on client and server sessions */
	    curproxy->options |= PR_O_TCP_CLI_KA;
	}
	else if (!strcmp(args[1], "clitcpka")) {
	    /* enable TCP keep-alives on client sessions */
	    curproxy->options |= PR_O_TCP_CLI_KA;
	}
	else {
	    Alert("parsing [%s:%d] : unknown option '%s'.\n", file, linenum, args[1]);
	    return -1;
	}
	return 0;
    }
    else if (!strcmp(args[0], "maxconn")) {  /* maxconn */
	if (*(args[1]) == 0) {
	    Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
	    return -1;
	}
	curproxy->maxconn = atol(args[1]);
    }
    else if (!strcmp(args[0], "grace")) {  /* grace time (ms) */
	if (*(args[1]) == 0) {
	    Alert("parsing [%s:%d] : '%s' expects a time in milliseconds.\n", file, linenum, args[0]);
	    return -1;
	}
	curproxy->grace = atol(args[1]);
    }
    else if (!strcmp(args[0], "object")) {
	int cur_arg;

	if (curproxy == &defproxy) {
	    Alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
	    return -1;
	}

	if (!*args[2]) {
	    Alert("parsing [%s:%d] : '%s' expects <name> as arguments.\n",
		  file, linenum, args[0]);
	    return -1;
	}
	if ((newsrv = (struct server *)calloc(1, sizeof(struct server))) == NULL) {
	    Alert("parsing [%s:%d] : out of memory.\n", file, linenum);
	    return -1;
	}

	/* the servers are linked backwards first */
	newsrv->next = curproxy->srv;
	curproxy->srv = newsrv;
	newsrv->proxy = curproxy;

	newsrv->resp_cache = 1;
	newsrv->resp_code = 200;
	newsrv->resp_size = -1; /* not yet set */

	cur_arg = 1;
	while (*args[cur_arg]) {
	    if (!strcmp(args[cur_arg], "name")) {
		newsrv->id = strdup(args[cur_arg + 1]);
		cur_arg += 2;
	    }
	    else if (!strcmp(args[cur_arg], "cache")) {
		newsrv->resp_cache = 1;
		cur_arg += 1;
	    }
	    else if (!strcmp(args[cur_arg], "no-cache")) {
		newsrv->resp_cache = 0;
		cur_arg += 1;
	    }
	    else if (!strcmp(args[cur_arg], "code")) {
		newsrv->resp_code = atol(args[cur_arg + 1]);
		cur_arg += 2;
	    }
	    else if (!strcmp(args[cur_arg], "size")) {
		newsrv->resp_size = atol(args[cur_arg + 1]);
		cur_arg += 2;
	    }
	    else if (!strcmp(args[cur_arg], "time")) {
		newsrv->resp_time = atol(args[cur_arg + 1]);
		cur_arg += 2;
	    }
	    else if (!strcmp(args[cur_arg], "file")) {
		int ret, hdr, fd;
		char *buf;
		struct stat stat;

		if (*(args[1]) == 0) {
		    Alert("parsing [%s:%d] : <%s> expects a <file> argument.\n", file, linenum, args[0]);
			return -1;
		}

		fd = open(args[cur_arg + 1], O_RDONLY);
		if ((fd < 0) || (fstat(fd, &stat) < 0)) {
			Alert("parsing [%s:%d] : error opening file <%s>.\n",
			      file, linenum, args[cur_arg + 1]);
			if (fd >= 0)
				close(fd);
			return -1;
		}

		if (newsrv->resp_size < 0 || newsrv->resp_size > stat.st_size)
		    newsrv->resp_size = stat.st_size;

		hdr = sprintf(trash,
			       "HTTP/1.1 %03d\r\n"
			       "Connection: close\r\n"
			       "Content-length: %d\r\n"
			       "%s"
			       "X-req: size=%d, time=%d ms\r\n"
			       "X-rsp: id=%s, code=%d, cache=%d, size=%d, time=%d ms\r\n"
			       "\r\n",
			       newsrv->resp_code,
			       newsrv->resp_size,
			       newsrv->resp_cache ? "" : "Cache-Control: no-cache\r\n",
			       newsrv->resp_size, newsrv->resp_time, 
			       newsrv->id, newsrv->resp_code, newsrv->resp_cache,
			       newsrv->resp_size, newsrv->resp_time);

		buf = malloc(hdr + newsrv->resp_size); /* malloc() must succeed during parsing */
		if (!buf) {
			Alert("parsing [%s:%d] : not enough memory to read file <%s>.\n",
			      file, linenum, args[cur_arg + 1]);
			close(fd);
			return -1;
		}

		memcpy(buf, trash, hdr);
		ret = read(fd, buf + hdr, newsrv->resp_size);
		close(fd);
		if (ret != newsrv->resp_size) {
			Alert("parsing [%s:%d] : error reading file <%s>.\n",
			      file, linenum, args[cur_arg + 1]);
			free(buf);
			return -1;
		}

		newsrv->resp_size += hdr;
		newsrv->resp_data = buf;
		cur_arg += 2;
	    }
	    else if (!strcmp(args[cur_arg], "rawfile")) {
		int ret, fd;
		char *buf;
		struct stat stat;

		if (*(args[1]) == 0) {
		    Alert("parsing [%s:%d] : <%s> expects a <file> argument.\n", file, linenum, args[0]);
			return -1;
		}

		fd = open(args[cur_arg + 1], O_RDONLY);
		if ((fd < 0) || (fstat(fd, &stat) < 0)) {
			Alert("parsing [%s:%d] : error opening file <%s>.\n",
			      file, linenum, args[cur_arg + 1]);
			if (fd >= 0)
				close(fd);
			return -1;
		}

		if (newsrv->resp_size < 0 || newsrv->resp_size > stat.st_size)
		    newsrv->resp_size = stat.st_size;

		buf = malloc(newsrv->resp_size); /* malloc() must succeed during parsing */
		if (!buf) {
			Alert("parsing [%s:%d] : not enough memory to read file <%s>.\n",
			      file, linenum, args[cur_arg + 1]);
			close(fd);
			return -1;
		}

		ret = read(fd, buf, newsrv->resp_size);
		close(fd);
		if (ret != newsrv->resp_size) {
			Alert("parsing [%s:%d] : error reading file <%s>.\n",
			      file, linenum, args[cur_arg + 1]);
			free(buf);
			return -1;
		}

		newsrv->resp_data = buf;
		cur_arg += 2;
	    }
	    else if (!strcmp(args[cur_arg], "weight")) {
		int w;
		w = atol(args[cur_arg + 1]);
		if (w < 1 || w > 256) {
		    Alert("parsing [%s:%d] : weight of object %s is not within 1 and 256 (%d).\n",
			  file, linenum, newsrv->id, w);
		    return -1;
		}
		newsrv->uweight = w - 1;
		cur_arg += 2;
	    }
	    else {
		Alert("parsing [%s:%d] : object %s only supports options 'name', 'code', 'size', 'time', 'cache', 'no-cache', 'file', 'rawfile' and 'weight'.\n",
		      file, linenum, newsrv->id);
		return -1;
	    }
	}
    }
    else {
	Alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section\n", file, linenum, args[0], "listen");
	return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq (%rdx), %r12
leaq 0x4159(%rip), %rsi      # 0xa57b
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x654b
leaq 0x41e3(%rip), %rsi      # 0xa61c
movq %r12, %rdi
callq 0x2200
leaq 0x29008(%rip), %rbx     # 0x2f450
testl %eax, %eax
je 0x66fe
movq 0x290d9(%rip), %r13     # 0x2f530
testq %r13, %r13
je 0x6765
movl %ebp, (%rsp)
xorl %ebp, %ebp
cmpl $0x3, 0x8(%r13)
je 0x682f
leaq 0x41e2(%rip), %rsi      # 0xa659
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x6797
leaq 0x4265(%rip), %rsi      # 0xa6f3
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x67d3
leaq 0x4257(%rip), %rsi      # 0xa6fc
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x67dd
leaq 0x4248(%rip), %rsi      # 0xa704
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x67ed
leaq 0x4281(%rip), %rsi      # 0xa754
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x6843
leaq 0x3fb8(%rip), %rsi      # 0xa4a2
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x68e0
leaq 0x42d0(%rip), %rsi      # 0xa7d1
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x68fb
leaq 0x42f7(%rip), %rsi      # 0xa80f
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0x692e
leaq 0x4014(%rip), %rdi      # 0xa543
leaq 0x4045(%rip), %r8       # 0xa57b
movq %r14, %rsi
movl (%rsp), %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x29aa
jmp 0x682c
movq 0x8(%r15), %r13
cmpb $0x0, (%r13)
je 0x676e
pushq $0x1
popq %rdi
movl $0xe0, %esi
callq 0x21f0
movq %rax, 0x28fc2(%rip)     # 0x2f530
testq %rax, %rax
je 0x677f
movq %rax, %r12
movq 0x7df7(%rip), %rax      # 0xe378
movq %rax, 0x50(%r12)
movq %r12, 0x7deb(%rip)      # 0xe378
movq %r13, %rdi
callq 0x23e0
movq %rax, 0x38(%r12)
movq 0x10(%r15), %rdi
cmpb $0x0, (%rdi)
je 0x65c4
xorl %esi, %esi
callq 0x2e68
movq 0x28f7f(%rip), %r12     # 0x2f530
movq %rax, (%r12)
testq %rax, %rax
je 0x682c
incl 0x7dec(%rip)            # 0xe3b0
movl 0x28e8e(%rip), %eax     # 0x2f458
movl %eax, 0x8(%r12)
movq 0x28ec2(%rip), %rax     # 0x2f498
movq %rax, 0x48(%r12)
movq 0x28ede(%rip), %rdi     # 0x2f4c0
testq %rdi, %rdi
je 0x65f1
callq 0x23e0
movq %rax, 0x70(%r12)
movl 0x28ed1(%rip), %eax     # 0x2f4c8
movl %eax, 0x78(%r12)
movq 0x28ecd(%rip), %rdi     # 0x2f4d0
testq %rdi, %rdi
je 0x6615
callq 0x23e0
movq %rax, 0x80(%r12)
movl 0x28ebd(%rip), %eax     # 0x2f4d8
movl %eax, 0x88(%r12)
movq 0x28eb6(%rip), %rdi     # 0x2f4e0
testq %rdi, %rdi
je 0x663c
callq 0x23e0
movq %rax, 0x90(%r12)
movl 0x28ea6(%rip), %eax     # 0x2f4e8
movl %eax, 0x98(%r12)
movq 0x28e9f(%rip), %rdi     # 0x2f4f0
testq %rdi, %rdi
je 0x6663
callq 0x23e0
movq %rax, 0xa0(%r12)
movl 0x28e8f(%rip), %eax     # 0x2f4f8
movl %eax, 0xa8(%r12)
movq 0x28e88(%rip), %rdi     # 0x2f500
testq %rdi, %rdi
je 0x668a
callq 0x23e0
movq %rax, 0xb0(%r12)
movl 0x28e78(%rip), %eax     # 0x2f508
movl %eax, 0xb8(%r12)
movq 0x28e71(%rip), %rdi     # 0x2f510
testq %rdi, %rdi
je 0x66b1
callq 0x23e0
movq %rax, 0xc0(%r12)
movl 0x28e61(%rip), %eax     # 0x2f518
movl %eax, 0xc8(%r12)
movq 0x28e5a(%rip), %rdi     # 0x2f520
testq %rdi, %rdi
je 0x66d8
callq 0x23e0
movq %rax, 0xd0(%r12)
movl 0x28e4a(%rip), %eax     # 0x2f528
movl %eax, 0xd8(%r12)
movl 0x28d94(%rip), %eax     # 0x2f480
movl %eax, 0x30(%r12)
movl 0x28dc1(%rip), %eax     # 0x2f4b8
movl %eax, 0x68(%r12)
jmp 0x675e
movq 0x28dbb(%rip), %rdi     # 0x2f4c0
callq 0x2050
movq 0x28dbf(%rip), %rdi     # 0x2f4d0
callq 0x2050
movq 0x28dc3(%rip), %rdi     # 0x2f4e0
callq 0x2050
movq 0x28dc7(%rip), %rdi     # 0x2f4f0
callq 0x2050
movq 0x28dcb(%rip), %rdi     # 0x2f500
callq 0x2050
movq 0x28dcf(%rip), %rdi     # 0x2f510
callq 0x2050
movq 0x28dd3(%rip), %rdi     # 0x2f520
callq 0x2050
callq 0x63c9
movq %rbx, 0x28dd2(%rip)     # 0x2f530
xorl %ebp, %ebp
jmp 0x682f
leaq 0x3eb9(%rip), %rdi      # 0xa625
jmp 0x6786
leaq 0x3e0d(%rip), %rdi      # 0xa582
movq %r14, %rsi
movl %ebp, %edx
jmp 0x6822
leaq 0x3e74(%rip), %rdi      # 0xa5fa
movq %r14, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x29aa
jmp 0x682c
cmpq %rbx, %r13
je 0x67e4
movq 0x8(%r15), %r15
pushq $0x3a
popq %rsi
movq %r15, %rdi
callq 0x2160
testq %rax, %rax
je 0x6815
movq (%r13), %rsi
movq %r15, %rdi
callq 0x2e68
movq 0x28d6d(%rip), %rcx     # 0x2f530
movq %rax, (%rcx)
testq %rax, %rax
je 0x682c
incl 0x7bdf(%rip)            # 0xe3b0
jmp 0x682f
movl $0x3, 0x8(%r13)
jmp 0x682f
andl $0x0, 0x8(%r13)
jmp 0x682f
leaq 0x3e73(%rip), %rdi      # 0xa65e
jmp 0x681c
movl 0x30(%r13), %eax
cmpl 0x28c89(%rip), %eax     # 0x2f480
jne 0x68c2
movq 0x8(%r15), %rdi
cmpb $0x0, (%rdi)
je 0x6922
callq 0x2320
movl %eax, 0x30(%r13)
jmp 0x682f
leaq 0x3e7d(%rip), %rdi      # 0xa699
movq %r14, %rsi
movl (%rsp), %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x29aa
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r15), %r15
cmpb $0x0, (%r15)
je 0x6916
leaq 0x3f33(%rip), %rsi      # 0xa78b
movq %r15, %rdi
callq 0x2200
testl %eax, %eax
je 0x6d15
leaq 0x3f26(%rip), %rsi      # 0xa795
movq %r15, %rdi
callq 0x2200
testl %eax, %eax
je 0x6d35
leaq 0x3f1d(%rip), %rsi      # 0xa7a3
movq %r15, %rdi
callq 0x2200
testl %eax, %eax
je 0x6d2b
leaq 0x3f03(%rip), %rsi      # 0xa7a0
movq %r15, %rdi
callq 0x2200
testl %eax, %eax
je 0x6d2b
leaq 0x3ef5(%rip), %rdi      # 0xa7a9
movq %r14, %rsi
movl (%rsp), %edx
movq %r15, %rcx
jmp 0x6825
leaq 0x3b62(%rip), %rdi      # 0xa42b
xorl %ebp, %ebp
movq %r14, %rsi
movl (%rsp), %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x29aa
jmp 0x682f
movq 0x8(%r15), %rdi
cmpb $0x0, (%rdi)
je 0x6d1f
callq 0x2320
movl %eax, 0x48(%r13)
jmp 0x682f
movq 0x8(%r15), %rdi
cmpb $0x0, (%rdi)
je 0x6d3f
callq 0x2320
movl %eax, 0x68(%r13)
jmp 0x682f
leaq 0x3e3e(%rip), %rdi      # 0xa75b
jmp 0x681c
leaq 0x3de6(%rip), %rdi      # 0xa70f
jmp 0x681c
cmpq %rbx, %r13
movl (%rsp), %ebx
je 0x6d4b
movq 0x10(%r15), %rax
cmpb $0x0, (%rax)
je 0x6d54
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x21f0
testq %rax, %rax
je 0x6d65
movq 0x10(%r13), %rcx
movq %rcx, (%rax)
movq %rax, 0x10(%r13)
movq %r13, 0x20(%rax)
movl $0x1, 0x34(%rax)
movabsq $-0xffffff38, %rcx      # imm = 0xFFFFFFFF000000C8
movq %rcx, 0x2c(%rax)
pushq $0x1
popq %rbx
xorl %ebp, %ebp
movq %rax, 0x8(%rsp)
movslq %ebx, %r12
movq (%r15,%r12,8), %r13
cmpb $0x0, (%r13)
je 0x682f
movq %r13, %rdi
leaq 0x3ea6(%rip), %rsi      # 0xa84b
callq 0x2200
testl %eax, %eax
je 0x6a95
movq %r13, %rdi
leaq 0x3e97(%rip), %rsi      # 0xa853
callq 0x2200
testl %eax, %eax
je 0x6ab0
movq %r13, %rdi
leaq 0x3e7d(%rip), %rsi      # 0xa850
callq 0x2200
testl %eax, %eax
je 0x6ac3
movq %r13, %rdi
leaq 0x3e6f(%rip), %rsi      # 0xa859
callq 0x2200
testl %eax, %eax
je 0x6ad3
movq %r13, %rdi
leaq 0x3b3d(%rip), %rsi      # 0xa53e
callq 0x2200
testl %eax, %eax
je 0x6aed
movq %r13, %rdi
leaq 0x3e46(%rip), %rsi      # 0xa85e
callq 0x2200
testl %eax, %eax
je 0x6b07
movq %r13, %rdi
leaq 0x3aca(%rip), %rsi      # 0xa4f9
callq 0x2200
testl %eax, %eax
je 0x6b21
movq %r13, %rdi
leaq 0x3f87(%rip), %rsi      # 0xa9cd
callq 0x2200
testl %eax, %eax
je 0x6c58
movq %r13, %rdi
leaq 0x3f78(%rip), %rsi      # 0xa9d5
callq 0x2200
testl %eax, %eax
jne 0x6e20
movq 0x8(%r15,%r12,8), %rdi
callq 0x2320
leal -0x1(%rax), %ecx
cmpl $0xff, %ecx
ja 0x6e3b
decb %al
movq 0x8(%rsp), %rcx
movb %al, 0x10(%rcx)
addl $0x2, %ebx
jmp 0x6989
movq 0x8(%r15,%r12,8), %rdi
callq 0x23e0
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
addl $0x2, %ebx
jmp 0x6989
movq 0x8(%rsp), %rcx
movl $0x1, 0x34(%rcx)
incl %ebx
jmp 0x6989
movq 0x8(%rsp), %rcx
andl $0x0, 0x34(%rcx)
incl %ebx
jmp 0x6989
movq 0x8(%r15,%r12,8), %rdi
callq 0x2320
movq 0x8(%rsp), %rcx
movl %eax, 0x2c(%rcx)
addl $0x2, %ebx
jmp 0x6989
movq 0x8(%r15,%r12,8), %rdi
callq 0x2320
movq 0x8(%rsp), %rcx
movl %eax, 0x30(%rcx)
addl $0x2, %ebx
jmp 0x6989
movq 0x8(%r15,%r12,8), %rdi
callq 0x2320
movq 0x8(%rsp), %rcx
movl %eax, 0x28(%rcx)
addl $0x2, %ebx
jmp 0x6989
movq 0x8(%r15), %rax
cmpb $0x0, (%rax)
je 0x6d9b
movq 0x8(%r15,%r12,8), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2330
movl %eax, %r8d
testl %eax, %eax
leaq 0x278e8(%rip), %r13     # 0x2e430
movl %eax, 0x4(%rsp)
js 0x6d76
movl %r8d, %edi
leaq 0x28(%rsp), %rsi
callq 0x23f0
movl 0x4(%rsp), %r8d
testl %eax, %eax
js 0x6d76
movq %r13, %r9
movq 0x8(%rsp), %r13
movl 0x30(%r13), %ecx
testl %ecx, %ecx
sets %dl
movl %ecx, %esi
movq 0x58(%rsp), %rax
cmpq %rsi, %rax
setl %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x6b9a
movl %eax, 0x30(%r13)
movl %eax, %ecx
movl 0x2c(%r13), %edx
movl 0x34(%r13), %r10d
testl %r10d, %r10d
leaq 0x35a4(%rip), %r8       # 0xa150
leaq 0x3d9c(%rip), %rax      # 0xa94f
cmoveq %rax, %r8
movl 0x28(%r13), %r11d
movq %r9, %rdi
leaq 0x3cfd(%rip), %rsi      # 0xa8c2
movl %ecx, %r9d
xorl %eax, %eax
pushq %r11
pushq %rcx
pushq %r10
pushq %rdx
pushq 0x8(%r13)
pushq %r11
callq 0x23a0
addq $0x30, %rsp
movslq 0x30(%r13), %rdx
movl %eax, 0x1c(%rsp)
movslq %eax, %r13
movq %rdx, 0x20(%rsp)
leaq (%rdx,%r13), %rdi
callq 0x2290
testq %rax, %rax
je 0x6daa
movq %rax, %rdi
leaq 0x27825(%rip), %rsi     # 0x2e430
movq %r13, %rdx
movq %rax, 0x10(%rsp)
callq 0x2250
movq 0x10(%rsp), %rsi
addq %r13, %rsi
movl 0x4(%rsp), %edi
movq 0x20(%rsp), %rdx
callq 0x21d0
movq %rax, %r13
movl 0x4(%rsp), %edi
callq 0x21b0
movq 0x8(%rsp), %rcx
cmpl %r13d, 0x30(%rcx)
jne 0x6dc9
movl 0x1c(%rsp), %eax
addl %r13d, %eax
movl %eax, 0x30(%rcx)
jmp 0x6d04
movq 0x8(%r15), %rax
cmpb $0x0, (%rax)
je 0x6d9b
movq 0x8(%r15,%r12,8), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2330
movl %eax, %r13d
testl %eax, %eax
js 0x6df1
movl %r13d, %edi
leaq 0x28(%rsp), %rsi
callq 0x23f0
testl %eax, %eax
js 0x6df1
movl %r13d, 0x4(%rsp)
movq 0x8(%rsp), %rdi
movl 0x30(%rdi), %eax
testl %eax, %eax
sets %dl
movl %eax, %esi
movq 0x58(%rsp), %rcx
cmpq %rsi, %rcx
setl %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x6cc1
movl %ecx, 0x30(%rdi)
movl %ecx, %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x2290
testq %rax, %rax
je 0x6daa
movl 0x4(%rsp), %edi
movq %rax, 0x10(%rsp)
movq %rax, %rsi
movq %r13, %rdx
callq 0x21d0
movq %rax, %r13
movl 0x4(%rsp), %edi
callq 0x21b0
movq 0x8(%rsp), %rcx
cmpl %r13d, 0x30(%rcx)
jne 0x6dc9
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rcx)
addl $0x2, %ebx
jmp 0x6989
orb $0x1, 0x4e(%r13)
jmp 0x682f
leaq 0x373c(%rip), %rdi      # 0xa462
jmp 0x681c
orb $0x4, 0x4e(%r13)
jmp 0x682f
orb $0x21, 0x4e(%r13)
jmp 0x682f
leaq 0x3a91(%rip), %rdi      # 0xa7d7
jmp 0x681c
leaq 0x390c(%rip), %rdi      # 0xa65e
jmp 0x6d5b
leaq 0x3abb(%rip), %rdi      # 0xa816
movq %r14, %rsi
movl %ebx, %edx
jmp 0x6822
leaq 0x388e(%rip), %rdi      # 0xa5fa
movq %r14, %rsi
movl %ebx, %edx
jmp 0x678b
movq 0x8(%r15,%r12,8), %rcx
leaq 0x3b14(%rip), %rdi      # 0xa896
movq %r14, %rsi
movl (%rsp), %edx
xorl %eax, %eax
movl %r8d, %ebx
callq 0x29aa
testl %ebx, %ebx
jns 0x6dc3
jmp 0x682c
movq (%r15), %rcx
leaq 0x3abe(%rip), %rdi      # 0xa863
jmp 0x6e30
movq 0x8(%r15,%r12,8), %rcx
leaq 0x3bb3(%rip), %rdi      # 0xa969
movq %r14, %rsi
movl (%rsp), %edx
xorl %eax, %eax
callq 0x29aa
movl 0x4(%rsp), %edi
jmp 0x6e16
movq 0x8(%r15,%r12,8), %rcx
leaq 0x3bcc(%rip), %rdi      # 0xa9a1
movq %r14, %rsi
movl (%rsp), %edx
xorl %eax, %eax
callq 0x29aa
movq 0x10(%rsp), %rdi
callq 0x2050
jmp 0x682c
movq 0x8(%r15,%r12,8), %rcx
leaq 0x3a99(%rip), %rdi      # 0xa896
movq %r14, %rsi
movl (%rsp), %edx
xorl %eax, %eax
callq 0x29aa
testl %r13d, %r13d
js 0x682c
movl %r13d, %edi
callq 0x21b0
jmp 0x682c
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rcx
leaq 0x3bf1(%rip), %rdi      # 0xaa21
movq %r14, %rsi
movl (%rsp), %edx
jmp 0x6825
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
leaq 0x3b91(%rip), %rdi      # 0xa9dc
movq %r14, %rsi
movl (%rsp), %edx
movl %eax, %r8d
xorl %eax, %eax
callq 0x29aa
jmp 0x682c