// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/cram_io.c
// Function: cram_compress_block
int cram_compress_block(cram_fd *fd, cram_block *b, cram_metrics *metrics,
			int method, int level) {

    char *comp = NULL;
    size_t comp_size = 0;
    int strat;

    if (b->method != RAW) {
        // Maybe already compressed if s->block[0] was compressed and
        // we have e.g. s->block[DS_BA] set to s->block[0] due to only
        // one base type present and hence using E_HUFFMAN on block 0.
        // A second explicit attempt to compress the same block then
        // occurs.
        return 0;
    }

    if (method == -1) {
	method = 1<<GZIP;
	if (fd->use_bz2)
	    method |= 1<<BZIP2;
	if (fd->use_lzma)
	    method |= 1<<LZMA;
    }

    if (level == -1)
	level = fd->level;

    //fprintf(stderr, "IN: block %d, sz %d\n", b->content_id, b->uncomp_size);

    if (method == RAW || level == 0 || b->uncomp_size == 0) {
	b->method = RAW;
	b->comp_size = b->uncomp_size;
	//fprintf(stderr, "Skip block id %d\n", b->content_id);
	return 0;
    }

    if (metrics) {
	pthread_mutex_lock(&fd->metrics_lock);
	if (metrics->trial > 0 || --metrics->next_trial <= 0) {
	    size_t sz_best = INT_MAX;
	    size_t sz_gz_rle = 0;
	    size_t sz_gz_def = 0;
	    size_t sz_rans0 = 0;
	    size_t sz_rans1 = 0;
	    size_t sz_bzip2 = 0;
	    size_t sz_lzma = 0;
	    int method_best = 0;
	    char *c_best = NULL, *c = NULL;

	    if (metrics->revised_method)
		method = metrics->revised_method;
	    else
		metrics->revised_method = method;

	    if (metrics->next_trial == 0) {
		metrics->next_trial = TRIAL_SPAN;
		metrics->trial = NTRIALS;
		metrics->sz_gz_rle /= 2;
		metrics->sz_gz_def /= 2;
		metrics->sz_rans0  /= 2;
		metrics->sz_rans1  /= 2;
		metrics->sz_bzip2  /= 2;
		metrics->sz_lzma   /= 2;
	    }

	    pthread_mutex_unlock(&fd->metrics_lock);
	    
	    if (method & (1<<GZIP_RLE)) {
		c = cram_compress_by_method((char *)b->data, b->uncomp_size,
					    &sz_gz_rle, GZIP, 1, Z_RLE);
		if (c && sz_best > sz_gz_rle) {
		    sz_best = sz_gz_rle;
		    method_best = GZIP_RLE;
		    if (c_best)
			free(c_best);
		    c_best = c;
		} else if (c) {
		    free(c);
		} else {
		    sz_gz_rle = b->uncomp_size*2+1000;
		}

		//fprintf(stderr, "Block %d; %d->%d\n", b->content_id, b->uncomp_size, sz_gz_rle);
	    }

	    if (method & (1<<GZIP)) {
		c = cram_compress_by_method((char *)b->data, b->uncomp_size,
					    &sz_gz_def, GZIP, level,
					    Z_FILTERED);
		if (c && sz_best > sz_gz_def) {
		    sz_best = sz_gz_def;
		    method_best = GZIP;
		    if (c_best)
			free(c_best);
		    c_best = c;
		} else if (c) {
		    free(c);
		} else {
		    sz_gz_def = b->uncomp_size*2+1000;
		}

		//fprintf(stderr, "Block %d; %d->%d\n", b->content_id, b->uncomp_size, sz_gz_def);
	    }

	    if (method & (1<<RANS0)) {
		c = cram_compress_by_method((char *)b->data, b->uncomp_size,
					    &sz_rans0, RANS0, 0, 0);
		if (c && sz_best > sz_rans0) {
		    sz_best = sz_rans0;
		    method_best = RANS0;
		    if (c_best)
			free(c_best);
		    c_best = c;
		} else if (c) {
		    free(c);
		} else {
		    sz_rans0 = b->uncomp_size*2+1000;
		}
	    }

	    if (method & (1<<RANS1)) {
		c = cram_compress_by_method((char *)b->data, b->uncomp_size,
					    &sz_rans1, RANS1, 0, 0);
		if (c && sz_best > sz_rans1) {
		    sz_best = sz_rans1;
		    method_best = RANS1;
		    if (c_best)
			free(c_best);
		    c_best = c;
		} else if (c) {
		    free(c);
		} else {
		    sz_rans1 = b->uncomp_size*2+1000;
		}
	    }

	    if (method & (1<<BZIP2)) {
		c = cram_compress_by_method((char *)b->data, b->uncomp_size,
					    &sz_bzip2, BZIP2, level, 0);
		if (c && sz_best > sz_bzip2) {
		    sz_best = sz_bzip2;
		    method_best = BZIP2;
		    if (c_best)
			free(c_best);
		    c_best = c;
		} else if (c) {
		    free(c);
		} else {
		    sz_bzip2 = b->uncomp_size*2+1000;
		}
	    }

	    if (method & (1<<LZMA)) {
		c = cram_compress_by_method((char *)b->data, b->uncomp_size,
					    &sz_lzma, LZMA, level, 0);
		if (c && sz_best > sz_lzma) {
		    sz_best = sz_lzma;
		    method_best = LZMA;
		    if (c_best)
			free(c_best);
		    c_best = c;
		} else if (c) {
		    free(c);
		} else {
		    sz_lzma = b->uncomp_size*2+1000;
		}
	    }

	    //fprintf(stderr, "sz_best = %d\n", sz_best);

	    free(b->data);
	    b->data = (unsigned char *)c_best;
	    //printf("method_best = %s\n", cram_block_method2str(method_best));
	    b->method = method_best == GZIP_RLE ? GZIP : method_best;
	    b->comp_size = sz_best;

	    pthread_mutex_lock(&fd->metrics_lock);
	    metrics->sz_gz_rle += sz_gz_rle;
	    metrics->sz_gz_def += sz_gz_def;
	    metrics->sz_rans0  += sz_rans0;
	    metrics->sz_rans1  += sz_rans1;
	    metrics->sz_bzip2  += sz_bzip2;
	    metrics->sz_lzma   += sz_lzma;
	    if (--metrics->trial == 0) {
		int best_method = RAW;
		int best_sz = INT_MAX;

		// Scale methods by cost
		if (fd->level <= 3) {
		    metrics->sz_rans1  *= 1.02;
		    metrics->sz_gz_def *= 1.04;
		    metrics->sz_bzip2  *= 1.08;
		    metrics->sz_lzma   *= 1.10;
		} else if (fd->level <= 6) {
		    metrics->sz_rans1  *= 1.01;
		    metrics->sz_gz_def *= 1.02;
		    metrics->sz_bzip2  *= 1.03;
		    metrics->sz_lzma   *= 1.05;
		}

		if (method & (1<<GZIP_RLE) && best_sz > metrics->sz_gz_rle)
		    best_sz = metrics->sz_gz_rle, best_method = GZIP_RLE;

		if (method & (1<<GZIP) && best_sz > metrics->sz_gz_def)
		    best_sz = metrics->sz_gz_def, best_method = GZIP;

		if (method & (1<<RANS0) && best_sz > metrics->sz_rans0)
		    best_sz = metrics->sz_rans0, best_method = RANS0;

		if (method & (1<<RANS1) && best_sz > metrics->sz_rans1)
		    best_sz = metrics->sz_rans1, best_method = RANS1;

		if (method & (1<<BZIP2) && best_sz > metrics->sz_bzip2)
		    best_sz = metrics->sz_bzip2, best_method = BZIP2;

		if (method & (1<<LZMA) && best_sz > metrics->sz_lzma)
		    best_sz = metrics->sz_lzma, best_method = LZMA;

		if (best_method == GZIP_RLE) {
		    metrics->method = GZIP;
		    metrics->strat  = Z_RLE;
		} else {
		    metrics->method = best_method;
		    metrics->strat  = Z_FILTERED;
		}

		// If we see at least MAXFAIL trials in a row for a specific
		// compression method with more than MAXDELTA aggregate
		// size then we drop this from the list of methods used
		// for this block type.
#define MAXDELTA 0.20
#define MAXFAILS 4
		if (best_method == GZIP_RLE) {
		    metrics->gz_rle_cnt = 0;
		    metrics->gz_rle_extra = 0;
		} else if (best_sz < metrics->sz_gz_rle) {
		    double r = (double)metrics->sz_gz_rle / best_sz - 1;
		    if (++metrics->gz_rle_cnt >= MAXFAILS && 
			(metrics->gz_rle_extra += r) >= MAXDELTA)
			method &= ~(1<<GZIP_RLE);
		}

		if (best_method == GZIP) {
		    metrics->gz_def_cnt = 0;
		    metrics->gz_def_extra = 0;
		} else if (best_sz < metrics->sz_gz_def) {
		    double r = (double)metrics->sz_gz_def / best_sz - 1;
		    if (++metrics->gz_def_cnt >= MAXFAILS &&
			(metrics->gz_def_extra += r) >= MAXDELTA)
			method &= ~(1<<GZIP);
		}

		if (best_method == RANS0) {
		    metrics->rans0_cnt = 0;
		    metrics->rans0_extra = 0;
		} else if (best_sz < metrics->sz_rans0) {
		    double r = (double)metrics->sz_rans0 / best_sz - 1;
		    if (++metrics->rans0_cnt >= MAXFAILS &&
			(metrics->rans0_extra += r) >= MAXDELTA)
			method &= ~(1<<RANS0);
		}

		if (best_method == RANS1) {
		    metrics->rans1_cnt = 0;
		    metrics->rans1_extra = 0;
		} else if (best_sz < metrics->sz_rans1) {
		    double r = (double)metrics->sz_rans1 / best_sz - 1;
		    if (++metrics->rans1_cnt >= MAXFAILS &&
			(metrics->rans1_extra += r) >= MAXDELTA)
			method &= ~(1<<RANS1);
		}

		if (best_method == BZIP2) {
		    metrics->bzip2_cnt = 0;
		    metrics->bzip2_extra = 0;
		} else if (best_sz < metrics->sz_bzip2) {
		    double r = (double)metrics->sz_bzip2 / best_sz - 1;
		    if (++metrics->bzip2_cnt >= MAXFAILS &&
			(metrics->bzip2_extra += r) >= MAXDELTA)
			method &= ~(1<<BZIP2);
		}

		if (best_method == LZMA) {
		    metrics->lzma_cnt = 0;
		    metrics->lzma_extra = 0;
		} else if (best_sz < metrics->sz_lzma) {
		    double r = (double)metrics->sz_lzma / best_sz - 1;
		    if (++metrics->lzma_cnt >= MAXFAILS &&
			(metrics->lzma_extra += r) >= MAXDELTA)
			method &= ~(1<<LZMA);
		}

		//if (method != metrics->revised_method)
		//    fprintf(stderr, "%d: method from %x to %x\n",
		//	    b->content_id, metrics->revised_method, method);
		metrics->revised_method = method;
	    }
	    pthread_mutex_unlock(&fd->metrics_lock);
	} else {
	    strat = metrics->strat;
	    method = metrics->method;

	    pthread_mutex_unlock(&fd->metrics_lock);
	    comp = cram_compress_by_method((char *)b->data, b->uncomp_size,
					   &comp_size, method,
					   level, strat);
	    if (!comp)
		return -1;
	    free(b->data);
	    b->data = (unsigned char *)comp;
	    b->comp_size = comp_size;
	    b->method = method;
	}

    } else {
	// no cached metrics, so just do zlib?
	comp = cram_compress_by_method((char *)b->data, b->uncomp_size,
				       &comp_size, GZIP, level, Z_FILTERED);
	if (!comp) {
	    fprintf(stderr, "Compression failed!\n");
	    return -1;
	}
	free(b->data);
	b->data = (unsigned char *)comp;
	b->comp_size = comp_size;
	b->method = GZIP;
    }

    if (fd->verbose)
	fprintf(stderr, "Compressed block ID %d from %d to %d by method %s\n",
		b->content_id, b->uncomp_size, b->comp_size,
		cram_block_method2str(b->method));

    if (b->method == RANS1)
	b->method = RANS0; // Spec just has RANS (not 0/1) with auto-sensing

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq $0x0, 0x48(%rsp)
xorl %ebx, %ebx
cmpl $0x0, (%rsi)
jne 0x56a64
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
cmpl $-0x1, %ecx
jne 0x5692b
xorl %eax, %eax
cmpl $0x0, 0x214(%r15)
setne %al
shll $0x2, %eax
xorl %ecx, %ecx
cmpl $0x0, 0x21c(%r15)
setne %cl
leal (%rax,%rcx,8), %ebp
addl $0x2, %ebp
cmpl $-0x1, %r12d
jne 0x56935
movl 0x78(%r15), %r12d
testl %ebp, %ebp
sete %al
testl %r12d, %r12d
sete %cl
orb %al, %cl
jne 0x56a55
movslq 0x14(%r14), %rsi
testq %rsi, %rsi
je 0x56a55
leaq 0x14(%r14), %rax
movq %rax, 0x28(%rsp)
testq %r13, %r13
je 0x56a75
leaq 0x8870(%r15), %rdi
movq %rdi, 0x50(%rsp)
callq 0x6ae0
cmpl $0x0, (%r13)
jg 0x56993
movl 0x4(%r13), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x4(%r13)
cmpl $0x1, %eax
jg 0x56b09
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movl 0x40(%r13), %eax
testl %eax, %eax
jne 0x569ad
movl %ebp, 0x40(%r13)
movl %ebp, %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0x4(%r13)
jne 0x56a2c
movabsq $0x3200000003, %rax     # imm = 0x3200000003
movq %rax, (%r13)
movl 0x8(%r13), %eax
movl 0xc(%r13), %ecx
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl %edx, 0x8(%r13)
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
movl %eax, 0xc(%r13)
movl 0x10(%r13), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x10(%r13)
movl 0x14(%r13), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x14(%r13)
movl 0x18(%r13), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x18(%r13)
movl 0x1c(%r13), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x1c(%r13)
movq 0x50(%rsp), %rdi
callq 0x64f0
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl 0xc(%rsp), %ecx
btl $0xb, %ecx
jb 0x56abe
movq $0x0, 0x18(%rsp)
xorl %ebp, %ebp
jmp 0x56b91
movl $0x0, (%r14)
movl 0x14(%r14), %eax
movl %eax, 0x10(%r14)
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r14), %rdi
leaq 0x48(%rsp), %rdx
movl $0x1, %ecx
movl %r12d, %r8d
movl $0x1, %r9d
callq 0x57207
testq %rax, %rax
je 0x571f8
movq %rax, %r12
movq 0x20(%r14), %rdi
callq 0x68a0
movq %r12, 0x20(%r14)
movl 0x48(%rsp), %eax
movl %eax, 0x10(%r14)
movl $0x1, (%r14)
jmp 0x571b5
movq 0x20(%r14), %rdi
movslq 0x14(%r14), %rsi
leaq 0x40(%rsp), %rdx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x3, %r9d
callq 0x57207
testq %rax, %rax
je 0x56b5e
movq %rax, %rbp
movq 0x40(%rsp), %rax
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jae 0x56b75
movl $0xb, %ecx
movq %rcx, 0x18(%rsp)
movl 0xc(%rsp), %ecx
jmp 0x56b91
movl 0x20(%r13), %ebp
movl 0x24(%r13), %r13d
movq 0x50(%rsp), %rdi
callq 0x64f0
movq 0x20(%r14), %rdi
movslq 0x14(%r14), %rsi
leaq 0x48(%rsp), %rdx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x57207
testq %rax, %rax
je 0x571fd
movq %rax, %r12
movq 0x20(%r14), %rdi
callq 0x68a0
movq %r12, 0x20(%r14)
movl 0x48(%rsp), %eax
movl %eax, 0x10(%r14)
movl %ebp, (%r14)
jmp 0x571b5
movq 0x28(%rsp), %rax
movslq (%rax), %rax
leaq 0x3e8(,%rax,2), %rax
movq %rax, 0x40(%rsp)
jmp 0x56b7d
movq %rbp, %rdi
callq 0x68a0
movq $0x0, 0x18(%rsp)
xorl %ebp, %ebp
movl 0xc(%rsp), %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testb $0x2, %cl
jne 0x56ba3
movq %rbp, %r12
movq %rax, 0x10(%rsp)
jmp 0x56c2d
movq %rax, 0x20(%rsp)
movq 0x20(%r14), %rdi
movslq 0x14(%r14), %rsi
leaq 0x38(%rsp), %rdx
movl $0x1, %ecx
movl %r12d, %r8d
movl $0x1, %r9d
callq 0x57207
testq %rax, %rax
je 0x56bfd
movq %rax, %r12
movq 0x38(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jbe 0x56c14
movl $0x1, %eax
movq %rax, 0x18(%rsp)
testq %rbp, %rbp
je 0x56c29
movq %rbp, %rdi
callq 0x68a0
jmp 0x56c29
movq 0x28(%rsp), %rax
movslq (%rax), %rax
leaq 0x3e8(,%rax,2), %rax
movq %rax, 0x38(%rsp)
jmp 0x56c1c
movq %r12, %rdi
callq 0x68a0
movq %rbp, %r12
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %ecx
movq $0x0, 0x20(%rsp)
testb $0x10, %cl
jne 0x56c42
xorl %eax, %eax
movq %r12, %rbp
jmp 0x56cb6
movq 0x20(%r14), %rdi
movl 0x14(%r14), %esi
leaq 0x34(%rsp), %rdx
xorl %ecx, %ecx
callq 0x6131b
testq %rax, %rax
je 0x56c91
movq %rax, %rbp
movl 0x34(%rsp), %eax
cmpq %rax, 0x10(%rsp)
jbe 0x56ca1
movl $0x4, %ecx
movq %rcx, 0x18(%rsp)
testq %r12, %r12
je 0x571e4
movq %r12, %rdi
movq %rax, %r12
callq 0x68a0
movq %r12, %rax
movq %r12, 0x10(%rsp)
jmp 0x56cb2
movq 0x28(%rsp), %rax
movl (%rax), %eax
leal 0x3e8(,%rax,2), %eax
jmp 0x56caf
movq %rbp, %rdi
movq %rax, %rbp
callq 0x68a0
movq %rbp, %rax
movq %r12, %rbp
movl 0xc(%rsp), %ecx
movq %rax, 0x60(%rsp)
btl $0xa, %ecx
movq %r15, 0x58(%rsp)
jb 0x56ccb
movq %rbp, %r12
jmp 0x56d43
movq 0x20(%r14), %rdi
movl 0x14(%r14), %esi
leaq 0x34(%rsp), %rdx
movl $0x1, %ecx
callq 0x6131b
testq %rax, %rax
je 0x56d1f
movq %rax, %r12
movl 0x34(%rsp), %ecx
cmpq %rcx, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
jbe 0x56d34
movl $0xa, %eax
movq %rax, 0x18(%rsp)
testq %rbp, %rbp
je 0x571ee
movq %rbp, %rdi
movq %rcx, %r15
callq 0x68a0
movq %r15, 0x10(%rsp)
jmp 0x56d3f
movq 0x28(%rsp), %rax
movl (%rax), %eax
leal 0x3e8(,%rax,2), %eax
movq %rax, 0x20(%rsp)
jmp 0x56d3c
movq %r12, %rdi
callq 0x68a0
movq %rbp, %r12
movl 0xc(%rsp), %ecx
xorl %ebp, %ebp
movl $0x0, %r15d
testb $0x4, %cl
je 0x56d5f
movq 0x28(%rsp), %rax
movl (%rax), %eax
leal 0x3e8(,%rax,2), %r15d
testb $0x8, %cl
je 0x56d72
movq 0x28(%rsp), %rax
movl (%rax), %eax
leal 0x3e8(,%rax,2), %ebp
movq 0x20(%r14), %rdi
callq 0x68a0
movq %r12, 0x20(%r14)
movq 0x18(%rsp), %rcx
cmpl $0xb, %ecx
movl $0x1, %eax
cmovnel %ecx, %eax
movl %eax, (%r14)
movq 0x10(%rsp), %rax
movl %eax, 0x10(%r14)
movq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x6ae0
movl 0x8(%r13), %edx
addl 0x40(%rsp), %edx
movl 0xc(%r13), %eax
movl %edx, 0x8(%r13)
addl 0x38(%rsp), %eax
movl %eax, 0xc(%r13)
movq 0x60(%rsp), %r9
addl 0x10(%r13), %r9d
movl %r9d, 0x10(%r13)
movq 0x20(%rsp), %rsi
addl 0x14(%r13), %esi
movl %esi, 0x14(%r13)
addl 0x18(%r13), %r15d
movl %r15d, 0x18(%r13)
addl 0x1c(%r13), %ebp
movl %ebp, 0x1c(%r13)
decl (%r13)
jne 0x571a8
movq 0x58(%rsp), %rcx
movl 0x78(%rcx), %ecx
cmpl $0x4, %ecx
jge 0x56e28
movsd 0x41dff(%rip), %xmm0    # 0x98c08
movsd 0x41dff(%rip), %xmm1    # 0x98c10
movsd 0x41dff(%rip), %xmm2    # 0x98c18
movsd 0x41dff(%rip), %xmm3    # 0x98c20
movl 0xc(%rsp), %r8d
jmp 0x56e52
cmpl $0x6, %ecx
movl 0xc(%rsp), %r8d
jg 0x56e9c
movsd 0x3be96(%rip), %xmm0    # 0x92cd0
movsd 0x41de6(%rip), %xmm1    # 0x98c28
movsd 0x41dd6(%rip), %xmm2    # 0x98c20
movsd 0x41dde(%rip), %xmm3    # 0x98c30
cvtsi2sd %esi, %xmm4
mulsd %xmm3, %xmm4
cvttsd2si %xmm4, %ecx
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
mulsd %xmm2, %xmm3
cvttsd2si %xmm3, %eax
xorps %xmm2, %xmm2
cvtsi2sd %r15d, %xmm2
movl %ecx, 0x14(%r13)
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
movl %eax, 0xc(%r13)
movl %ecx, 0x18(%r13)
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x1c(%r13)
movl %r8d, %eax
shll $0x14, %eax
sarl $0x1f, %eax
xorl %ecx, %ecx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpl %esi, %edx
movl $0xb, %edi
cmovel %ecx, %edi
andl %eax, %edi
btl $0xb, %r8d
cmovbl %edx, %esi
testb $0x2, %r8b
je 0x56ed7
movl 0xc(%r13), %eax
cmpl %eax, %esi
movl $0x1, %ecx
cmovgl %ecx, %edi
cmovgel %eax, %esi
cmpl %r9d, %esi
movl $0x4, %ecx
cmovlel %edi, %ecx
movl %r9d, %eax
cmovll %esi, %eax
testb $0x10, %r8b
cmovel %edi, %ecx
cmovel %esi, %eax
btl $0xa, %r8d
jae 0x56f0a
movl 0x14(%r13), %esi
cmpl %esi, %eax
movl $0xa, %edi
cmovgl %edi, %ecx
cmovgel %esi, %eax
testb $0x4, %r8b
je 0x56f21
movl 0x18(%r13), %esi
cmpl %esi, %eax
movl $0x2, %edi
cmovgl %edi, %ecx
cmovgel %esi, %eax
testb $0x8, %r8b
je 0x56f38
movl 0x1c(%r13), %esi
cmpl %esi, %eax
movl $0x3, %edi
cmovgl %edi, %ecx
cmovgel %esi, %eax
xorl %esi, %esi
movl $0x1, %edi
cmpl $0xb, %ecx
cmovnel %ecx, %edi
sete %sil
leal 0x1(%rsi,%rsi), %esi
movl %edi, 0x20(%r13)
movl %esi, 0x24(%r13)
jne 0x56f69
movl $0x0, 0x28(%r13)
movq $0x0, 0x48(%r13)
jmp 0x56fb4
cmpl %edx, %eax
jge 0x56fb4
movl 0x28(%r13), %esi
leal 0x1(%rsi), %edi
movl %edi, 0x28(%r13)
cmpl $0x3, %esi
jl 0x56fb4
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd 0x41ca1(%rip), %xmm0    # 0x98c38
addsd 0x48(%r13), %xmm0
movsd %xmm0, 0x48(%r13)
ucomisd 0x41c95(%rip), %xmm0    # 0x98c40
jb 0x56fb4
andl $0xfffff7ff, %r8d       # imm = 0xFFFFF7FF
cmpl $0x1, %ecx
jne 0x56fcb
movl $0x0, 0x2c(%r13)
movq $0x0, 0x50(%r13)
jmp 0x57017
movl 0xc(%r13), %edx
cmpl %edx, %eax
jge 0x57017
movl 0x2c(%r13), %esi
leal 0x1(%rsi), %edi
movl %edi, 0x2c(%r13)
cmpl $0x3, %esi
jl 0x57017
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd 0x41c3b(%rip), %xmm0    # 0x98c38
addsd 0x50(%r13), %xmm0
movsd %xmm0, 0x50(%r13)
ucomisd 0x41c2f(%rip), %xmm0    # 0x98c40
jb 0x57017
andl $-0x3, %r8d
cmpl $0x4, %ecx
jne 0x5702e
movl $0x0, 0x30(%r13)
movq $0x0, 0x58(%r13)
jmp 0x57078
cmpl %r9d, %eax
jge 0x57078
movl 0x30(%r13), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x30(%r13)
cmpl $0x3, %edx
jl 0x57078
xorps %xmm0, %xmm0
cvtsi2sd %r9d, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd 0x41bda(%rip), %xmm0    # 0x98c38
addsd 0x58(%r13), %xmm0
movsd %xmm0, 0x58(%r13)
ucomisd 0x41bce(%rip), %xmm0    # 0x98c40
jb 0x57078
andl $-0x11, %r8d
cmpl $0xa, %ecx
jne 0x5708f
movl $0x0, 0x34(%r13)
movq $0x0, 0x60(%r13)
jmp 0x570de
movl 0x14(%r13), %edx
cmpl %edx, %eax
jge 0x570de
movl 0x34(%r13), %esi
leal 0x1(%rsi), %edi
movl %edi, 0x34(%r13)
cmpl $0x3, %esi
jl 0x570de
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd 0x41b77(%rip), %xmm0    # 0x98c38
addsd 0x60(%r13), %xmm0
movsd %xmm0, 0x60(%r13)
ucomisd 0x41b6b(%rip), %xmm0    # 0x98c40
jb 0x570de
andl $0xfffffbff, %r8d       # imm = 0xFFFFFBFF
cmpl $0x2, %ecx
jne 0x570f5
movl $0x0, 0x38(%r13)
movq $0x0, 0x68(%r13)
jmp 0x57141
movl 0x18(%r13), %edx
cmpl %edx, %eax
jge 0x57141
movl 0x38(%r13), %esi
leal 0x1(%rsi), %edi
movl %edi, 0x38(%r13)
cmpl $0x3, %esi
jl 0x57141
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd 0x41b11(%rip), %xmm0    # 0x98c38
addsd 0x68(%r13), %xmm0
movsd %xmm0, 0x68(%r13)
ucomisd 0x41b05(%rip), %xmm0    # 0x98c40
jb 0x57141
andl $-0x5, %r8d
cmpl $0x3, %ecx
jne 0x57158
movl $0x0, 0x3c(%r13)
movq $0x0, 0x70(%r13)
jmp 0x571a4
movl 0x1c(%r13), %ecx
cmpl %ecx, %eax
jge 0x571a4
movl 0x3c(%r13), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x3c(%r13)
cmpl $0x3, %edx
jl 0x571a4
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd 0x41aae(%rip), %xmm0    # 0x98c38
addsd 0x70(%r13), %xmm0
movsd %xmm0, 0x70(%r13)
ucomisd 0x41aa2(%rip), %xmm0    # 0x98c40
jb 0x571a4
andl $-0x9, %r8d
movl %r8d, 0x40(%r13)
movq %r12, %rdi
callq 0x64f0
movq 0x58(%rsp), %r15
cmpl $0x0, 0x1fc(%r15)
jne 0x571d5
cmpl $0xa, (%r14)
jne 0x56a64
movl $0x4, (%r14)
jmp 0x56a64
movq %r14, %rdi
movq 0x28(%rsp), %rsi
callq 0x776d
jmp 0x571bf
movq %rax, 0x10(%rsp)
jmp 0x56cb2
movq %rcx, 0x10(%rsp)
jmp 0x56d3f
callq 0x77b8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x56a64