LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/redis-check-aof.c
// Function: readLong
int readLong(FILE *fp, char prefix, long *target) {
    char buf[128], *eptr;

    epos = ftello(fp);

    // 读入行
    if (fgets(buf,sizeof(buf),fp) == NULL) {
        return 0;
    }

    // 确保前缀相同
    if (buf[0] != prefix) {
        ERROR("Expected prefix '%c', got: '%c'",buf[0],prefix);
        return 0;
    }

    // 将字符串转换成 long 值
    *target = strtol(buf+1,&eptr,10);

    return consumeNewline(eptr);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x480, %rsp            # imm = 0x480
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x1090
movq %rax, 0x31f2(%rip)      # 0x44d0
movq %rsp, %rdi
movl $0x80, %esi
movq %r14, %rdx
callq 0x10a0
testq %rax, %rax
je 0x1325
movsbl (%rsp), %edx
cmpb %bpl, %dl
jne 0x1329
leaq 0x1(%rsp), %rdi
leaq 0x80(%rsp), %r14
movq %r14, %rsi
movl $0xa, %edx
callq 0x10e0
movq %rax, (%rbx)
movq (%r14), %rdi
callq 0x125c
movl %eax, %ebx
jmp 0x1367
xorl %ebx, %ebx
jmp 0x1367
movsbl %bpl, %ecx
leaq 0xcfa(%rip), %rsi       # 0x202e
xorl %ebx, %ebx
leaq 0x80(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x1130
movq 0x3181(%rip), %rdx      # 0x44d0
leaq 0x2d7a(%rip), %rdi      # 0x40d0
leaq 0xcc4(%rip), %rsi       # 0x2021
movq %r14, %rcx
xorl %eax, %eax
callq 0x1130
movl %ebx, %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/redis-check-aof.c
// Function: readBytes
int readBytes(FILE *fp, char *target, long length) {
    long real;

    epos = ftello(fp);

    real = fread(target,1,length,fp);
    if (real != length) {
        ERROR("Expected to read %ld bytes, got %ld bytes",length,real);
        return 0;
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x1090
movq %rax, 0x3139(%rip)      # 0x44d0
movl $0x1, %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x1060
movl $0x1, %ebp
cmpq %rbx, %rax
je 0x13ef
leaq 0xc93(%rip), %rsi       # 0x204e
xorl %ebp, %ebp
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1130
movq 0x30f9(%rip), %rdx      # 0x44d0
leaq 0x2cf2(%rip), %rdi      # 0x40d0
leaq 0xc3c(%rip), %rsi       # 0x2021
movq %r14, %rcx
xorl %eax, %eax
callq 0x1130
movl %ebp, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/redis-check-aof.c
// Function: readString
int readString(FILE *fp, char** target) {

    // 读取字符串的长度
    long len;
    *target = NULL;
    if (!readLong(fp,'$',&len)) {
        return 0;
    }

    /* Increase length to also consume \r\n */
    len += 2;

    // 为字符串分配空间
    *target = (char*)malloc(len);

    // 读取内容
    if (!readBytes(fp,*target,len)) {
        return 0;
    }

    // 确认 \r\n
    if (!consumeNewline(*target+len-2)) {
        return 0;
    }

    (*target)[len-2] = '\0';

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq $0x0, (%rsi)
movq %rsp, %rdx
movl $0x24, %esi
callq 0x12bf
xorl %ebp, %ebp
testl %eax, %eax
je 0x146d
movq (%rsp), %r14
addq $0x2, %r14
movq %r14, %rdi
callq 0x1100
movq %rax, (%rbx)
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1375
testl %eax, %eax
je 0x146d
movq (%rbx), %rax
leaq (%rax,%r14), %rdi
addq $-0x2, %rdi
callq 0x125c
testl %eax, %eax
je 0x146d
movq (%rbx), %rax
movb $0x0, -0x2(%rax,%r14)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/CSerxzm[P]WindowstoLinuxInterface/src/CD.c
// Function: main
int main(int argc, char *argv[])
{
    char lines[argc+1][255];
    char cwd[100];
    predealLine(argc, argv, lines);
    if(argc!=2)
    {
		printf("参数数目不正确.\n");
		return 0; 
    }
    if(!chdir(lines[1]))
    {
		printf("当前工作文件夹改变到：");
        if(getcwd(cwd,sizeof(cwd)) != NULL)
	{
		puts(cwd);  
	}
	else
	{
		perror("getcwd");
	}
    }
    else
    {
		perror("chdir"); 
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl %edi, %r14d
leal 0x1(%r14), %eax
movq %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %rax    # imm = 0x1FFFFFFFFF0
andq %rcx, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq %rbx, %rdx
callq 0x11ac
cmpl $0x2, %r14d
jne 0x132b
addq $0xff, %rbx
movq %rbx, %rdi
callq 0x1050
testl %eax, %eax
jne 0x1342
leaq 0xcf9(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1060
leaq -0x80(%rbp), %rdi
movl $0x64, %esi
callq 0x1070
testq %rax, %rax
je 0x134b
leaq -0x80(%rbp), %rdi
jmp 0x1332
leaq 0xd01(%rip), %rdi       # 0x2033
callq 0x1030
xorl %eax, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xce4(%rip), %rdi       # 0x202d
jmp 0x1352
leaq 0xcd4(%rip), %rdi       # 0x2026
callq 0x1080
jmp 0x1337
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/server/worker.c
// Function: start_worker
int start_worker(struct server_worker_data *data)
{
	pthread_attr_t attr;
	int ret;

	ret = pthread_attr_init(&attr);
	if (ret)
		return -ret;
	ret = pthread_attr_setstacksize(&attr, WORKER_STACK_SIZE);
	if (ret)
		return -ret;
	ret = pthread_create(&data->tid, &attr, worker_main, data);

	pthread_attr_destroy(&attr);
	return -ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x10f0
testl %eax, %eax
jne 0x1c4c
leaq 0x8(%rsp), %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x1240
testl %eax, %eax
je 0x1c5b
movl %eax, %ebp
negl %ebp
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x28(%rbx), %rdi
leaq 0x1c(%rip), %rdx        # 0x1c82
leaq 0x8(%rsp), %r14
movq %r14, %rsi
movq %rbx, %rcx
callq 0x1150
movl %eax, %ebp
movq %r14, %rdi
callq 0x11b0
jmp 0x1c4e
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/server/worker.c
// Function: worker_main
static void *worker_main(void *_data)
{
	struct server_worker_data *data = _data;
	bool do_write = data->reply;
	bool eof = false;
	int ret;

	pthread_cleanup_push(cleanup_close, data);

	while (!eof) {
		ret = recv_msg(data, &eof);
		if (ret < 0 || eof)
			break;
		if (do_write) {
			ret = send_msg(data);
			if (ret < 0)
				break;
		}
	}

	pthread_cleanup_pop(1);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
movb 0x18(%rdi), %r12b
movq %rsp, %rdi
xorl %esi, %esi
callq 0x1200
testl %eax, %eax
jne 0x1dba
movq %rsp, %rdi
callq 0x11e0
xorl %ebp, %ebp
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x1d0e
movq 0x10(%rbx), %r15
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x1030
testq %rax, %rax
jns 0x1ce1
callq 0x1040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x1cbe
jmp 0x1d14
je 0x1d9b
addq %rax, %r15
movdqu 0x38(%rbx), %xmm0
movq %rax, %xmm1
movdqa 0x1684(%rip), %xmm2     # 0x3380
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x38(%rbx)
subq %rax, %r14
jne 0x1cbe
incq 0x30(%rbx)
jmp 0x1d1f
movl %eax, %ecx
negl %ecx
movl %ecx, 0x60(%rbx)
testl %eax, %eax
jg 0x1d9b
testb %r12b, %r12b
je 0x1cb1
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x1d7b
movq 0x10(%rbx), %r15
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x10a0
testq %rax, %rax
jns 0x1d54
callq 0x1040
movl (%rax), %ecx
cmpl $0x4, %ecx
je 0x1d31
jmp 0x1d84
addq %rax, %r15
movdqu 0x50(%rbx), %xmm0
movq %rax, %xmm1
movdqa 0x1617(%rip), %xmm2     # 0x3380
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x50(%rbx)
subq %rax, %r14
jne 0x1d31
incq 0x48(%rbx)
jmp 0x1cb1
cmpl $0x20, %ecx
jne 0x1d8d
xorl %ecx, %ecx
jmp 0x1d8f
negl %ecx
movl %ecx, 0x60(%rbx)
cmpl $0x0, (%rax)
jle 0x1cb1
movq %rsp, %rdi
callq 0x10c0
movl 0x4(%rbx), %edi
callq 0x10e0
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rbx), %edi
callq 0x1dca
movq %rsp, %rdi
callq 0x1120
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: parse_ulong_delim
int parse_ulong_delim(const char *name, const char *str, unsigned long *val,
		      char delimiter, const char **next)
{
	unsigned long factor = 1;
	char *eptr;
	char c;

	if (!*str)
		goto invalid;
	*val = strtoul(str, &eptr, 10);

	c = *eptr++;
	switch(c) {
	case '\0':
		eptr--;
		break;
	case 'k':
		factor = 1000UL;
		break;
	case 'K':
		factor = 1UL << 10;
		break;
	case 'm':
		factor = 1000000UL;
		break;
	case 'M':
		factor = 1UL << 20;
		break;
	case 'g':
		factor = 1000000000UL;
		break;
	case 'G':
		factor = 1UL << 30;
		break;
	case 't':
		factor = 1000000000000UL;
		break;
	case 'T':
		factor = 1UL << 40;
		break;
	default:
		eptr--;
		break;
	}
	if (*eptr) {
	       if (*eptr != delimiter)
		       goto invalid;
	}

	if (*val > ULONG_MAX / factor) {
		fprintf(stderr, "value '%s' of %s too large\n", str, name);
		return -EINVAL;
	}
	*val *= factor;
	if (next)
		*next = eptr;
	return 0;

invalid:
	fprintf(stderr, "invalid value '%s' of %s\n", str, name);
	return -EINVAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, (%rsi)
je 0x1ec9
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r12
movq %rsp, %r13
movq %r14, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x11a0
movq %rax, %rcx
movq %rax, (%r12)
movq (%r13), %rdi
leaq 0x1(%rdi), %rax
movzbl (%rdi), %edx
cmpl $0x53, %edx
jle 0x1e3c
cmpl $0x6a, %edx
jle 0x1e62
cmpl $0x6b, %edx
je 0x1e81
cmpl $0x6d, %edx
je 0x1e94
cmpl $0x74, %edx
jne 0x1e73
movabsq $0xe8d4a51000, %rsi     # imm = 0xE8D4A51000
jmp 0x1e99
cmpl $0x4a, %edx
jg 0x1e51
testl %edx, %edx
je 0x1e73
cmpl $0x47, %edx
jne 0x1e73
movl $0x40000000, %esi       # imm = 0x40000000
jmp 0x1e99
cmpl $0x4b, %edx
je 0x1e7a
cmpl $0x4d, %edx
jne 0x1e73
movl $0x100000, %esi         # imm = 0x100000
jmp 0x1e99
cmpl $0x54, %edx
je 0x1e88
cmpl $0x67, %edx
jne 0x1e73
movl $0x3b9aca00, %esi       # imm = 0x3B9ACA00
jmp 0x1e99
movl $0x1, %esi
jmp 0x1e9c
movl $0x400, %esi            # imm = 0x400
jmp 0x1e99
movl $0x3e8, %esi            # imm = 0x3E8
jmp 0x1e99
movabsq $0x10000000000, %rsi    # imm = 0x10000000000
jmp 0x1e99
movl $0xf4240, %esi          # imm = 0xF4240
movq %rax, %rdi
movb (%rdi), %al
testb %al, %al
setne %dl
cmpb %bpl, %al
setne %al
testb %al, %dl
jne 0x1ec9
movq %rsi, %rax
mulq %rcx
jo 0x1edc
imulq %rcx, %rsi
movq %rsi, (%r12)
xorl %eax, %eax
testq %r15, %r15
je 0x1eff
movq %rdi, (%r15)
jmp 0x1eff
movq 0x3128(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x14e4(%rip), %rsi      # 0x33be
jmp 0x1eed
movq 0x3115(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x14b5(%rip), %rsi      # 0x33a2
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1100
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: parse_ulong_range_delim
int parse_ulong_range_delim(const char *name, const char *str,
			    unsigned long *val, unsigned long min_val,
			    unsigned long max_val, char delimiter,
			    const char **next)
{
	int ret;

	ret = parse_ulong_delim(name, str, val, delimiter, next);
	if (ret < 0)
		return ret;
	if (*val < min_val) {
		fprintf(stderr, "value %lu of %s is lower than %lu\n",
			*val, name, min_val);
		return -EINVAL;
	}
	if (*val > max_val) {
		fprintf(stderr, "value %lu of %s is higher than %lu\n",
			*val, name, max_val);
		return -EINVAL;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %rbx
movq 0x30(%rsp), %r8
movl %r9d, %ecx
callq 0x1dd0
testl %eax, %eax
js 0x1f4d
movq (%r12), %rdx
cmpq %r15, %rdx
jb 0x1f59
xorl %eax, %eax
cmpq %r14, %rdx
ja 0x1f72
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x3098(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x146e(%rip), %rsi      # 0x33d8
movq %rbx, %rcx
movq %r15, %r8
jmp 0x1f89
movq 0x307f(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1478(%rip), %rsi      # 0x33fb
movq %rbx, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x1100
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
jmp 0x1f4d
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: parse_double_delim
int parse_double_delim(const char *name, const char *str, double *val,
		       char delimiter, const char **next)
{
	char *eptr;

	if (!*str)
		goto invalid;
	*val = strtod(str, &eptr);

	if (*eptr) {
	       if (*eptr != delimiter)
		       goto invalid;
	}

	if (next)
		*next = eptr;
	return 0;

invalid:
	fprintf(stderr, "invalid value '%s' of %s\n", str, name);
	return -EINVAL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, (%rsi)
je 0x200a
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r12
movq %rsp, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x1060
movsd %xmm0, (%r12)
movq (%r13), %rcx
movb (%rcx), %al
testb %al, %al
setne %dl
cmpb %bpl, %al
setne %al
testb %al, %dl
jne 0x200a
xorl %eax, %eax
testq %r15, %r15
je 0x1ffb
movq %rcx, (%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2fe7(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x13a3(%rip), %rsi      # 0x33be
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1100
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
jmp 0x1ffb
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: parse_double_range_delim
int parse_double_range_delim(const char *name, const char *str,
			     double *val, double min_val,
			     double max_val, char delimiter,
			     const char **next)
{
	int ret;

	ret = parse_double_delim(name, str, val, delimiter, next);
	if (ret < 0)
		return ret;
	if (*val < min_val) {
		fprintf(stderr, "value '%s' of %s is lower than %g\n",
			str, name, min_val);
		return -EINVAL;
	}
	if (*val > max_val) {
		fprintf(stderr, "value '%s' of %s is higher than %g\n",
			str, name, max_val);
		return -EINVAL;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm1, (%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1faa
testl %eax, %eax
js 0x207d
movsd (%r15), %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x2087
xorl %eax, %eax
movsd (%rsp), %xmm0
ucomisd %xmm0, %xmm1
ja 0x209a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x2f6a(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1387(%rip), %rsi      # 0x341f
jmp 0x20ab
movq 0x2f57(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1397(%rip), %rsi      # 0x3442
movq %r14, %rdx
movq %rbx, %rcx
movb $0x1, %al
callq 0x1100
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
jmp 0x207d
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: ignore_signal
int ignore_signal(int signum)
{
	struct sigaction action;
	int ret;

	ret = sigaction(signum, NULL, &action);
	if (ret < 0)
		return -errno;
	action.sa_handler = SIG_IGN;
	ret = sigaction(signum, &action, NULL);
	if (ret < 0)
		return -errno;

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebp
xorl %ebx, %ebx
movq %rsp, %rdx
xorl %esi, %esi
callq 0x1050
testl %eax, %eax
js 0x20fb
movq %rsp, %rsi
movq $0x1, (%rsi)
movl %ebp, %edi
xorl %edx, %edx
callq 0x1050
testl %eax, %eax
jns 0x2104
callq 0x1040
xorl %ebx, %ebx
subl (%rax), %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: send_block
int send_block(int sd, const void *buff, unsigned int length)
{
	const unsigned char *bp = buff;
	unsigned int rest = length;
	ssize_t chunk;

	while (rest > 0) {
		chunk = send(sd, bp, rest, 0);
		if (chunk < 0) {
			if (errno == EINTR)
				continue;
			return -errno;
		}

		bp += chunk;
		rest -= chunk;
	}

	return 0;
}

// Assembly:
testl %edx, %edx
je 0x2155
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movl %ebx, %ebx
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x10a0
testq %rax, %rax
jns 0x2143
callq 0x1040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x2121
jmp 0x214e
addq %rax, %r14
subl %eax, %ebx
jne 0x211f
xorl %eax, %eax
jmp 0x2150
negl %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: recv_block
int recv_block(int sd, void *buff, unsigned int length)
{
	unsigned int rest = length;
	unsigned char *bp = buff;
	ssize_t chunk;

	while (rest > 0) {
		chunk = recv(sd, bp, rest, MSG_WAITALL);
		if (chunk < 0) {
			if (errno == EINTR)
				continue;
			return -errno;
		}
		if (!chunk)
			return -EINVAL;

		bp += chunk;
		rest -= chunk;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testl %edx, %edx
je 0x21a5
movl %edx, %r14d
movq %rsi, %r15
movl %edi, %ebp
movl %r14d, %r14d
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x1030
testq %rax, %rax
jns 0x2195
callq 0x1040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x2170
jmp 0x21a1
je 0x21b2
addq %rax, %r15
subl %eax, %r14d
jne 0x216d
jmp 0x21a5
negl %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
jmp 0x21a5
// File: /workspace/github_c_makefile_star2_O3/mkubecek[P]nperf/common.c
// Function: ctrl_recv_msg
int ctrl_recv_msg(int sd, void *buff, unsigned int length)
{
	const struct __common_ctrl_header *hdr = buff;
	unsigned int rest = length;
	unsigned char *bp = buff;
	ssize_t chunk;

	while (rest > length - sizeof(*hdr)) {
		chunk = recv(sd, bp, rest, 0);
		if (chunk < 0) {
			if (errno == EINTR)
				continue;
			return -errno;
		}
		if (!chunk)
			return -EINVAL;

		bp += chunk;
		rest -= chunk;
	}

	if (ntohl(hdr->length) != length || ntohl(hdr->version) != CTRL_VERSION)
		return -EINVAL;

	while (rest > 0) {
		chunk = recv(sd, bp, rest, MSG_WAITALL);
		if (chunk < 0)
			return -errno;

		bp += chunk;
		rest -= chunk;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %edi, %ebx
movl %edx, %r15d
movq %rsi, %r14
cmpl $0x8, %edx
jb 0x222d
movl %ebp, %r13d
leaq -0x8(%r13), %rax
movq %rax, 0x8(%rsp)
movq %rsi, %r14
movl %ebp, %r15d
movq %rsi, 0x10(%rsp)
movl %ebx, %edi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x1030
testq %rax, %rax
jns 0x2216
callq 0x1040
movl (%rax), %r12d
cmpl $0x4, %r12d
je 0x21f2
jmp 0x226d
movq 0x10(%rsp), %rsi
je 0x228f
addq %rax, %r14
subl %eax, %r15d
movq %r15, %r13
cmpq %r15, 0x8(%rsp)
jb 0x21f2
movl (%rsi), %eax
bswapl %eax
movl $0xffffffea, %r12d      # imm = 0xFFFFFFEA
cmpl %ebp, %eax
jne 0x2270
cmpl $0x1000000, 0x4(%rsi)   # imm = 0x1000000
jne 0x2270
xorl %r12d, %r12d
testl %r15d, %r15d
je 0x2270
movl %r15d, %edx
movl %ebx, %edi
movq %r14, %rsi
movl $0x100, %ecx            # imm = 0x100
callq 0x1030
testq %rax, %rax
js 0x2282
addq %rax, %r14
subl %eax, %r15d
jne 0x224c
jmp 0x2270
negl %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1040
xorl %r12d, %r12d
subl (%rax), %r12d
jmp 0x2270
movl $0xffffffea, %r12d      # imm = 0xFFFFFFEA
jmp 0x2270
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/encoding.c
// Function: decode_table
static void decode_table(VTermEncoding *enc, void *data,
                         uint32_t cp[], int *cpi, int cplen,
                         const char bytes[], size_t *pos, size_t bytelen)
{
  struct StaticTableEncoding *table = (struct StaticTableEncoding *)enc;
  int is_gr = bytes[*pos] & 0x80;

  for(; *pos < bytelen && *cpi < cplen; (*pos)++) {
    unsigned char c = bytes[*pos] ^ is_gr;

    if(c < 0x20 || c == 0x7f || c >= 0x80)
      return;

    if(table->chars[c])
      cp[(*cpi)++] = table->chars[c];
    else
      cp[(*cpi)++] = c;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rsi
movq (%rsi), %r10
cmpq %rax, %r10
jae 0x2656
movb (%r9,%r10), %r11b
andb $-0x80, %r11b
negq %rax
incq %r10
movslq (%rcx), %rbx
cmpl %r8d, %ebx
jge 0x2656
movb -0x1(%r9,%r10), %r14b
xorb %r11b, %r14b
leal -0x20(%r14), %ebp
cmpb $0x5e, %bpl
ja 0x2656
movzbl %r14b, %r14d
movl 0x10(%rdi,%r14,4), %ebp
leal 0x1(%rbx), %r15d
testl %ebp, %ebp
movl %r15d, (%rcx)
cmovel %r14d, %ebp
movl %ebp, (%rdx,%rbx,4)
movq %r10, (%rsi)
leaq (%rax,%r10), %rbx
incq %rbx
incq %r10
cmpq $0x1, %rbx
jne 0x2610
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/encoding.c
// Function: decode_usascii
static void decode_usascii(VTermEncoding *enc, void *data,
                           uint32_t cp[], int *cpi, int cplen,
                           const char bytes[], size_t *pos, size_t bytelen)
{
  int is_gr = bytes[*pos] & 0x80;

  for(; *pos < bytelen && *cpi < cplen; (*pos)++) {
    unsigned char c = bytes[*pos] ^ is_gr;

    if(c < 0x20 || c == 0x7f || c >= 0x80)
      return;

    cp[(*cpi)++] = c;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rsi
movq (%rsi), %rdi
cmpq %rax, %rdi
jae 0x26b8
movb (%r9,%rdi), %r10b
andb $-0x80, %r10b
negq %rax
incq %rdi
movslq (%rcx), %r11
cmpl %r8d, %r11d
jge 0x26b8
movb -0x1(%r9,%rdi), %bl
xorb %r10b, %bl
leal -0x20(%rbx), %ebp
cmpb $0x5e, %bpl
ja 0x26b8
movzbl %bl, %ebx
leal 0x1(%r11), %ebp
movl %ebp, (%rcx)
movl %ebx, (%rdx,%r11,4)
movq %rdi, (%rsi)
leaq (%rax,%rdi), %r11
incq %r11
incq %rdi
cmpq $0x1, %r11
jne 0x267f
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/mouse.c
// Function: vterm_mouse_move
void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod)
{
  VTermState *state = vt->state;

  if(col == state->mouse_col && row == state->mouse_row)
    return;

  state->mouse_col = col;
  state->mouse_row = row;

  if((state->mouse_flags & MOUSE_WANT_DRAG && state->mouse_buttons) ||
     (state->mouse_flags & MOUSE_WANT_MOVE)) {
    int button = state->mouse_buttons & 0x01 ? 1 :
                 state->mouse_buttons & 0x02 ? 2 :
                 state->mouse_buttons & 0x04 ? 3 : 4;
    output_mouse(state, button-1 + 0x20, 1, mod, col, row);
  }
}

// Assembly:
movl %edx, %r8d
movl %esi, %r9d
movq 0x128(%rdi), %rdi
cmpl %edx, 0x78(%rdi)
jne 0x2a58
cmpl %r9d, 0x7c(%rdi)
je 0x2aa9
movl %r8d, 0x78(%rdi)
movl %r9d, 0x7c(%rdi)
movl 0x84(%rdi), %edx
testb $0x2, %dl
jne 0x2a78
testb $0x4, %dl
je 0x2aa9
movl 0x80(%rdi), %eax
jmp 0x2a85
movl 0x80(%rdi), %eax
andl $0x4, %edx
orl %eax, %edx
je 0x2aa9
movl $0x20, %esi
testb $0x1, %al
jne 0x2aa2
movl $0x21, %esi
testb $0x2, %al
jne 0x2aa2
andl $0x4, %eax
xorl %esi, %esi
cmpl $0x1, %eax
adcl $0x22, %esi
movl $0x1, %edx
jmp 0x2aaa
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/mouse.c
// Function: output_mouse
static void output_mouse(VTermState *state, int code, int pressed, int modifiers, int col, int row)
{
  modifiers <<= 2;

  switch(state->mouse_protocol) {
  case MOUSE_X10:
    if(col + 0x21 > 0xff)
      col = 0xff - 0x21;
    if(row + 0x21 > 0xff)
      row = 0xff - 0x21;

    if(!pressed)
      code = 3;

    vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "M%c%c%c",
        (code | modifiers) + 0x20, col + 0x21, row + 0x21);
    break;

  case MOUSE_UTF8:
    {
      char utf8[18]; size_t len = 0;

      if(!pressed)
        code = 3;

      len += fill_utf8((code | modifiers) + 0x20, utf8 + len);
      len += fill_utf8(col + 0x21, utf8 + len);
      len += fill_utf8(row + 0x21, utf8 + len);
      utf8[len] = 0;

      vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "M%s", utf8);
    }
    break;

  case MOUSE_SGR:
    vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "<%d;%d;%d%c",
        code | modifiers, col + 1, row + 1, pressed ? 'M' : 'm');
    break;

  case MOUSE_RXVT:
    if(!pressed)
      code = 3;

    vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "%d;%d;%dM",
        code | modifiers, col + 1, row + 1);
    break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %esi, %eax
movl 0x88(%rdi), %esi
cmpq $0x3, %rsi
ja 0x2c07
movl %r9d, %ebp
movl %r8d, %ebx
movq %rdi, %r14
shll $0x2, %ecx
leaq 0x97e9(%rip), %rdi      # 0xc2c4
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
movl $0xde, %r9d
cmpl %r9d, %ebx
cmovgel %r9d, %ebx
cmpl %r9d, %ebp
cmovll %ebp, %r9d
testl %edx, %edx
movl $0x3, %edx
cmovel %edx, %eax
movq (%r14), %rdi
orl %ecx, %eax
addl $0x20, %eax
addl $0x21, %ebx
addl $0x21, %r9d
leaq 0x97d4(%rip), %rdx      # 0xc2ec
movl $0x9b, %esi
movl %eax, %ecx
movl %ebx, %r8d
jmp 0x2b82
movq (%r14), %rdi
orl %eax, %ecx
incl %ebx
incl %ebp
xorl %eax, %eax
testl %edx, %edx
sete %al
shll $0x5, %eax
orl $0x4d, %eax
movl %eax, (%rsp)
leaq 0x97b4(%rip), %rdx      # 0xc2f8
movl $0x9b, %esi
movl %ebx, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0xaf11
jmp 0x2c07
testl %edx, %edx
movl $0x3, %edx
cmovel %edx, %eax
movq (%r14), %rdi
orl %ecx, %eax
incl %ebx
incl %ebp
leaq 0x978f(%rip), %rdx      # 0xc304
movl $0x9b, %esi
movl %eax, %ecx
movl %ebx, %r8d
movl %ebp, %r9d
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xaf11
testl %edx, %edx
movl $0x3, %edx
cmovel %edx, %eax
orl %ecx, %eax
addl $0x20, %eax
movslq %eax, %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x2c7d
movl %eax, %r12d
movl %eax, %eax
addl $0x21, %ebx
movslq %ebx, %rdi
leaq (%rsp,%rax), %rsi
addq $0x10, %rsi
callq 0x2c7d
movl %eax, %ebx
addl %r12d, %ebx
addl $0x21, %ebp
movslq %ebp, %rdi
leaq (%rsp,%rbx), %rsi
addq $0x10, %rsi
callq 0x2c7d
movl %eax, %eax
addq %rbx, %rax
movb $0x0, 0x10(%rsp,%rax)
movq (%r14), %rdi
leaq 0x96fc(%rip), %rdx      # 0xc2f4
movl $0x9b, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xaf11
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/mouse.c
// Function: vterm_mouse_button
void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod)
{
  VTermState *state = vt->state;

  int old_buttons = state->mouse_buttons;

  if(button > 0 && button <= 3) {
    if(pressed)
      state->mouse_buttons |= (1 << (button-1));
    else
      state->mouse_buttons &= ~(1 << (button-1));
  }

  /* Most of the time we don't get button releases from 4/5 */
  if(state->mouse_buttons == old_buttons && button < 4)
    return;

  if(!state->mouse_flags)
    return;

  if(button < 4) {
    output_mouse(state, button-1, pressed, mod, state->mouse_col, state->mouse_row);
  }
  else if(button < 8) {
    output_mouse(state, button-4 + 0x40, pressed, mod, state->mouse_col, state->mouse_row);
  }
}

// Assembly:
movq 0x128(%rdi), %rdi
movl 0x80(%rdi), %r8d
leal -0x1(%rsi), %eax
movl %r8d, %r9d
cmpl $0x2, %eax
ja 0x2c48
movl %r8d, %r10d
btsl %eax, %r10d
movl %r8d, %r9d
btrl %eax, %r9d
testb %dl, %dl
cmovnel %r10d, %r9d
movl %r9d, 0x80(%rdi)
cmpl $0x3, %esi
jg 0x2c52
cmpl %r8d, %r9d
je 0x2c7c
cmpl $0x0, 0x84(%rdi)
je 0x2c7c
cmpl $0x4, %esi
jl 0x2c6a
cmpl $0x7, %esi
ja 0x2c7c
addl $0x3c, %esi
movl %esi, %eax
movzbl %dl, %edx
movl 0x78(%rdi), %r8d
movl 0x7c(%rdi), %r9d
movl %eax, %esi
jmp 0x2aaa
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/utf8.h
// Function: fill_utf8
static int fill_utf8(long codepoint, char *str)
{
  int nbytes = utf8_seqlen(codepoint);

  // This is easier done backwards
  int b = nbytes;
  while(b > 1) {
    b--;
    str[b] = 0x80 | (codepoint & 0x3f);
    codepoint >>= 6;
  }

  switch(nbytes) {
    case 1: str[0] =        (codepoint & 0x7f); break;
    case 2: str[0] = 0xc0 | (codepoint & 0x1f); break;
    case 3: str[0] = 0xe0 | (codepoint & 0x0f); break;
    case 4: str[0] = 0xf0 | (codepoint & 0x07); break;
    case 5: str[0] = 0xf8 | (codepoint & 0x03); break;
    case 6: str[0] = 0xfc | (codepoint & 0x01); break;
  }

  return nbytes;
}

// Assembly:
cmpq $0x80, %rdi
jge 0x2c93
andb $0x7f, %dil
movl $0x1, %eax
movb %dil, (%rsi)
retq
movl $0x2, %eax
cmpq $0x800, %rdi            # imm = 0x800
jb 0x2ccc
movl $0x3, %eax
cmpq $0x10000, %rdi          # imm = 0x10000
jb 0x2ccc
movl $0x4, %eax
cmpq $0x200000, %rdi         # imm = 0x200000
jb 0x2ccc
cmpq $0x4000000, %rdi        # imm = 0x4000000
movl $0x6, %eax
sbbl $0x0, %eax
movl %eax, %ecx
incq %rcx
movl %edi, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, -0x2(%rsi,%rcx)
shrq $0x6, %rdi
decq %rcx
cmpq $0x2, %rcx
ja 0x2cd1
decl %eax
leaq 0x95e1(%rip), %rcx      # 0xc2d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andb $0x1f, %dil
orb $-0x40, %dil
movl $0x2, %eax
jmp 0x2c8f
andb $0x3, %dil
orb $-0x8, %dil
movl $0x5, %eax
jmp 0x2c8f
andb $0xf, %dil
orb $-0x20, %dil
movl $0x3, %eax
jmp 0x2c8f
andb $0x7, %dil
orb $-0x10, %dil
movl $0x4, %eax
jmp 0x2c8f
andb $0x1, %dil
orb $-0x4, %dil
movl $0x6, %eax
jmp 0x2c8f
nop
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/parser.c
// Function: string_fragment
static void string_fragment(VTerm *vt, const char *str, size_t len, bool final)
{
  VTermStringFragment frag = {
    .str     = str,
    .len     = len,
    .initial = vt->parser.string_initial,
    .final   = final,
  };

  switch(vt->parser.state) {
    case OSC:
      if(vt->parser.callbacks && vt->parser.callbacks->osc)
        (*vt->parser.callbacks->osc)(vt->parser.v.osc.command, frag, vt->parser.cbdata);
      break;

    case DCS:
      if(vt->parser.callbacks && vt->parser.callbacks->dcs)
        (*vt->parser.callbacks->dcs)(vt->parser.v.dcs.command, vt->parser.v.dcs.commandlen, frag, vt->parser.cbdata);
      break;

    case APC:
      if(vt->parser.callbacks && vt->parser.callbacks->apc)
        (*vt->parser.callbacks->apc)(frag, vt->parser.cbdata);
      break;

    case PM:
      if(vt->parser.callbacks && vt->parser.callbacks->pm)
        (*vt->parser.callbacks->pm)(frag, vt->parser.cbdata);
      break;

    case SOS:
      if(vt->parser.callbacks && vt->parser.callbacks->sos)
        (*vt->parser.callbacks->sos)(frag, vt->parser.cbdata);
      break;

    case NORMAL:
    case CSI_LEADER:
    case CSI_ARGS:
    case CSI_INTERMED:
    case OSC_COMMAND:
    case DCS_COMMAND:
      break;
  }

  vt->parser.string_initial = false;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movl 0x20(%rdi), %esi
addl $-0x6, %esi
cmpl $0x4, %esi
ja 0x3420
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
movzbl 0xe8(%rbx), %edi
shlq $0x1e, %rdi
orq %rdx, %rdi
shll $0x1f, %ecx
orq %rdi, %rcx
leaq 0x8fef(%rip), %rdx      # 0xc35c
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x3420
movq 0x20(%rdx), %r9
testq %r9, %r9
je 0x3420
movl 0x40(%rbx), %edi
movq 0xe0(%rbx), %r8
movq %rax, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq *%r9
jmp 0x3420
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x3420
movq 0x40(%rdx), %r8
jmp 0x33df
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x3420
movq 0x30(%rdx), %r8
jmp 0x33df
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x3420
movq 0x38(%rdx), %r8
testq %r8, %r8
je 0x3420
movq 0xe0(%rbx), %rdx
movq %rax, %rdi
movq %rcx, %rsi
callq *%r8
jmp 0x3420
movq 0xd8(%rbx), %rdx
testq %rdx, %rdx
je 0x3420
movq 0x28(%rdx), %r9
testq %r9, %r9
je 0x3420
leaq 0x44(%rbx), %rdi
movslq 0x40(%rbx), %rsi
movq 0xe0(%rbx), %r8
movq %rax, %rdx
callq *%r9
movb $0x0, 0xe8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/parser.c
// Function: do_escape
static void do_escape(VTerm *vt, char command)
{
  char seq[INTERMED_MAX+1];

  size_t len = vt->parser.intermedlen;
  strncpy(seq, vt->parser.intermed, len);
  seq[len++] = command;
  seq[len]   = 0;

  if(vt->parser.callbacks && vt->parser.callbacks->escape)
    if((*vt->parser.callbacks->escape)(seq, len, vt->parser.cbdata))
      return;

  DEBUG_LOG("libvterm: Unhandled escape ESC 0x%02x\n", command);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %r14
movslq 0x28(%rdi), %rbx
leaq 0x2c(%rdi), %rsi
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x2070
movb %bpl, (%rsp,%rbx)
movb $0x0, 0x1(%rsp,%rbx)
movq 0xd8(%r14), %rax
testq %rax, %rax
je 0x3479
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x3479
incq %rbx
movq 0xe0(%r14), %rdx
movq %rsp, %rdi
movq %rbx, %rsi
callq *%rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: vterm_state_newpen
INTERNAL void vterm_state_newpen(VTermState *state)
{
  // 90% grey so that pure white is brighter
  vterm_color_rgb(&state->default_fg, 240, 240, 240);
  vterm_color_rgb(&state->default_bg, 0, 0, 0);
  vterm_state_set_default_colors(state, &state->default_fg, &state->default_bg);

  for(int col = 0; col < 16; col++)
    lookup_default_colour_ansi(col, &state->colors[col]);
}

// Assembly:
movl $0xf0f0f000, %eax       # imm = 0xF0F0F000
movq %rax, 0x140(%rdi)
movb $0x2, 0x140(%rdi)
movb $0x4, 0x144(%rdi)
leaq 0x908d(%rip), %rax      # 0xc552
xorl %ecx, %ecx
movzwl -0x2(%rax), %edx
movb (%rax), %sil
movb $0x0, 0x148(%rdi,%rcx,4)
movw %dx, 0x149(%rdi,%rcx,4)
movb %sil, 0x14b(%rdi,%rcx,4)
incq %rcx
addq $0x3, %rax
cmpq $0x10, %rcx
jne 0x34c7
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: vterm_state_set_default_colors
void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg)
{
  if(default_fg) {
    state->default_fg = *default_fg;
    state->default_fg.type = (state->default_fg.type & ~VTERM_COLOR_DEFAULT_MASK)
                           | VTERM_COLOR_DEFAULT_FG;
  }

  if(default_bg) {
    state->default_bg = *default_bg;
    state->default_bg.type = (state->default_bg.type & ~VTERM_COLOR_DEFAULT_MASK)
                           | VTERM_COLOR_DEFAULT_BG;
  }
}

// Assembly:
testq %rsi, %rsi
je 0x350b
movl (%rsi), %eax
movl %eax, 0x140(%rdi)
andb $-0x7, %al
orb $0x2, %al
movb %al, 0x140(%rdi)
testq %rdx, %rdx
je 0x3522
movl (%rdx), %eax
movl %eax, 0x144(%rdi)
andb $-0x7, %al
orb $0x4, %al
movb %al, 0x144(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: vterm_color_is_equal
int vterm_color_is_equal(const VTermColor *a, const VTermColor *b)
{
  /* First make sure that the two colours are of the same type (RGB/Indexed) */
  if (a->type != b->type) {
    return false;
  }

  /* Depending on the type inspect the corresponding members */
  if (VTERM_COLOR_IS_INDEXED(a)) {
    return a->indexed.idx == b->indexed.idx;
  }
  else if (VTERM_COLOR_IS_RGB(a)) {
    return    (a->rgb.red   == b->rgb.red)
           && (a->rgb.green == b->rgb.green)
           && (a->rgb.blue  == b->rgb.blue);
  }

  return 0;
}

// Assembly:
movb (%rdi), %al
cmpb (%rsi), %al
jne 0x3d2b
movb 0x1(%rsi), %cl
cmpb %cl, 0x1(%rdi)
sete %cl
movl %ecx, %edx
notb %dl
orb %al, %dl
testb $0x1, %dl
je 0x3d18
andb %cl, %al
jmp 0x3d2d
movb 0x2(%rdi), %al
cmpb 0x2(%rsi), %al
jne 0x3d2b
movb 0x3(%rdi), %al
cmpb 0x3(%rsi), %al
sete %al
jmp 0x3d2d
xorl %eax, %eax
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: lookup_colour_palette
static bool lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
{
  if(index >= 0 && index < 16) {
    // Normal 8 colours or high intensity - parse as palette 0
    return lookup_colour_ansi(state, index, col);
  }
  else if(index >= 16 && index < 232) {
    // 216-colour cube
    index -= 16;

    vterm_color_rgb(col, ramp6[index/6/6 % 6],
                         ramp6[index/6   % 6],
                         ramp6[index     % 6]);

    return true;
  }
  else if(index >= 232 && index < 256) {
    // 24 greyscales
    index -= 232;

    vterm_color_rgb(col, ramp24[index], ramp24[index], ramp24[index]);

    return true;
  }

  return false;
}

// Assembly:
cmpq $0xf, %rsi
ja 0x3d57
movl 0x148(%rdi,%rsi,4), %eax
movl %eax, (%rdx)
retq
leaq -0x10(%rsi), %rax
cmpq $0xd7, %rax
ja 0x3db8
movzbl %al, %ecx
imull $0x39, %ecx, %esi
shrl $0xb, %esi
leaq 0x880d(%rip), %rdi      # 0xc580
movb (%rdi,%rsi,4), %sil
imull $0xab, %ecx, %ecx
shrl $0xa, %ecx
imull $0x2b, %ecx, %r8d
shrl $0x7, %r8d
andl $-0x2, %r8d
leal (%r8,%r8,2), %r8d
movl %ecx, %r9d
subb %r8b, %r9b
movzbl %r9b, %r8d
movb (%rdi,%r8,4), %r8b
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
subb %cl, %al
movzbl %al, %eax
movb (%rdi,%rax,4), %al
movb $0x0, (%rdx)
movb %sil, 0x1(%rdx)
movb %r8b, 0x2(%rdx)
jmp 0x3ddc
leaq -0xe8(%rsi), %rax
cmpq $0x17, %rax
ja 0x3ddf
leaq 0x87d4(%rip), %rax      # 0xc5a0
movb -0x3a0(%rax,%rsi,4), %al
movb $0x0, (%rdx)
movb %al, 0x1(%rdx)
movb %al, 0x2(%rdx)
movb %al, 0x3(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: lookup_colour
static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col)
{
  switch(palette) {
  case 2: // RGB mode - 3 args contain colour values directly
    if(argcount < 3)
      return argcount;

    vterm_color_rgb(col, CSI_ARG(args[0]), CSI_ARG(args[1]), CSI_ARG(args[2]));

    return 3;

  case 5: // XTerm 256-colour mode
    if (!argcount || CSI_ARG_IS_MISSING(args[0])) {
      return argcount ? 1 : 0;
    }

    vterm_color_indexed(col, args[0]);

    return argcount ? 1 : 0;

  default:
    DEBUG_LOG("Unrecognised colour palette %d\n", palette);
    return 0;
  }
}

// Assembly:
cmpl $0x5, %edi
je 0x44cb
xorl %eax, %eax
cmpl $0x2, %edi
jne 0x44f1
movl %edx, %eax
cmpl $0x3, %edx
jl 0x44f1
movb (%rsi), %al
movb 0x8(%rsi), %dl
movb 0x10(%rsi), %sil
movb $0x0, (%rcx)
movb %al, 0x1(%rcx)
movb %dl, 0x2(%rcx)
movb %sil, 0x3(%rcx)
movl $0x3, %eax
retq
testl %edx, %edx
je 0x44de
movq (%rsi), %rax
movl %eax, %esi
notl %esi
testl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jne 0x44e6
xorl %eax, %eax
testl %edx, %edx
setne %al
retq
movb $0x1, (%rcx)
movb %al, 0x1(%rcx)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: vterm_state_getpen
INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount)
{
  int argi = 0;

  if(state->pen.bold)
    args[argi++] = 1;

  if(state->pen.italic)
    args[argi++] = 3;

  if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
    args[argi++] = 4;
  if(state->pen.underline == VTERM_UNDERLINE_CURLY)
    args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;

  if(state->pen.blink)
    args[argi++] = 5;

  if(state->pen.reverse)
    args[argi++] = 7;

  if(state->pen.conceal)
    args[argi++] = 8;

  if(state->pen.strike)
    args[argi++] = 9;

  if(state->pen.font)
    args[argi++] = 10 + state->pen.font;

  if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
    args[argi++] = 21;

  argi = vterm_state_getpen_color(&state->pen.fg, argi, args, true);

  argi = vterm_state_getpen_color(&state->pen.bg, argi, args, false);

  if(state->pen.small) {
    if(state->pen.baseline == VTERM_BASELINE_RAISE)
      args[argi++] = 73;
    else if(state->pen.baseline == VTERM_BASELINE_LOWER)
      args[argi++] = 74;
  }

  return argi;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x13c(%rdi), %eax
testb $0x1, %al
jne 0x450b
xorl %esi, %esi
jmp 0x451f
movq $0x1, (%rbx)
movzwl 0x13c(%r14), %eax
movl $0x1, %esi
testb $0x8, %al
je 0x4537
movl %esi, %eax
incl %esi
movq $0x3, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
movl %eax, %ecx
andl $0x6, %ecx
cmpw $0x2, %cx
jne 0x4556
movl %esi, %eax
incl %esi
movq $0x4, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
movl %eax, %ecx
notl %ecx
testb $0x6, %cl
jne 0x457e
movl %esi, %eax
movl $0x80000004, %ecx       # imm = 0x80000004
movq %rcx, (%rbx,%rax,8)
addl $0x2, %esi
movq $0x3, 0x8(%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb $0x10, %al
je 0x4596
movl %esi, %eax
incl %esi
movq $0x5, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb $0x20, %al
je 0x45ae
movl %esi, %eax
incl %esi
movq $0x7, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb $0x40, %al
je 0x45c6
movl %esi, %eax
incl %esi
movq $0x8, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
testb %al, %al
jns 0x45de
movl %esi, %eax
incl %esi
movq $0x9, (%rbx,%rax,8)
movzwl 0x13c(%r14), %eax
movzwl %ax, %ecx
shrl $0x8, %ecx
andw $0xf, %cx
je 0x4600
movzwl %cx, %eax
addl $0xa, %eax
movl %esi, %ecx
incl %esi
movq %rax, (%rbx,%rcx,8)
movzwl 0x13c(%r14), %eax
leaq 0x134(%r14), %rdi
andl $0x6, %eax
cmpw $0x4, %ax
jne 0x461c
movl %esi, %eax
incl %esi
movq $0x15, (%rbx,%rax,8)
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x4677
leaq 0x138(%r14), %rdi
movl %eax, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x4677
movzwl 0x13c(%r14), %ecx
btl $0xc, %ecx
jae 0x466f
shrl $0xd, %ecx
andl $0x3, %ecx
cmpl $0x1, %ecx
je 0x4661
cmpl $0x2, %ecx
jne 0x466f
movl $0x4a, %ecx
jmp 0x4666
movl $0x49, %ecx
movslq %eax, %rdx
incl %eax
movq %rcx, (%rbx,%rdx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/pen.c
// Function: vterm_state_getpen_color
static int vterm_state_getpen_color(const VTermColor *col, int argi, long args[], int fg)
{
    /* Do nothing if the given color is the default color */
    if (( fg && VTERM_COLOR_IS_DEFAULT_FG(col)) ||
        (!fg && VTERM_COLOR_IS_DEFAULT_BG(col))) {
        return argi;
    }

    /* Decide whether to send an indexed color or an RGB color */
    if (VTERM_COLOR_IS_INDEXED(col)) {
        const uint8_t idx = col->indexed.idx;
        if (idx < 8) {
            args[argi++] = (idx + (fg ? 30 : 40));
        }
        else if (idx < 16) {
            args[argi++] = (idx - 8 + (fg ? 90 : 100));
        }
        else {
            args[argi++] = CSI_ARG_FLAG_MORE | (fg ? 38 : 48);
            args[argi++] = CSI_ARG_FLAG_MORE | 5;
            args[argi++] = idx;
        }
    }
    else if (VTERM_COLOR_IS_RGB(col)) {
        args[argi++] = CSI_ARG_FLAG_MORE | (fg ? 38 : 48);
        args[argi++] = CSI_ARG_FLAG_MORE | 2;
        args[argi++] = CSI_ARG_FLAG_MORE | col->rgb.red;
        args[argi++] = CSI_ARG_FLAG_MORE | col->rgb.green;
        args[argi++] = col->rgb.blue;
    }
    return argi;
}

// Assembly:
movl %esi, %eax
movb (%rdi), %sil
testl %ecx, %ecx
je 0x4687
testb $0x2, %sil
je 0x468d
retq
testb $0x4, %sil
jne 0x4686
testb $0x1, %sil
jne 0x46e6
testl %ecx, %ecx
movl $0x30, %ecx
movl $0x26, %esi
cmoveq %rcx, %rsi
btsq $0x1f, %rsi
movslq %eax, %rcx
movq %rsi, (%rdx,%rcx,8)
movl $0x80000000, %esi       # imm = 0x80000000
orq $0x2, %rsi
movq %rsi, 0x8(%rdx,%rcx,8)
movzbl 0x1(%rdi), %esi
btsq $0x1f, %rsi
movq %rsi, 0x10(%rdx,%rcx,8)
movzbl 0x2(%rdi), %esi
btsq $0x1f, %rsi
movq %rsi, 0x18(%rdx,%rcx,8)
movzbl 0x3(%rdi), %esi
addl $0x5, %eax
movq %rsi, 0x20(%rdx,%rcx,8)
retq
movzbl 0x1(%rdi), %esi
cmpl $0x7, %esi
ja 0x46f7
leal 0x1e(%rsi), %edi
addl $0x28, %esi
jmp 0x4703
cmpb $0xf, %sil
ja 0x4712
leal 0x52(%rsi), %edi
addl $0x5c, %esi
testl %ecx, %ecx
cmovnel %edi, %esi
movslq %eax, %rcx
incl %eax
movq %rsi, (%rdx,%rcx,8)
retq
testl %ecx, %ecx
movl $0x30, %ecx
movl $0x26, %edi
cmoveq %rcx, %rdi
btsq $0x1f, %rdi
movslq %eax, %rcx
movq %rdi, (%rdx,%rcx,8)
movl $0x80000000, %eax       # imm = 0x80000000
orq $0x5, %rax
movq %rax, 0x8(%rdx,%rcx,8)
leal 0x3(%rcx), %eax
movq %rsi, 0x10(%rdx,%rcx,8)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_free
INTERNAL void vterm_screen_free(VTermScreen *screen)
{
  vterm_allocator_free(screen->vt, screen->buffers[BUFIDX_PRIMARY]);
  if(screen->buffers[BUFIDX_ALTSCREEN])
    vterm_allocator_free(screen->vt, screen->buffers[BUFIDX_ALTSCREEN]);

  vterm_allocator_free(screen->vt, screen->sb_buffer);

  vterm_allocator_free(screen->vt, screen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x60(%rbx), %rsi
callq 0xad24
movq 0x68(%rbx), %rsi
testq %rsi, %rsi
je 0x480d
movq (%rbx), %rdi
callq 0xad24
movq (%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0xad24
movq (%rbx), %rdi
movq %rbx, %rsi
popq %rbx
jmp 0xad24
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_reset
void vterm_screen_reset(VTermScreen *screen, int hard)
{
  screen->damaged.start_row = -1;
  screen->pending_scrollrect.start_row = -1;
  vterm_state_reset(screen->state, hard);
  vterm_screen_flush_damage(screen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x28(%rdi)
movl %eax, 0x38(%rdi)
movq 0x8(%rdi), %rdi
callq 0x2100
movq %rbx, %rdi
popq %rbx
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_flush_damage
void vterm_screen_flush_damage(VTermScreen *screen)
{
  if(screen->pending_scrollrect.start_row != -1) {
    vterm_scroll_rect(screen->pending_scrollrect, screen->pending_scroll_downward, screen->pending_scroll_rightward,
        moverect_user, erase_user, screen);

    screen->pending_scrollrect.start_row = -1;
  }

  if(screen->damaged.start_row != -1) {
    if(screen->callbacks && screen->callbacks->damage)
      (*screen->callbacks->damage)(screen->damaged, screen->cbdata);

    screen->damaged.start_row = -1;
  }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $-0x1, 0x38(%rdi)
je 0x4880
movl 0x48(%rbx), %edx
movl 0x4c(%rbx), %ecx
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
movq %rbx, (%rsp)
leaq 0x6cc(%rip), %r8        # 0x4f39
leaq 0x738(%rip), %r9        # 0x4fac
callq 0x2160
movl $0xffffffff, 0x38(%rbx) # imm = 0xFFFFFFFF
cmpl $-0x1, 0x28(%rbx)
je 0x48ac
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x48a5
movq (%rax), %rax
testq %rax, %rax
je 0x48a5
movq 0x18(%rbx), %rdx
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq *%rax
movl $0xffffffff, 0x28(%rbx) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_screen_is_eol
int vterm_screen_is_eol(const VTermScreen *screen, VTermPos pos)
{
  /* This cell is EOL if this and every cell to the right is black */
  for(; pos.col < screen->cols; pos.col++) {
    ScreenCell *cell = getcell(screen, pos.row, pos.col);
    if(cell->chars[0] != 0)
      return 0;
  }

  return 1;
}

// Assembly:
movq %rsi, %rcx
shrq $0x20, %rcx
movl 0x54(%rdi), %edx
movl $0x1, %eax
cmpl %ecx, %edx
jle 0x4d29
imull %edx, %esi
leaq (%rcx,%rcx,8), %r8
leaq (%rsi,%rsi,8), %rsi
shlq $0x2, %rsi
leaq (%rsi,%r8,4), %rsi
addq 0x70(%rdi), %rsi
cmpl $0x0, (%rsi)
jne 0x4d2a
addq $0x24, %rsi
incl %ecx
cmpl %ecx, %edx
jg 0x4d1a
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/src/screen.c
// Function: vterm_obtain_screen
VTermScreen *vterm_obtain_screen(VTerm *vt)
{
  if(vt->screen)
    return vt->screen;

  VTermScreen *screen = screen_new(vt);
  vt->screen = screen;

  return screen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x130(%rdi), %r14
testq %r14, %r14
jne 0x4e15
movq %rdi, %rbx
callq 0x2140
testq %rax, %rax
je 0x4e0b
movq %rax, %r15
movl $0x90, %esi
movq %rbx, %rdi
callq 0xacb9
movq %rax, %r14
leaq 0xc(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20a0
movq %rbx, (%r14)
movq %r15, 0x8(%r14)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x24(%r14)
movl $0xffffffff, 0x38(%r14) # imm = 0xFFFFFFFF
movl (%r12), %esi
movl %esi, 0x50(%r14)
movl (%r13), %edx
movl %edx, 0x54(%r14)
andb $-0x4, 0x58(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movb $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x4e8f
movq %rax, 0x60(%r14)
movq %rax, 0x70(%r14)
movq (%r14), %rdi
movslq (%r13), %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rsi
callq 0xacb9
movq %rax, 0x78(%r14)
movq 0x8(%r14), %rdi
leaq 0xc330(%rip), %rsi      # 0x11128
movq %r14, %rdx
callq 0x21b0
movq 0x8(%r14), %rdi
callq 0x2180
jmp 0x4e0e
xorl %r14d, %r14d
movq %r14, 0x130(%rbx)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq