// File: /workspace/github_c_makefile_star2_O3/tomka[P]cliaspora/cliaspora.c
// Function: main
int
main(int argc, char *argv[])
{
	int	  ch, eflag, mflag, i, len, aspect_id, user_id, pm_id; 
	bool	  public, have_cfg;
	char	  *account, *host, *user, *pass, *p, *ans, *buf, url[256];
	session_t *sp;
	contact_t *contacts;

	if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) {
		warnx("Failed to set locale to \"en_US.UTF-8\". Using " \
		    "default locale.");
		if (setlocale(LC_CTYPE, "C") == NULL)
			warnx("Failed to set default locale.");
		warnx("Expect messed up output");
	}

	eflag = mflag = 0; account = NULL;
	while ((ch = getopt(argc, argv, "a:emh")) != -1) {
		switch (ch) {
		case 'a':
			account = optarg;
			break;
		case 'e':
			eflag = 1;
			break;
		case 'm':
			mflag = 1;
			break;
		case 'h':
		case '?':
		default:
			usage();
			break;
		}
	}
	argc -= optind;
	argv += optind;

	if (argc == 0)
		usage();

	(void)signal(SIGINT, cleanup);
	(void)signal(SIGTERM, cleanup);
	(void)signal(SIGHUP, cleanup);
	(void)signal(SIGQUIT, cleanup);

	switch (read_config(account)) {
	case  0:
		have_cfg = true;
		break;
	case -1:
		errx(EXIT_FAILURE, "Failed to read config file");
		/* NOTREACHED */
	default:
		have_cfg = false;
	}
	sp = NULL;
	if (strcmp(argv[0], "session") == 0) {
		if (argc < 2)
			usage();
		if (strcmp(argv[1], "close") == 0) {
			if (!have_cfg)
				errx(EXIT_FAILURE, "There is no session.");
			if ((sp = create_session()) == NULL) {
				errx(EXIT_FAILURE,
				    "Failed to create session.");
			}
			close_session(sp);
			return (EXIT_SUCCESS);
		}
		if (strcmp(argv[1], "new") != 0 || argc < 3)
			usage();
		if ((user = strtok(argv[2], "@")) == NULL)
			usage();
		if ((host = strtok(NULL, "@")) == NULL)
			usage();
		if (argc > 3)
			pass = argv[3];
		else if ((pass = readpass()) == NULL)
			errx(EXIT_FAILURE, "readpass() failed");
		sp = new_session(host, SSL_PORT, user, pass);
		if (sp == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
	} else if (!have_cfg)
		errx(EXIT_FAILURE, "Please create a session first.");
	else if (strcmp(argv[0], "show") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (strcmp(argv[1], "stream") == 0)
			read_stream(sp, "/stream");
		else if (strcmp(argv[1], "activity") == 0)
			read_stream(sp, "/activity");
		else if (strcmp(argv[1], "mystream") == 0) {
			if (cfg.user == NULL || cfg.user[0] == '\0') {
				errx(EXIT_FAILURE, "Username not set. " \
				    "Please create a new session.");
			}
			(void)snprintf(url, sizeof(url), "/u/%s", cfg.user);
			read_stream(sp, url);
		} else
			usage();
	} else if (strcmp(argv[0], "lookup") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if ((contacts = lookup_user(sp, argv[1])) == NULL)
			errx(EXIT_FAILURE, "Failed to look up %s", argv[1]);
		show_contacts(contacts);
	} else if (strcmp(argv[0], "list") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (strcmp(argv[1], "contacts") == 0) {
			if (get_contacts(sp) == NULL)
				errx(EXIT_FAILURE, "Failed to get contacts");
			show_contacts(sp->contacts);
		} else if (strcmp(argv[1], "messages") == 0) {
			if (get_contacts(sp) == NULL)
				warnx("Failed to get contacts");
			if (get_msg_index(sp) == NULL) {
				errx(EXIT_FAILURE,
				    "Failed to get message index");
			}
			show_msg_index(sp);
			exit(0);
		} else if (strcmp(argv[1], "aspects") == 0)
			show_aspects(sp);
		else
			usage();
	} else if (strcmp(argv[0], "like") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (like(sp, strtol(argv[1], NULL, 10)) == -1)
			errx(EXIT_FAILURE, "Failed to \"like\" post");
	} else if (strcmp(argv[0], "delete") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (delete_post(sp, strtol(argv[1], NULL, 10)) == -1)
			errx(EXIT_FAILURE, "Failed to delete post");
	} else if (strcmp(argv[0], "upload") == 0) {
		if (argc < 3)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (strcmp(argv[1], "public") != 0 &&
		    get_aspect_id(sp, argv[1]) == -1) {
			errx(EXIT_FAILURE, "Unknown aspect '%s'", argv[1]);
		}
		if (mflag == 1)
			buf = get_input(eflag == 1 ? false : true);
		if (upload(sp, argv[1], mflag ? buf : NULL, &argv[2]) == -1)
			errx(EXIT_FAILURE, "Failed to upload file(s).");
		if (mflag == 1 && eflag == 1)
			delete_postponed();
	} else if (strcmp(argv[0], "poll") == 0) {
		if (argc < 5)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		for (ans = NULL, len = 0, i = 3; i < argc; i++) {
			if ((p = json_escape_str(argv[i])) == NULL)
				err(EXIT_FAILURE, "json_escape_str()");
			len += strlen(p) + 4;
			if ((ans = realloc(ans, len)) == NULL)
				err(EXIT_FAILURE, "realloc()");
			if (i == 3)
				/* First iteration. Initialize 'ans' */
				*ans = '\0';
			(void)sprintf(ans + strlen(ans), "\"%s\"%s", p,
			    argc - 1 > i ? "," : "");
			free(p);
		}
		if (mflag == 1)
			buf = get_input(eflag == 1 ? false : true);
		if (dpoll(sp, argv[1], mflag ? buf : NULL, argv[2], ans) == -1)
			errx(EXIT_FAILURE, "Failed to start poll.");
		if (mflag == 1 && eflag == 1)
			delete_postponed();
	} else if (strcmp(argv[0], "reshare") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (reshare(sp, strtol(argv[1], NULL, 10)) == -1)
			errx(EXIT_FAILURE, "Failed to reshare post");
 	} else if (strcmp(argv[0], "follow") == 0) {
		if (argc < 3)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE,  "Failed to create session.");
		if (strcmp(argv[1], "tag") == 0) {
			if (follow_tag(sp, argv[2]) == -1)
				errx(EXIT_FAILURE, "Failed to follow tag.");
		} else if (strcmp(argv[1], "user") == 0) {
			if (argc < 4)
				usage();
			contacts = lookup_user(sp, argv[2]);
			if (contacts == NULL) {
				errx(EXIT_FAILURE, "Failed to lookup '%s'",
				    argv[2]);
			}
			user_id = get_contact_id(contacts, argv[2]);
			if (user_id == -1) {
				errx(EXIT_FAILURE, "Couldn't find '%s'",
				    argv[2]);
			}
			aspect_id = get_aspect_id(sp, argv[3]);
			if (aspect_id == -1) {
				errx(EXIT_FAILURE, "Aspect '%s' not found",
				    argv[3]);
			}
			if (add_contact(sp, aspect_id, user_id) == -1)
				errx(EXIT_FAILURE, "Failed to follow");
		} else
			usage();
	} else if (strcmp(argv[0], "add") == 0) {
		if (argc < 4)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (strcmp(argv[1], "aspect") == 0) {
			public = false;
			if (strcmp(argv[3], "public") == 0)
				public = true;
			else if (strcmp(argv[3], "private") == 0)
				public = false;
			else
				usage();
			if (add_aspect(sp, argv[2], public) == -1)
				errx(EXIT_FAILURE, "Failed to add aspect");
		} else
			usage();
	} else if (strcmp(argv[0], "post") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (strcmp(argv[1], "public") != 0 &&
		    get_aspect_id(sp, argv[1]) == -1) {
			errx(EXIT_FAILURE, "Unknown aspect '%s'", argv[1]);
		}
		buf = get_input(eflag == 1 ? false : true);
		if (post(sp, buf, argv[1]) == -1)
			errx(EXIT_FAILURE, "Failed to post");
		if (eflag == 1)
			delete_postponed();
	} else if (strcmp(argv[0], "comment") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		buf = get_input(eflag == 1 ? false : true);
		if (comment(sp, buf, strtol(argv[1], NULL, 10)) == -1)
			errx(EXIT_FAILURE, "Failed to send comment");
		if (eflag == 1)
			delete_postponed();
	} else if (strcmp(argv[0], "message") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		if (get_contacts(sp) == NULL)
			errx(EXIT_FAILURE, "Failed to get contacts");
		if ((pm_id = get_pm_id(sp, argv[1])) == -1) {
			errx(EXIT_FAILURE, "Failed to get %s's PM ID",
			    argv[1]);
		}
		buf = get_input(eflag == 1 ? false : true);
		if (message(sp, argc > 2 ? argv[2] : "No subject", buf,
		    pm_id) == -1)
			errx(EXIT_FAILURE, "Failed to send message");
		if (eflag == 1)
			delete_postponed();
	} else if (strcmp(argv[0], "reply") == 0) {
		if (argc < 2)
			usage();
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		buf = get_input(eflag == 1 ? false : true);
		if (reply(sp, buf, strtol(argv[1], NULL, 10)) == -1) {
			errx(EXIT_FAILURE, "Failed to reply to message %d",
			    (int)strtol(argv[1], NULL, 10));
		}
		if (eflag == 1)
			delete_postponed();
	} else if (strcmp(argv[0], "status") == 0) {
		if ((sp = create_session()) == NULL)
			errx(EXIT_FAILURE, "Failed to create session.");
		(void)puts("NOTIFICATIONS  NEW MESSAGES");
		(void)printf("%-13d  %d\n", sp->attr.nc, sp->attr.mc);
	} else
		usage();
	exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x7766(%rip), %rsi      # 0xa020
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x2240
testq %rax, %rax
jne 0x2905
leaq 0x775d(%rip), %rdi      # 0xa02c
xorl %eax, %eax
callq 0x22d0
leaq 0x778c(%rip), %rsi      # 0xa069
xorl %edi, %edi
callq 0x2240
testq %rax, %rax
jne 0x28f7
leaq 0x777b(%rip), %rdi      # 0xa06b
xorl %eax, %eax
callq 0x22d0
leaq 0x778b(%rip), %rdi      # 0xa089
xorl %eax, %eax
callq 0x22d0
movb $0x1, %al
movl %eax, 0xc(%rsp)
leaq 0x778f(%rip), %r12      # 0xa0a1
movq 0xc6a7(%rip), %r13      # 0xefc0
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
movl %ebp, %ecx
movl %ecx, %ebp
movl %r14d, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x20e0
movl $0x1, %ecx
cmpl $0x65, %eax
je 0x2927
cmpl $-0x1, %eax
je 0x296b
cmpl $0x6d, %eax
je 0x295a
cmpl $0x61, %eax
jne 0x3483
movq (%r13), %r15
jmp 0x2925
movb $0x1, %al
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
jmp 0x2925
movq 0xc66e(%rip), %rax      # 0xefe0
movslq (%rax), %rax
subl %eax, %r14d
je 0x3483
leaq (%rbx,%rax,8), %rbx
leaq 0xbe2(%rip), %r12       # 0x356b
movl $0x2, %edi
movq %r12, %rsi
callq 0x23b0
movl $0xf, %edi
movq %r12, %rsi
callq 0x23b0
movl $0x1, %edi
movq %r12, %rsi
callq 0x23b0
movl $0x3, %edi
movq %r12, %rsi
callq 0x23b0
movq %r15, %rdi
callq 0x6923
testl %eax, %eax
je 0x29f4
cmpl $-0x1, %eax
je 0x2b52
movq (%rbx), %rdi
leaq 0x7a58(%rip), %rsi      # 0xa434
callq 0x2450
movb $0x1, %bpl
testl %eax, %eax
je 0x2a10
leaq 0x7720(%rip), %rsi      # 0xa10f
jmp 0x2cfb
movq (%rbx), %r15
leaq 0x7a36(%rip), %rsi      # 0xa434
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2b5e
xorl %ebp, %ebp
cmpl $0x1, %r14d
jle 0x3483
movq 0x8(%rbx), %r15
leaq 0x769d(%rip), %rsi      # 0xa0c2
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2ada
testb %bpl, %bpl
jne 0x2b46
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq (%rax), %rdi
movzwl 0x10(%rax), %esi
callq 0x7710
testq %rax, %rax
je 0x2ac6
movq %rax, %rbx
movq 0x8(%r14), %rdx
leaq 0x7a5d(%rip), %rax      # 0xa4cb
movq %rax, (%rsp)
leaq 0x7a61(%rip), %rsi      # 0xa4da
leaq 0x7a17(%rip), %rcx      # 0xa497
leaq 0x7979(%rip), %r8       # 0xa400
movq %rbx, %rdi
movl $0x3, %r9d
callq 0x8281
cmpl $-0x1, %eax
je 0x2abe
cmpl $0x12e, %eax            # imm = 0x12E
sete %cl
cmpl $0x12c, %eax            # imm = 0x12C
setl %dl
orb %cl, %dl
jne 0x2abe
leaq 0x7c06(%rip), %rdi      # 0xa6bb
movl %eax, %esi
xorl %eax, %eax
callq 0x22d0
movq %rbx, %rdi
callq 0x7921
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7616(%rip), %rsi      # 0xa0f7
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
sete %al
cmpl $0x2, %r14d
setne %cl
testb %cl, %al
je 0x3483
movq 0x10(%rbx), %rdi
leaq 0x75f3(%rip), %rsi      # 0xa0fb
callq 0x2500
testq %rax, %rax
je 0x3483
movq %rax, %r15
leaq 0x75db(%rip), %rsi      # 0xa0fb
xorl %edi, %edi
callq 0x2500
testq %rax, %rax
je 0x3483
movq %rax, %r12
cmpl $0x4, %r14d
jb 0x2cca
movq 0x18(%rbx), %rdx
jmp 0x2ce0
leaq 0x757b(%rip), %rsi      # 0xa0c8
jmp 0x2cfb
leaq 0x754e(%rip), %rsi      # 0xa0a7
jmp 0x2cfb
leaq 0x75c9(%rip), %rsi      # 0xa12e
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2bb3
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %rbx
leaq 0x8cac(%rip), %rsi      # 0xb843
movq %rbx, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2d07
leaq 0x7585(%rip), %rsi      # 0xa133
jmp 0x2d21
leaq 0x75c9(%rip), %rsi      # 0xa183
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2c0a
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x4276
testq %rax, %rax
jne 0x2d84
movq 0x8(%rbx), %rdx
leaq 0x758c(%rip), %rsi      # 0xa18a
movl $0x1, %edi
xorl %eax, %eax
callq 0x2590
leaq 0x758e(%rip), %rsi      # 0xa19f
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2c70
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %rbx
leaq 0x77b4(%rip), %rsi      # 0xa3f7
movq %rbx, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2e44
movq %r14, %rdi
callq 0x45ef
testq %rax, %rax
jne 0x2fc1
leaq 0x7539(%rip), %rsi      # 0xa1a4
jmp 0x2cfb
leaq 0x7560(%rip), %rsi      # 0xa1d7
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2d2b
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2460
movq %r14, %rdi
movl %eax, %esi
callq 0x4d1f
cmpl $-0x1, %eax
jne 0x2d8c
leaq 0x7514(%rip), %rsi      # 0xa1dc
jmp 0x2cfb
callq 0x9655
movq %rax, %rdx
testq %rax, %rax
jne 0x2ce0
leaq 0x741f(%rip), %rsi      # 0xa0fd
jmp 0x2cfb
movq %r12, %rdi
movq %r15, %rsi
callq 0x362e
testq %rax, %rax
jne 0x2d8c
leaq 0x73e2(%rip), %rsi      # 0xa0dd
movl $0x1, %edi
xorl %eax, %eax
callq 0x2590
leaq 0x742e(%rip), %rsi      # 0xa13c
movq %rbx, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2d93
leaq 0x741a(%rip), %rsi      # 0xa13b
movq %r14, %rdi
callq 0x3b82
jmp 0x2d8c
leaq 0x77a1(%rip), %rsi      # 0xa4d3
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2dcf
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2460
movq %r14, %rdi
movl %eax, %esi
callq 0x4dfc
cmpl $-0x1, %eax
jne 0x2d8c
leaq 0x7473(%rip), %rsi      # 0xa1f2
jmp 0x2cfb
movq %rax, %rdi
callq 0x4540
xorl %edi, %edi
callq 0x23e0
leaq 0x73ab(%rip), %rsi      # 0xa145
movq %rbx, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3483
leaq 0xc64f(%rip), %rax      # 0xf400
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x2dc3
cmpb $0x0, (%rcx)
jne 0x304b
leaq 0x7384(%rip), %rsi      # 0xa14e
jmp 0x2cfb
leaq 0x7432(%rip), %rsi      # 0xa208
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2e93
cmpl $0x2, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %r15
leaq 0x7403(%rip), %rsi      # 0xa20f
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
je 0x30ec
movq %r14, %rdi
movq %r15, %rsi
callq 0x4ec6
cmpl $-0x1, %eax
jne 0x30ec
leaq 0x73df(%rip), %rsi      # 0xa216
movl $0x1, %edi
movq %r15, %rdx
jmp 0x2c03
leaq 0x77ac(%rip), %rsi      # 0xa5f7
movq %rbx, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2fca
movq %r14, %rdi
callq 0x45ef
testq %rax, %rax
jne 0x2e76
leaq 0x7335(%rip), %rdi      # 0xa1a4
xorl %eax, %eax
callq 0x22d0
movq %r14, %rdi
callq 0x4898
testq %rax, %rax
jne 0x3071
leaq 0x732d(%rip), %rsi      # 0xa1bb
jmp 0x2cfb
leaq 0x73aa(%rip), %rsi      # 0xa244
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x2fee
cmpl $0x4, %r14d
jle 0x3483
callq 0x3584
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x2cf4
leal -0x1(%r14), %eax
movq %rax, 0x28(%rsp)
movl %r14d, %eax
movq %rax, 0x20(%rsp)
movl $0x3, %r12d
xorl %r14d, %r14d
xorl %r13d, %r13d
movq (%rbx,%r12,8), %rdi
callq 0x8eb3
testq %rax, %rax
je 0x327d
movq %rax, %r15
movq %rax, %rdi
callq 0x2150
movslq %r13d, %rcx
addq %rcx, %rax
addq $0x4, %rax
movq %rax, %r13
movslq %eax, %rsi
movq %r14, %rdi
callq 0x2540
testq %rax, %rax
je 0x3286
movq %rax, %r14
cmpq $0x3, %r12
jne 0x2f2f
movb $0x0, (%r14)
movq %r14, %rdi
callq 0x2150
movq %r14, %rdi
addq %rax, %rdi
cmpq 0x28(%rsp), %r12
leaq 0x8bf8(%rip), %rcx      # 0xbb41
leaq 0x75cb(%rip), %rax      # 0xa51b
cmovbq %rax, %rcx
leaq 0x730a(%rip), %rsi      # 0xa265
movq %r15, %rdx
xorl %eax, %eax
callq 0x20c0
movq %r15, %rdi
callq 0x23c0
incq %r12
cmpq %r12, 0x20(%rsp)
jne 0x2ee4
testb $0x1, 0x10(%rsp)
je 0x2f8c
movl %ebp, %edi
xorl $0x1, %edi
callq 0x918f
xorl %edx, %edx
testb $0x1, 0xc(%rsp)
cmoveq %rax, %rdx
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rcx
movq 0x18(%rsp), %rdi
movq %r14, %r8
callq 0x53bb
cmpl $-0x1, %eax
jne 0x31d3
leaq 0x72b0(%rip), %rsi      # 0xa26c
jmp 0x2cfb
movq 0x20(%r14), %rdi
jmp 0x2d87
leaq 0x767c(%rip), %rsi      # 0xa64d
movq %rbx, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3483
movq %r14, %rdi
callq 0x4c98
jmp 0x2d8c
leaq 0x728d(%rip), %rsi      # 0xa282
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x307e
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2460
movq %r14, %rdi
movl %eax, %esi
callq 0x5597
cmpl $-0x1, %eax
jne 0x2d8c
leaq 0x7244(%rip), %rsi      # 0xa28a
jmp 0x2cfb
leaq 0x712b(%rip), %rdx      # 0xa17d
leaq 0x30(%rsp), %rbx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2530
movq %r14, %rdi
movq %rbx, %rsi
jmp 0x2d24
movq %r14, %rdi
callq 0x4b92
jmp 0x2d8c
leaq 0x727f(%rip), %rsi      # 0xa304
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3133
cmpl $0x2, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r15
movq 0x8(%rbx), %r12
leaq 0x71e6(%rip), %rsi      # 0xa2a1
movq %r12, %rdi
callq 0x2450
testl %eax, %eax
jne 0x330a
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x5819
cmpl $-0x1, %eax
jne 0x2d8c
leaq 0x71be(%rip), %rsi      # 0xa2a5
jmp 0x2cfb
testb $0x1, 0x10(%rsp)
je 0x3101
movl %ebp, %edi
xorl $0x1, %edi
callq 0x918f
movq 0x8(%rbx), %r15
xorl %edx, %edx
testb $0x1, 0xc(%rsp)
cmoveq %rax, %rdx
addq $0x10, %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x4f02
cmpl $-0x1, %eax
jne 0x31d3
leaq 0x70fc(%rip), %rsi      # 0xa22a
jmp 0x2cfb
leaq 0x71d1(%rip), %rsi      # 0xa30b
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x31f2
cmpl $0x3, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %rdi
leaq 0x71b5(%rip), %rsi      # 0xa325
callq 0x2450
testl %eax, %eax
jne 0x3483
movq 0x18(%rbx), %r15
leaq 0x7087(%rip), %rsi      # 0xa20f
movq %r15, %rdi
callq 0x2450
movl $0x1, %edx
testl %eax, %eax
je 0x31b2
leaq 0x716f(%rip), %rsi      # 0xa30f
movq %r15, %rdi
callq 0x2450
xorl %edx, %edx
testl %eax, %eax
jne 0x3483
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x5a30
cmpl $-0x1, %eax
jne 0x2d8c
leaq 0x7149(%rip), %rsi      # 0xa317
jmp 0x2cfb
testl %ebp, %ebp
setne %al
movq 0x10(%rsp), %rcx
andb %al, %cl
cmpb $0x1, %cl
jne 0x2d8c
callq 0x9010
jmp 0x2d8c
leaq 0x6ff4(%rip), %rsi      # 0xa1ed
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3299
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movq 0x8(%rbx), %r15
leaq 0x6fe0(%rip), %rsi      # 0xa20f
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
je 0x324f
movq %r14, %rdi
movq %r15, %rsi
callq 0x4ec6
cmpl $-0x1, %eax
je 0x2e30
movl %ebp, %edi
xorl $0x1, %edi
callq 0x918f
movq 0x8(%rbx), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x5b54
cmpl $-0x1, %eax
jne 0x353d
leaq 0x70b4(%rip), %rsi      # 0xa32c
jmp 0x2cfb
leaq 0x6fc5(%rip), %rsi      # 0xa249
jmp 0x328d
leaq 0x6fce(%rip), %rsi      # 0xa25b
movl $0x1, %edi
xorl %eax, %eax
callq 0x2250
leaq 0x70aa(%rip), %rsi      # 0xa34a
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3350
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movl %ebp, %edi
xorl $0x1, %edi
callq 0x918f
movq %rax, %r15
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2460
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x5ce6
cmpl $-0x1, %eax
jne 0x353d
leaq 0x7036(%rip), %rsi      # 0xa33b
jmp 0x2cfb
leaq 0x746c(%rip), %rsi      # 0xa77d
movq %r12, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3483
cmpl $0x3, %r14d
je 0x3483
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x4276
movq 0x10(%rbx), %r14
testq %rax, %rax
jne 0x3499
leaq 0x6f70(%rip), %rsi      # 0xa2bb
jmp 0x34c9
leaq 0x702e(%rip), %rsi      # 0xa385
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x33b4
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r15
movq %rax, %rdi
callq 0x45ef
testq %rax, %rax
je 0x2c64
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x5e28
cmpl $-0x1, %eax
jne 0x34d6
movq 0x8(%rbx), %rdx
leaq 0x6fa3(%rip), %rsi      # 0xa352
jmp 0x2bfe
leaq 0x70b2(%rip), %rsi      # 0xa46d
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x343a
cmpl $0x1, %r14d
jle 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %r14
movl %ebp, %edi
xorl $0x1, %edi
callq 0x918f
movq %rax, %r15
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2460
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x60b9
cmpl $-0x1, %eax
jne 0x353d
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2460
leaq 0x6f61(%rip), %rsi      # 0xa38d
movl $0x1, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x2590
leaq 0x6f6a(%rip), %rsi      # 0xa3ab
movq %r15, %rdi
callq 0x2450
testl %eax, %eax
jne 0x3483
callq 0x3584
testq %rax, %rax
je 0x2cf4
movq %rax, %rbx
leaq 0x6f4d(%rip), %rdi      # 0xa3b2
callq 0x24e0
movl 0x2c(%rbx), %esi
movl 0x30(%rbx), %edx
leaq 0x6f57(%rip), %rdi      # 0xa3ce
xorl %eax, %eax
callq 0x2070
jmp 0x2d8c
leaq 0x74f4(%rip), %rdi      # 0xa97e
callq 0x24e0
movl $0x1, %edi
callq 0x23e0
movq %rax, %r12
movq 0x10(%r12), %rdi
movq %r14, %rsi
callq 0x2450
testl %eax, %eax
je 0x34b9
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0x349c
jmp 0x34c2
movl (%r12), %ebp
cmpl $-0x1, %ebp
jne 0x34f2
leaq 0x6e08(%rip), %rsi      # 0xa2d1
movl $0x1, %edi
movq %r14, %rdx
jmp 0x2c03
movl %eax, %r12d
movl %ebp, %edi
xorl $0x1, %edi
callq 0x918f
cmpl $0x2, %r14d
jne 0x351a
leaq 0x6e7b(%rip), %rsi      # 0xa36b
jmp 0x351e
movq 0x18(%rbx), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4ec6
cmpl $-0x1, %eax
jne 0x354a
leaq 0x6dd7(%rip), %rsi      # 0xa2e4
movl $0x1, %edi
movq %rbx, %rdx
jmp 0x2c03
movq 0x10(%rbx), %rsi
movq %r15, %rdi
movq %rax, %rdx
movl %r12d, %ecx
callq 0x5f6f
cmpl $-0x1, %eax
jne 0x353d
leaq 0x6e3e(%rip), %rsi      # 0xa376
jmp 0x2cfb
testl %ebp, %ebp
je 0x2d8c
jmp 0x31e8
movq %r15, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x5923
cmpl $-0x1, %eax
jne 0x2d8c
leaq 0x6d94(%rip), %rsi      # 0xa2fa
jmp 0x2cfb