LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/hoomanist[P]carrot/yes.c
// Function: main
int 
main(int argc, char **argv)
{
	char msg[CHAR_MAX] ;
	if (argc == 1)
		strcpy(msg, "yes");
	else if (argc > 2)
		return 0;
	else if (argc == 2)
		strcpy(msg, argv[1]);
	for(;;){
		printf("%s\n", msg);
	}

}

// Assembly:
pushq %rbx
subq $0x80, %rsp
cmpl $0x1, %edi
jne 0x116d
movl $0x736579, (%rsp)       # imm = 0x736579
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x1040
jmp 0x1163
cmpl $0x3, %edi
jl 0x117d
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
retq
cmpl $0x2, %edi
jne 0x1160
movq 0x8(%rsi), %rsi
movq %rsp, %rdi
callq 0x1030
jmp 0x1160
// File: /workspace/github_c_makefile_star2_O2/openshmem-org[P]openshmem-examples/c/bcast1.c
// Function: main
int
main(void)
{
    int i;
    long *target;
    long *source;
    int me, npes;

    shmem_init();
    me = shmem_my_pe();
    npes = shmem_n_pes();

    source = (long *) shmem_malloc(npes * sizeof(*source));
    for (i = 0; i < npes; i += 1) {
        source[i] = i + 1;
    }

    target = (long *) shmem_malloc(npes * sizeof(*target));
    for (i = 0; i < npes; i += 1) {
        target[i] = -999;
    }

    for (i = 0; i < SHMEM_BCAST_SYNC_SIZE; i += 1) {
        pSync[i] = SHMEM_SYNC_VALUE;
    }
    shmem_barrier_all();

    shmem_broadcast64(target, source, npes, 0, 0, 0, npes, pSync);

    for (i = 0; i < npes; i++) {
        printf("%-8d %ld\n", me, target[i]);
    }

    shmem_barrier_all();

    shmem_free(target);
    shmem_free(source);
    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x1090
callq 0x1060
movl %eax, %ebx
callq 0x1040
movslq %eax, %r15
leaq (,%r15,8), %r12
movq %r12, %rdi
callq 0x1070
xorl %r13d, %r13d
testl %r15d, %r15d
cmovgl %r15d, %r13d
movq %rax, %r14
movq %r13, %rax
negq %rax
pushq $0x1
popq %rcx
leaq (%rax,%rcx), %rdx
cmpq $0x1, %rdx
je 0x1215
movq %rcx, -0x8(%r14,%rcx,8)
incq %rcx
jmp 0x1201
movq %r12, %rdi
callq 0x1070
movq %rax, %r12
xorl %eax, %eax
cmpq %rax, %r13
je 0x1234
movq $-0x3e7, (%r12,%rax,8)  # imm = 0xFC19
incq %rax
jmp 0x1222
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x2e40(%rip)     # 0x4080
leaq 0x2e39(%rip), %rbp      # 0x4080
callq 0x1080
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbp
pushq %r15
callq 0x10b0
addq $0x10, %rsp
leaq 0xd94(%rip), %r15       # 0x2004
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x128c
movq (%r12,%rbp,8), %rdx
movq %r15, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
incq %rbp
jmp 0x1272
callq 0x1080
movq %r12, %rdi
callq 0x10a0
movq %r14, %rdi
callq 0x10a0
callq 0x1050
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/fieldarith.c
// Function: check
void check(const bam1_t *aln, const char *testname, const char *tag, int value)
{
    int32_t refvalue;
    uint8_t *aux = bam_aux_get(aln, tag);
    if (!aux) return;
    ntests++;
    refvalue = bam_aux2i(aux);
    if (value != refvalue) {
        fprintf(stderr, "%s FAIL for %s: computed %d != %d expected\n",
                testname, bam_get_qname(aln), value, refvalue);
        nfailures++;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rsi
callq 0x198a8
testq %rax, %rax
je 0x5ac8
incl 0x91a48(%rip)           # 0x97504
movq %rax, %rdi
callq 0x1b4b5
cmpl %ebx, %eax
jne 0x5ace
popq %rbx
popq %r14
popq %r15
retq
movq 0x9150b(%rip), %rcx     # 0x96fe0
movq (%rcx), %rdi
movq 0x38(%r15), %rcx
leaq 0x6b521(%rip), %rsi     # 0x71004
movq %r14, %rdx
movl %ebx, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x46f0
incl 0x91a0f(%rip)           # 0x97508
jmp 0x5ac8
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/fieldarith.c
// Function: main
int main(int argc, char **argv)
{
    sam_hdr_t *header;
    bam1_t *aln = bam_init1();
    int i;

    for (i = 1; i < argc; i++) {
        samFile *in = sam_open(argv[i], "r");
        if (in == NULL) { perror(argv[1]); return 1; }

        header = sam_hdr_read(in);
        while (sam_read1(in, header, aln) >= 0) {
            check(aln, "cigar2qlen", "XQ",
                  bam_cigar2qlen(aln->core.n_cigar, bam_get_cigar(aln)));
            check(aln, "cigar2rlen", "XR",
                  bam_cigar2rlen(aln->core.n_cigar, bam_get_cigar(aln)));
            check(aln, "endpos", "XE", bam_endpos(aln));
        }

        sam_hdr_destroy(header);
        sam_close(in);
    }

    bam_destroy1(aln);

    return (nfailures > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, (%rsp)
movl %edi, %ebx
callq 0x13244
movq %rax, %r14
movslq %ebx, %rax
movq %rax, 0x8(%rsp)
pushq $0x1
popq %rbp
leaq 0x6b520(%rip), %r15     # 0x71049
leaq 0x6b51c(%rip), %rbx     # 0x7104c
leaq 0x6b51c(%rip), %r12     # 0x71053
cmpq 0x8(%rsp), %rbp
jge 0x5c0b
movq (%rsp), %rax
movq (%rax,%rbp,8), %rdi
leaq 0x6e337(%rip), %rsi     # 0x73e88
callq 0x7e87
testq %rax, %rax
je 0x5c2e
movq %rax, %r13
movq %rbp, 0x10(%rsp)
movq %rax, %rdi
callq 0x159ce
movq %rax, %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x18762
testl %eax, %eax
js 0x5bee
movl 0x14(%r14), %edi
movzwl 0x12(%r14), %esi
addq 0x38(%r14), %rsi
callq 0x13829
movq %r14, %rdi
leaq 0x6b490(%rip), %rsi     # 0x71030
leaq 0x6b494(%rip), %rdx     # 0x7103b
movl %eax, %ecx
callq 0x5a9c
movl 0x14(%r14), %edi
movzwl 0x12(%r14), %esi
addq 0x38(%r14), %rsi
callq 0x13861
movq %r14, %rdi
leaq 0x6b474(%rip), %rsi     # 0x7103e
movq %r15, %rdx
movl %eax, %ecx
callq 0x5a9c
movq %r14, %rdi
callq 0x13898
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl %eax, %ecx
callq 0x5a9c
jmp 0x5b72
movq %rbp, %rdi
callq 0x1299e
movq %r13, %rdi
callq 0x905d
movq 0x10(%rsp), %rbp
incq %rbp
jmp 0x5b37
movq %r14, %rdi
callq 0x13312
xorl %eax, %eax
cmpl $0x0, 0x918ec(%rip)     # 0x97508
setg %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x43c0
pushq $0x1
popq %rax
jmp 0x5c1f
// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/tcp-client.c
// Function: send_chunks
void
send_chunks(int sock_fd)
{
	char buf[MAXLINE];
	char chunk[MAXLINE] = { 0 };

	memset(chunk, 65, MAXLINE);

	while (run) {
		_STRESS_MUST(stress_write_n(sock_fd, chunk, MAXLINE) >= 0,
		             "couldn't write contents to socket");
		_STRESS_MUST(stress_read_n(sock_fd, buf, MAXLINE) >= 0,
		             "unexpected error while reading");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
movl %edi, %ebx
movq %rsp, %r14
pushq $0x41
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
callq 0x10b0
leaq 0x1000(%rsp), %r15
cmpl $0x0, 0x29fa(%rip)      # 0x40d8
je 0x1797
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
movq %r14, %rsi
callq 0x160c
testq %rax, %rax
js 0x17a4
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
movq %r15, %rsi
callq 0x165d
testq %rax, %rax
jns 0x16d7
movq 0x28e1(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x8ff(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rcx
leaq 0x8ed(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rcx
leaq 0x9ed(%rip), %rdi       # 0x213b
pushq $0x1e
popq %rsi
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rcx
leaq 0x8ea(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rdi
leaq 0x8d8(%rip), %rsi       # 0x2050
leaq 0x9ab(%rip), %rdx       # 0x212a
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x8dc(%rip), %rsi       # 0x206c
pushq $0x20
jmp 0x1826
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r14
popq %r15
retq
movq 0x284d(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x86b(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rcx
leaq 0x859(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rcx
leaq 0x926(%rip), %rdi       # 0x2108
pushq $0x21
popq %rsi
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rcx
leaq 0x856(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1150
movq (%r14), %rdi
leaq 0x844(%rip), %rsi       # 0x2050
leaq 0x917(%rip), %rdx       # 0x212a
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x848(%rip), %rsi       # 0x206c
pushq $0x1e
popq %rdx
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x10c0
movq (%r14), %rcx
leaq 0x836(%rip), %rdi       # 0x2079
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x1150
pushq $0x1
popq %rdi
callq 0x1130
// File: /workspace/github_c_makefile_star2_O2/ryuichiueda[P]glueutils/src/ignerr.c
// Function: usage
void usage(void){
	fputs("ignerr: ignore exit status\n", stderr);
	fputs("usage: ignerr <command> [args]\n", stderr);
	fputs("\nCopyright (C) 2021 Ryuichi Ueda\n", stderr);
	fputs("Released under the MIT License.\n", stderr);
	fputs("https://github.com/ryuichiueda/glueutils\n", stderr);
}

// Assembly:
pushq %rbx
movq 0x2e74(%rip), %rbx      # 0x3ff8
movq (%rbx), %rsi
leaq 0xe76(%rip), %rdi       # 0x2004
callq 0x1030
movq (%rbx), %rsi
leaq 0xe83(%rip), %rdi       # 0x2020
callq 0x1030
movq (%rbx), %rsi
leaq 0xe94(%rip), %rdi       # 0x2040
callq 0x1030
movq (%rbx), %rsi
leaq 0xea7(%rip), %rdi       # 0x2062
callq 0x1030
movq (%rbx), %rsi
leaq 0xeb9(%rip), %rdi       # 0x2083
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/ryuichiueda[P]glueutils/src/ignerr.c
// Function: main
int main(int argc, char * argv[])
{
	if(argc < 2){
		usage();
		exit(1);
	}

	int pid = fork();
	if(pid == 0)//child 
		return -execvp(argv[1], &argv[1]);

	waitpid(pid, NULL, 0);
	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x1, %edi
jle 0x1209
movq %rsi, %rbx
callq 0x1070
testl %eax, %eax
je 0x11f1
xorl %ebx, %ebx
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1040
jmp 0x1205
movq 0x8(%rbx), %rdi
addq $0x8, %rbx
movq %rbx, %rsi
callq 0x1050
movl %eax, %ebx
negl %ebx
movl %ebx, %eax
popq %rbx
retq
callq 0x117c
pushq $0x1
popq %rdi
callq 0x1060
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/dns.c
// Function: fill_binary_ip
void fill_binary_ip( unsigned char bin[], char* ip )
{
    char tmp[20];
    char *p, *p1;
    
    strcpy( tmp, ip );
    p1 = tmp;
    
    p = strchr( p1, '.' );
    p[0] = 0;
    bin[0] = atoi( p1 );
    p1 = p+1;
    
    p = strchr( p1, '.' );
    p[0] = 0;
    bin[1] = atoi( p1 );
    p1 = p+1;

    p = strchr( p1, '.' );
    p[0] = 0;
    bin[2] = atoi( p1 );
    p1 = p+1;
    
    bin[3] = atoi( p1 );
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x2060
pushq $0x2e
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x2110
movq %rax, %r15
xorl %r12d, %r12d
movb %r12b, (%rax)
movq %r14, %rdi
callq 0x2290
movb %al, (%rbx)
incq %r15
movq %r15, %rdi
movl %ebp, %esi
callq 0x2110
movq %rax, %r14
movb %r12b, (%rax)
movq %r15, %rdi
callq 0x2290
movb %al, 0x1(%rbx)
incq %r14
movq %r14, %rdi
movl %ebp, %esi
callq 0x2110
movq %rax, %r15
movb %r12b, (%rax)
movq %r14, %rdi
callq 0x2290
movb %al, 0x2(%rbx)
incq %r15
movq %r15, %rdi
callq 0x2290
movb %al, 0x3(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/dns.c
// Function: dns_write_domain
int dns_write_domain( char* data, int size, char* domain, int* write_len )
{
    char* pdata;
    char* pdomain, *p;
    unsigned char *blen;
    int seclen;
    int left;
    
    left = size;
    if( strlen( domain ) > MAX_DOMAIN )
    {
        write_log( "[WRN] write domain failed, domain name too large." );
        return -1;
    }
    
    pdata = data;
    pdomain = domain;
    
    while( 1 )
    {
        if( pdomain[0] == 0 )
            break;
        
        p = strchr( pdomain, '.' );
        if( p )
        {
            seclen = p - pdomain;
            if( left <= seclen + 1 )
            {
                write_log( "[WRN] write domain failed, space not enough." );
                return 1;
            }
            
            blen = (unsigned char*)pdata;
            *blen = seclen;
            memcpy( pdata+1, pdomain, seclen );
            left -= ( seclen + 1 );
            pdata += ( seclen + 1 );
            pdomain = p+1;
        }
        else
        {
            seclen = strlen( pdomain );
            if( left < seclen + 2 )
            {
                write_log( "[WRN] write domain failed, space not enough." );
                return 1;
            }
            
            blen = (unsigned char*)pdata;
            *blen = seclen;
            memcpy( pdata+1, pdomain, seclen );
            blen = (unsigned char*)pdata + 1 + seclen;
            *blen = 0;
            left -= ( seclen + 2 );
            pdata += ( seclen + 2 );
            break;
        }
    }
    
    *write_len = size - left;
    
    return 0;
    
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0x2100
cmpq $0xff, %rax
jbe 0x2fdd
leaq 0x6388(%rip), %rdi      # 0x935a
xorl %eax, %eax
callq 0x3281
pushq $-0x1
jmp 0x304c
movq %rbx, 0x10(%rsp)
pushq $0x2e
popq %r12
movl %ebp, 0xc(%rsp)
cmpb $0x0, (%r15)
je 0x306a
movq %r15, %rdi
movl %r12d, %esi
callq 0x2110
testq %rax, %rax
je 0x302d
movq %rax, %r13
subq %r15, %rax
leal 0x1(%rax), %ebx
subl %ebx, %ebp
jle 0x303c
movb %al, (%r14)
leaq 0x1(%r14), %rdi
movslq %eax, %rdx
movq %r15, %rsi
callq 0x21e0
movslq %ebx, %rax
addq %rax, %r14
incq %r13
movq %r13, %r15
jmp 0x2fea
movq %r15, %rdi
callq 0x2100
leal 0x2(%rax), %ecx
subl %ecx, %ebp
jge 0x304f
leaq 0x6349(%rip), %rdi      # 0x938c
xorl %eax, %eax
callq 0x3281
pushq $0x1
popq %rax
jmp 0x3079
movb %al, (%r14)
leaq 0x1(%r14), %rdi
movslq %eax, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x21e0
movb $0x0, 0x1(%r14,%r12)
movl 0xc(%rsp), %ecx
subl %ebp, %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/dns.c
// Function: check_domain_char
int check_domain_char( char* domain, int len )
{
    int i;
    
    for( i = 0; i < len; i++ )
    {
        if( isalnum( domain[i] ) )
            continue;
        
        switch( domain[i] )
        {
            case '_':
            case '-':
                break;
            
               default:
                return -1;
        }
    }
    
    return 0;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %r15
xorl %ebx, %ebx
testl %esi, %esi
cmovlel %ebx, %r14d
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x30d0
callq 0x2300
movq (%rax), %rcx
movsbq (%r15,%r12), %rax
testb $0x8, (%rcx,%rax,2)
jne 0x30c9
movzbl %al, %eax
cmpl $0x5f, %eax
je 0x30c9
cmpl $0x2d, %eax
jne 0x30ce
incq %r12
jmp 0x30a4
movl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: binary_node_insert
int binary_node_insert( rbtree* tree, rbnode* node, rbnode* newnode )
{
    int cmp;
    
    cmp = tree->node_cmp( newnode, node );
    if( cmp == 0 )
        return RBTREE_ERR_EXIST;
    
    if( cmp < 0 )
    {
        if( node->left == NULL )
        {
            node->left = newnode;
            newnode->color = RED;
            newnode->left  = NULL;
            newnode->right = NULL;
            newnode->parent = node;
            tree->count++;
            return 0;
        }
        else
            return binary_node_insert( tree, node->left, newnode );
    }
    else
    {
        if( node->right == NULL )
        {
            node->right = newnode;
            newnode->color = RED;
            newnode->left = NULL;
            newnode->right = NULL;
            newnode->parent = node;
            tree->count++;
            return 0;
        }
        else
            return binary_node_insert( tree, node->right, newnode );
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
pushq $0x1
popq %rbp
pushq $0x8
popq %r13
pushq $0x10
popq %r12
movq %rsi, %r15
movq %rbx, %rdi
callq *0x10(%r14)
testl %eax, %eax
je 0x69ef
js 0x69c8
movq 0x10(%r15), %rsi
testq %rsi, %rsi
jne 0x69ad
jmp 0x69d4
movq 0x8(%r15), %rsi
testq %rsi, %rsi
jne 0x69ad
movq %r13, %r12
movq %rbx, (%r15,%r12)
movl $0x1, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq %r15, 0x18(%rbx)
incl 0x8(%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: rbtree_insert
int  rbtree_insert( rbtree* tree, rbnode* node )
{
    int rc;
    
    if( tree->root == NULL )
    {
        node->color = BLACK;
        node->left  = NULL;
        node->right = NULL;
        node->parent = NULL;
        tree->root = node;
        tree->count ++;
        return 0;
    }
    
    rc = binary_node_insert( tree, tree->root, node );
    if( rc )
        return rc;
    
    insert_case1( tree, node );
    
    return 0;
    
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x6a63
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6991
testl %eax, %eax
je 0x6a86
pushq $0x1
popq %rbp
jmp 0x6a7f
movl $0x2, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
andq $0x0, 0x18(%r14)
movq %r14, (%rbx)
incl 0x8(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x2
popq %rdx
xorl %ebp, %ebp
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x6af3
cmpl $0x2, (%rax)
je 0x6a7f
movq 0x18(%rax), %rsi
movq 0x8(%rsi), %rcx
xorl %edi, %edi
cmpq %rcx, %rax
sete %dil
movq 0x8(%rsi,%rdi,8), %rdi
testq %rdi, %rdi
je 0x6ac8
cmpl $0x1, (%rdi)
jne 0x6ac8
movl %edx, (%rax)
movl %edx, (%rdi)
movl $0x1, (%rsi)
movq %rsi, %r14
jmp 0x6a8b
cmpq %rcx, %rax
jne 0x6afc
cmpq %r14, 0x10(%rax)
jne 0x6afc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x72c4
pushq $0x8
popq %rax
movq (%r14,%rax), %r14
movq 0x18(%r14), %rax
movq 0x8(%rax), %rdx
movq 0x18(%rax), %rsi
jmp 0x6b05
movl $0x2, (%r14)
jmp 0x6a7d
movq 0x8(%rax), %rdx
cmpq %r14, %rdx
je 0x6b1c
movl $0x2, (%rax)
movl $0x1, (%rsi)
cmpq %r14, %rdx
jne 0x6b33
movq 0x8(%rsi), %rcx
jmp 0x6b2e
cmpq 0x10(%rsi), %rax
je 0x6b4d
movl $0x2, (%rax)
movl $0x1, (%rsi)
cmpq %rcx, %rax
je 0x6b40
movq %rbx, %rdi
callq 0x72c4
jmp 0x6a7f
movq %rbx, %rdi
callq 0x7306
jmp 0x6a7f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7306
pushq $0x10
jmp 0x6ae0
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: print_node
static void print_node( rbtree* tree, rbnode* node, rbtree_proc_node print )
{
    print( node );
    if( node->left )
        print_node( tree, node->left, print );
    
    if( node->right )
        print_node( tree, node->right, print );

    
    
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %r14, %rdi
callq *%rbx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x6ba6
movq %rbx, %rsi
callq 0x6b86
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x6b90
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: rbtree_verify_rednode
int rbtree_verify_rednode( rbnode* n )
{
    int rc;
    
    if( n->color == RED )
    {
        if(( n->left ) && n->left->color != BLACK  )
        {
            printf( "red node %p child is red!\n", n );
            return 1;
        }
            
        if(( n->right ) && n->right->color != BLACK  )
        {
            printf( "red node %p child is red!\n", n );
            return 1;
        }
    }
    
    
    if( n->left )
    {
        rc = rbtree_verify_rednode( n->left );
        if( rc ) 
            return rc;
    }
     
    if( n->right )
    {
        rc = rbtree_verify_rednode( n->right );
        if( rc )
            return rc;
    }
    
    return 0;
    
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, (%rdi)
movq 0x8(%rdi), %rdi
jne 0x6c16
testq %rdi, %rdi
je 0x6c08
cmpl $0x2, (%rdi)
jne 0x6c3d
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x6c16
cmpl $0x2, (%rax)
jne 0x6c3d
pushq $0x1
popq %rbp
testq %rdi, %rdi
je 0x6c27
callq 0x6bef
testl %eax, %eax
jne 0x6c51
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6c39
callq 0x6bef
testl %eax, %eax
jne 0x6c51
xorl %ebp, %ebp
jmp 0x6c51
leaq 0x2d2a(%rip), %rdi      # 0x996e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2120
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: verify_node
int verify_node( rbnode* n )
{
    int cnt;
    int find = 0;
    int rc;
    
    cnt = rbtree_path_black_count( n );
    rc = node_black_walk( n, find, cnt );
    if( rc )
        return 1;

    if( n->left )
    {
        rc = verify_node( n->left );
        if( rc )
            return rc;
    }
    
    if( n->right )
    {
        rc = verify_node( n->right );
        if( rc )
            return rc;
            
    }
    
        
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edx, %edx
movq %rdi, %rax
testq %rax, %rax
je 0x6c7a
xorl %ecx, %ecx
cmpl $0x2, (%rax)
sete %cl
addl %ecx, %edx
movq 0x8(%rax), %rax
jmp 0x6c65
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7348
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x6c94
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x6ca6
callq 0x6c5a
testl %eax, %eax
jne 0x6c8b
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6cb8
callq 0x6c5a
testl %eax, %eax
jne 0x6c8b
xorl %ebp, %ebp
jmp 0x6c8b
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: delete_one_child
void delete_one_child( rbtree* tree, rbnode *n)
{
        rbnode *child = n->left != NULL ? n->left : n->right;
        
        if(n->color == BLACK){
                n->color = node_color( child );
                delete_case1 ( tree, n );
        }
        replace_child( tree, n, child);
        
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
testq %r15, %r15
jne 0x6cd7
movq 0x10(%r14), %r15
cmpl $0x2, (%r14)
jne 0x6e6b
testq %r15, %r15
je 0x6ceb
movl (%r15), %eax
jmp 0x6cee
pushq $0x2
popq %rax
movl %eax, (%r14)
movq %r14, %r12
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x6e6b
movq 0x8(%rsi), %rax
movq %rax, %rcx
cmpq %r12, %rax
jne 0x6d12
movq 0x10(%rsi), %rcx
cmpl $0x1, (%rcx)
jne 0x6d37
movl $0x1, (%rsi)
movl $0x2, (%rcx)
movq %rbx, %rdi
cmpq %r12, %rax
je 0x6d32
callq 0x7306
jmp 0x6d37
callq 0x72c4
movq 0x18(%r12), %rax
movq 0x8(%rax), %rsi
movq %rsi, %rdx
cmpq %r12, %rsi
jne 0x6d4c
movq 0x10(%rax), %rdx
movl (%rax), %ecx
cmpl $0x2, %ecx
jne 0x6d87
testq %rdx, %rdx
je 0x6d5d
cmpl $0x2, (%rdx)
jne 0x6d87
movq 0x8(%rdx), %rdi
testq %rdi, %rdi
je 0x6d6b
cmpl $0x2, (%rdi)
jne 0x6d87
movq 0x10(%rdx), %rdi
testq %rdi, %rdi
je 0x6d79
cmpl $0x2, (%rdi)
jne 0x6d87
movl $0x1, (%rdx)
movq %rax, %r12
jmp 0x6cf4
movq %rsi, %rdx
cmpq %r12, %rsi
jne 0x6d93
movq 0x10(%rax), %rdx
cmpl $0x1, %ecx
jne 0x6dcf
testq %rdx, %rdx
je 0x6da2
cmpl $0x2, (%rdx)
jne 0x6dcf
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x6db0
cmpl $0x2, (%rcx)
jne 0x6dcf
movq 0x10(%rdx), %rcx
testq %rcx, %rcx
je 0x6dbe
cmpl $0x2, (%rcx)
jne 0x6dcf
movl $0x1, (%rdx)
movl $0x2, (%rax)
jmp 0x6e6b
cmpq %r12, %rsi
je 0x6ddf
cmpl $0x2, (%rsi)
jne 0x6e29
movq 0x10(%rax), %rax
jmp 0x6e20
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x6e29
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x6df6
cmpl $0x2, (%rcx)
jne 0x6e1d
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x6e1d
cmpl $0x1, (%rcx)
jne 0x6e1d
movl $0x1, (%rax)
movl $0x2, (%rcx)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7306
jmp 0x6e29
movq %rax, %rsi
cmpq %r12, %rax
je 0x6eb0
movq 0x18(%r12), %rsi
movq 0x8(%rsi), %rax
cmpq %r12, %rax
je 0x6e50
movl (%rsi), %ecx
movl %ecx, (%rax)
pushq $0x2
popq %rcx
movl %ecx, (%rsi)
movq 0x8(%rax), %rax
movl %ecx, (%rax)
movq %rbx, %rdi
callq 0x7306
jmp 0x6e6b
movq 0x10(%rsi), %rax
movl (%rsi), %ecx
movl %ecx, (%rax)
pushq $0x2
popq %rcx
movl %ecx, (%rsi)
movq 0x10(%rax), %rax
movl %ecx, (%rax)
movq %rbx, %rdi
callq 0x72c4
movq 0x18(%r14), %rax
testq %r15, %r15
je 0x6e89
movq %rax, 0x18(%r15)
testq %rax, %rax
jne 0x6e8e
movq %r15, (%rbx)
movl $0x2, (%r15)
jmp 0x6ea4
testq %rax, %rax
je 0x6ea0
cmpq %r14, 0x8(%rax)
je 0x6e9a
movq %r15, 0x10(%rax)
jmp 0x6ea4
movq %r15, 0x8(%rax)
jmp 0x6ea4
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x6ec2
cmpl $0x2, (%rax)
jne 0x6e29
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x6e29
cmpl $0x1, (%rax)
jne 0x6e29
movl $0x1, (%rsi)
movl $0x2, (%rax)
movq %rbx, %rdi
callq 0x72c4
jmp 0x6e29
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: rbtree_delete
rbnode* rbtree_delete( rbtree* tree, void* val )
{
    rbnode* node;
    rbnode* min;
    
    if( tree->root == NULL )
        return NULL;
    
    node = rbtree_find( tree, val );
    if( node == NULL )
        return NULL;
    
    
    if( node->left && node->right )
    {
        min = find_subtree_min( node->right );
        tree->node_swap( node, min );
        node = min;
    }
    
    delete_one_child( tree, node );
    tree->count --;
    
    return node;
    
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, (%rdi)
je 0x6f2f
movq %rdi, %rbx
callq 0x6a00
testq %rax, %rax
je 0x6f2f
cmpq $0x0, 0x8(%rax)
je 0x6f34
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x6f34
movq %rcx, %r14
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x6f18
movq %rax, %rdi
movq %r14, %rsi
callq *0x20(%rbx)
jmp 0x6f37
xorl %r14d, %r14d
jmp 0x6f45
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6cbc
decl 0x8(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: node_walk
void node_walk( rbnode* node, int order, rbtree_proc_node cb )
{
    if( !node )
        return;

    switch( order )
    {
        case RBTREE_WALK_PRE_ORDER:
            cb( node );
            node_walk( node->left, order, cb );
            node_walk( node->right, order, cb );
            break;
        
        case RBTREE_WALK_IN_ORDER:
            node_walk( node->left, order, cb );
            cb( node );
            node_walk( node->right, order, cb );
            break;
        
        case RBTREE_WALK_POST_ORDER:
            node_walk( node->left, order, cb );
            node_walk( node->right, order, cb );
            cb( node );
            break;
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r12
pushq $0x1
popq %r14
pushq $0x2
popq %r15
movq %rdi, 0x8(%rsp)
testq %r12, %r12
je 0x7001
cmpl $0x1, %ebp
je 0x6fa8
cmpl $0x2, %ebp
jne 0x6fc4
movq 0x8(%r12), %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x6f61
movq %r12, %rdi
callq *%rbx
jmp 0x6fbd
movq %r12, %rdi
callq *%rbx
movq 0x8(%r12), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x6f61
movq 0x10(%r12), %r12
jmp 0x6f82
cmpl $0x3, %ebp
jne 0x7001
movq 0x8(%rsp), %r14
movq 0x8(%r14), %rdi
pushq $0x3
popq %rbp
movl %ebp, %esi
movq %rbx, %rdx
callq 0x6f61
movq 0x10(%r14), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x6f61
movq %r14, %rdi
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: rbtree_free
void rbtree_free( rbtree* tree, rbtree_proc_node cb )
{
    if( !tree->root )
        return;

    node_free( tree->root, cb );
    tree->root = NULL;
    tree->count = 0;
    
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x7027
callq 0x7029
andq $0x0, (%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: node_free
void node_free( rbnode* node, rbtree_proc_node cb )
{
    if( node->left )
        node_free( node->left, cb );
    
    if( node->right )
        node_free( node->right, cb );
    
    cb( node );
    
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x7044
movq %rsi, %r14
callq 0x7029
movq %r14, %rsi
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x7058
movq %rsi, %r14
callq 0x7029
movq %r14, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rsi
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: rbtree_dot
void rbtree_dot( rbtree* tree, char* file, rbtree_node_value cb )
{
    FILE* f;
    rbnode* node;
    
    f = fopen( file, "w" );
    if( !f )
        return;
    
    fprintf( f, "digraph rbtree{\n" );
    
    if( tree->root )
    {
        node= tree->root;
        fprintf( f, "n_%p[color=%s,fontcolor=white, style=filled, shape=circle, label=\"%s\"];\n", node, node->color == RED ? "red" : "black", cb( node ) );
        node_dot( tree->root, f, cb );
    }
    else
        fprintf( f, "nil[color=black, fontcolor=white, style=filled, shape=box, label=\"nil\"];\n" );
    
    fprintf( f, "}\n" );
    fclose( f );
    
    
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %r15
leaq 0x26ba(%rip), %rsi      # 0x98c5
movq %rax, %rdi
callq 0x2270
testq %rax, %rax
je 0x727f
movq %rax, %rbx
leaq 0x26a5(%rip), %rdi      # 0x98c7
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x22b0
movq (%r15), %r12
testq %r12, %r12
je 0x7289
cmpl $0x1, (%r12)
leaq 0x25f4(%rip), %rax      # 0x9838
leaq 0x25f1(%rip), %r13      # 0x983c
cmoveq %rax, %r13
movq %r12, %rdi
callq *%r14
leaq 0x267c(%rip), %rsi      # 0x98d8
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x21d0
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7064
jmp 0x729e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x2691(%rip), %rdi      # 0x9921
pushq $0x49
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22b0
leaq 0x26c6(%rip), %rdi      # 0x996b
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22b0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x20f0
// File: /workspace/github_c_makefile_star2_O2/bloomsource[P]dns_update/rbtree.c
// Function: node_black_walk
int node_black_walk( rbnode* n, int find, int count )
{
    int rc;
    
    if( !n )
    {
        if( find != count )
        {
            printf( "black node in path not equal!\n" );
            return 1;
        }
        return 0;
    }
    else
    {
        if( n->color == BLACK )
            find ++;
        rc = node_black_walk( n->left, find, count );
        if( rc )
            return rc;
        rc = node_black_walk( n->right, find, count );
        if( rc )
            return rc;
        
        return 0;
    }
    
    
    
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
xorl %eax, %eax
testq %r14, %r14
je 0x737a
cmpl $0x2, (%r14)
sete %al
addl %eax, %ebp
movq 0x8(%r14), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x7348
testl %eax, %eax
jne 0x738d
movq 0x10(%r14), %r14
jmp 0x7353
cmpl %ebx, %ebp
je 0x738d
leaq 0x262a(%rip), %rdi      # 0x99af
callq 0x2070
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: test_ints
void test_ints() // {{{
{
  const char *bufs[]={
    "\x8b",  // 0
    "\xef",  // 100
    "\x27",  // -100
    "\xfa\x7c",  // 1000
    "\xfe\x7c",  // -1000
    "\x1c\x27\x10",  // 10000
    "\x1c\xd8\xf0",  // -10000
    "\x1d\x00\x01\x86\xa0",  // 100000
    "\x1d\xff\xfe\x79\x60",  // -100000
    NULL
  };
  char out[10];
  int iA;
  for (iA=0;bufs[iA];iA++) {
    const char *tmp=bufs[iA];
    int32_t val=cff_read_integer(&tmp);
    printf("%d\n",val);
    char *o=out;
    cff_write_integer(&o,val);
    dump(out,o);
//    assert(memcmp(out,bufs[iA],o-out)==0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x10(%rsp), %rbx
leaq 0x406e(%rip), %r14      # 0x83cb
leaq 0x1e(%rsp), %r15
leaq 0x8(%rsp), %r12
xorl %r13d, %r13d
cmpq $0x48, %r13
je 0x43b9
leaq 0x8249(%rip), %rax      # 0xc5c0
movq (%r13,%rax), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x6593
movl %eax, %ebp
movq %r14, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x4040
movq %r15, 0x8(%rsp)
movq %r12, %rdi
movl %ebp, %esi
callq 0x66c7
movq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x430c
addq $0x8, %r13
jmp 0x436a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: test_real
void test_real(double v) // {{{
{
  char buf[10],*b=buf;
  cff_write_real(&b,v);
  dump(buf,b);

  const char *c=buf;
  double res=cff_read_real(&c);
  printf("%g\n",res);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x1e(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, (%r14)
movq %r14, %rdi
callq 0x647e
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x430c
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
callq 0x6354
leaq 0x3c61(%rip), %rdi      # 0x8064
movb $0x1, %al
callq 0x4040
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: dump_name_index
void dump_name_index(CFF_FILE *cff) // {{{
{
  printf("Name index: %d entries\n",
         cff->nameIndex.count);
  if (cff->nameIndex.count==0) {
    return;
  }
  int iA;
  for (iA=0;iA<cff->nameIndex.count;iA++) {
    printf("  %d: %.*s\n",
           iA,
           cff_index_length(&cff->nameIndex,iA),
           cff_index_get(&cff->nameIndex,iA));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x20(%rdi), %esi
leaq 0x3c40(%rip), %rdi      # 0x8068
xorl %eax, %eax
callq 0x4040
movzwl 0x20(%rbx), %eax
testw %ax, %ax
je 0x4483
leaq 0x20(%rbx), %r14
leaq 0x3c3d(%rip), %r15      # 0x8080
xorl %r12d, %r12d
movzwl %ax, %eax
cmpq %rax, %r12
jae 0x4483
movq %r14, %rdi
movl %r12d, %esi
callq 0x448f
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
movl (%rcx,%r12,4), %ecx
addq %rdx, %rcx
decq %rcx
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4040
incq %r12
movzwl 0x20(%rbx), %eax
jmp 0x4446
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: dump_string_index
void dump_string_index(CFF_FILE *cff) // {{{
{
  printf("String index: %d extra entries\n",
         cff->stringIndex.count);
  if (cff->stringIndex.count==0) {
    return;
  }
  int iA;
  for (iA=0;iA<cff->stringIndex.count;iA++) {
    printf("  %d: %.*s\n",
           iA+391,
           cff_index_length(&cff->stringIndex,iA),
           cff_index_get(&cff->stringIndex,iA));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x50(%rdi), %esi
leaq 0x3bcb(%rip), %rdi      # 0x808c
xorl %eax, %eax
callq 0x4040
movzwl 0x50(%rbx), %eax
testw %ax, %ax
je 0x4521
leaq 0x50(%rbx), %r14
leaq 0x3ba4(%rip), %r15      # 0x8080
xorl %r12d, %r12d
movzwl %ax, %eax
cmpq %rax, %r12
jae 0x4521
movq %r14, %rdi
movl %r12d, %esi
callq 0x448f
movq 0x58(%rbx), %rcx
movq 0x60(%rbx), %rdx
movl (%rcx,%r12,4), %ecx
addq %rdx, %rcx
decq %rcx
leal 0x187(%r12), %esi
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x4040
incq %r12
movzwl 0x50(%rbx), %eax
jmp 0x44df
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: dump_op
void dump_op(CFF_FILE *cff,struct _CFF_VALUE *value,int args) // {{{
{
  printf(" : ");
  switch (value->op->flags&CFFOP_TYPEMASK) {
  case CFFOP_TYPE_NUMBER:
    assert(args==1);
    // already shown, int or real
    break;
  case CFFOP_TYPE_BOOL:
    assert(args==1);
    assert(value[-1].type==CFF_VAL_INT);
    if (value[-1].number==0) {
      printf("false");
    } else if (value[-1].number==1) {
      printf("true");
    } else {
      printf("[error]");
    }
    break;
  case CFFOP_TYPE_SID:
    assert(args==1);
    assert(value[-1].type==CFF_VAL_INT);
    {
      int len;
      const char *str=cff_get_string(cff,value[-1].number,&len);
      printf("%.*s",len,str);
    }
    break;
  case CFFOP_TYPE_ARRAY:
    // TODO
    printf("[array size %d]",args);
    break;
  case CFFOP_TYPE_DELTA: // TODO
    printf("[delta size %d]",args);
    break;
  case CFFOP_TYPE_NUMNUM:
    printf("[todo: NUM NUM]");
    break;
  case CFFOP_TYPE_SIDSIDNUM:
    printf("[todo: SID SID NUM]");
    break;
  default:
    printf("[error]");
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3b68(%rip), %rdi      # 0x80ac
xorl %eax, %eax
callq 0x4040
movq 0x8(%rbx), %rax
movl 0x18(%rax), %eax
andl $0xf, %eax
decl %eax
cmpl $0xa, %eax
ja 0x45c9
leaq 0x3aa1(%rip), %rcx      # 0x8004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x1, %ebp
je 0x4614
leaq 0x3b34(%rip), %rdi      # 0x80b0
leaq 0x3b35(%rip), %rsi      # 0x80b8
leaq 0x3b39(%rip), %rcx      # 0x80c3
pushq $0x65
jmp 0x46b6
leaq 0x3bb2(%rip), %rdi      # 0x814a
jmp 0x4645
cmpl $0x1, %ebp
jne 0x4654
cmpl $0x2, -0x10(%rbx)
jne 0x4686
movl -0x8(%rbx), %eax
cmpl $0x1, %eax
je 0x463e
testl %eax, %eax
jne 0x45c9
leaq 0x3b4b(%rip), %rdi      # 0x8112
jmp 0x4645
leaq 0x3b4d(%rip), %rdi      # 0x811d
jmp 0x4645
leaq 0x3b81(%rip), %rdi      # 0x815a
jmp 0x4645
cmpl $0x1, %ebp
jne 0x466d
cmpl $0x2, -0x10(%rbx)
jne 0x469f
movl -0x8(%rbx), %esi
leaq 0xc(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x699e
movl (%rbx), %esi
leaq 0x3b1b(%rip), %rdi      # 0x8125
movq %rax, %rdx
xorl %eax, %eax
callq 0x4040
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3b06(%rip), %rdi      # 0x812a
jmp 0x462d
leaq 0x3b0d(%rip), %rdi      # 0x813a
movl %ebp, %esi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4040
leaq 0x3ad3(%rip), %rdi      # 0x8118
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4040
leaq 0x3a55(%rip), %rdi      # 0x80b0
leaq 0x3a56(%rip), %rsi      # 0x80b8
leaq 0x3a5a(%rip), %rcx      # 0x80c3
pushq $0x69
jmp 0x46b6
leaq 0x3a3c(%rip), %rdi      # 0x80b0
leaq 0x3a3d(%rip), %rsi      # 0x80b8
leaq 0x3a41(%rip), %rcx      # 0x80c3
pushq $0x74
jmp 0x46b6
leaq 0x3a69(%rip), %rdi      # 0x80f6
leaq 0x3a24(%rip), %rsi      # 0x80b8
leaq 0x3a28(%rip), %rcx      # 0x80c3
pushq $0x6a
jmp 0x46b6
leaq 0x3a50(%rip), %rdi      # 0x80f6
leaq 0x3a0b(%rip), %rsi      # 0x80b8
leaq 0x3a0f(%rip), %rcx      # 0x80c3
pushq $0x75
popq %rdx
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: dump_value
void dump_value(CFF_FILE *cff,struct _CFF_VALUE *value,int args) // {{{
{
  if (!value) {
    printf("null");
    return;
  }
  switch (value->type) {
  case CFF_VAL_ERROR:
    printf("ERROR");
    break;
  case CFF_VAL_OP:
    printf(" %s",value->op->name);
    if (args>=0) {
      dump_op(cff,value,args);
    }
    printf("\n");
    break;
  case CFF_VAL_INT:
    printf(" %d",value->number);
    break;
  case CFF_VAL_REAL:
    printf(" %gf",value->real);
    break;
  default:
    assert(0);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x46ed
movq %rsi, %rbx
movl (%rsi), %eax
cmpq $0x3, %rax
ja 0x4762
leaq 0x3955(%rip), %rcx      # 0x8030
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x3a88(%rip), %rdi      # 0x8173
jmp 0x46f4
leaq 0x3a7a(%rip), %rdi      # 0x816e
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x4040
movl 0x8(%rbx), %esi
leaq 0x3a74(%rip), %rdi      # 0x817d
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x4040
movsd 0x8(%rbx), %xmm0
leaq 0x3a61(%rip), %rdi      # 0x8181
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
jmp 0x4040
movl %edx, %ebp
movq %rdi, %r14
movq 0x8(%rbx), %rax
movq (%rax), %rsi
leaq 0x3a3b(%rip), %rdi      # 0x8179
xorl %eax, %eax
callq 0x4040
testl %ebp, %ebp
js 0x4756
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x452d
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4170
leaq 0x52ad(%rip), %rdi      # 0x9a16
leaq 0x3948(%rip), %rsi      # 0x80b8
leaq 0x3a0f(%rip), %rcx      # 0x8186
movl $0xa7, %edx
callq 0x40d0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: dump_dict
void dump_dict(CFF_FILE *cff,struct _CFF_DICT *dict) // {{{
{
  int iA,lastoppos=-1;
  printf("<\n");
  for (iA=0;iA<dict->len;iA++) {
    dump_value(cff,&dict->data[iA],iA-lastoppos-1);
    if (dict->data[iA].type==CFF_VAL_OP) {
      lastoppos=iA;
    }
  }
  printf(">\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3a8d(%rip), %rdi      # 0x8223
callq 0x41b0
leaq 0x8(%rbx), %r15
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
movslq (%rbx), %rax
cmpq %rax, %r12
jge 0x47d0
movl %ebp, %edx
notl %edx
addl %r12d, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x46bc
cmpl $0x1, (%r15)
cmovel %r12d, %ebp
incq %r12
addq $0x10, %r15
jmp 0x47a5
leaq 0x3a4e(%rip), %rdi      # 0x8225
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x41b0
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: is_sfnt_cff
int is_sfnt_cff(FILE *f) // {{{
{
  char buf[8];
  const int res=fread(buf,1,8,f);
  rewind(f); // esp. for cff_load

  if (res<8) {
    return 0;
  }
  if (memcmp(buf,"OTTO",4)==0) {
    return 1;
  } else if (memcmp(buf,"wOFFOTTO",8)==0) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rcx
callq 0x41a0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4050
xorl %eax, %eax
cmpl $0x8, %r14d
jl 0x4830
cmpl $0x4f54544f, (%rsp)     # imm = 0x4F54544F
je 0x482d
movabsq $0x4f54544f46464f77, %rcx # imm = 0x4F54544F46464F77
xorl %eax, %eax
cmpq %rcx, (%rsp)
sete %al
jmp 0x4830
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/test_cff.c
// Function: main
int main(int argc,char **argv)
{
  FILE *f;
  const char *fn="ee.cff";

  if (argc==2) {
    fn=argv[1];
  }

  if ((f=fopen(fn,"rb"))==NULL) {
    fprintf(stderr,"Could not open font: %m\n");
    return 1;
  }

  CFF_FILE *cff;
  if (is_sfnt_cff(f)) {
    OTF_FILE *otf=otf_load2(f,-1);
    assert(otf);

    int len;
    char *buf=otf_get_table(otf,OTF_TAG('C','F','F',' '),&len);
    otf_close(otf);
    assert(buf);

    cff=cff_load2(buf,len,1);
  } else {
    cff=cff_load_file(f);
    fclose(f);
  }
  assert(cff);

  dump_name_index(cff);
//  dump_string_index(cff);
// ...

  assert(cff->nameIndex.count>0);
  struct _CFF_DICT *dict=cff_read_dict(
    cff_index_get(&cff->topDictIndex,0),
    cff_index_length(&cff->topDictIndex,0));
  assert(dict);
  dump_dict(cff,dict);

  cff_close(cff);

//  test_ints();
//  test_real(100000000.);
//  test_real(-2.25);
//  test_real(1.140541e-05);

//  printf("%d",cff_find_stdstr("a"));

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x4847
movq 0x8(%rsi), %rdi
jmp 0x484e
leaq 0x3977(%rip), %rdi      # 0x81c5
leaq 0x3977(%rip), %rsi      # 0x81cc
callq 0x4130
testq %rax, %rax
je 0x493a
movq %rax, %r14
movq %rax, %rdi
callq 0x47e4
testl %eax, %eax
je 0x48c4
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0x4c75
testq %rax, %rax
je 0x49b4
movq %rax, %rbx
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
movl $0x43464620, %esi       # imm = 0x43464620
callq 0x55e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x5382
testq %r14, %r14
je 0x49d3
movslq 0x4(%rsp), %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x6a97
movq %rax, %rbx
jmp 0x48d7
movq %r14, %rdi
callq 0x6ced
movq %rax, %rbx
movq %r14, %rdi
callq 0x4100
testq %rbx, %rbx
je 0x4957
movq %rbx, %rdi
callq 0x4412
cmpw $0x0, 0x20(%rbx)
je 0x4976
cmpw $0x0, 0x38(%rbx)
je 0x490e
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
movl (%rax), %edx
movl 0x4(%rax), %esi
leaq (%rcx,%rdx), %rdi
decq %rdi
subl %edx, %esi
jmp 0x4913
pushq $-0x1
popq %rsi
xorl %edi, %edi
callq 0x6801
testq %rax, %rax
je 0x4995
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4781
movq %rbx, %rdi
callq 0x6c8a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x869f(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
leaq 0x3884(%rip), %rsi      # 0x81cf
xorl %eax, %eax
callq 0x4190
pushq $0x1
popq %rax
jmp 0x4932
leaq 0x386a(%rip), %rdi      # 0x81c8
leaq 0x3753(%rip), %rsi      # 0x80b8
leaq 0x3880(%rip), %rcx      # 0x81ec
movl $0xeb, %edx
callq 0x40d0
leaq 0x388a(%rip), %rdi      # 0x8207
leaq 0x3734(%rip), %rsi      # 0x80b8
leaq 0x3861(%rip), %rcx      # 0x81ec
movl $0xf1, %edx
callq 0x40d0
leaq 0x3882(%rip), %rdi      # 0x821e
leaq 0x3715(%rip), %rsi      # 0x80b8
leaq 0x3842(%rip), %rcx      # 0x81ec
movl $0xf5, %edx
callq 0x40d0
leaq 0x382d(%rip), %rdi      # 0x81e8
leaq 0x36f6(%rip), %rsi      # 0x80b8
leaq 0x3823(%rip), %rcx      # 0x81ec
movl $0xdf, %edx
callq 0x40d0
leaq 0x3829(%rip), %rdi      # 0x8203
leaq 0x36d7(%rip), %rsi      # 0x80b8
leaq 0x3804(%rip), %rcx      # 0x81ec
movl $0xe4, %edx
callq 0x40d0
nop
// File: /workspace/github_c_makefile_star2_O2/smilingthax[P]libfontembed/cff.c
// Function: cff_read_real
double cff_read_real(const char **buf) // {{{   NAN on error
{
  int iA,iB=0;

  char tmp[250];
  while (1) {
    const unsigned char b=**buf;
    const unsigned char n1=b&0x0f;
    const unsigned char n[2]={b>>4, n1};
    for (iA=0;iA<2;iA++) {
      switch (n[iA]) {
      case 0x0a:
        tmp[iB++]='.';
        break;
      case 0x0b:
        tmp[iB++]='E';
        tmp[iB++]='+';
        break;
      case 0x0c:
        tmp[iB++]='E';
        tmp[iB++]='-';
        break;
      case 0x0d:
        assert(0);
        break;
      case 0x0e:
        tmp[iB++]='-';
        break;
      case 0x0f:
        tmp[iB++]=0;
        break;
      default: // 0-9
        tmp[iB++]=n[iA]+'0';
        break;
      }
    }
    (*buf)++;
    assert(iB<200);
    if (iB>=200) {
      return NAN;
    }
    if (n1==0xf) {
      break;
    }
  }
  char *end;
  double ret=strtod(tmp,&end);
  assert(!*end);
  if (*end) {
    return NAN;
  }
  return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq (%rdi), %rax
xorl %ecx, %ecx
pushq $0x1
popq %rdx
leaq 0x2434(%rip), %rsi      # 0x87a0
pushq $0x2
popq %r8
movb (%rax), %r10b
movl %r10d, %r9d
andb $0xf, %r9b
shrb $0x4, %r10b
movb %r10b, 0x8(%rsp)
movb %r9b, 0x9(%rsp)
xorl %r10d, %r10d
cmpq $0x2, %r10
je 0x63f3
movzbl 0x8(%rsp,%r10), %r11d
leal -0xa(%r11), %ebx
cmpl $0x5, %ebx
ja 0x63dc
movslq (%rsi,%rbx,4), %rbx
addq %rsi, %rbx
movslq %ecx, %r11
jmpq *%rbx
movb $0x2e, %r11b
jmp 0x63e0
xorl %r11d, %r11d
jmp 0x63e0
leal 0x1(%r11), %ebx
movb $0x45, 0x10(%rsp,%r11)
movb $0x2d, %r11b
jmp 0x63d2
leal 0x1(%r11), %ebx
movb $0x45, 0x10(%rsp,%r11)
movb $0x2b, %r11b
movl %r8d, %ebp
jmp 0x63e4
movb $0x2d, %r11b
jmp 0x63e0
addb $0x30, %r11b
movl %edx, %ebp
movl %ecx, %ebx
addl %ebp, %ecx
movslq %ebx, %rbx
movb %r11b, 0x10(%rsp,%rbx)
incq %r10
jmp 0x638b
incq %rax
movq %rax, (%rdi)
cmpl $0xc8, %ecx
jge 0x644c
cmpb $0xf, %r9b
jne 0x6370
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x40f0
movq (%rbx), %rax
cmpb $0x0, (%rax)
jne 0x6465
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %rbp
retq
leaq 0x35e0(%rip), %rdi      # 0x9a16
leaq 0x1c80(%rip), %rsi      # 0x80bd
leaq 0x2384(%rip), %rcx      # 0x87c8
pushq $0x2d
popq %rdx
callq 0x40d0
leaq 0x2399(%rip), %rdi      # 0x87ec
leaq 0x1c63(%rip), %rsi      # 0x80bd
leaq 0x2367(%rip), %rcx      # 0x87c8
pushq $0x3b
jmp 0x6446
leaq 0x2387(%rip), %rdi      # 0x87f3
leaq 0x1c4a(%rip), %rsi      # 0x80bd
leaq 0x234e(%rip), %rcx      # 0x87c8
pushq $0x45
jmp 0x6446