LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_huffman_encode_char
int cram_huffman_encode_char(cram_slice *slice, cram_codec *c,
			     char *in, int in_size) {
    int i, code, len, r = 0;
    unsigned char *syms = (unsigned char *)in;

    while (in_size--) {
	int sym = *syms++;
	if (sym >= -1 && sym < MAX_HUFF) {
	    i = c->e_huffman.val2code[sym+1];
	    assert(c->e_huffman.codes[i].symbol == sym);
	    code = c->e_huffman.codes[i].code;
	    len  = c->e_huffman.codes[i].len;
	} else {
	    /* Slow - use a lookup table for when sym < MAX_HUFF? */
	    for (i = 0; i < c->e_huffman.nvals; i++) {
		if (c->e_huffman.codes[i].symbol == sym)
		    break;
	    }
	    if (i == c->e_huffman.nvals)
		return -1;
    
	    code = c->e_huffman.codes[i].code;
	    len  = c->e_huffman.codes[i].len;
	}

	r |= store_bits_MSB(c->out, code, len);
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
subl $0x1, %ebp
jb 0x4c02c
movzbl (%r14), %ecx
testb %cl, %cl
js 0x4bfd7
movslq 0x40(%r15,%rcx,4), %rdx
movq 0x30(%r15), %rax
shlq $0x4, %rdx
cmpl %ecx, (%rax,%rdx)
jne 0x4c039
addq %rdx, %rax
jmp 0x4c00d
movl 0x38(%r15), %eax
testl %eax, %eax
jle 0x4bff9
movq 0x30(%r15), %rsi
xorl %edx, %edx
cmpl %ecx, (%rsi)
je 0x4bffb
incq %rdx
addq $0x10, %rsi
cmpq %rdx, %rax
jne 0x4bfe5
movl %eax, %edx
jmp 0x4bffb
xorl %edx, %edx
cmpl %eax, %edx
jne 0x4c003
xorl %eax, %eax
jmp 0x4c020
movl %edx, %eax
shlq $0x4, %rax
addq 0x30(%r15), %rax
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
movq 0x8(%r15), %rdi
callq 0x4adc3
orl %eax, %ebx
movb $0x1, %al
incq %r14
testb %al, %al
jne 0x4bfb3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa62c(%rip), %rdi      # 0x5666c
leaq 0xa55c(%rip), %rsi      # 0x565a3
leaq 0xa642(%rip), %rcx      # 0x56690
movl $0x429, %edx            # imm = 0x429
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_huffman_encode_free
void cram_huffman_encode_free(cram_codec *c) {
    if (!c)
	return;

    if (c->e_huffman.codes)
	free(c->e_huffman.codes);
    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x4c139
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x4c130
callq 0x4610
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_decode
int cram_byte_array_len_decode(cram_slice *slice, cram_codec *c,
			       cram_block *in, char *out,
			       int *out_size) {
    /* Fetch length */
    int32_t len = 0, one = 1;
    int r;

    r = c->byte_array_len.len_codec->decode(slice, c->byte_array_len.len_codec,
                                            in, (char *)&len, &one);
    //printf("ByteArray Len=%d\n", len);

    if (!r && c->byte_array_len.val_codec && len >= 0) {
	r = c->byte_array_len.val_codec->decode(slice,
						c->byte_array_len.val_codec,
						in, out, &len);
    } else {
	return -1;
    }

    *out_size = len;

    return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
leaq 0x8(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0xc(%rsp), %r8
movl $0x1, (%r8)
movq 0x30(%rsi), %rsi
callq *0x18(%rsi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x4cb3c
movq 0x38(%r13), %rsi
testq %rsi, %rsi
je 0x4cb3c
cmpl $0x0, 0x8(%rsp)
js 0x4cb3c
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %r13, %r8
callq *0x18(%rsi)
movl (%r13), %ecx
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_decode_free
void cram_byte_array_len_decode_free(cram_codec *c) {
    if (!c) return;

    if (c->byte_array_len.len_codec)
	c->byte_array_len.len_codec->free(c->byte_array_len.len_codec);

    if (c->byte_array_len.val_codec)
	c->byte_array_len.val_codec->free(c->byte_array_len.val_codec);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x4cb74
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x4cb5f
callq *0x10(%rdi)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4cb6b
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_decoder_init
cram_codec *cram_decoder_init(enum cram_encoding codec,
			      char *data, int size,
			      enum cram_external_type option,
			      int version) {
    if (codec >= E_NULL && codec < E_NUM_CODECS && decode_init[codec]) {
	return decode_init[codec](data, size, option, version);
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	return NULL;
    }
}

// Assembly:
cmpl $0x9, %edi
ja 0x4cfd3
movl $0x105, %eax            # imm = 0x105
btq %rdi, %rax
jb 0x4cfd3
movl %edi, %eax
leaq 0x16cbb(%rip), %r9      # 0x63c80
movq %rsi, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
jmpq *(%r9,%rax,8)
pushq %rax
callq 0x628a
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode
int cram_byte_array_len_encode(cram_slice *slice, cram_codec *c,
			       char *in, int in_size) {
    int32_t i32 = in_size;
    int r = 0;

    r |= c->e_byte_array_len.len_codec->encode(slice,
					       c->e_byte_array_len.len_codec,
					       (char *)&i32, 1);
    r |= c->e_byte_array_len.val_codec->encode(slice,
					       c->e_byte_array_len.val_codec,
					       in, in_size);
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0xc(%rsp), %rdx
movl %ecx, (%rdx)
movq 0x48(%rsi), %rsi
movl $0x1, %ecx
callq *0x20(%rsi)
movl %eax, %ebp
movq 0x50(%r15), %rsi
movq %r12, %rdi
movq %r14, %rdx
movl %ebx, %ecx
callq *0x20(%rsi)
orl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode_free
void cram_byte_array_len_encode_free(cram_codec *c) {
    if (!c)
	return;

    if (c->e_byte_array_len.len_codec)
	c->e_byte_array_len.len_codec->free(c->e_byte_array_len.len_codec);

    if (c->e_byte_array_len.val_codec)
	c->e_byte_array_len.val_codec->free(c->e_byte_array_len.val_codec);

    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x4d051
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x4d03c
callq *0x10(%rdi)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x4d048
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode_init
cram_codec *cram_byte_array_len_encode_init(cram_stats *st,
					    enum cram_external_type option,
					    void *dat,
					    int version) {
    cram_codec *c;
    cram_byte_array_len_encoder *e = (cram_byte_array_len_encoder *)dat;

    c = malloc(sizeof(*c));
    if (!c)
	return NULL;
    c->codec = E_BYTE_ARRAY_LEN;
    c->free = cram_byte_array_len_encode_free;
    c->encode = cram_byte_array_len_encode;
    c->store = cram_byte_array_len_encode_store;

    c->e_byte_array_len.len_codec = cram_encoder_init(e->len_encoding,
						      NULL, E_INT, 
						      e->len_dat,
						      version);
    c->e_byte_array_len.val_codec = cram_encoder_init(e->val_encoding,
						      NULL, E_BYTE_ARRAY, 
						      e->val_dat,
						      version);

    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x4d387
movq %rax, %rbx
movl $0x4, (%rax)
leaq -0x30f(%rip), %rax      # 0x4d027
movq %rax, 0x10(%rbx)
leaq -0x364(%rip), %rax      # 0x4cfdd
movq %rax, 0x20(%rbx)
leaq -0x2fa(%rip), %rax      # 0x4d052
movq %rax, 0x28(%rbx)
movl (%r14), %edi
movq 0x8(%r14), %rcx
xorl %esi, %esi
movl $0x1, %edx
movl %ebp, %r8d
callq 0x4d391
movq %rax, 0x48(%rbx)
movl 0x4(%r14), %edi
movq 0x10(%r14), %rcx
xorl %esi, %esi
movl $0x4, %edx
movl %ebp, %r8d
callq 0x4d391
movq %rax, 0x50(%rbx)
jmp 0x4d389
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_encoder_init
cram_codec *cram_encoder_init(enum cram_encoding codec,
			      cram_stats *st,
			      enum cram_external_type option,
			      void *dat,
			      int version) {
    if (st && !st->nvals)
	return NULL;

    if (encode_init[codec]) {
	cram_codec *r;
	if ((r = encode_init[codec](st, option, dat, version)))
	    r->out = NULL;
	return r;
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	abort();
    }
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0x4d3a0
cmpl $0x0, 0x100c(%rsi)
je 0x4d3d2
movl $0x385, %eax            # imm = 0x385
btq %rdi, %rax
jb 0x4d3d6
movl %edi, %eax
leaq 0x1691c(%rip), %r9      # 0x63cd0
movq %rsi, %rdi
movl %edx, %esi
movq %rcx, %rdx
movl %r8d, %ecx
callq *(%r9,%rax,8)
testq %rax, %rax
je 0x4d3d4
movq $0x0, 0x8(%rax)
jmp 0x4d3d4
xorl %eax, %eax
popq %rcx
retq
callq 0x62bf
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_init
cram_codec *cram_byte_array_stop_decode_init(char *data, int size,
					     enum cram_external_type option,
					     int version) {
    cram_codec *c;
    unsigned char *cp = (unsigned char *)data;

    if (!(c = malloc(sizeof(*c))))
	return NULL;

    c->codec  = E_BYTE_ARRAY_STOP;
    switch (option) {
    case E_BYTE_ARRAY_BLOCK:
        c->decode = cram_byte_array_stop_decode_block;
	break;
    case E_BYTE_ARRAY:
        c->decode = cram_byte_array_stop_decode_char;
	break;
    default:
        fprintf(stderr, "byte_array_stop codec only supports BYTE_ARRAYs.\n");
        free(c);
        return NULL;
    }
    c->free   = cram_byte_array_stop_decode_free;
    
    c->byte_array_stop.stop = *cp++;
    if (CRAM_MAJOR_VERS(version) == 1) {
	c->byte_array_stop.content_id = cp[0] + (cp[1]<<8) + (cp[2]<<16)
	    + (cp[3]<<24);
	cp += 4;
    } else {
	cp += itf8_get(cp, &c->byte_array_stop.content_id);
    }

    if ((char *)cp - data != size) {
	fprintf(stderr, "Malformed byte_array_stop header stream\n");
	free(c);
	return NULL;
    }

    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r14
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x4d7aa
movq %rax, %rbx
movl $0x5, (%rax)
cmpl $0x5, %r12d
je 0x4d68f
cmpl $0x4, %r12d
jne 0x4d75a
leaq 0x12b(%rip), %rax       # 0x4d7b8
jmp 0x4d696
leaq -0x2bb(%rip), %rax      # 0x4d3db
movq %rax, 0x18(%rbx)
leaq -0x64(%rip), %rax       # 0x4d63d
movq %rax, 0x10(%rbx)
movb (%r14), %al
movb %al, 0x30(%rbx)
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
movzbl 0x1(%r14), %ecx
cmpl $0x100, %r15d           # imm = 0x100
jne 0x4d6ea
movzbl 0x2(%r14), %eax
shll $0x8, %eax
movzbl 0x3(%r14), %edx
shll $0x10, %edx
orl %eax, %edx
movzbl 0x4(%r14), %eax
shll $0x18, %eax
orl %edx, %eax
orl %ecx, %eax
movl %eax, 0x34(%rbx)
leaq 0x5(%r14), %rax
jmp 0x4d792
leaq 0x1(%r14), %rax
movl $0x1, %edx
testb %cl, %cl
jns 0x4d78c
movzbl 0x2(%r14), %edx
cmpb $-0x41, %cl
ja 0x4d714
andl $0x3f, %ecx
shll $0x8, %ecx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x4d78c
cmpb $-0x21, %cl
ja 0x4d732
shll $0x8, %edx
movzbl 0x3(%r14), %esi
andl $0x1f, %ecx
shll $0x10, %ecx
orl %edx, %ecx
orl %esi, %ecx
movl $0x3, %edx
jmp 0x4d78c
cmpb $-0x11, %cl
ja 0x4d761
shll $0x10, %edx
movzbl 0x3(%r14), %esi
shll $0x8, %esi
movzbl 0x4(%r14), %edi
andl $0xf, %ecx
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl $0x4, %edx
jmp 0x4d78c
callq 0x6304
jmp 0x4d7a2
shll $0x1c, %ecx
shll $0x14, %edx
orl %ecx, %edx
movzbl 0x3(%r14), %ecx
shll $0xc, %ecx
orl %edx, %ecx
movzbl 0x4(%r14), %edx
shll $0x4, %edx
orl %ecx, %edx
movzbl 0x5(%r14), %ecx
andl $0xf, %ecx
orl %edx, %ecx
movl $0x5, %edx
addq %rdx, %rax
movl %ecx, 0x34(%rbx)
subq %r14, %rax
movslq %ebp, %rcx
cmpq %rcx, %rax
je 0x4d7ac
callq 0x62e8
movq %rbx, %rdi
callq 0x4610
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_char
static int cram_byte_array_stop_decode_char(cram_slice *slice, cram_codec *c,
					    cram_block *in, char *out,
					    int *out_size) {
    cram_block *b = NULL;
    char *cp, ch;

    b = cram_get_block_by_id(slice, c->byte_array_stop.content_id);
    if (!b)
        return *out_size?-1:0;

    if (b->idx >= b->uncomp_size)
	return -1;

    cp = (char *)b->data + b->idx;
    if (out) {
	while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	    if (cp - (char *)b->data >= b->uncomp_size)
		return -1;
	    *out++ = ch;
	    cp++;
	}
    } else {
	// Consume input, but produce no output
	while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	    if (cp - (char *)b->data >= b->uncomp_size)
		return -1;
	    cp++;
	}
    }

    *out_size = cp - (char *)(b->data + b->idx);
    b->idx = cp - (char *)b->data + 1;

    return 0;
}

// Assembly:
pushq %rbx
movl 0x34(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %r9b
movq 0x18(%rdi), %rdx
testq %rdx, %rdx
setne %r10b
testb %r10b, %r9b
je 0x4d7dc
movq (%rdx,%rax,8), %rdx
jmp 0x4d81c
movq (%rdi), %rdx
movslq 0x20(%rdx), %r9
testq %r9, %r9
jle 0x4d81a
movq 0x10(%rdi), %rdi
xorl %r10d, %r10d
movq (%rdi,%r10,8), %r11
testq %r11, %r11
je 0x4d80c
cmpl $0x4, 0x8(%r11)
jne 0x4d80c
cmpl %eax, 0xc(%r11)
jne 0x4d80c
xorl %ebx, %ebx
movq %r11, %rdx
jmp 0x4d80e
movb $0x1, %bl
testb %bl, %bl
je 0x4d81c
incq %r10
cmpq %r10, %r9
jne 0x4d7ef
xorl %edx, %edx
testq %rdx, %rdx
je 0x4d878
movslq 0x1c(%rdx), %r10
movslq 0x14(%rdx), %r11
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %r11d, %r10d
jge 0x4d8b9
movq 0x20(%rdx), %r9
leaq (%r9,%r10), %rdi
testq %rcx, %rcx
je 0x4d881
movb (%rdi), %r11b
cmpb 0x30(%rsi), %r11b
je 0x4d8a1
addq %r10, %r9
movq %r9, %r10
subq 0x20(%rdx), %r10
movslq 0x14(%rdx), %rbx
cmpq %rbx, %r10
jge 0x4d8b9
movb %r11b, (%rcx)
incq %rcx
movb 0x1(%rdi), %r11b
incq %rdi
incq %r9
cmpb 0x30(%rsi), %r11b
jne 0x4d850
jmp 0x4d8a1
xorl %eax, %eax
cmpl (%r8), %eax
sbbl %eax, %eax
jmp 0x4d8b9
movb 0x30(%rsi), %cl
cmpb %cl, (%rdi)
je 0x4d8a1
cmpq %r11, %r10
jge 0x4d8b9
leaq 0x1(%r10), %rsi
cmpb %cl, 0x1(%r9,%r10)
movq %rsi, %r10
jne 0x4d888
addq %rsi, %r9
movq %r9, %rdi
movl 0x20(%rdx), %eax
movl 0x1c(%rdx), %ecx
addl %eax, %ecx
movl %edi, %esi
subl %ecx, %esi
movl %esi, (%r8)
subl %eax, %edi
incl %edi
movl %edi, 0x1c(%rdx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_encode_init
cram_codec *cram_byte_array_stop_encode_init(cram_stats *st,
					     enum cram_external_type option,
					     void *dat,
					     int version) {
    cram_codec *c;

    c = malloc(sizeof(*c));
    if (!c)
	return NULL;
    c->codec = E_BYTE_ARRAY_STOP;
    c->free = cram_byte_array_stop_encode_free;
    c->encode = cram_byte_array_stop_encode;
    c->store = cram_byte_array_stop_encode_store;

    c->e_byte_array_stop.stop = ((int *)dat)[0];
    c->e_byte_array_stop.content_id = ((int *)dat)[1];

    return c;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl $0x240, %edi            # imm = 0x240
callq 0x4700
testq %rax, %rax
je 0x4dda8
movl $0x5, (%rax)
leaq -0x360(%rip), %rcx      # 0x4da21
movq %rcx, 0x10(%rax)
leaq -0x4d1(%rip), %rcx      # 0x4d8bb
movq %rcx, 0x20(%rax)
leaq -0x36c(%rip), %rcx      # 0x4da2b
movq %rcx, 0x28(%rax)
movb (%rbx), %cl
movb %cl, 0x30(%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x34(%rax)
jmp 0x4ddaa
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/cram_codecs.c
// Function: cram_codec_to_id
int cram_codec_to_id(cram_codec *c, int *id2) {
    int bnum1, bnum2 = -2;

    switch (c->codec) {
    case E_HUFFMAN:
	bnum1 = c->huffman.ncodes == 1 ? -2 : -1;
	break;
    case E_GOLOMB:
    case E_BETA:
    case E_SUBEXP:
    case E_GOLOMB_RICE:
    case E_GAMMA:
	bnum1 = -1;
	break;
    case E_EXTERNAL:
	bnum1 = c->external.content_id;
	break;
    case E_BYTE_ARRAY_LEN:
	bnum1 = cram_codec_to_id(c->byte_array_len.len_codec, NULL);
	bnum2 = cram_codec_to_id(c->byte_array_len.val_codec, NULL);
	break;
    case E_BYTE_ARRAY_STOP:
	bnum1 = c->byte_array_stop.content_id;
	break;
    case E_NULL:
	bnum1 = -2;
	break;
    default:
	fprintf(stderr, "Unknown codec type %d\n", c->codec);
	bnum1 = -1;
    }

    if (id2)
	*id2 = bnum2;
    return bnum1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl (%rdi), %edx
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x9, %rdx
ja 0x4de4b
movq %rdi, %r15
leaq 0x8722(%rip), %rax      # 0x56510
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testq %rbx, %rbx
je 0x4ddff
movl %r14d, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x4ddf7
movl 0x34(%r15), %ebp
jmp 0x4ddf7
xorl %ebp, %ebp
cmpl $0x1, 0x30(%r15)
sete %bpl
notl %ebp
jmp 0x4ddf7
movl 0x30(%r15), %ebp
jmp 0x4ddf7
movq 0x30(%r15), %rdi
xorl %esi, %esi
callq 0x4ddc7
movl %eax, %ebp
movq 0x38(%r15), %rdi
xorl %esi, %esi
callq 0x4ddc7
movl %eax, %r14d
jmp 0x4ddf7
movq 0x16176(%rip), %rax     # 0x63fc8
movq (%rax), %rdi
leaq 0x8a38(%rip), %rsi      # 0x56894
xorl %eax, %eax
callq 0x4770
jmp 0x4ddf7
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/pooled_alloc.c
// Function: pool_create
pool_alloc_t *pool_create(size_t dsize) {
    pool_alloc_t *p;

    if (NULL == (p = (pool_alloc_t *)malloc(sizeof(*p))))
	return NULL;

    /* Minimum size is a pointer, for free list */
    dsize = (dsize + sizeof(void *) - 1) & ~(sizeof(void *)-1);
    if (dsize < sizeof(void *))
	dsize = sizeof(void *);
    p->dsize = dsize;
    p->psize = MIN(PSIZE, next_power_2(p->dsize*1024));

    p->npools = 0;
    p->pools = NULL;
    p->free  = NULL;

    return p;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x28, %edi
callq 0x4700
testq %rax, %rax
je 0x4e13d
addq $0x7, %rbx
movq %rbx, %rcx
andq $-0x8, %rcx
cmpq $0x8, %rbx
movl $0x8, %edx
cmovaeq %rcx, %rdx
movq %rdx, (%rax)
shll $0xa, %edx
decl %edx
movl %edx, %ecx
shrl %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x2, %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x8, %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x10, %ecx
orl %edx, %ecx
incl %ecx
movl $0x100000, %edx         # imm = 0x100000
cmpl %edx, %ecx
cmovgel %edx, %ecx
movslq %ecx, %rcx
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
jmp 0x4e13f
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/pooled_alloc.c
// Function: pool_destroy
void pool_destroy(pool_alloc_t *p) {
    size_t i;

    for (i = 0; i < p->npools; i++) {
        free(p->pools[i].pool);
    }
    free(p->pools);
    free(p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x4e170
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x4610
incq %r15
addq $0x10, %r14
cmpq 0x10(%rbx), %r15
jb 0x4e156
movq 0x18(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4610
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/pooled_alloc.c
// Function: pool_alloc
void *pool_alloc(pool_alloc_t *p) {
    pool_t *pool;
    void *ret;

    /* Look on free list */
    if (NULL != p->free) {
        ret = p->free;
	p->free = *((void **)p->free);
	return ret;
    }

    /* Look for space in the last pool */
    if (p->npools) {
        pool = &p->pools[p->npools - 1];
        if (pool->used + p->dsize < p->psize) {
	    ret = ((char *) pool->pool) + pool->used;
	    pool->used += p->dsize;
	    return ret;
	}
    }

    /* Need a new pool */
    pool = new_pool(p);
    if (NULL == pool) return NULL;

    pool->used = p->dsize;
    return pool->pool;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x4e1a7
movq (%rax), %rcx
movq %rcx, 0x20(%rbx)
jmp 0x4e257
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x4e1d9
movq 0x18(%rbx), %rcx
movq %rsi, %rdi
shlq $0x4, %rdi
movq -0x8(%rcx,%rdi), %rax
movq (%rbx), %rdx
addq %rax, %rdx
cmpq 0x8(%rbx), %rdx
jae 0x4e1d9
addq %rdi, %rcx
addq -0x10(%rcx), %rax
movq %rdx, -0x8(%rcx)
jmp 0x4e257
movq (%rbx), %r13
movq 0x8(%rbx), %r15
movq 0x18(%rbx), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x48d0
testq %rax, %rax
je 0x4e23f
movq %rax, %r14
xorl %r12d, %r12d
movq %r15, %rax
xorl %edx, %edx
divq %r13
movq %r14, 0x18(%rbx)
movq 0x10(%rbx), %r15
movq %r15, %r13
shlq $0x4, %r13
imulq (%rbx), %rax
movq %rax, %rdi
callq 0x4700
movq %rax, (%r14,%r13)
testq %rax, %rax
je 0x4e242
addq %r13, %r14
movq $0x0, 0x8(%r14)
incq %r15
movq %r15, 0x10(%rbx)
movq %r14, %r12
jmp 0x4e242
xorl %r12d, %r12d
testq %r12, %r12
je 0x4e255
movq (%rbx), %rax
movq %rax, 0x8(%r12)
movq (%r12), %rax
jmp 0x4e257
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: socket_connect
static int socket_connect(const char *host, const char *port)
{
#define __err_connect(func) do { perror(func); freeaddrinfo(res); return -1; } while (0)

	int ai_err, on = 1, fd;
	struct linger lng = { 0, 0 };
	struct addrinfo hints, *res = 0;
	memset(&hints, 0, sizeof(struct addrinfo));
	hints.ai_family = AF_UNSPEC;
	hints.ai_socktype = SOCK_STREAM;
	/* In Unix/Mac, getaddrinfo() is the most convenient way to get
	 * server information. */
	if ((ai_err = getaddrinfo(host, port, &hints, &res)) != 0) { fprintf(stderr, "can't resolve %s:%s: %s\n", host, port, gai_strerror(ai_err)); return -1; }
	if ((fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) __err_connect("socket");
	/* The following two setsockopt() are used by ftplib
	 * (http://nbpfaus.net/~pfau/ftplib/). I am not sure if they
	 * necessary. */
	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) __err_connect("setsockopt");
	if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &lng, sizeof(lng)) == -1) __err_connect("setsockopt");
	if (connect(fd, res->ai_addr, res->ai_addrlen) != 0) __err_connect("connect");
	freeaddrinfo(res);
	return fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %eax
movl %eax, 0x14(%rsp)
xorl %edx, %edx
movq %rdx, 0x18(%rsp)
leaq 0x8(%rsp), %rcx
movq %rdx, (%rcx)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl %eax, 0x8(%rdx)
callq 0x46a0
testl %eax, %eax
jne 0x4e3a5
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edi
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
callq 0x4130
cmpl $-0x1, %eax
je 0x4e3d2
movl %eax, %ebx
leaq 0x14(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x4990
cmpl $-0x1, %eax
je 0x4e3de
leaq 0x18(%rsp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0xd, %edx
movl $0x8, %r8d
callq 0x4990
cmpl $-0x1, %eax
je 0x4e3ea
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x4430
testl %eax, %eax
jne 0x4e3f6
movq 0x8(%rsp), %rdi
callq 0x46e0
jmp 0x4e405
movq 0x15c1c(%rip), %rcx     # 0x63fc8
movq (%rcx), %r15
movl %eax, %edi
callq 0x4730
leaq 0x8654(%rip), %rsi      # 0x56a11
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x4770
jmp 0x4e400
leaq 0x8(%rsp), %rdi
callq 0x636e
jmp 0x4e400
leaq 0x8(%rsp), %rdi
callq 0x6354
jmp 0x4e400
leaq 0x8(%rsp), %rdi
callq 0x633a
jmp 0x4e400
leaq 0x8(%rsp), %rdi
callq 0x6320
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: kftp_send_cmd
static int kftp_send_cmd(knetFile *ftp, const char *cmd, int is_get)
{
	if (socket_wait(ftp->ctrl_fd, 0) <= 0) return -1; // socket is not ready for writing
    int len = strlen(cmd);
	if ( netwrite(ftp->ctrl_fd, cmd, len) != len ) return -1;
	return is_get? kftp_get_response(ftp) : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x20(%rdi), %edi
xorl %esi, %esi
callq 0x4efc6
testl %eax, %eax
jle 0x4e57e
movq %r14, %rdi
callq 0x4230
movl 0x20(%rbx), %edi
movslq %eax, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x41f0
cmpq %r15, %rax
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
je 0x4e589
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4e411
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: kftp_parse_url
knetFile *kftp_parse_url(const char *fn, const char *mode)
{
	knetFile *fp;
	char *p;
	int l;
	if (strstr(fn, "ftp://") != fn) return 0;
	for (p = (char*)fn + 6; *p && *p != '/'; ++p);
	if (*p != '/') return 0;
	l = p - fn - 6;
	fp = (knetFile*)calloc(1, sizeof(knetFile));
	fp->type = KNF_TYPE_FTP;
	fp->fd = -1;
	/* the Linux/Mac version of socket_connect() also recognizes a port
	 * like "ftp", but the Windows version does not. */
	fp->port = strdup("21");
	fp->host = (char*)calloc(l + 1, 1);
	if (strchr(mode, 'c')) fp->no_reconnect = 1;
	strncpy(fp->host, fn + 6, l);
	fp->retr = (char*)calloc(strlen(p) + 8, 1);
	sprintf(fp->retr, "RETR %s\r\n", p);
    fp->size_cmd = (char*)calloc(strlen(p) + 8, 1);
    sprintf(fp->size_cmd, "SIZE %s\r\n", p);
	fp->seek_offset = 0;
	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %r15
leaq 0x8318(%rip), %rsi      # 0x568fb
movl $0x6, %edx
callq 0x4280
testl %eax, %eax
je 0x4e606
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x100000000, %rbp      # imm = 0x100000000
addq $0x6, %r15
xorl %r13d, %r13d
movq %r15, %rbx
movzbl (%rbx), %eax
testl %eax, %eax
je 0x4e5f1
cmpl $0x2f, %eax
je 0x4e62e
incq %rbx
addq %rbp, %r13
jmp 0x4e61a
movl $0x1, %edi
movl $0x80, %esi
callq 0x4360
movq %rax, %r14
movabsq $-0xfffffffe, %rax      # imm = 0xFFFFFFFF00000002
movq %rax, (%r14)
leaq 0x82ae(%rip), %rdi      # 0x56902
callq 0x49c0
movq %rax, 0x18(%r14)
addq %r13, %rbp
sarq $0x20, %rbp
movl $0x1, %esi
movq %rbp, %rdi
callq 0x4360
movq %rax, %rbp
movq %rax, 0x10(%r14)
movq %r12, %rdi
movl $0x63, %esi
callq 0x4200
testq %rax, %rax
je 0x4e692
movl $0x1, 0x3c(%r14)
sarq $0x20, %r13
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x42b0
movq %rbx, %rdi
callq 0x4230
leaq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x4360
movq %rax, 0x50(%r14)
leaq 0x8240(%rip), %rsi      # 0x56905
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4110
movq %rbx, %rdi
callq 0x4230
leaq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x4360
movq %rax, 0x58(%r14)
leaq 0x821c(%rip), %rsi      # 0x5690f
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4110
movq $0x0, 0x60(%r14)
jmp 0x4e5f4
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: my_netread
static off_t my_netread(int fd, void *buf, off_t len)
{
	off_t rest = len, curr, l = 0;
	/* recv() and read() may not read the required length of data with
	 * one call. They have to be called repeatedly. */
	while (rest) {
		if (socket_wait(fd, 1) <= 0) break; // socket is not ready for reading
		curr = netread(fd, (void*)((char*)buf + l), rest);
		/* According to the glibc manual, section 13.2, a zero returned
		 * value indicates end-of-file (EOF), which should mean that
		 * read() will not return zero if EOF has not been met but data
		 * are not immediately available. */
		if (curr == 0) break;
		l += curr; rest -= curr;
	}
	return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x4ecf2
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
xorl %ebx, %ebx
movl %ebp, %edi
movl $0x1, %esi
callq 0x4efc6
testl %eax, %eax
jle 0x4ecf4
leaq (%r15,%rbx), %rsi
movl %ebp, %edi
movq %r14, %rdx
callq 0x4780
testq %rax, %rax
je 0x4ecf4
addq %rax, %rbx
subq %rax, %r14
jne 0x4ecc5
jmp 0x4ecf4
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: knet_read
ssize_t knet_read(knetFile *fp, void *buf, size_t len)
{
	off_t l = 0;
	if (fp->fd == -1) return 0;
	if (fp->type == KNF_TYPE_FTP) {
		if (fp->is_ready == 0) {
			if (!fp->no_reconnect) kftp_reconnect(fp);
			kftp_connect_file(fp);
		}
	} else if (fp->type == KNF_TYPE_HTTP) {
		if (fp->is_ready == 0)
			khttp_connect_file(fp);
	}
	if (fp->type == KNF_TYPE_LOCAL) { // on Windows, the following block is necessary; not on UNIX
		size_t rest = len;
		ssize_t curr;
		while (rest) {
			do {
				curr = read(fp->fd, (void*)((char*)buf + l), rest);
			} while (curr < 0 && EINTR == errno);
			if (curr < 0) return -1;
			if (curr == 0) break;
			l += curr; rest -= curr;
		}
	} else l = my_netread(fp->fd, buf, len);
	fp->offset += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $-0x1, 0x4(%rdi)
je 0x4eeb9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x3, %eax
je 0x4eebe
cmpl $0x2, %eax
jne 0x4eecc
cmpl $0x0, 0x40(%rbx)
jne 0x4eecc
cmpl $0x0, 0x3c(%rbx)
jne 0x4eeaf
movq %rbx, %rdi
callq 0x4e59b
movq %rbx, %rdi
callq 0x4e70d
jmp 0x4eecc
xorl %r12d, %r12d
jmp 0x4ef26
cmpl $0x0, 0x40(%rbx)
jne 0x4eecc
movq %rbx, %rdi
callq 0x4ea5f
cmpl $0x1, (%rbx)
jne 0x4ef08
xorl %r12d, %r12d
testq %r14, %r14
je 0x4ef19
leaq (%r15,%r12), %r13
movl 0x4(%rbx), %edi
movq %r13, %rsi
movq %r14, %rdx
callq 0x4780
testq %rax, %rax
jns 0x4eefc
callq 0x4070
cmpl $0x4, (%rax)
je 0x4eedd
jmp 0x4ef1f
je 0x4ef19
addq %rax, %r12
subq %rax, %r14
jne 0x4eed9
jmp 0x4ef19
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4ecaf
movq %rax, %r12
addq %r12, 0x8(%rbx)
jmp 0x4ef26
movq $-0x1, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: knet_seek
off_t knet_seek(knetFile *fp, off_t off, int whence)
{
	if (whence == SEEK_SET && off == fp->offset) return 0;
	if (fp->type == KNF_TYPE_LOCAL) {
		/* Be aware that lseek() returns the offset after seeking, while fseek() returns zero on success. */
		off_t offset = lseek(fp->fd, off, whence);
		if (offset == -1) return -1;
		fp->offset = offset;
		return fp->offset;
	} else if (fp->type == KNF_TYPE_FTP) {
		if (whence == SEEK_CUR) fp->offset += off;
		else if (whence == SEEK_SET) fp->offset = off;
		else if (whence == SEEK_END) fp->offset = fp->file_size + off;
		else return -1;
		fp->is_ready = 0;
		return fp->offset;
	} else if (fp->type == KNF_TYPE_HTTP) {
		if (whence == SEEK_END) { // FIXME: can we allow SEEK_END in future?
			fprintf(stderr, "[knet_seek] SEEK_END is not supported for HTTP. Offset is unchanged.\n");
			errno = ESPIPE;
			return -1;
		}
		if (whence == SEEK_CUR) fp->offset += off;
		else if (whence == SEEK_SET) fp->offset = off;
		else return -1;
		fp->is_ready = 0;
		return fp->offset;
	}
	errno = EINVAL;
	fprintf(stderr,"[knet_seek] %s\n", strerror(errno));
	return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %edx, %edx
jne 0x4ef45
cmpq %rsi, 0x8(%rbx)
jne 0x4ef45
xorl %eax, %eax
jmp 0x4efc4
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x4ef6a
cmpl $0x2, %eax
je 0x4ef81
cmpl $0x1, %eax
jne 0x4efb1
movl 0x4(%rbx), %edi
callq 0x49e0
cmpq $-0x1, %rax
je 0x4efbd
movq %rax, 0x8(%rbx)
jmp 0x4efc4
cmpl $0x1, %edx
je 0x4ef86
cmpl $0x2, %edx
je 0x4efb8
movq $-0x1, %rax
testl %edx, %edx
jne 0x4efc4
jmp 0x4efa0
cmpl $0x1, %edx
jne 0x4ef8c
addq %rsi, 0x8(%rbx)
jmp 0x4efa4
testl %edx, %edx
je 0x4efa0
movq $-0x1, %rax
cmpl $0x2, %edx
jne 0x4efc4
addq 0x68(%rbx), %rsi
movq %rsi, 0x8(%rbx)
movl $0x0, 0x40(%rbx)
movq 0x8(%rbx), %rax
jmp 0x4efc4
callq 0x6421
jmp 0x4efbd
callq 0x63f4
movq $-0x1, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/grdview/grdview.cpp
// Function: GLUTMotion(int, int)
void GLUTMotion(int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;

  // Compute mouse movement
  int dx = x - GLUTmouse[0];
  int dy = y - GLUTmouse[1];
  
  // World in hand navigation 
  R3Point origin = grid->GridBox().Centroid();
  if (GLUTbutton[0]) viewer->RotateWorld(1.0, origin, x, y, dx, dy);
  else if (GLUTbutton[1]) viewer->ScaleWorld(1.0, origin, x, y, dx, dy);
  else if (GLUTbutton[2]) viewer->TranslateWorld(1.0, origin, x, y, dx, dy);
  if (GLUTbutton[0] || GLUTbutton[1] || GLUTbutton[2]) glutPostRedisplay();

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %edi, %ebp
movl 0xff6d0(%rip), %ebx     # 0x122880
subl %esi, %ebx
movl %edi, %r14d
subl 0x10467c(%rip), %r14d   # 0x127838
movl %ebx, %r15d
subl 0x104676(%rip), %r15d   # 0x12783c
movq 0x1045d3(%rip), %rax    # 0x1277a0
movl 0x238(%rax), %ecx
decl %ecx
cvtsi2sd %ecx, %xmm3
movl 0x23c(%rax), %ecx
decl %ecx
cvtsi2sd %ecx, %xmm4
movl 0x240(%rax), %eax
decl %eax
cvtsi2sd %eax, %xmm5
leaq 0x18(%rsp), %r12
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r12, %rdi
callq 0x2c158
movq %rsp, %rdi
movq %r12, %rsi
callq 0x2c8fa
leaq 0x18(%rsp), %rdi
callq 0x2cf10
movl $0x58, %eax
cmpl $0x0, 0x104618(%rip)    # 0x127840
jne 0x23246
movl $0x50, %eax
cmpl $0x0, 0x10460e(%rip)    # 0x127844
jne 0x23246
movl $0x48, %eax
cmpl $0x0, 0x104604(%rip)    # 0x127848
je 0x23269
movq 0x104543(%rip), %rdi    # 0x127790
movq (%rdi), %r10
movsd 0xa1de8(%rip), %xmm0    # 0xc5040
movq %rsp, %rsi
movl %ebp, %edx
movl %ebx, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
callq *(%r10,%rax)
cmpl $0x0, 0x1045d0(%rip)    # 0x127840
jne 0x23284
cmpl $0x0, 0x1045cb(%rip)    # 0x127844
jne 0x23284
cmpl $0x0, 0x1045c6(%rip)    # 0x127848
je 0x23289
callq 0x889cc
movl %ebp, 0x1045a9(%rip)    # 0x127838
movl %ebx, 0x1045a7(%rip)    # 0x12783c
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2cf10
movq %rbx, %rdi
callq 0x1fe30
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/grdview/grdview.cpp
// Function: GLUTMouse(int, int, int, int)
void GLUTMouse(int button, int state, int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;
  
  // Process mouse button event

  // Remember button state 
  int b = (button == GLUT_LEFT_BUTTON) ? 0 : ((button == GLUT_MIDDLE_BUTTON) ? 1 : 2);
  GLUTbutton[b] = (state == GLUT_DOWN) ? 1 : 0;

  // Remember modifiers 
  GLUTmodifiers = glutGetModifiers();

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;

  // Redraw
  glutPostRedisplay();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
movl 0xff5be(%rip), %ebp     # 0x122880
xorl %eax, %eax
cmpl $0x1, %edi
setne %al
incl %eax
subl %ecx, %ebp
xorl %ecx, %ecx
testl %esi, %esi
sete %cl
testl %edi, %edi
cmovel %edi, %eax
leaq 0x10455f(%rip), %rdx    # 0x127840
movl %ecx, (%rdx,%rax,4)
callq 0x8d914
movl %ebx, 0x104549(%rip)    # 0x127838
movl %ebp, 0x104547(%rip)    # 0x12783c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x889cc
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/grdview/grdview.cpp
// Function: GLUTMainLoop()
void GLUTMainLoop(void)
{
  // Set default values
  if (grid_threshold == -98765) {
    RNScalar max_threshold = grid->Maximum() - 1.0E-20;
    grid_threshold = grid->Mean() + 3 * grid->StandardDeviation();
    if (grid_threshold > max_threshold) grid_threshold = max_threshold;
  }

  // Set slice coords to middle of grid
  grid_slice_coords[RN_X] = grid->XResolution()/2;
  grid_slice_coords[RN_Y] = grid->YResolution()/2;
  grid_slice_coords[RN_Z] = grid->ZResolution()/2;

  // Run main loop -- never returns 
  glutMainLoop();
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movss 0xfef64(%rip), %xmm0    # 0x122870
ucomiss 0xa1701(%rip), %xmm0    # 0xc5014
jne 0x239d0
jp 0x239d0
movq 0x103e7a(%rip), %rsi    # 0x1277a0
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x33e90
movsd 0x8(%rbx), %xmm1
movq 0x103e61(%rip), %rbx    # 0x1277a0
cmpl $0x0, 0x24c(%rbx)
xorps %xmm0, %xmm0
je 0x23969
movq %rbx, %rdi
movsd %xmm1, (%rsp)
callq 0x33ef6
movsd (%rsp), %xmm1
cvtsi2sdl 0x24c(%rbx), %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
addsd 0xa16f9(%rip), %xmm1    # 0xc5070
movsd %xmm1, (%rsp)
movq 0x103e1d(%rip), %rdi    # 0x1277a0
callq 0x33d6e
ucomisd 0xa16d0(%rip), %xmm0    # 0xc5060
jb 0x23998
sqrtsd %xmm0, %xmm0
jmp 0x2399d
callq 0x1f590
mulsd 0xa16d3(%rip), %xmm0    # 0xc5078
addsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd (%rsp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0x239c8
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
movss %xmm0, 0xfeea0(%rip)    # 0x122870
movq 0x103dc9(%rip), %rax    # 0x1277a0
movl 0x238(%rax), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movl %edx, 0x103dcc(%rip)    # 0x1277b8
movl 0x23c(%rax), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movl %edx, 0x103dbb(%rip)    # 0x1277bc
movl 0x240(%rax), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x103daa(%rip)    # 0x1277c0
callq 0x8bc8b
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPClient::initalizeSocket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
static int initalizeSocket(std::string address, int port)
    {
        int sockfd;

        struct addrinfo hints;
        struct addrinfo* servinfo;
        struct addrinfo* p;

        memset(&hints, 0, sizeof(hints));
        hints.ai_family = AF_UNSPEC;
        hints.ai_socktype = SOCK_STREAM;

        getaddrinfo(address.c_str(), std::to_string(port).c_str(), &hints, &servinfo);

        for(p = servinfo; p != NULL; p = p->ai_next)
        {
            if((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
            {
                continue;
            }
            if(connect(sockfd, p->ai_addr, p->ai_addrlen) == -1)
            {
                close(sockfd);
                continue;
            }
            break;
        }

        if(p == NULL)
        {
            return -1;
        }

        freeaddrinfo(servinfo);

        return sockfd;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %r14d
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x70(%rbp)
movl $0x1, -0x88(%rbp)
movq (%rdi), %rax
movq %rax, -0x38(%rbp)
movl %esi, %r15d
negl %r15d
cmovsl %esi, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x3143
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x313a
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3140
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3143
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3107
addl $-0x3, %r12d
jmp 0x3143
addl $-0x2, %r12d
jmp 0x3143
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0x48(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movl $0x2d, %edx
callq 0x2230
addq (%r13), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x4347
movq (%r13), %rsi
leaq -0x90(%rbp), %rdx
leaq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdi
callq 0x2240
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x31a3
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x30(%rbp), %r15
testq %r15, %r15
sete %r14b
je 0x31f2
movl 0x4(%r15), %edi
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
callq 0x2080
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x31e3
movq 0x18(%r15), %rsi
movl 0x10(%r15), %edx
movl %ebx, %edi
callq 0x2190
cmpl $-0x1, %eax
jne 0x31f2
movl %ebx, %edi
callq 0x2330
movq 0x28(%r15), %r15
testq %r15, %r15
sete %r14b
jne 0x31b0
jmp 0x31f2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, %r14b
jne 0x3208
movq -0x30(%rbp), %rdi
callq 0x2250
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x322f
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21f0
movq %r14, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPHeader::HTTPHeader(bool)
HTTPHeader(bool isRequest_ = false)
    {
        bufferIndex = 0;
        parsingFieldName = true;
        isRequest = isRequest_;
        parsingHeader = true;
        isDone = false;
        currentChunkLength = 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8(%rdi), %rcx
xorl %eax, %eax
movl %eax, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %rcx, 0x20(%rdi)
movq %rax, 0x28(%rdi)
leaq 0x48(%rdi), %rcx
movq %rcx, 0x38(%rdi)
movq %rax, 0x40(%rdi)
movb %al, 0x48(%rdi)
leaq 0x68(%rdi), %rcx
movq %rcx, 0x58(%rdi)
movq %rax, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x78(%rdi)
movq %rax, 0x80(%rdi)
movb %al, 0x88(%rdi)
leaq 0xa8(%rdi), %rcx
movq %rcx, 0x98(%rdi)
movq %rax, 0xa0(%rdi)
movb %al, 0xa8(%rdi)
leaq 0xc8(%rdi), %rcx
movq %rcx, 0xb8(%rdi)
movq %rax, 0xc0(%rdi)
movb %al, 0xc8(%rdi)
leaq 0xf0(%rdi), %rcx
movq %rcx, 0xe0(%rdi)
movq %rax, 0xe8(%rdi)
movb %al, 0xf0(%rdi)
leaq 0x110(%rdi), %rcx
movq %rcx, 0x100(%rdi)
movq %rax, 0x108(%rdi)
movb %al, 0x110(%rdi)
leaq 0x138(%rdi), %rcx
movq %rcx, 0x128(%rdi)
movq %rax, 0x130(%rdi)
movb %al, 0x138(%rdi)
movl %eax, 0xd8(%rdi)
movb $0x1, 0x120(%rdi)
movb %sil, 0x30(%rdi)
movw $0x1, 0x121(%rdi)
movl %eax, 0x124(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPHeader::parseData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void parseData(const std::string& input)
    {
        if(headers.find("transfer-encoding") != headers.end() && headers.find("transfer-encoding")->second == "chunked")
        {
            parseChunk(input);
        }
        else
        {
            body += input;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa36(%rip), %rsi       # 0x508a
leaq 0xa40(%rip), %rdx       # 0x509b
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x4abc
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b56
movq %rax, %r15
leaq 0x8(%r14), %r13
cmpq %r13, %rax
je 0x46c5
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x9fc(%rip), %rsi       # 0x508a
leaq 0xa06(%rip), %rdx       # 0x509b
leaq -0x68(%rbp), %rdi
callq 0x4abc
leaq -0x68(%rbp), %rsi
movq %r14, %rdi
callq 0x4b56
addq $0x40, %rax
leaq 0x9e7(%rip), %rsi       # 0x509c
movq %rax, %rdi
callq 0x20a0
testl %eax, %eax
sete %r12b
jmp 0x46c8
xorl %r12d, %r12d
cmpq %r13, %r15
je 0x46e6
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x46e6
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x46ff
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21f0
testb %r12b, %r12b
je 0x4711
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4776
jmp 0x4727
addq $0x98, %r14
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x20b0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x4755
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21f0
jmp 0x4755
jmp 0x4752
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x476e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/include/tinyopt/tinyopt.h
// Function: to::sink to::action<void (*)(char const*), to::keyword_parser<char const*>>(void (*)(char const*), to::keyword_parser<char const*>)
sink action(F f, P parser) {
    return sink(sink::action,
        [f = std::move(f), parser = std::move(parser)](const char* arg) -> bool {
            return static_cast<bool>(f << parser(arg));
        });
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsp), %rbx
movq %rsi, -0x8(%rbx)
movq (%rdx), %r12
movq %r12, (%rbx)
movq 0x8(%rdx), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rdx), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movl $0x20, %edi
callq 0x2160
movq %r15, (%rax)
movq %r12, 0x8(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rcx
movq %rcx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rax, (%r14)
leaq 0xf3f(%rip), %rax       # 0x3d86
movq %rax, 0x18(%r14)
leaq 0xf3c(%rip), %rax       # 0x3d8e
movq %rax, 0x10(%r14)
movq %rbx, %rdi
callq 0x3600
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3600
movq %r14, %rdi
callq 0x2280