// File: /workspace/github_c_makefile_star2_O0/zhou-lab[P]tbmate/htslib/cram/cram_io.c
// Function: cram_populate_ref
static int cram_populate_ref(cram_fd *fd, int id, ref_entry *r) {
    char *ref_path = getenv("REF_PATH");
    SAM_hdr_type *ty;
    SAM_hdr_tag *tag;
    char path[PATH_MAX], path_tmp[PATH_MAX];
    char cache[PATH_MAX], cache_root[PATH_MAX];
    char *local_cache = getenv("REF_CACHE");
    mFILE *mf;
    int local_path = 0;

    if (fd->verbose)
	fprintf(stderr, "cram_populate_ref on fd %p, id %d\n", fd, id);

    cache_root[0] = '\0';

    if (!ref_path || *ref_path == '\0') {
	/*
	 * If we have no ref path, we use the EBI server.
	 * However to avoid spamming it we require a local ref cache too.
	 */
	ref_path = "http://www.ebi.ac.uk:80/ena/cram/md5/%s";
	if (!local_cache || *local_cache == '\0') {
	    const char *extra;
	    const char *base = get_cache_basedir(&extra);
	    snprintf(cache_root, PATH_MAX, "%s%s/hts-ref", base, extra);
	    snprintf(cache,PATH_MAX, "%s%s/hts-ref/%%2s/%%2s/%%s", base, extra);
	    local_cache = cache;
	    if (fd->verbose)
		fprintf(stderr, "Populating local cache: %s\n", local_cache);
	}
    }

    if (!r->name)
	return -1;

    if (!(ty = sam_hdr_find(fd->header, "SQ", "SN", r->name)))
	return -1;

    if (!(tag = sam_hdr_find_key(fd->header, ty, "M5", NULL)))
	goto no_M5;

    if (fd->verbose)
	fprintf(stderr, "Querying ref %s\n", tag->str+3);

    /* Use cache if available */
    if (local_cache && *local_cache) {
	expand_cache_path(path, local_cache, tag->str+3);
	local_path = 1;
    }

#ifndef HAVE_MMAP
    char *path2;
    /* Search local files in REF_PATH; we can open them and return as above */
    if (!local_path && (path2 = find_path(tag->str+3, ref_path))) {
	strncpy(path, path2, PATH_MAX);
	free(path2);
	if (is_file(path)) // incase it's too long
	    local_path = 1;
    }
#endif

    /* Found via REF_CACHE or local REF_PATH file */
    if (local_path) {
	struct stat sb;
	BGZF *fp;

	if (0 == stat(path, &sb) && (fp = bgzf_open(path, "r"))) {
	    r->length = sb.st_size;
	    r->offset = r->line_length = r->bases_per_line = 0;

	    r->fn = string_dup(fd->refs->pool, path);

	    if (fd->refs->fp)
		if (bgzf_close(fd->refs->fp) != 0)
		    return -1;
	    fd->refs->fp = fp;
	    fd->refs->fn = r->fn;
	    r->is_md5 = 1;

	    // Fall back to cram_get_ref() where it'll do the actual
	    // reading of the file.
	    return 0;
	}
    }


    /* Otherwise search full REF_PATH; slower as loads entire file */
    if ((mf = open_path_mfile(tag->str+3, ref_path, NULL))) {
	size_t sz;
	r->seq = mfsteal(mf, &sz);
	if (r->seq) {
	    r->mf = NULL;
	} else {
	    // keep mf around as we couldn't detach
	    r->seq = mf->data;
	    r->mf = mf;
	}
	r->length = sz;
	r->is_md5 = 1;
    } else {
	refs_t *refs;
	char *fn;

    no_M5:
	/* Failed to find in search path or M5 cache, see if @SQ UR: tag? */
	if (!(tag = sam_hdr_find_key(fd->header, ty, "UR", NULL)))
	    return -1;

	fn = (strncmp(tag->str+3, "file:", 5) == 0)
	    ? tag->str+8
	    : tag->str+3;

	if (fd->refs->fp) {
	    if (bgzf_close(fd->refs->fp) != 0)
		return -1;
	    fd->refs->fp = NULL;
	}
	if (!(refs = refs_load_fai(fd->refs, fn, 0)))
	    return -1;
	sanitise_SQ_lines(fd);

	fd->refs = refs;
	if (fd->refs->fp) {
	    if (bgzf_close(fd->refs->fp) != 0)
		return -1;
	    fd->refs->fp = NULL;
	}

	if (!fd->refs->fn)
	    return -1;

	if (-1 == refs2id(fd->refs, fd->header))
	    return -1;
	if (!fd->refs->ref_id || !fd->refs->ref_id[id])
	    return -1;

	// Local copy already, so fall back to cram_get_ref().
	return 0;
    }

    /* Populate the local disk cache if required */
    if (local_cache && *local_cache) {
	int pid = (int) getpid();
	unsigned thrid = get_int_threadid();
	FILE *fp;

	if (*cache_root && !is_directory(cache_root) && hts_verbose >= 1)
	    fprintf(stderr,
"Creating reference cache directory %s\n"
"This may become large; see the samtools(1) manual page REF_CACHE discussion\n",
		    cache_root);

	expand_cache_path(path, local_cache, tag->str+3);
	if (fd->verbose)
	    fprintf(stderr, "Writing cache file '%s'\n", path);
	mkdir_prefix(path, 01777);

	do {
	    // Attempt to further uniquify the temporary filename
	    unsigned t = ((unsigned) time(NULL)) ^ ((unsigned) clock());
	    thrid++; // Ensure filename changes even if time/clock haven't

	    sprintf(path_tmp, "%s.tmp_%d_%u_%u", path, pid, thrid, t);
	    fp = fopen(path_tmp, "wx");
	} while (fp == NULL && errno == EEXIST);
	if (!fp) {
	    perror(path_tmp);

	    // Not fatal - we have the data already so keep going.
	    return 0;
	}

	// Check md5sum
	hts_md5_context *md5;
	char unsigned md5_buf1[16];
	char md5_buf2[33];

	if (!(md5 = hts_md5_init())) {
	    unlink(path_tmp);
	    fclose(fp);
	    return -1;
	}
	hts_md5_update(md5, r->seq, r->length);
	hts_md5_final(md5_buf1, md5);
	hts_md5_destroy(md5);
	hts_md5_hex(md5_buf2, md5_buf1);

	if (strncmp(tag->str+3, md5_buf2, 32) != 0) {
	    fprintf(stderr, "[E::%s] mismatching md5sum for downloaded reference.\n", __func__);
	    unlink(path_tmp);
	    fclose(fp);
	    return -1;
	}

	if (r->length != fwrite(r->seq, 1, r->length, fp)) {
	    perror(path);
	}
	if (-1 == paranoid_fclose(fp)) {
	    unlink(path_tmp);
	} else {
	    if (0 == chmod(path_tmp, 0444))
		rename(path_tmp, path);
	    else
		unlink(path_tmp);
	}
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x41a0, %rsp           # imm = 0x41A0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
leaq 0x55c21(%rip), %rdi     # 0x7762e
callq 0x35c0
movq %rax, -0x28(%rbp)
leaq 0x55c1a(%rip), %rdi     # 0x77637
callq 0x35c0
movq %rax, -0x4048(%rbp)
movl $0x0, -0x4054(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1fc(%rax)
je 0x21a5f
movq 0x635a1(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
leaq 0x55be9(%rip), %rsi     # 0x77641
movb $0x0, %al
callq 0x37f0
movb $0x0, -0x4040(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x21a7d
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x21b46
leaq 0x55be0(%rip), %rax     # 0x77664
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x4048(%rbp)
je 0x21aa5
movq -0x4048(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x21b44
leaq -0x4060(%rbp), %rdi
callq 0x2be10
movq %rax, -0x4068(%rbp)
leaq -0x4040(%rbp), %rdi
movq -0x4068(%rbp), %rcx
movq -0x4060(%rbp), %r8
movl $0x1000, %esi           # imm = 0x1000
leaq 0x55bb3(%rip), %rdx     # 0x7768c
movb $0x0, %al
callq 0x30c0
leaq -0x3040(%rbp), %rdi
movq -0x4068(%rbp), %rcx
movq -0x4060(%rbp), %r8
movl $0x1000, %esi           # imm = 0x1000
leaq 0x55b98(%rip), %rdx     # 0x77699
movb $0x0, %al
callq 0x30c0
leaq -0x3040(%rbp), %rax
movq %rax, -0x4048(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1fc(%rax)
je 0x21b42
movq 0x634be(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
movq -0x4048(%rbp), %rdx
leaq 0x55b79(%rip), %rsi     # 0x776b4
movb $0x0, %al
callq 0x37f0
jmp 0x21b44
jmp 0x21b46
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x21b5c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rcx
leaq 0x57358(%rip), %rsi     # 0x78eca
leaq 0x558f1(%rip), %rdx     # 0x7746a
callq 0x34830
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x21b94
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
leaq 0x558c6(%rip), %rdx     # 0x7746d
xorl %eax, %eax
movl %eax, %ecx
callq 0x34fa0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x21bbf
jmp 0x21e54
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1fc(%rax)
je 0x21bf0
movq 0x63415(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
leaq 0x55ae7(%rip), %rsi     # 0x776d0
movb $0x0, %al
callq 0x37f0
cmpq $0x0, -0x4048(%rbp)
je 0x21c32
movq -0x4048(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x21c32
leaq -0x1040(%rbp), %rdi
movq -0x4048(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
callq 0x20880
movl $0x1, -0x4054(%rbp)
cmpl $0x0, -0x4054(%rbp)
jne 0x21c9e
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
movq -0x28(%rbp), %rsi
callq 0x2eff0
movq %rax, -0x4070(%rbp)
cmpq $0x0, %rax
je 0x21c9e
leaq -0x1040(%rbp), %rdi
movq -0x4070(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x36f0
movq -0x4070(%rbp), %rdi
callq 0x3370
leaq -0x1040(%rbp), %rdi
callq 0x2d180
cmpl $0x0, %eax
je 0x21c9c
movl $0x1, -0x4054(%rbp)
jmp 0x21c9e
cmpl $0x0, -0x4054(%rbp)
je 0x21db4
leaq -0x1040(%rbp), %rdi
leaq -0x4100(%rbp), %rsi
callq 0x3830
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x21db2
leaq -0x1040(%rbp), %rdi
leaq 0x5774b(%rip), %rsi     # 0x79423
callq 0x39540
movq %rax, -0x4108(%rbp)
cmpq $0x0, %rax
je 0x21db2
movq -0x40d0(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rdi
leaq -0x1040(%rbp), %rsi
callq 0x377e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x21d74
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rax), %rdi
callq 0x3c070
cmpl $0x0, %eax
je 0x21d72
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
jmp 0x21d74
movq -0x4108(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x40(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22376
jmp 0x21db4
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
movq -0x28(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2ed80
movq %rax, -0x4050(%rbp)
cmpq $0x0, %rax
je 0x21e52
movq -0x4050(%rbp), %rdi
leaq -0x4110(%rbp), %rsi
callq 0x2dcf0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x21e11
movq -0x20(%rbp), %rax
movq $0x0, 0x38(%rax)
jmp 0x21e33
movq -0x4050(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x4050(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x4110(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x40(%rax)
jmp 0x2202c
jmp 0x21e54
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
leaq 0x55609(%rip), %rdx     # 0x77470
xorl %eax, %eax
movl %eax, %ecx
callq 0x34fa0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x21e86
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
leaq 0x55848(%rip), %rsi     # 0x776e1
movl $0x5, %edx
callq 0x3240
cmpl $0x0, %eax
jne 0x21ebd
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rax
movq %rax, -0x4188(%rbp)
jmp 0x21ed0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x3, %rax
movq %rax, -0x4188(%rbp)
movq -0x4188(%rbp), %rax
movq %rax, -0x4120(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x21f1f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rax), %rdi
callq 0x3c070
cmpl $0x0, %eax
je 0x21f0f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x4120(%rbp), %rsi
xorl %edx, %edx
callq 0x22530
movq %rax, -0x4118(%rbp)
cmpq $0x0, %rax
jne 0x21f4e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rdi
callq 0x22ce0
movq -0x4118(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x21fa7
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rax), %rdi
callq 0x3c070
cmpl $0x0, %eax
je 0x21f97
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x21fc2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x20300
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x21fee
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x22014
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x22020
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movl $0x0, -0x4(%rbp)
jmp 0x22376
cmpq $0x0, -0x4048(%rbp)
je 0x2236f
movq -0x4048(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2236f
callq 0x32c0
movl %eax, -0x4124(%rbp)
callq 0x2bf10
movl %eax, -0x4128(%rbp)
movsbl -0x4040(%rbp), %eax
cmpl $0x0, %eax
je 0x220ab
leaq -0x4040(%rbp), %rdi
callq 0x2d120
cmpl $0x0, %eax
jne 0x220ab
leaq 0x63409(%rip), %rax     # 0x85490
cmpl $0x1, (%rax)
jl 0x220ab
movq 0x62f55(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
leaq -0x4040(%rbp), %rdx
leaq 0x55643(%rip), %rsi     # 0x776e7
movb $0x0, %al
callq 0x37f0
leaq -0x1040(%rbp), %rdi
movq -0x4048(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
callq 0x20880
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1fc(%rax)
je 0x220f6
movq 0x62f0a(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
leaq -0x1040(%rbp), %rdx
leaq 0x5566b(%rip), %rsi     # 0x7775a
movb $0x0, %al
callq 0x37f0
leaq -0x1040(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x20ad0
xorl %eax, %eax
movl %eax, %edi
callq 0x38b0
movl %eax, -0x418c(%rbp)
callq 0x3600
movq %rax, %rcx
movl -0x418c(%rbp), %eax
xorl %ecx, %eax
movl %eax, -0x4134(%rbp)
movl -0x4128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4128(%rbp)
leaq -0x2040(%rbp), %rdi
leaq -0x1040(%rbp), %rdx
movl -0x4124(%rbp), %ecx
movl -0x4128(%rbp), %r8d
movl -0x4134(%rbp), %r9d
leaq 0x5560f(%rip), %rsi     # 0x77773
movb $0x0, %al
callq 0x3460
leaq -0x2040(%rbp), %rdi
leaq 0x5560a(%rip), %rsi     # 0x77783
callq 0x3260
movq %rax, -0x4130(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x4130(%rbp)
movb %al, -0x418d(%rbp)
jne 0x221a8
callq 0x35d0
cmpl $0x11, (%rax)
sete %al
movb %al, -0x418d(%rbp)
movb -0x418d(%rbp), %al
testb $0x1, %al
jne 0x22107
cmpq $0x0, -0x4130(%rbp)
jne 0x221d8
leaq -0x2040(%rbp), %rdi
callq 0x37d0
movl $0x0, -0x4(%rbp)
jmp 0x22376
callq 0x44490
movq %rax, -0x4140(%rbp)
cmpq $0x0, %rax
jne 0x2220e
leaq -0x2040(%rbp), %rdi
callq 0x3280
movq -0x4130(%rbp), %rdi
callq 0x36d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x4140(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x430a0
leaq -0x4150(%rbp), %rdi
movq -0x4140(%rbp), %rsi
callq 0x44200
movq -0x4140(%rbp), %rdi
callq 0x444e0
leaq -0x4180(%rbp), %rdi
leaq -0x4150(%rbp), %rsi
callq 0x44510
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
leaq -0x4180(%rbp), %rsi
movl $0x20, %edx
callq 0x3240
cmpl $0x0, %eax
je 0x222c1
movq 0x62d63(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
leaq 0x554f7(%rip), %rsi     # 0x77786
leaq 0x55526(%rip), %rdx     # 0x777bc
movb $0x0, %al
callq 0x37f0
leaq -0x2040(%rbp), %rdi
callq 0x3280
movq -0x4130(%rbp), %rdi
callq 0x36d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22376
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x4198(%rbp)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x4130(%rbp), %rcx
movl $0x1, %esi
callq 0x3780
movq %rax, %rcx
movq -0x4198(%rbp), %rax
cmpq %rcx, %rax
je 0x2230c
leaq -0x1040(%rbp), %rdi
callq 0x37d0
movq -0x4130(%rbp), %rdi
callq 0x20070
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x22331
leaq -0x2040(%rbp), %rdi
callq 0x3280
jmp 0x2236d
leaq -0x2040(%rbp), %rdi
movl $0x124, %esi            # imm = 0x124
callq 0x3030
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x2235f
leaq -0x2040(%rbp), %rdi
leaq -0x1040(%rbp), %rsi
callq 0x3880
jmp 0x2236b
leaq -0x2040(%rbp), %rdi
callq 0x3280
jmp 0x2236d
jmp 0x2236f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x41a0, %rsp           # imm = 0x41A0
popq %rbp
retq
nopw %cs:(%rax,%rax)