// File: funny-falcon[P]fanom_hash/test_lucky777.cpp
// Function: main
int main(int argc, char** argv) {
	unsigned i;
	int hex = 0;
	int use_std = 0;
	int check = 0;
	int binary = 0;
	int only_hash = 2;
	uint32_t sum = 0;
	ssize_t lsize;
	char *lbuf = NULL;
	size_t lcapa = 0;
	FILE* r;
	table tbl = {0, 0, NULL};
	std::unordered_set<std::string> set;

	for (i=1; i<argc; i++) {
		if (strcmp(argv[i], "--help") == 0) {
			goto usage;
		} else if (strcmp(argv[i], "-s") == 0) {
			use_std = 1;
		} else if (strcmp(argv[i], "-c") == 0) {
			check = 1;
		} else if (strcmp(argv[i], "-x") == 0) {
			hex = 1;
			fill_dehex();
		} else if (strcmp(argv[i], "-r") == 0) {
			custom_seed = -1;
		} else if (strcmp(argv[i], "-speed") == 0) {
			only_hash = 1;
		} else if (strcmp(argv[i], "-table") == 0) {
			only_hash = 0;
		} else if (strcmp(argv[i], "-seed") == 0) {
			uint32_t s;
			i++;
			if (i == argc)
				goto usage;
			if (custom_seed == sizeof(seed)/sizeof(seed[0]))
				goto usage;
			s = strtol(argv[i], NULL, 0); /* strtol recognize hex */
			seed[custom_seed++] = s;
		} else if (strcmp(argv[i], "-b") == 0) {
			i++;
			if (i == argc)
				goto usage;
			binary = atoi(argv[i]);
		} else {
			goto usage;
		}
	}

	if (only_hash != 2) {
		setbuffer(stdin, buffer, sizeof(buffer));
	}

	if (custom_seed == 0 && !only_hash || custom_seed == -1) {
		r = fopen("/dev/urandom", "rb");
		if (r == NULL) {
			perror("open /dev/urandom");
			return 1;
		}
		if (fread(&seed, sizeof(seed), 1, r) != 1) {
			perror("Could not read seed from /dev/urandom");
			return 1;
		}
		fclose(r);
	} else if (custom_seed == 1) {
		const uint32_t c = 0xeb0d2f41;
		seed[1] = seed[0] ^ c;
		seed[2] = 0;
	} else if (custom_seed == 2) {
		seed[2] = 0;
	}
	

	if (binary) {
		lbuf = (char*)malloc(binary+1);
		while ((lsize = fread(lbuf, 1, binary, stdin)) > 0) {
			if (only_hash) {
				uint32_t hash;
				hash = lucky777_string_hash2(lbuf, lsize, seed[0], seed[1]);
				if (only_hash == 2) {
					printf("%08u\n", hash);
				}
				sum += hash;
			} else if (use_std == 0) {
				table_insert(&tbl, lbuf, lsize);
			} else {
				set.insert(std::string(lbuf, lsize));
			}
		}
	} else {
		char* copy;
		while ((lsize = getline(&lbuf, &lcapa, stdin)) != -1) {
			lsize--;
			if (only_hash == 2) {
				copy = strndup(lbuf, lsize);
			}
			if (hex) {
				assert((lsize&1) == 0);
				dehexify(lbuf, lsize);
				lsize /= 2;
			}
			if (only_hash) {
				uint32_t hash;
				hash = lucky777_string_hash2(lbuf, lsize, seed[0], seed[1]);
				if (only_hash == 2) {
					printf("%08x\t%s\n", hash, copy);
					free(copy);
				}
				sum += hash;
			} else if (use_std == 0) {
				table_insert(&tbl, lbuf, lsize);
			} else {
				set.insert(std::string(lbuf, lsize));
			}
		}
	}
	if (only_hash) {
		if (only_hash == 1)
			printf("Sum = %08x\n", sum);
		return 0;
	}

	if (use_std == 0) {
		if (tbl.size == 0) {
			goto usage;
		}

		printf("tbl->size == %u\n", tbl.size);
		if (check) {
			return check_table(&tbl, 1);
		}
	} else {
		if (set.size() == 0) {
			goto usage;
		}
		printf("tbl->size == %zu\n", set.size());
		if (check) {
			for (auto& s: set) {
				checksum_add(s.data(), s.size());
			}
			printf("checksum %08x %08x\n", checksum[0], checksum[1]);
		}
	}
	return 0;
usage:
	printf("Usage: %s [-seed N] [-x] [-b N] [-speed|-table] [-s] [-c] < input_file\n%s", argv[0],
	"  Default, \"test vector mode\": reads lines from stdin and report checksum for every line.\n" \
	"  With -speed , only checksumming performed.\n" \
	"  With -table , puts them into chained hash table, on exit it \n" \
	"    calculates and outputs checksum and table size.\n" \
	"\t--help  - this help.\n" \
	"\t-seed N - use custom seed instead of random.\n" \
	"\t          Every invocation fills next seed array element,\n" \
	"\t          so you may give this option 1 or 2 times.\n" \
	"\t-b N    - input is binary, slice it to chunks of fixed size N\n" \
	"\t-x      - input lines are hexified, so de-hexify it\n" \
	"\t-r      - force random seed for \"test vector\"\n" \
	"\t-speed  - test speed only\n" \
	"\t-table  - test hash table (options below for this mode only)\n" \
	"\t-s      - use c++ set to verify hash table implementation\n" \
	"\t-c      - at the end, detect collisions and chain length, and\n" \
	"\t          calculate independent checksum for all inserted strings\n");
	printf("  example for \"test vector\":\n" \
		"\t%s < test_lucky777.cpp\n" \
		"\techo 'a1b2bc3def' | %s \n" \
		"\techo 'a1b2bc3def' | %s -seed 2 -seed 3 -seed 4\n" \
		"\techo 'a1b2bc3def' | %s -x -seed 2 -seed 3 -seed 4\n",
		argv[0], argv[0], argv[0], argv[0]
		);
	return 0;
}

