LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/TeaInside[P]teavpn/src/third_party/thpool/thpool.c
// Function: thpool_add_work
int thpool_add_work(thpool_* thpool_p, void* (*function_p)(void*), void* arg_p){
	job* newjob;

	newjob=(struct job*)malloc(sizeof(struct job));
	if (newjob==NULL){
		err("thpool_add_work(): Could not allocate memory for new job\n");
		return -1;
	}

	/* add function and argument */
	newjob->function=function_p;
	newjob->arg=arg_p;

	/* add job to queue */
	jobqueue_push(&thpool_p->__jobqueue, newjob);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x22c0
testq %rax, %rax
je 0x5f2b
movq %rax, %r15
movq %r12, 0x8(%rax)
movq %r14, 0x10(%rax)
leaq 0x68(%rbx), %r14
movq %r14, %rdi
callq 0x23f0
andq $0x0, (%r15)
movl 0xa8(%rbx), %eax
testl %eax, %eax
je 0x5ef6
movq 0x98(%rbx), %rcx
movq %r15, (%rcx)
jmp 0x5efd
movq %r15, 0x90(%rbx)
movq %r15, 0x98(%rbx)
incl %eax
movl %eax, 0xa8(%rbx)
movq 0xa0(%rbx), %rdi
callq 0x6368
movq %r14, %rdi
callq 0x22b0
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x50c6(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x2504(%rip), %rdi      # 0x8440
pushq $0x39
popq %rsi
pushq $0x1
popq %rdx
callq 0x23b0
pushq $-0x1
popq %rax
jmp 0x5f22
// File: /workspace/github_c_makefile_star2_O2/TeaInside[P]teavpn/src/third_party/thpool/thpool.c
// Function: thpool_wait
void thpool_wait(thpool_* thpool_p){
	pthread_mutex_lock(&thpool_p->thcount_lock);
	while (thpool_p->__jobqueue.len || thpool_p->num_threads_working) {
		pthread_cond_wait(&thpool_p->threads_all_idle, &thpool_p->thcount_lock);
	}
	pthread_mutex_unlock(&thpool_p->thcount_lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x23f0
leaq 0x38(%r14), %r15
cmpl $0x0, 0xa8(%r14)
jne 0x5f7a
cmpl $0x0, 0xc(%r14)
je 0x5f87
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20e0
jmp 0x5f69
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22b0
// File: /workspace/github_c_makefile_star2_O2/TeaInside[P]teavpn/src/third_party/thpool/thpool.c
// Function: thpool_destroy
void thpool_destroy(thpool_* thpool_p){
	/* No need to destory if it's NULL */
	if (thpool_p == NULL) return ;

	volatile int threads_total = thpool_p->num_threads_alive;

	/* End each thread 's infinite loop */
	threads_keepalive = 0;

	/* Give one second to kill idle threads */
	double TIMEOUT = 1.0;
	time_t start, end;
	double tpassed = 0.0;
	time (&start);
	while (tpassed < TIMEOUT && thpool_p->num_threads_alive){
		bsem_post_all(thpool_p->__jobqueue.has_jobs);
		time (&end);
		tpassed = difftime(end,start);
	}

	/* Poll remaining threads */
	while (thpool_p->num_threads_alive){
		bsem_post_all(thpool_p->__jobqueue.has_jobs);
		sleep(1);
	}

	/* Job queue cleanup */
	jobqueue_destroy(&thpool_p->__jobqueue);
	/* Deallocs */
	int n;
	for (n=0; n < threads_total; n++){
		thread_destroy(thpool_p->threads[n]);
	}
	free(thpool_p->threads);
	free(thpool_p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %fs:0x28, %rax
movq %rax, -0x18(%rbp)
testq %rdi, %rdi
je 0x6062
movq %rdi, %rbx
movl 0x8(%rdi), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, 0x545f(%rip)      # 0xb42c
leaq -0x20(%rbp), %rdi
callq 0x2280
xorpd %xmm0, %xmm0
leaq -0x28(%rbp), %r14
movsd 0x23aa(%rip), %xmm1     # 0x8390
ucomisd %xmm0, %xmm1
jbe 0x6029
cmpl $0x0, 0x8(%rbx)
je 0x6029
movq 0xa0(%rbx), %rdi
callq 0x607f
movq %r14, %rdi
callq 0x2280
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2160
jmp 0x5fde
movq 0xa0(%rbx), %rdi
callq 0x607f
pushq $0x1
popq %rdi
callq 0x23c0
cmpl $0x0, 0x8(%rbx)
jne 0x6015
leaq 0x68(%rbx), %rdi
callq 0x5e60
xorl %r14d, %r14d
movslq -0x2c(%rbp), %rax
movq (%rbx), %rdi
cmpq %rax, %r14
jge 0x6055
movq (%rdi,%r14,8), %rdi
callq 0x2030
incq %r14
jmp 0x603b
callq 0x2030
movq %rbx, %rdi
callq 0x2030
movq %fs:0x28, %rax
cmpq -0x18(%rbp), %rax
jne 0x607a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/TeaInside[P]teavpn/src/third_party/thpool/thpool.c
// Function: thread_hold
static void thread_hold(int sig_id) {
    (void)sig_id;
	threads_on_hold = 1;
	while (threads_on_hold){
		sleep(1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, 0x5130(%rip)      # 0xb428
pushq $0x1
popq %rbx
cmpl $0x0, 0x5126(%rip)      # 0xb428
je 0x630d
movl %ebx, %edi
callq 0x23c0
jmp 0x62fb
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/TeaInside[P]teavpn/src/third_party/thpool/thpool.c
// Function: jobqueue_pull
static struct job* jobqueue_pull(jobqueue* jobqueue_p){

	pthread_mutex_lock(&jobqueue_p->rwmutex);
	job* job_p = jobqueue_p->front;

	switch(jobqueue_p->len){

		case 0:  /* if no jobs in queue */
		  			break;

		case 1:  /* if one job in queue */
					jobqueue_p->front = NULL;
					jobqueue_p->rear  = NULL;
					jobqueue_p->len = 0;
					break;

		default: /* if >1 jobs in queue */
					jobqueue_p->front = job_p->prev;
					jobqueue_p->len--;
					/* more than one job in queue -> post it */
					bsem_post(jobqueue_p->has_jobs);

	}

	pthread_mutex_unlock(&jobqueue_p->rwmutex);
	return job_p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x23f0
movq 0x28(%rbx), %r14
movl 0x40(%rbx), %eax
testl %eax, %eax
je 0x6358
cmpl $0x1, %eax
jne 0x6343
andl $0x0, 0x40(%rbx)
leaq 0x28(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
jmp 0x6358
movq (%r14), %rcx
movq %rcx, 0x28(%rbx)
decl %eax
movl %eax, 0x40(%rbx)
movq 0x38(%rbx), %rdi
callq 0x6368
movq %rbx, %rdi
callq 0x22b0
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/TeaInside[P]teavpn/src/third_party/thpool/thpool.c
// Function: bsem_init
static void bsem_init(bsem *bsem_p, int value) {
	if (value < 0 || value > 1) {
		err("bsem_init(): Binary semaphore can take only values 1 or 0");
		exit(1);
	}
	pthread_mutex_init(&(bsem_p->mutex), NULL);
	pthread_cond_init(&(bsem_p->cond), NULL);
	bsem_p->v = value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
callq 0x23d0
leaq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x22a0
andl $0x0, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/zhoudian64[P]OS2-exp/mmap_example.c
// Function: main
int main() {
	// U may use dprintf instead of trying to oreooreo fds.
	int fd = open("./data.bin", O_RDWR | O_CREAT, 0666);
	dprintf(fd, "%d\n",8);

	char *p = mmap(NULL, sizeof(char), PROT_READ, MAP_SHARED, fd, 0);
	while (1) {
		printf("%c\n", *p);
		sleep(1);
	}
	munmap(p, sizeof(int));
	close(fd);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xe77(%rip), %rdi       # 0x2004
pushq $0x42
popq %rsi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x1060
movl %eax, %r14d
leaq 0xe69(%rip), %rsi       # 0x200f
pushq $0x8
popq %rdx
movl %eax, %edi
xorl %eax, %eax
callq 0x1050
pushq $0x1
popq %rsi
pushq $0x1
popq %rbx
xorl %edi, %edi
movl %ebx, %edx
movl %ebx, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x1030
movq %rax, %r14
leaq 0xe40(%rip), %r15       # 0x2013
movsbl (%r14), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
movl %ebx, %edi
callq 0x1070
jmp 0x11d3
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test_kstring.c
// Function: test_kputuw_from_to
static int test_kputuw_from_to(kstring_t *str, unsigned int s, unsigned int e) {
    unsigned int i = s;

    for (;;) {
        str->l = 0;
        memset(str->s, 0xff, str->m);
        if (kputuw(i, str) < 0 || !str->s) {
            perror("kputuw");
            return -1;
        }
        if (str->l >= str->m || str->s[str->l] != '\0') {
            fprintf(stderr, "No NUL termination on string from kputuw\n");
            return -1;
        }
        if (i != strtoul(str->s, NULL, 10)) {
            fprintf(stderr,
                    "kputuw wrote the wrong value, expected %u, got %s\n",
                    i, str->s);
            return -1;
        }
        if (i >= e) break;
        i++;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, %ebx
movl %edx, %r15d
pushq $0xa
popq %rbp
andq $0x0, (%r14)
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rdi
movl $0xff, %esi
callq 0x10a0
movl %ebx, %edi
movq %r14, %rsi
callq 0x2422
testl %eax, %eax
js 0x23ca
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x23ca
movq (%r14), %rax
cmpq 0x8(%r14), %rax
jae 0x23d8
cmpb $0x0, (%rdi,%rax)
jne 0x23d8
xorl %esi, %esi
movl %ebp, %edx
callq 0x1070
cmpq %rax, %rbx
jne 0x23f6
leaq 0x1(%rbx), %rax
cmpq %r15, %rbx
movq %rax, %rbx
jb 0x2370
xorl %eax, %eax
jmp 0x2417
leaq 0x1ca5(%rip), %rdi      # 0x4076
callq 0x10e0
jmp 0x2414
movq 0x4bf9(%rip), %rax      # 0x6fd8
movq (%rax), %rcx
leaq 0x1d83(%rip), %rdi      # 0x416c
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
jmp 0x2414
movq 0x4bdb(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq 0x10(%r14), %rcx
leaq 0x1d8b(%rip), %rsi      # 0x4196
movl %ebx, %edx
xorl %eax, %eax
callq 0x1160
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test_kstring.c
// Function: test_kputw_from_to
static int test_kputw_from_to(kstring_t *str, int s, int e) {
    int i = s;

    for (;;) {
        str->l = 0;
        memset(str->s, 0xff, str->m);
        if (kputw(i, str) < 0 || !str->s) {
            perror("kputw");
            return -1;
        }
        if (str->l >= str->m || str->s[str->l] != '\0') {
            fprintf(stderr, "No NUL termination on string from kputw\n");
            return -1;
        }
        if (i != strtol(str->s, NULL, 10)) {
            fprintf(stderr,
                    "kputw wrote the wrong value, expected %d, got %s\n",
                    i, str->s);
            return -1;
        }
        if (i >= e) break;
        i++;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movslq %esi, %r12
movslq %edx, %r15
movl %r12d, %ebx
negl %ebx
pushq $0xa
popq %rbp
andq $0x0, (%r14)
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rdi
movl $0xff, %esi
callq 0x10a0
movl %r12d, %edi
testq %r12, %r12
jns 0x25c6
movq (%r14), %rsi
addq $0x3, %rsi
movq %r14, %rdi
callq 0x2513
testl %eax, %eax
js 0x260f
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r14)
movb $0x2d, (%rcx,%rax)
movl %ebx, %edi
movq %r14, %rsi
callq 0x2422
testl %eax, %eax
js 0x260f
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x260f
movq (%r14), %rax
cmpq 0x8(%r14), %rax
jae 0x261d
cmpb $0x0, (%rdi,%rax)
jne 0x261d
xorl %esi, %esi
movl %ebp, %edx
callq 0x1140
cmpq %rax, %r12
jne 0x263b
leaq 0x1(%r12), %rax
decl %ebx
cmpq %r15, %r12
movq %rax, %r12
jl 0x2581
xorl %eax, %eax
jmp 0x265e
leaq 0x1a67(%rip), %rdi      # 0x407d
callq 0x10e0
jmp 0x265b
movq 0x49b4(%rip), %rax      # 0x6fd8
movq (%rax), %rcx
leaq 0x1b9b(%rip), %rdi      # 0x41c9
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
jmp 0x265b
movq 0x4996(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq 0x10(%r14), %rcx
negl %ebx
leaq 0x1ba0(%rip), %rsi      # 0x41f2
movl %ebx, %edx
xorl %eax, %eax
callq 0x1160
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test_kstring.c
// Function: test_kputll_from_to
static int test_kputll_from_to(kstring_t *str, long long s, long long e) {
    long long i = s;

    for (;;) {
        str->l = 0;
        memset(str->s, 0xff, str->m);
        if (kputll(i, str) < 0 || !str->s) {
            perror("kputll");
            return -1;
        }
        if (str->l >= str->m || str->s[str->l] != '\0') {
            fprintf(stderr, "No NUL termination on string from kputll\n");
            return -1;
        }
        if (i != strtoll(str->s, NULL, 10)) {
            fprintf(stderr,
                    "kputll wrote the wrong value, expected %lld, got %s\n",
                    i, str->s);
            return -1;
        }
        if (i >= e) break;
        i++;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
pushq $0xa
popq %rbp
leaq 0x1fbb(%rip), %r12      # 0x4640
pushq $0x64
popq %r13
andq $0x0, (%r14)
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rdi
movl $0xff, %esi
callq 0x10a0
movq (%r14), %rsi
addq $0x17, %rsi
movq %r14, %rdi
callq 0x2513
testl %eax, %eax
js 0x277e
movq %rbx, %rax
testq %rbx, %rbx
jns 0x26d6
movq %rbx, %rax
negq %rax
movq (%r14), %rcx
movq 0x10(%r14), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r14)
movb $0x2d, (%rdx,%rcx)
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x26f2
movl %eax, %edi
movq %r14, %rsi
callq 0x2422
testl %eax, %eax
jns 0x2747
jmp 0x277e
xorl %ecx, %ecx
pushq $-0x1
popq %rdi
pushq $0x1
popq %rdx
movl %edi, %esi
incl %ecx
imulq $0xa, %rdx, %rdx
leal 0x1(%rsi), %edi
cmpq %rdx, %rax
jae 0x26fa
movq 0x10(%r14), %rdi
addq (%r14), %rdi
cmpq $0xa, %rax
jb 0x272e
xorl %edx, %edx
divq %r13
movl %esi, %r8d
movzwl (%r12,%rdx,2), %edx
movw %dx, (%rdi,%r8)
addl $-0x2, %esi
jmp 0x2711
cmpl $-0x1, %esi
jne 0x2737
orb $0x30, %al
movb %al, (%rdi)
movl %ecx, %eax
addq (%r14), %rax
movq %rax, (%r14)
movq 0x10(%r14), %rcx
movb $0x0, (%rcx,%rax)
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x277e
movq (%r14), %rax
cmpq 0x8(%r14), %rax
jae 0x278c
cmpb $0x0, (%rdi,%rax)
jne 0x278c
xorl %esi, %esi
movl %ebp, %edx
callq 0x1050
cmpq %rax, %rbx
jne 0x27aa
cmpq %r15, %rbx
jge 0x277a
incq %rbx
jmp 0x2689
xorl %eax, %eax
jmp 0x27cc
leaq 0x18fe(%rip), %rdi      # 0x4083
callq 0x10e0
jmp 0x27c9
movq 0x4845(%rip), %rax      # 0x6fd8
movq (%rax), %rcx
leaq 0x1a87(%rip), %rdi      # 0x4224
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x11a0
jmp 0x27c9
movq 0x4827(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq 0x10(%r14), %rcx
leaq 0x1a8f(%rip), %rsi      # 0x424e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1160
pushq $-0x1
popq %rax
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/../htslib/kstring.h
// Function: kinsert_str
static inline int kinsert_str(const char *str, size_t pos, kstring_t *s)
{
    size_t len = 0;
    if (!s || pos > s->l || !str)  {
        return EOF;
    }
    if (!(len = strlen(str))) {
        return 0;
    }
    if (ks_resize(s, s->l + len + 1) < 0) {
        return EOF;
    }
    memmove(s->s + pos + len, s->s + pos, s->l - pos);
    memcpy(s->s + pos, str, len);
    s->l += len;
    s->s[s->l] = '\0';
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbp
testq %rdx, %rdx
je 0x29f6
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdx), %r13
cmpq %rsi, %r13
setb %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x29f6
movq %r14, %rdi
callq 0x1090
testq %rax, %rax
je 0x29f4
movq %rax, %r12
leaq (%rax,%r13), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x2513
testl %eax, %eax
js 0x29f6
movq 0x10(%rbx), %rsi
addq %r15, %rsi
movq %r12, %rdi
addq %rsi, %rdi
movq (%rbx), %rdx
subq %r15, %rdx
callq 0x1180
addq 0x10(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x10d0
movq (%rbx), %rax
addq %r12, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/lib/ae/ae.c
// Function: aeMain
void aeMain(aeEventLoop *eventLoop) {
    eventLoop->stop = 0;
    while (!eventLoop->stop) {
        if (eventLoop->beforesleep != NULL)
            eventLoop->beforesleep(eventLoop);
        aeProcessEvents(eventLoop, AE_ALL_EVENTS|AE_CALL_AFTER_SLEEP);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
andl $0x0, 0x30(%rdi)
xorl %eax, %eax
pushq $0xb
popq %r14
testl %eax, %eax
jne 0x2da9
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x2d99
movq %rbx, %rdi
callq *%rax
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2998
movl 0x30(%rbx), %eax
jmp 0x2d87
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/lib/utf8_decode.c
// Function: utf8_decode_init
void utf8_decode_init(char p[], int length) {
    the_index = 0;
    the_input = p;
    the_length = length;
    the_char = 0;
    the_byte = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0xc425(%rip)      # 0xf200
movq %rdi, 0xc426(%rip)      # 0xf208
andl $0x0, 0xc42b(%rip)      # 0xf214
movl %esi, 0xc421(%rip)      # 0xf210
andl $0x0, 0xc422(%rip)      # 0xf218
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/lib/utf8_decode.c
// Function: utf8_decode_next
int utf8_decode_next() {
    int c;  /* the first byte of the character */
    int c1; /* the first continuation character */
    int c2; /* the second continuation character */
    int c3; /* the third continuation character */
    int r;  /* the result */

    if (the_index >= the_length) {
        return the_index == the_length ? UTF8_END : UTF8_ERROR;
    }
    the_byte = the_index;
    the_char += 1;
    c = get();
/*
    Zero continuation (0 to 127)
*/
    if ((c & 0x80) == 0) {
        return c;
    }
/*
    One continuation (128 to 2047)
*/
    if ((c & 0xE0) == 0xC0) {
        c1 = cont();
        if (c1 >= 0) {
            r = ((c & 0x1F) << 6) | c1;
            if (r >= 128) {
                return r;
            }
        }

/*
    Two continuations (2048 to 55295 and 57344 to 65535)
*/
    } else if ((c & 0xF0) == 0xE0) {
        c1 = cont();
        c2 = cont();
        if ((c1 | c2) >= 0) {
            r = ((c & 0x0F) << 12) | (c1 << 6) | c2;
            if (r >= 2048 && (r < 55296 || r > 57343)) {
                return r;
            }
        }

/*
    Three continuations (65536 to 1114111)
*/
    } else if ((c & 0xF8) == 0xF0) {
        c1 = cont();
        c2 = cont();
        c3 = cont();
        if ((c1 | c2 | c3) >= 0) {
            r = ((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
            if (r >= 65536 && r <= 1114111) {
                return r;
            }
        }
    }
    return UTF8_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0xc3d6(%rip), %eax      # 0xf200
cmpl 0xc3e0(%rip), %eax      # 0xf210
jge 0x2e7e
movl %eax, 0xc3e0(%rip)      # 0xf218
incl 0xc3d6(%rip)            # 0xf214
callq 0x2f4a
movl %eax, %ebx
testb %bl, %bl
jns 0x2f3d
movl %ebx, %eax
andl $0xe0, %eax
cmpl $0xc0, %eax
jne 0x2e8c
callq 0x2f78
testl %eax, %eax
js 0x2f3a
andl $0x1f, %ebx
shll $0x6, %ebx
orl %eax, %ebx
cmpl $0x7f, %ebx
jbe 0x2f3a
jmp 0x2f3d
sete %al
movzbl %al, %ebx
orl $-0x2, %ebx
jmp 0x2f3d
movl %ebx, %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
jne 0x2ee5
callq 0x2f78
movl %eax, %r14d
callq 0x2f78
movl %eax, %ecx
orl %r14d, %ecx
js 0x2f3a
shll $0xc, %ebx
movzwl %bx, %ecx
shll $0x6, %r14d
orl %ecx, %r14d
orl %eax, %r14d
cmpl $0x800, %r14d           # imm = 0x800
setge %al
leal -0xe000(%r14), %ecx
cmpl $0xfffff800, %ecx       # imm = 0xFFFFF800
setb %cl
movl %r14d, %ebx
testb %cl, %al
je 0x2f3a
jmp 0x2f3d
movl %ebx, %eax
andl $0xf8, %eax
cmpl $0xf0, %eax
jne 0x2f3a
callq 0x2f78
movl %eax, %r15d
callq 0x2f78
movl %eax, %r14d
callq 0x2f78
movl %r14d, %ecx
orl %r15d, %ecx
orl %eax, %ecx
js 0x2f3a
andl $0x7, %ebx
shll $0x12, %ebx
shll $0xc, %r15d
shll $0x6, %r14d
orl %r15d, %r14d
orl %ebx, %r14d
orl %eax, %r14d
leal -0x10000(%r14), %eax
movl %r14d, %ebx
cmpl $0x100000, %eax         # imm = 0x100000
jb 0x2f3d
pushq $-0x2
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/lib/cJSON.c
// Function: cJSON_AddItemToObjectCS
CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item)
{
    if ((item == NULL) || (string == NULL))
    {
        return;
    }
    if (!(item->type & cJSON_StringIsConst) && item->string)
    {
        global_hooks.deallocate(item->string);
    }
    item->string = (char*)string;
    item->type |= cJSON_StringIsConst;
    cJSON_AddItemToArray(object, item);
}

// Assembly:
testq %rdx, %rdx
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x3f33
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0x18(%rdx), %eax
btl $0x9, %eax
jb 0x3f61
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x3f61
callq *0xb28a(%rip)           # 0xf1e8
movl 0x18(%rbx), %eax
movq %r15, 0x38(%rbx)
orl $0x200, %eax            # imm = 0x200
movl %eax, 0x18(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3ebb
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_create_ex
struct buffer *buf_create_ex(size_t size, size_t prepend_size)
{
    assert(size > 0);
    assert(prepend_size >= 0);

    size_t sz = size + prepend_size;
    struct buffer *buf = calloc(1, sizeof(*buf));
    if (buf == NULL)
    {
        return NULL;
    }
    buf->buf = calloc(1, sz);
    if (buf->buf == NULL)
    {
        free(buf);
        return NULL;
    }
    buf->sz = sz;
    buf->read_idx = prepend_size;
    buf->write_idx = prepend_size;
    buf->p_sz = prepend_size;
    buf->refcount = 0;
    buf->src = NULL;
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x51cc
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x21b0
testq %rax, %rax
je 0x51bc
movq %rax, %rbx
addq %r14, %r15
pushq $0x1
popq %rdi
movq %r15, %rsi
callq 0x21b0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x51b4
movq %r15, 0x10(%rbx)
movq %r14, (%rbx)
movq %r14, 0x8(%rbx)
movq %r14, 0x18(%rbx)
jmp 0x51be
movq %rbx, %rdi
callq 0x23a0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ed9(%rip), %rdi      # 0x90ac
leaq 0x3edb(%rip), %rsi      # 0x90b5
leaq 0x3edd(%rip), %rcx      # 0x90be
pushq $0x20
popq %rdx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_release
void buf_release(struct buffer *buf)
{
    // 可以嵌套创建readonlyView, 都要检查 refcount
    assert(buf->refcount == 0);

    if (buf->src)
    {
        // 只读视图
        buf->src->refcount--;

        // 缓存 只读视图, 为 mysql 协议解析做的优化
        if (!buf->src->cache)
        {
            buf->src->cache = buf;
        }
        else
        {
            free(buf);
        }
    }
    else
    {
        // 常规 buffer
        free(buf->buf);
        if (buf->cache)
        {
            free(buf->cache);
        }
        free(buf);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpq $0x0, 0x28(%rdi)
jne 0x5238
movq %rdi, %rbx
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x5218
decq 0x28(%rax)
cmpq $0x0, 0x38(%rax)
jne 0x522a
movq %rbx, 0x38(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x20(%rbx), %rdi
callq 0x23a0
movq 0x38(%rbx), %rdi
callq 0x23a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x23a0
leaq 0x3eac(%rip), %rdi      # 0x90eb
leaq 0x3e6f(%rip), %rsi      # 0x90b5
leaq 0x3eb1(%rip), %rcx      # 0x90fe
pushq $0x3b
popq %rdx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_retrieveAsString
void buf_retrieveAsString(struct buffer *buf, size_t len, char *str)
{
    assert(str != NULL);
    memcpy(str, buf_peek(buf), len);
    str[len] = 0;
    buf_retrieve(buf, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x543a
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x20(%rdi), %rsi
addq (%rdi), %rsi
movq %rdx, %rdi
movq %rbx, %rdx
callq 0x2200
movb $0x0, (%r14,%rbx)
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5459
leaq 0x3d82(%rip), %rdi      # 0x91c3
leaq 0x3c6d(%rip), %rsi      # 0x90b5
leaq 0x3d80(%rip), %rcx      # 0x91cf
movl $0x99, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_retrieve
void buf_retrieve(struct buffer *buf, size_t len)
{
    assert(len <= buf_readable(buf));
    if (len < buf_readable(buf))
    {
        buf->read_idx += len;
    }
    else
    {
        buf_retrieveAll(buf);
    }
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq %rsi, %rcx
jb 0x547b
jbe 0x546f
addq %rsi, %rax
jmp 0x5477
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
movq %rax, (%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x3d21(%rip), %rdi      # 0x91a7
leaq 0x3c28(%rip), %rsi      # 0x90b5
leaq 0x3d76(%rip), %rcx      # 0x920a
movl $0xa7, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_ensureWritable
void buf_ensureWritable(struct buffer *buf, size_t len)
{
    ASSERT_WRITE(buf);
    if (buf_writable(buf) < len)
    {
        buf_makeSpace(buf, len);
    }
    assert(buf_writable(buf) >= len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x30(%rdi)
jne 0x55fe
movq %rdi, %r14
cmpq $0x0, 0x28(%rdi)
jne 0x55fe
movq %rsi, %rbx
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rcx
movq %rcx, %rax
subq %rsi, %rax
cmpq %rbx, %rax
jae 0x55ee
movq (%r14), %rax
movq 0x18(%r14), %rdi
movq %rsi, %r15
subq %rax, %r15
addq %rax, %rcx
subq %rsi, %rcx
subq %rdi, %rcx
cmpq %rbx, %rcx
jae 0x55bf
addq %rbx, %rsi
movq %r14, %rdi
callq 0x5746
jmp 0x55d9
cmpq %rax, %rdi
jae 0x563c
movq 0x20(%r14), %rcx
addq %rcx, %rdi
addq %rcx, %rax
movq %rax, %rsi
movq %r15, %rdx
callq 0x2290
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq %rcx, (%r14)
addq %rcx, %r15
movq %r15, 0x8(%r14)
subq %r15, %rax
cmpq %rbx, %rax
jb 0x561d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3b62(%rip), %rdi      # 0x9167
leaq 0x3aa9(%rip), %rsi      # 0x90b5
leaq 0x3c88(%rip), %rcx      # 0x929b
movl $0xee, %edx
callq 0x2150
leaq 0x3ca8(%rip), %rdi      # 0x92cc
leaq 0x3a8a(%rip), %rsi      # 0x90b5
leaq 0x3c69(%rip), %rcx      # 0x929b
movl $0xf3, %edx
callq 0x2150
leaq 0x403f(%rip), %rdi      # 0x9682
leaq 0x3a6b(%rip), %rsi      # 0x90b5
leaq 0x404b(%rip), %rcx      # 0x969c
movl $0xe3, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_append
void buf_append(struct buffer *buf, const char *data, size_t len)
{
    ASSERT_WRITE(buf);
    buf_ensureWritable(buf, len);
    memcpy(buf_beginWrite(buf), data, len);
    buf_has_written(buf, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x30(%rdi)
jne 0x56af
movq %rdi, %r14
cmpq $0x0, 0x28(%rdi)
jne 0x56af
movq %rdx, %rbx
movq %rsi, %r15
movq %r14, %rdi
movq %rdx, %rsi
callq 0x5562
movq 0x20(%r14), %rdi
addq 0x8(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2200
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x529e
leaq 0x3ab1(%rip), %rdi      # 0x9167
leaq 0x39f8(%rip), %rsi      # 0x90b5
leaq 0x3c21(%rip), %rcx      # 0x92e5
movl $0xf8, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_swap
static void buf_swap(struct buffer *buf, size_t nsz)
{
    // TODO nsz > buf->size realloc ?
    assert(nsz >= buf_readable(buf));
    void *nbuf = calloc(1, nsz);
    assert(nbuf);
    memcpy(nbuf + buf->p_sz, buf_peek(buf), buf_readable(buf));
    free(buf->buf);
    buf->buf = nbuf;
    buf->sz = nsz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
movq 0x8(%rdi), %r12
subq %r15, %r12
cmpq %rsi, %r12
ja 0x57b6
movq %rdi, %r14
pushq $0x1
popq %rdi
movq %rsi, -0x30(%rbp)
callq 0x21b0
testq %rax, %rax
je 0x57d5
movq %rax, %r13
movq 0x18(%r14), %rdi
addq %rax, %rdi
movq 0x20(%r14), %rbx
addq %rbx, %r15
movq %r15, %rsi
movq %r12, %rdx
callq 0x2200
movq %rbx, %rdi
callq 0x23a0
movq %r13, 0x20(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3f0b(%rip), %rdi      # 0x96c8
leaq 0x38f1(%rip), %rsi      # 0x90b5
leaq 0x3f16(%rip), %rcx      # 0x96e1
movl $0xd0, %edx
callq 0x2150
leaq 0x3f2c(%rip), %rdi      # 0x9708
leaq 0x38d2(%rip), %rsi      # 0x90b5
leaq 0x3ef7(%rip), %rcx      # 0x96e1
movl $0xd2, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt64
int64_t buf_peekInt64(const struct buffer *buf)
{
    assert(buf_readable(buf) >= sizeof(int64_t));
    int64_t be64 = 0;
    memcpy(&be64, buf_peek(buf), sizeof(int64_t));
    return be64toh(be64);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x7, %rcx
jbe 0x59de
movq 0x20(%rdi), %rcx
movq (%rcx,%rax), %rax
bswapq %rax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x39b0(%rip), %rdi      # 0x9399
leaq 0x36c5(%rip), %rsi      # 0x90b5
leaq 0x39c7(%rip), %rcx      # 0x93be
movl $0x15f, %edx            # imm = 0x15F
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt32
int32_t buf_peekInt32(const struct buffer *buf)
{
    assert(buf_readable(buf) >= sizeof(int32_t));
    int32_t be32 = 0;
    memcpy(&be32, buf_peek(buf), sizeof(int32_t));
    return be32toh(be32);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x3, %rcx
jbe 0x5a1b
movq 0x20(%rdi), %rcx
movl (%rcx,%rax), %eax
bswapl %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x39c5(%rip), %rdi      # 0x93eb
leaq 0x3688(%rip), %rsi      # 0x90b5
leaq 0x39dc(%rip), %rcx      # 0x9410
movl $0x167, %edx            # imm = 0x167
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt16
int16_t buf_peekInt16(const struct buffer *buf)
{
    assert(buf_readable(buf) >= sizeof(int16_t));
    int16_t be16 = 0;
    memcpy(&be16, buf_peek(buf), sizeof(int16_t));
    return be16toh(be16);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x1, %rcx
jbe 0x5a5b
movq 0x20(%rdi), %rcx
movzwl (%rcx,%rax), %eax
rolw $0x8, %ax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x39d7(%rip), %rdi      # 0x943d
leaq 0x3648(%rip), %rsi      # 0x90b5
leaq 0x39ee(%rip), %rcx      # 0x9462
movl $0x16f, %edx            # imm = 0x16F
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt64LE
int64_t buf_peekInt64LE(const struct buffer *buf)
{
    assert(buf_readable(buf) >= sizeof(int64_t));
    int64_t le64 = 0;
    memcpy(&le64, buf_peek(buf), sizeof(int64_t));
    return le64toh(le64);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x7, %rcx
jbe 0x5acb
movq 0x20(%rdi), %rcx
movq (%rcx,%rax), %rax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x38c3(%rip), %rdi      # 0x9399
leaq 0x35d8(%rip), %rsi      # 0x90b5
leaq 0x39fa(%rip), %rcx      # 0x94de
movl $0x17d, %edx            # imm = 0x17D
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt32LE
int32_t buf_peekInt32LE(const struct buffer *buf)
{
    assert(buf_readable(buf) >= sizeof(int32_t));
    int32_t le32 = 0;
    memcpy(&le32, buf_peek(buf), sizeof(int32_t));
    return le32toh(le32);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x3, %rcx
jbe 0x5b06
movq 0x20(%rdi), %rcx
movl (%rcx,%rax), %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x38da(%rip), %rdi      # 0x93eb
leaq 0x359d(%rip), %rsi      # 0x90b5
leaq 0x39ee(%rip), %rcx      # 0x950d
movl $0x185, %edx            # imm = 0x185
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt32LE24
int32_t buf_peekInt32LE24(const struct buffer *buf)
{
    assert(buf_readable(buf) >= 3);
    int32_t le32 = 0x00000000; /* 0x000000{00 小端高位未使用} */
    memcpy(&le32, buf_peek(buf), 3);
    return le32toh(le32);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x2, %rcx
jbe 0x5b4c
movq 0x20(%rdi), %rcx
movzwl (%rcx,%rax), %edx
movzbl 0x2(%rcx,%rax), %eax
shll $0x10, %eax
orl %edx, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x39e5(%rip), %rdi      # 0x953c
leaq 0x3557(%rip), %rsi      # 0x90b5
leaq 0x39ee(%rip), %rcx      # 0x9553
movl $0x18d, %edx            # imm = 0x18D
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_peekInt16LE
int16_t buf_peekInt16LE(const struct buffer *buf)
{
    assert(buf_readable(buf) >= sizeof(int16_t));
    int16_t le16 = 0;
    memcpy(&le16, buf_peek(buf), sizeof(int16_t));
    return le16toh(le16);
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x1, %rcx
jbe 0x5b88
movq 0x20(%rdi), %rcx
movzwl (%rcx,%rax), %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x38aa(%rip), %rdi      # 0x943d
leaq 0x351b(%rip), %rsi      # 0x90b5
leaq 0x39e3(%rip), %rcx      # 0x9584
movl $0x195, %edx            # imm = 0x195
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_readCStr
char *buf_readCStr(struct buffer *buf, char *str, int sz)
{
    int sz1;
    const char *eos = buf_findChar(buf, '\0');

    if (eos == NULL)
    {
        sz1 = buf_readable(buf) + 1;
    }
    else
    {
        sz1 = eos - buf_peek(buf) + 1;
    }

    if (sz < sz1)
    {
        return NULL;
    }

    memcpy(str, buf_peek(buf), sz);
    if (eos == NULL)
    {
        buf_retrieve(buf, sz1 - 1);
    }
    else
    {
        buf_retrieve(buf, sz1);
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, -0x30(%rbp)
movq %rdi, %r14
xorl %esi, %esi
callq 0x538f
movq %rax, %r12
movq (%r14), %rsi
testq %rax, %rax
je 0x5cf7
movq 0x20(%r14), %rax
addq %rsi, %rax
movq %r12, %r13
subq %rax, %r13
jmp 0x5cfe
movq 0x8(%r14), %r13
subq %rsi, %r13
leal 0x1(%r13), %ebx
cmpl %r15d, %ebx
jle 0x5d0c
xorl %r15d, %r15d
jmp 0x5d34
addq 0x20(%r14), %rsi
movslq %r15d, %rdx
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x2200
testq %r12, %r12
movslq %r13d, %rax
movslq %ebx, %rsi
cmoveq %rax, %rsi
movq %r14, %rdi
callq 0x5459
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_dupCStr
char *buf_dupCStr(struct buffer *buf)
{
    int sz;
    const char *eos = buf_findChar(buf, '\0');

    if (eos == NULL)
    {
        sz = buf_readable(buf) + 1;
    }
    else
    {
        sz = eos - buf_peek(buf) + 1;
    }

    char *str = calloc(sz, 1);
    if (str == NULL)
    {
        return NULL;
    }

    memcpy(str, buf_peek(buf), sz);
    if (eos == NULL)
    {
        buf_retrieve(buf, sz - 1);
    }
    else
    {
        buf_retrieve(buf, sz);
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
callq 0x538f
movq (%rbx), %r12
testq %rax, %rax
movq %rax, -0x30(%rbp)
je 0x5dcf
movq 0x20(%rbx), %rcx
addq %r12, %rcx
movq %rax, %r15
subq %rcx, %r15
jmp 0x5dd6
movq 0x8(%rbx), %r15
subq %r12, %r15
shlq $0x20, %r15
movabsq $0x100000000, %r13      # imm = 0x100000000
addq %r15, %r13
sarq $0x20, %r13
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x21b0
movq %rax, %r14
testq %rax, %rax
je 0x5e28
addq 0x20(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2200
sarq $0x20, %r15
cmpq $0x0, -0x30(%rbp)
cmovneq %r13, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5459
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_dupStr
char *buf_dupStr(struct buffer *buf, int sz)
{
    if (buf_readable(buf) < sz)
    {
        sz = buf_readable(buf);
    }
    char *str = malloc(sz + 1);
    if (str == NULL)
    {
        return NULL;
    }

    memcpy(str, buf_peek(buf), sz);
    str[sz] = '\0';

    buf_retrieve(buf, sz);
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %rax
subq %r14, %rax
movslq %esi, %r12
cmpq %r12, %rax
cmovbl %eax, %r12d
leal 0x1(%r12), %eax
movslq %eax, %rdi
callq 0x23a8
movq %rax, %r15
testq %rax, %rax
je 0x5e96
addq 0x20(%rbx), %r14
movslq %r12d, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2200
movb $0x0, (%r15,%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5459
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_readFd
ssize_t buf_readFd(struct buffer *buf, int fd, int *errno_)
{
    ASSERT_WRITE(buf);
    char extrabuf[65535];
    struct iovec vec[2];
    size_t writable = buf_writable(buf);
    vec[0].iov_base = buf_beginWrite(buf);
    vec[0].iov_len = writable;
    vec[1].iov_base = extrabuf;
    vec[1].iov_len = sizeof(extrabuf);

    int iovcnt = writable < sizeof(extrabuf) ? 2 : 1;
    ssize_t n = readv(fd, vec, iovcnt);
    if (n < 0)
    {
        *errno_ = n;
    }
    else if (n <= writable)
    {
        buf->write_idx += n;
    }
    else
    {
        buf->write_idx = buf->sz;
        buf_append(buf, (char *)(&extrabuf[0]), n - writable);
    }

    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10020, %rsp          # imm = 0x10020
cmpq $0x0, 0x30(%rdi)
jne 0x5f55
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x5f55
movq %rdx, %r14
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r12
subq %rcx, %r12
addq 0x20(%rbx), %rcx
leaq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq %r12, 0x8(%rax)
leaq -0x10040(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0xffff, %ecx           # imm = 0xFFFF
movq %rcx, 0x18(%rax)
xorl %edx, %edx
cmpq %rcx, %r12
adcl $0x1, %edx
movl %esi, %edi
movq %rax, %rsi
callq 0x2280
movq %rax, %r15
testq %rax, %rax
js 0x5f39
movq %r15, %rdx
subq %r12, %rdx
jbe 0x5f3e
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
leaq -0x10040(%rbp), %rsi
movq %rbx, %rdi
callq 0x565b
jmp 0x5f42
movl %r15d, (%r14)
jmp 0x5f42
addq %r15, 0x8(%rbx)
movq %r15, %rax
addq $0x10020, %rsp          # imm = 0x10020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x320b(%rip), %rdi      # 0x9167
leaq 0x3152(%rip), %rsi      # 0x90b5
leaq 0x3649(%rip), %rcx      # 0x95b3
movl $0x235, %edx            # imm = 0x235
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/buffer.c
// Function: buf_readonlyView
struct buffer *buf_readonlyView(struct buffer *buf, int sz)
{
    assert(sz > 0);
    if (sz > buf_readable(buf))
    {
        sz = buf_readable(buf);
    }

    struct buffer *rbuf;

    if (buf->cache)
    {
        memset(buf->cache, 0, sizeof(*(buf->cache)));
        rbuf = buf->cache;
        buf->cache = NULL;
    }
    else
    {
        rbuf = calloc(1, sizeof(*buf));
        if (rbuf == NULL)
        {
            return NULL;
        }
    }

    rbuf->buf = buf->buf + buf->read_idx; // buf_peek(buf)
    rbuf->sz = sz;
    rbuf->read_idx = 0;
    rbuf->write_idx = sz;
    rbuf->p_sz = 0;
    rbuf->refcount = 0;
    rbuf->src = buf;
    buf->refcount++;
    return rbuf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
jle 0x601b
movq %rdi, %rbx
movl %esi, %eax
movq (%rdi), %r15
movq 0x8(%rdi), %r14
subq %r15, %r14
cmpq %rax, %r14
cmovael %esi, %r14d
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x5fd3
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq (%rbx), %r15
movq 0x38(%rbx), %rax
andq $0x0, 0x38(%rbx)
jmp 0x5fe3
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x21b0
testq %rax, %rax
je 0x6017
addq 0x20(%rbx), %r15
movq %r15, 0x20(%rax)
movl %r14d, %ecx
movq %rcx, 0x10(%rax)
andq $0x0, (%rax)
movq %rcx, 0x8(%rax)
andq $0x0, 0x18(%rax)
andq $0x0, 0x28(%rax)
movq %rbx, 0x30(%rax)
incq 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x600c
leaq 0x35c1(%rip), %rdi      # 0x95e3
leaq 0x308c(%rip), %rsi      # 0x90b5
leaq 0x35ba(%rip), %rcx      # 0x95ea
movl $0x25d, %edx            # imm = 0x25D
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/socket.c
// Function: socket_create_
static int socket_create_(bool nonblock)
{
#ifdef __APPLE__
    int sockfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
#else
    int sockfd = socket(PF_INET, SOCK_STREAM | (nonblock ? SOCK_NONBLOCK : 0) | SOCK_CLOEXEC, IPPROTO_TCP);
#endif

    if (sockfd < 0)
    {
        perror("ERROR socket");
        return -1;
    }

#ifdef __APPLE__
    if (nonblock)
    {
        socket_setNonblock(sockfd);
    }
#endif

    int yes = 1;
    setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes));
    setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
#ifdef SO_REUSEPORT
    setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes));
#endif
    setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));

    // !! for server
    signal(SIGPIPE, SIG_IGN);
    return sockfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
shll $0xb, %edi
leal 0x80001(%rdi), %esi
pushq $0x2
popq %rdi
pushq $0x6
popq %rdx
callq 0x2390
testl %eax, %eax
js 0x63c7
movl %eax, %ebx
leaq -0x24(%rbp), %r14
movl $0x1, (%r14)
pushq $0x6
popq %rsi
pushq $0x1
popq %r12
pushq $0x4
popq %r15
movl %eax, %edi
movl %r12d, %edx
movq %r14, %rcx
movl %r15d, %r8d
callq 0x2090
pushq $0x2
popq %rdx
movl %ebx, %edi
movl %r12d, %esi
movq %r14, %rcx
movl %r15d, %r8d
callq 0x2090
pushq $0xf
popq %rdx
movl %ebx, %edi
movl %r12d, %esi
movq %r14, %rcx
movl %r15d, %r8d
callq 0x2090
pushq $0x9
popq %rdx
movl %ebx, %edi
movl %r12d, %esi
movq %r14, %rcx
movl %r15d, %r8d
callq 0x2090
pushq $0xd
popq %rdi
pushq $0x1
popq %rsi
callq 0x21d0
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3388(%rip), %rdi      # 0x9756
callq 0x22a0
pushq $-0x1
popq %rbx
jmp 0x63b8
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/socket.c
// Function: socket_sendAllSync
size_t socket_sendAllSync(int sockfd, const char *buf, size_t size)
{
    size_t sent = 0;
    while (sent < size)
    {
        ssize_t n = send(sockfd, buf + sent, size - sent, 0);
        if (n == -1)
        {
            if (errno == EINTR)
            {
                continue;
            }
            else
            {
                perror("ERROR send");
                break;
            }
        }
        sent += n;
    }

    return sent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %edi, %r12d
xorl %ebx, %ebx
movq %rsi, -0x30(%rbp)
leaq (%rsi,%rbx), %r13
movq %r15, %r14
subq %rbx, %r14
cmpq %rbx, %r15
jbe 0x65a5
movl %r12d, %edi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x20f0
cmpq $-0x1, %rax
jne 0x6590
callq 0x2050
cmpl $0x4, (%rax)
je 0x6569
jmp 0x6599
addq %rax, %rbx
movq -0x30(%rbp), %rsi
jmp 0x655f
leaq 0x31a0(%rip), %rdi      # 0x9740
callq 0x22a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/socket.c
// Function: socket_recvAllSync
size_t socket_recvAllSync(int sockfd, char *buf, size_t size)
{
    size_t recved = 0;
    while (recved < size)
    {
        ssize_t n = recv(sockfd, buf + recved, size - recved, 0);
        if (n == -1)
        {
            if (errno == EINTR)
            {
                continue;
            }
            else
            {
                perror("ERROR recv");
                recved = -1;
                break;
            }
        }
        else if (n == 0)
        {
            break; // EOF
        }
        else
        {
            recved += n;
        }
    }

    return recved;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %edi, %r12d
xorl %ebx, %ebx
movq %rsi, -0x30(%rbp)
leaq (%rsi,%rbx), %r13
movq %r15, %r14
subq %rbx, %r14
cmpq %rbx, %r15
jbe 0x661f
movl %r12d, %edi
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x2040
cmpq $-0x1, %rax
jne 0x6602
callq 0x2050
cmpl $0x4, (%rax)
je 0x65db
jmp 0x6610
testq %rax, %rax
je 0x661f
addq %rax, %rbx
movq -0x30(%rbp), %rsi
jmp 0x65d1
leaq 0x3134(%rip), %rdi      # 0x974b
callq 0x22a0
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/sa.c
// Function: sa_create
union sockaddr_all
sa_create(uint16_t port, bool loopback_only)
{
    union sockaddr_all u;
    memset(&u, 0, sizeof(u));
    u.v4.sin_family = AF_INET;
    in_addr_t addr = loopback_only ? INADDR_LOOPBACK : INADDR_ANY;
    u.v4.sin_addr.s_addr = htonl(addr);
    u.v4.sin_port = htons(port);
    return u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
xorps %xmm0, %xmm0
andl $0x0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movw $0x2, (%rdi)
testl %edx, %edx
movl $0x7f000001, %ecx       # imm = 0x7F000001
cmovel %edx, %ecx
bswapl %ecx
movl %ecx, 0x4(%rdi)
rolw $0x8, %si
movw %si, 0x2(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/sa.c
// Function: sa_createV6
union sockaddr_all
sa_createV6(uint16_t port, bool loopback_only)
{
    union sockaddr_all u;
    memset(&u, 0, sizeof(u));
    u.v6.sin6_family = AF_INET6;
    u.v6.sin6_addr = loopback_only ? in6addr_loopback : in6addr_any;
    u.v6.sin6_port = htons(port);
    return u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
xorps %xmm0, %xmm0
andq $0x0, 0x14(%rdi)
movups %xmm0, 0x4(%rdi)
movw $0xa, (%rdi)
leaq 0x8(%rdi), %rcx
testl %edx, %edx
je 0x66c5
movq 0x88fd(%rip), %rdx      # 0xefc0
jmp 0x66cc
movq 0x88ec(%rip), %rdx      # 0xefb8
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
rolw $0x8, %si
movw %si, 0x2(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/sa.c
// Function: sa_fromip
union sockaddr_all
sa_fromip(const char *ip, uint16_t port)
{
    union sockaddr_all u;
    memset(&u, 0, sizeof(u));
    u.v4.sin_family = AF_INET;
    if (inet_pton(AF_INET, ip, &(u.v4.sin_addr)) <= 0)
    {
        fprintf(stderr, "ERROR inet_pton %s", ip);
    }
    u.v4.sin_port = htons(port);
    return u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0xc(%rdi)
movw $0x2, (%rdi)
leaq 0x4(%rdi), %rdx
pushq $0x2
popq %rdi
callq 0x2210
testl %eax, %eax
jle 0x6724
rolw $0x8, %bx
movw %bx, 0x2(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x88cd(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3126(%rip), %rsi      # 0x985b
movq %r15, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x670d
// File: /workspace/github_c_makefile_star2_O2/goghcrow[P]dubbo_ab/sa.c
// Function: sa_fromipV6
union sockaddr_all
sa_fromipV6(const char *ip, uint16_t port)
{
    union sockaddr_all u;
    memset(&u, 0, sizeof(u));
    u.v6.sin6_family = AF_INET6;
    if (inet_pton(AF_INET6, ip, &(u.v6.sin6_addr)) <= 0)
    {
        fprintf(stderr, "ERROR inet_pton %s", ip);
    }
    u.v6.sin6_port = htons(port);
    return u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0xc(%rdi)
movw $0xa, (%rdi)
leaq 0x8(%rdi), %rdx
pushq $0xa
popq %rdi
callq 0x2210
testl %eax, %eax
jle 0x6789
rolw $0x8, %bx
movw %bx, 0x2(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8868(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x30c1(%rip), %rsi      # 0x985b
movq %r15, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x6772