// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mtest2.c
// Function: main
int main(int argc,char * argv[])
{
	int i = 0, j = 0, rc;
	MDB_env *env;
	MDB_dbi dbi;
	MDB_val key, data;
	MDB_txn *txn;
	MDB_stat mst;
	MDB_cursor *cursor;
	int count;
	int *values;
	char sval[32] = "";

	srand(time(NULL));

	count = (rand()%384) + 64;
	values = (int *)malloc(count*sizeof(int));

	for(i = 0;i<count;i++) {
		values[i] = rand()%1024;
	}

	E(mdb_env_create(&env));
	E(mdb_env_set_maxreaders(env, 1));
	E(mdb_env_set_mapsize(env, 10485760));
	E(mdb_env_set_maxdbs(env, 4));
	E(mdb_env_open(env, "./testdb", MDB_FIXEDMAP|MDB_NOSYNC, 0664));

	E(mdb_txn_begin(env, NULL, 0, &txn));
	E(mdb_dbi_open(txn, "id1", MDB_CREATE, &dbi));
   
	key.mv_size = sizeof(int);
	key.mv_data = sval;

	printf("Adding %d values\n", count);
	for (i=0;i<count;i++) {	
		sprintf(sval, "%03x %d foo bar", values[i], values[i]);
		data.mv_size = sizeof(sval);
		data.mv_data = sval;
		if (RES(MDB_KEYEXIST, mdb_put(txn, dbi, &key, &data, MDB_NOOVERWRITE)))
			j++;
	}
	if (j) printf("%d duplicates skipped\n", j);
	E(mdb_txn_commit(txn));
	E(mdb_env_stat(env, &mst));

	E(mdb_txn_begin(env, NULL, MDB_RDONLY, &txn));
	E(mdb_cursor_open(txn, dbi, &cursor));
	while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) {
		printf("key: %p %.*s, data: %p %.*s\n",
			key.mv_data,  (int) key.mv_size,  (char *) key.mv_data,
			data.mv_data, (int) data.mv_size, (char *) data.mv_data);
	}
	CHECK(rc == MDB_NOTFOUND, "mdb_cursor_get");
	mdb_cursor_close(cursor);
	mdb_txn_abort(txn);

	j=0;
	key.mv_data = sval;
	for (i= count - 1; i > -1; i-= (rand()%5)) {
		j++;
		txn=NULL;
		E(mdb_txn_begin(env, NULL, 0, &txn));
		sprintf(sval, "%03x ", values[i]);
		if (RES(MDB_NOTFOUND, mdb_del(txn, dbi, &key, NULL))) {
			j--;
			mdb_txn_abort(txn);
		} else {
			E(mdb_txn_commit(txn));
		}
	}
	free(values);
	printf("Deleted %d values\n", j);

	E(mdb_env_stat(env, &mst));
	E(mdb_txn_begin(env, NULL, MDB_RDONLY, &txn));
	E(mdb_cursor_open(txn, dbi, &cursor));
	printf("Cursor next\n");
	while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) {
		printf("key: %.*s, data: %.*s\n",
			(int) key.mv_size,  (char *) key.mv_data,
			(int) data.mv_size, (char *) data.mv_data);
	}
	CHECK(rc == MDB_NOTFOUND, "mdb_cursor_get");
	printf("Cursor prev\n");
	while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_PREV)) == 0) {
		printf("key: %.*s, data: %.*s\n",
			(int) key.mv_size,  (char *) key.mv_data,
			(int) data.mv_size, (char *) data.mv_data);
	}
	CHECK(rc == MDB_NOTFOUND, "mdb_cursor_get");
	mdb_cursor_close(cursor);
	mdb_txn_abort(txn);

	mdb_dbi_close(env, dbi);
	mdb_env_close(env);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2180