// Assembly:
subq $0x1e8, %rsp            # imm = 0x1E8
movl $0x0, 0x1e4(%rsp)
movl %edi, 0x1e0(%rsp)
movq %rsi, 0x1d8(%rsp)
movl $0x0, 0x1d0(%rsp)
movl $0x0, 0x1cc(%rsp)
movl $0x0, 0x1c8(%rsp)
movl $0x0, 0x1c4(%rsp)
movl $0x2, 0x1c0(%rsp)
movl $0x0, 0x1bc(%rsp)
movq $0x0, 0x1a8(%rsp)
movq $0x0, 0x1a0(%rsp)
leaq 0x188(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20c0
leaq 0x150(%rsp), %rdi
callq 0x3fb0
movl $0x1, 0x1d4(%rsp)
movl 0x1d4(%rsp), %eax
cmpl 0x1e0(%rsp), %eax
jae 0x3224
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x41b1(%rip), %rsi      # 0x7146
callq 0x2220
cmpl $0x0, %eax
jne 0x2fa4
jmp 0x3a10
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x418f(%rip), %rsi      # 0x714d
callq 0x2220
cmpl $0x0, %eax
jne 0x2fd8
movl $0x1, 0x1cc(%rsp)
jmp 0x320a
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x415e(%rip), %rsi      # 0x7150
callq 0x2220
cmpl $0x0, %eax
jne 0x300c
movl $0x1, 0x1c8(%rsp)
jmp 0x3208
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x412d(%rip), %rsi      # 0x7153
callq 0x2220
cmpl $0x0, %eax
jne 0x3045
movl $0x1, 0x1d0(%rsp)
callq 0x2840
jmp 0x3206
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x40f7(%rip), %rsi      # 0x7156
callq 0x2220
cmpl $0x0, %eax
jne 0x3078
movl $0xffffffff, 0x823d(%rip) # imm = 0xFFFFFFFF
jmp 0x3204
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x40c7(%rip), %rsi      # 0x7159
callq 0x2220
cmpl $0x0, %eax
jne 0x30ac
movl $0x1, 0x1c0(%rsp)
jmp 0x3202
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x409a(%rip), %rsi      # 0x7160
callq 0x2220
cmpl $0x0, %eax
jne 0x30e0
movl $0x0, 0x1c0(%rsp)
jmp 0x3200
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x406d(%rip), %rsi      # 0x7167
callq 0x2220
cmpl $0x0, %eax
jne 0x318c
movl 0x1d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d4(%rsp)
movl 0x1d4(%rsp), %eax
cmpl 0x1e0(%rsp), %eax
jne 0x312e
jmp 0x3a10
movslq 0x817b(%rip), %rax      # 0xb2b0
cmpq $0x3, %rax
jne 0x3140
jmp 0x3a10
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x2230
movl %eax, 0x14c(%rsp)
movl 0x14c(%rsp), %edx
movl 0x813e(%rip), %eax      # 0xb2b0
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x8133(%rip)      # 0xb2b0
movslq %eax, %rcx
leaq 0x7ff1(%rip), %rax      # 0xb178
movl %edx, (%rax,%rcx,4)
jmp 0x31fe
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x3fc7(%rip), %rsi      # 0x716d
callq 0x2220
cmpl $0x0, %eax
jne 0x31f7
movl 0x1d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d4(%rsp)
movl 0x1d4(%rsp), %eax
cmpl 0x1e0(%rsp), %eax
jne 0x31d6
jmp 0x3a10
movq 0x1d8(%rsp), %rax
movl 0x1d4(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2270
movl %eax, 0x1c4(%rsp)
jmp 0x31fc
jmp 0x3a10
jmp 0x31fe
jmp 0x3200
jmp 0x3202
jmp 0x3204
jmp 0x3206
jmp 0x3208
jmp 0x320a
jmp 0x320c
jmp 0x320e
movl 0x1d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d4(%rsp)
jmp 0x2f67
cmpl $0x2, 0x1c0(%rsp)
je 0x3249
movq 0x7dab(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x8081(%rip), %rsi      # 0xb2c0
movl $0x100000, %edx         # imm = 0x100000
callq 0x2070
cmpl $0x0, 0x8060(%rip)      # 0xb2b0
jne 0x325c
cmpl $0x0, 0x1c0(%rsp)
je 0x3269
cmpl $-0x1, 0x804d(%rip)     # 0xb2b0
jne 0x3353
leaq 0x3f2e(%rip), %rdi      # 0x719e
leaq 0x3ef9(%rip), %rsi      # 0x7170
callq 0x21c0
movq %rax, 0x88(%rsp)
jmp 0x3286
movq 0x88(%rsp), %rax
movq %rax, 0x198(%rsp)
cmpq $0x0, 0x198(%rsp)
jne 0x32e3
leaq 0x3ecb(%rip), %rdi      # 0x7173
callq 0x2150
jmp 0x32af
movl $0x1, 0x1e4(%rsp)
movl $0x1, 0x138(%rsp)
jmp 0x3a6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x3a88
movq 0x198(%rsp), %rcx
leaq 0x7e86(%rip), %rdi      # 0xb178
movl $0xc, %esi
movl $0x1, %edx
callq 0x2250
movq %rax, 0x80(%rsp)
jmp 0x330b
movq 0x80(%rsp), %rax
cmpq $0x1, %rax
je 0x3342
leaq 0x3e65(%rip), %rdi      # 0x7185
callq 0x2150
jmp 0x3327
movl $0x1, 0x1e4(%rsp)
movl $0x1, 0x138(%rsp)
jmp 0x3a6c
movq 0x198(%rsp), %rdi
callq 0x2170
jmp 0x3351
jmp 0x339b
cmpl $0x1, 0x7f56(%rip)      # 0xb2b0
jne 0x3384
movl $0xeb0d2f41, 0x134(%rsp) # imm = 0xEB0D2F41
movl 0x7e0b(%rip), %eax      # 0xb178
xorl $0xeb0d2f41, %eax       # imm = 0xEB0D2F41
movl %eax, 0x7e04(%rip)      # 0xb17c
movl $0x0, 0x7dfe(%rip)      # 0xb180
jmp 0x3399
cmpl $0x2, 0x7f25(%rip)      # 0xb2b0
jne 0x3397
movl $0x0, 0x7de9(%rip)      # 0xb180
jmp 0x3399
jmp 0x339b
cmpl $0x0, 0x1c4(%rsp)
je 0x359f
movl 0x1c4(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x2210
movq %rax, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rdi
movslq 0x1c4(%rsp), %rdx
movq 0x7c06(%rip), %rax      # 0xafe0
movq (%rax), %rcx
movl $0x1, %esi
callq 0x2250
movq %rax, 0x78(%rsp)
jmp 0x33ee
movq 0x78(%rsp), %rax
movq %rax, 0x1b0(%rsp)
cmpq $0x0, %rax
jle 0x359a
cmpl $0x0, 0x1c0(%rsp)
je 0x347e
movq 0x1a8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movl 0x7d53(%rip), %edx      # 0xb178
movl 0x7d51(%rip), %ecx      # 0xb17c
callq 0x3ab0
movl %eax, 0x74(%rsp)
jmp 0x3436
movl 0x74(%rsp), %eax
movl %eax, 0x130(%rsp)
cmpl $0x2, 0x1c0(%rsp)
jne 0x3464
movl 0x130(%rsp), %esi
leaq 0x3d52(%rip), %rdi      # 0x71ab
xorl %eax, %eax
callq 0x2030
jmp 0x3462
jmp 0x3464
movl 0x130(%rsp), %eax
addl 0x1bc(%rsp), %eax
movl %eax, 0x1bc(%rsp)
jmp 0x3595
cmpl $0x0, 0x1cc(%rsp)
jne 0x34ac
movq 0x1a8(%rsp), %rsi
movq 0x1b0(%rsp), %rdx
leaq 0x188(%rsp), %rdi
callq 0x2580
jmp 0x34a7
jmp 0x3593
movq 0x1a8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x10f(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x22c0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x68(%rsp), %rcx
leaq 0x110(%rsp), %rdi
callq 0x21b0
jmp 0x34f6
leaq 0x150(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x3fc0
movb %dl, 0x4f(%rsp)
movq %rax, 0x50(%rsp)
jmp 0x3516
movb 0x4f(%rsp), %al
movq 0x50(%rsp), %rcx
movq %rcx, 0xf8(%rsp)
movb %al, 0x100(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x20e0
leaq 0x10f(%rsp), %rdi
callq 0x21a0
jmp 0x3593
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x3581
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x20e0
leaq 0x10f(%rsp), %rdi
callq 0x21a0
jmp 0x3a88
jmp 0x3595
jmp 0x33c3
jmp 0x3833
jmp 0x35a1
movq 0x7a38(%rip), %rax      # 0xafe0
movq (%rax), %rdx
leaq 0x1a8(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x21e0
movq %rax, 0x40(%rsp)
jmp 0x35c7
movq 0x40(%rsp), %rax
movq %rax, 0x1b0(%rsp)
cmpq $-0x1, %rax
je 0x3831
movq 0x1b0(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x1b0(%rsp)
cmpl $0x2, 0x1c0(%rsp)
jne 0x3619
movq 0x1a8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x2040
movq %rax, 0xf0(%rsp)
cmpl $0x0, 0x1d0(%rsp)
je 0x3685
movq 0x1b0(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x3637
jmp 0x3656
leaq 0x3b73(%rip), %rdi      # 0x71b1
leaq 0x3b7b(%rip), %rsi      # 0x71c0
movl $0x77, %edx
leaq 0x3b81(%rip), %rcx      # 0x71d2
callq 0x20f0
movq 0x1a8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x2920
movq 0x1b0(%rsp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, 0x1b0(%rsp)
cmpl $0x0, 0x1c0(%rsp)
je 0x3715
movq 0x1a8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movl 0x7acf(%rip), %edx      # 0xb178
movl 0x7acd(%rip), %ecx      # 0xb17c
callq 0x3ab0
movl %eax, 0x3c(%rsp)
jmp 0x36ba
movl 0x3c(%rsp), %eax
movl %eax, 0xec(%rsp)
cmpl $0x2, 0x1c0(%rsp)
jne 0x36fb
movl 0xec(%rsp), %esi
movq 0xf0(%rsp), %rdx
leaq 0x3b04(%rip), %rdi      # 0x71e9
xorl %eax, %eax
callq 0x2030
jmp 0x36ee
movq 0xf0(%rsp), %rdi
callq 0x21d0
movl 0xec(%rsp), %eax
addl 0x1bc(%rsp), %eax
movl %eax, 0x1bc(%rsp)
jmp 0x382c
cmpl $0x0, 0x1cc(%rsp)
jne 0x3743
movq 0x1a8(%rsp), %rsi
movq 0x1b0(%rsp), %rdx
leaq 0x188(%rsp), %rdi
callq 0x2580
jmp 0x373e
jmp 0x382a
movq 0x1a8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x22c0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0xc8(%rsp), %rdi
callq 0x21b0
jmp 0x378d
leaq 0x150(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x3fc0
movb %dl, 0x17(%rsp)
movq %rax, 0x18(%rsp)
jmp 0x37ad
movb 0x17(%rsp), %al
movq 0x18(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movb %al, 0xb8(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x20e0
leaq 0xc7(%rsp), %rdi
callq 0x21a0
jmp 0x382a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x3818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x20e0
leaq 0xc7(%rsp), %rdi
callq 0x21a0
jmp 0x3a88
jmp 0x382c
jmp 0x35a1
jmp 0x3833
cmpl $0x0, 0x1c0(%rsp)
je 0x387b
cmpl $0x1, 0x1c0(%rsp)
jne 0x3860
movl 0x1bc(%rsp), %esi
leaq 0x399d(%rip), %rdi      # 0x71f2
xorl %eax, %eax
callq 0x2030
jmp 0x385e
jmp 0x3860
movl $0x0, 0x1e4(%rsp)
movl $0x1, 0x138(%rsp)
jmp 0x3a6c
cmpl $0x0, 0x1cc(%rsp)
jne 0x38ed
cmpl $0x0, 0x188(%rsp)
jne 0x3894
jmp 0x3a10
movl 0x188(%rsp), %esi
leaq 0x395c(%rip), %rdi      # 0x71fe
xorl %eax, %eax
callq 0x2030
jmp 0x38ab
cmpl $0x0, 0x1c8(%rsp)
je 0x38e8
leaq 0x188(%rsp), %rdi
movl $0x1, %esi
callq 0x2a10
movl %eax, 0x10(%rsp)
jmp 0x38cd
movl 0x10(%rsp), %eax
movl %eax, 0x1e4(%rsp)
movl $0x1, 0x138(%rsp)
jmp 0x3a6c
jmp 0x39f8
leaq 0x150(%rsp), %rdi
callq 0x4010
cmpq $0x0, %rax
jne 0x3905
jmp 0x3a10
leaq 0x150(%rsp), %rdi
callq 0x4010
movq %rax, %rsi
leaq 0x38f3(%rip), %rdi      # 0x720f
xorl %eax, %eax
callq 0x2030
jmp 0x3925
cmpl $0x0, 0x1c8(%rsp)
je 0x39f6
leaq 0x150(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x4020
movq %rax, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x4050
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x4080
testb $0x1, %al
jne 0x3988
jmp 0x39d8
leaq 0xa0(%rsp), %rdi
callq 0x40a0
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
callq 0x21f0
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rdi
callq 0x2110
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x2740
leaq 0xa0(%rsp), %rdi
callq 0x40c0
jmp 0x396d
movl 0x77c2(%rip), %esi      # 0xb1a0
movl 0x77c0(%rip), %edx      # 0xb1a4
leaq 0x36b7(%rip), %rdi      # 0x70a2
xorl %eax, %eax
callq 0x2030
jmp 0x39f4
jmp 0x39f6
jmp 0x39f8
movl $0x0, 0x1e4(%rsp)
movl $0x1, 0x138(%rsp)
jmp 0x3a6c
movq 0x1d8(%rsp), %rax
movq (%rax), %rsi
leaq 0x37ff(%rip), %rdi      # 0x7221
leaq 0x3842(%rip), %rdx      # 0x726b
xorl %eax, %eax
callq 0x2030
jmp 0x3a32
movq 0x1d8(%rsp), %rax
movq (%rax), %r8
leaq 0x3b8f(%rip), %rdi      # 0x75d3
xorl %eax, %eax
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
callq 0x2030
jmp 0x3a56
movl $0x0, 0x1e4(%rsp)
movl $0x1, 0x138(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x40f0
movl 0x1e4(%rsp), %eax
addq $0x1e8, %rsp            # imm = 0x1E8
retq
leaq 0x150(%rsp), %rdi
callq 0x40f0
movq 0x140(%rsp), %rdi
callq 0x22b0
nopw %cs:(%rax,%rax)