xorl %eax, %eax
movl %eax, %edi
callq 0x2240
movl %eax, %edi
callq 0x21c0
callq 0x2400
movl $0x180, %ecx            # imm = 0x180
cltd
idivl %ecx
addl $0x40, %edx
movl %edx, -0x8c(%rbp)
movslq -0x8c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x2270
movq %rax, -0x98(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jge 0x25cf
callq 0x2400
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x259e
leaq -0x28(%rbp), %rdi
callq 0x13360
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x25e2
jmp 0x262b
movq 0x18a0f(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xc8(%rbp), %rdi
movq %rax, %r9
leaq 0x149f8(%rip), %rsi     # 0x17004
leaq 0x14a00(%rip), %rdx     # 0x17013
movl $0x31, %ecx
leaq 0x149fd(%rip), %r8      # 0x1701c
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x136e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2643
jmp 0x268c
movq 0x189ae(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xd0(%rbp), %rdi
movq %rax, %r9
leaq 0x14997(%rip), %rsi     # 0x17004
leaq 0x1499f(%rip), %rdx     # 0x17013
movl $0x32, %ecx
leaq 0x149b1(%rip), %r8      # 0x17031
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
movl $0xa00000, %esi         # imm = 0xA00000
callq 0x13410
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x26a4
jmp 0x26ed
movq 0x1894d(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xd8(%rbp), %rdi
movq %rax, %r9
leaq 0x14936(%rip), %rsi     # 0x17004
leaq 0x1493e(%rip), %rdx     # 0x17013
movl $0x33, %ecx
leaq 0x1496f(%rip), %r8      # 0x17050
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
movl $0x4, %esi
callq 0x136a0
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2705
jmp 0x274e
movq 0x188ec(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xe0(%rbp), %rdi
movq %rax, %r9
leaq 0x148d5(%rip), %rsi     # 0x17004
leaq 0x148dd(%rip), %rdx     # 0x17013
movl $0x34, %ecx
leaq 0x14931(%rip), %r8      # 0x17073
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
leaq 0x14935(%rip), %rsi     # 0x1708e
movl $0x10001, %edx          # imm = 0x10001
movl $0x1b4, %ecx            # imm = 0x1B4
callq 0x13760
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2772
jmp 0x27bb
movq 0x1887f(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xe8(%rbp), %rdi
movq %rax, %r9
leaq 0x14868(%rip), %rsi     # 0x17004
leaq 0x14870(%rip), %rdx     # 0x17013
movl $0x35, %ecx
leaq 0x148e8(%rip), %r8      # 0x17097
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
leaq -0x58(%rbp), %rcx
callq 0x3990
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x27d8
jmp 0x2821
movq 0x18819(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xf0(%rbp), %rdi
movq %rax, %r9
leaq 0x14802(%rip), %rsi     # 0x17004
leaq 0x1480a(%rip), %rdx     # 0x17013
movl $0x37, %ecx
leaq 0x148bf(%rip), %r8      # 0x170d4
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x58(%rbp), %rdi
leaq 0x148ca(%rip), %rsi     # 0x170f6
movl $0x40000, %edx          # imm = 0x40000
leaq -0x2c(%rbp), %rcx
callq 0xdfc0
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2844
jmp 0x288d
movq 0x187ad(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0xf8(%rbp), %rdi
movq %rax, %r9
leaq 0x14796(%rip), %rsi     # 0x17004
leaq 0x1479e(%rip), %rdx     # 0x17013
movl $0x38, %ecx
leaq 0x14879(%rip), %r8      # 0x170fa
movb $0x0, %al
callq 0x2210
callq 0x2040
movq $0x4, -0x40(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x8c(%rbp), %esi
leaq 0x14878(%rip), %rdi     # 0x17125
movb $0x0, %al
callq 0x2120
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jge 0x29a4
leaq -0xc0(%rbp), %rdi
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
leaq 0x14843(%rip), %rsi     # 0x17137
movb $0x0, %al
callq 0x2360
movq $0x20, -0x50(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %esi
leaq -0x40(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movl $0x10, %r8d
callq 0xded0
movl %eax, -0x1c(%rbp)
cmpl $0xffff87b1, %eax       # imm = 0xFFFF87B1
je 0x298b
cmpl $0x0, -0x1c(%rbp)
jne 0x293a
jmp 0x2983
movq 0x186b7(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x100(%rbp), %rdi
movq %rax, %r9
leaq 0x146a0(%rip), %rsi     # 0x17004
leaq 0x146a8(%rip), %rdx     # 0x17013
movl $0x42, %ecx
leaq 0x147d0(%rip), %r8      # 0x17147
movb $0x0, %al
callq 0x2210
callq 0x2040
xorl %eax, %eax
testb $0x1, %al
jne 0x298b
jmp 0x2994
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2996
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x28bb
cmpl $0x0, -0x18(%rbp)
je 0x29bb
movl -0x18(%rbp), %esi
leaq 0x147c3(%rip), %rdi     # 0x17177
movb $0x0, %al
callq 0x2120
movq -0x58(%rbp), %rdi
callq 0x4290
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x29ce
jmp 0x2a17
movq 0x18623(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x108(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x108(%rbp), %rdi
movq %rax, %r9
leaq 0x1460c(%rip), %rsi     # 0x17004
leaq 0x14614(%rip), %rdx     # 0x17013
movl $0x46, %ecx
leaq 0x14783(%rip), %r8      # 0x1718e
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x15180
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2a2e
jmp 0x2a77
movq 0x185c3(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x110(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x110(%rbp), %rdi
movq %rax, %r9
leaq 0x145ac(%rip), %rsi     # 0x17004
leaq 0x145b4(%rip), %rdx     # 0x17013
movl $0x47, %ecx
leaq 0x14737(%rip), %r8      # 0x171a2
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x20000, %edx          # imm = 0x20000
leaq -0x58(%rbp), %rcx
callq 0x3990
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2a97
jmp 0x2ae0
movq 0x1855a(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x118(%rbp), %rdi
movq %rax, %r9
leaq 0x14543(%rip), %rsi     # 0x17004
leaq 0x1454b(%rip), %rdx     # 0x17013
movl $0x49, %ecx
leaq 0x146e6(%rip), %r8      # 0x171ba
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %esi
leaq -0x88(%rbp), %rdx
callq 0xd830
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2afd
jmp 0x2b46
movq 0x184f4(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x120(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x120(%rbp), %rdi
movq %rax, %r9
leaq 0x144dd(%rip), %rsi     # 0x17004
leaq 0x144e5(%rip), %rdx     # 0x17013
movl $0x4a, %ecx
leaq 0x146ab(%rip), %r8      # 0x171e5
movb $0x0, %al
callq 0x2210
callq 0x2040
jmp 0x2b48
movq -0x88(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movl $0x8, %ecx
callq 0x8080
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2b9a
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %rax
movl %eax, %r9d
movq -0x48(%rbp), %rax
leaq 0x1467b(%rip), %rdi     # 0x17208
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2120
jmp 0x2b48
cmpl $0xffff87b2, -0x1c(%rbp) # imm = 0xFFFF87B2
jne 0x2ba5
jmp 0x2bee
movq 0x1844c(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x128(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x128(%rbp), %rdi
movq %rax, %r9
leaq 0x14435(%rip), %rsi     # 0x17004
leaq 0x1443d(%rip), %rdx     # 0x17013
movl $0x50, %ecx
leaq 0x14643(%rip), %r8      # 0x17225
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x88(%rbp), %rdi
callq 0xdb90
movq -0x58(%rbp), %rdi
callq 0x4240
movl $0x0, -0x18(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x8c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jle 0x2dca
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
leaq -0x58(%rbp), %rcx
callq 0x3990
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2c59
jmp 0x2ca2
movq 0x18398(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x130(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x130(%rbp), %rdi
movq %rax, %r9
leaq 0x14381(%rip), %rsi     # 0x17004
leaq 0x14389(%rip), %rdx     # 0x17013
movl $0x59, %ecx
leaq 0x1443e(%rip), %r8      # 0x170d4
movb $0x0, %al
callq 0x2210
callq 0x2040
leaq -0xc0(%rbp), %rdi
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x14576(%rip), %rsi     # 0x17234
movb $0x0, %al
callq 0x2360
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %esi
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xdcb0
movl %eax, -0x1c(%rbp)
cmpl $0xffff87b2, %eax       # imm = 0xFFFF87B2
je 0x2d3c
cmpl $0x0, -0x1c(%rbp)
jne 0x2ceb
jmp 0x2d34
movq 0x18306(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x138(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x138(%rbp), %rdi
movq %rax, %r9
leaq 0x142ef(%rip), %rsi     # 0x17004
leaq 0x142f7(%rip), %rdx     # 0x17013
movl $0x5b, %ecx
leaq 0x14512(%rip), %r8      # 0x1723a
movb $0x0, %al
callq 0x2210
callq 0x2040
xorl %eax, %eax
testb $0x1, %al
jne 0x2d3c
jmp 0x2d50
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x58(%rbp), %rdi
callq 0x4240
jmp 0x2dae
movq -0x58(%rbp), %rdi
callq 0x4290
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2d63
jmp 0x2dac
movq 0x1828e(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x140(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x140(%rbp), %rdi
movq %rax, %r9
leaq 0x14277(%rip), %rsi     # 0x17004
leaq 0x1427f(%rip), %rdx     # 0x17013
movl $0x5f, %ecx
leaq 0x143ee(%rip), %r8      # 0x1718e
movb $0x0, %al
callq 0x2210
callq 0x2040
jmp 0x2dae
jmp 0x2db0
callq 0x2400
movl $0x5, %ecx
cltd
idivl %ecx
movl -0x14(%rbp), %eax
subl %edx, %eax
movl %eax, -0x14(%rbp)
jmp 0x2c21
movq -0x98(%rbp), %rdi
callq 0x2030
movl -0x18(%rbp), %esi
leaq 0x14478(%rip), %rdi     # 0x17258
movb $0x0, %al
callq 0x2120
movq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x15180
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2dfe
jmp 0x2e47
movq 0x181f3(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x148(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x148(%rbp), %rdi
movq %rax, %r9
leaq 0x141dc(%rip), %rsi     # 0x17004
leaq 0x141e4(%rip), %rdx     # 0x17013
movl $0x65, %ecx
leaq 0x14367(%rip), %r8      # 0x171a2
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x20000, %edx          # imm = 0x20000
leaq -0x58(%rbp), %rcx
callq 0x3990
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2e67
jmp 0x2eb0
movq 0x1818a(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x150(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x150(%rbp), %rdi
movq %rax, %r9
leaq 0x14173(%rip), %rsi     # 0x17004
leaq 0x1417b(%rip), %rdx     # 0x17013
movl $0x66, %ecx
leaq 0x14316(%rip), %r8      # 0x171ba
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %esi
leaq -0x88(%rbp), %rdx
callq 0xd830
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2ecd
jmp 0x2f16
movq 0x18124(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x158(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x158(%rbp), %rdi
movq %rax, %r9
leaq 0x1410d(%rip), %rsi     # 0x17004
leaq 0x14115(%rip), %rdx     # 0x17013
movl $0x67, %ecx
leaq 0x142db(%rip), %r8      # 0x171e5
movb $0x0, %al
callq 0x2210
callq 0x2040
leaq 0x1434e(%rip), %rdi     # 0x1726b
movb $0x0, %al
callq 0x2120
movq -0x88(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movl $0x8, %ecx
callq 0x8080
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x2f69
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x38(%rbp), %rdx
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x48(%rbp), %r8
leaq 0x14318(%rip), %rdi     # 0x17278
movb $0x0, %al
callq 0x2120
jmp 0x2f24
cmpl $0xffff87b2, -0x1c(%rbp) # imm = 0xFFFF87B2
jne 0x2f74
jmp 0x2fbd
movq 0x1807d(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x160(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x160(%rbp), %rdi
movq %rax, %r9
leaq 0x14066(%rip), %rsi     # 0x17004
leaq 0x1406e(%rip), %rdx     # 0x17013
movl $0x6e, %ecx
leaq 0x14274(%rip), %r8      # 0x17225
movb $0x0, %al
callq 0x2210
callq 0x2040
leaq 0x142cb(%rip), %rdi     # 0x1728f
movb $0x0, %al
callq 0x2120
movq -0x88(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movl $0xc, %ecx
callq 0x8080
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x3010
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x38(%rbp), %rdx
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x48(%rbp), %r8
leaq 0x14271(%rip), %rdi     # 0x17278
movb $0x0, %al
callq 0x2120
jmp 0x2fcb
cmpl $0xffff87b2, -0x1c(%rbp) # imm = 0xFFFF87B2
jne 0x301b
jmp 0x3064
movq 0x17fd6(%rip), %rax     # 0x1aff8
movq (%rax), %rax
movq %rax, -0x168(%rbp)
movl -0x1c(%rbp), %edi
callq 0x30a0
movq -0x168(%rbp), %rdi
movq %rax, %r9
leaq 0x13fbf(%rip), %rsi     # 0x17004
leaq 0x13fc7(%rip), %rdx     # 0x17013
movl $0x75, %ecx
leaq 0x141cd(%rip), %r8      # 0x17225
movb $0x0, %al
callq 0x2210
callq 0x2040
movq -0x88(%rbp), %rdi
callq 0xdb90
movq -0x58(%rbp), %rdi
callq 0x4240
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xe5b0
movq -0x28(%rbp), %rdi
callq 0x14670
xorl %eax, %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)