LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: qtopFromAcc
void
qtopFromAcc(struct q_topology_t **qtop, int acc_enum,
		struct acc100_conf *acc100_conf)
{
	struct q_topology_t *p_qtop;
	p_qtop = NULL;
	switch (acc_enum) {
	case UL_4G:
		p_qtop = &(acc100_conf->q_ul_4g);
		break;
	case UL_5G:
		p_qtop = &(acc100_conf->q_ul_5g);
		break;
	case DL_4G:
		p_qtop = &(acc100_conf->q_dl_4g);
		break;
	case DL_5G:
		p_qtop = &(acc100_conf->q_dl_5g);
		break;
	default:
		/* NOTREACHED */
		LOG(ERR, "Unexpected error evaluating qtopFromAcc");
		break;
	}
	*qtop = p_qtop;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, %esi
ja 0xe47d
movq %rdx, %r14
movl %esi, %eax
leaq 0xd230(%rip), %rcx      # 0x1b68c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %r14
jmp 0xe4a4
addq $0xc, %r14
jmp 0xe4a4
addq $0x18, %r14
jmp 0xe4a4
addq $0x12, %r14
jmp 0xe4a4
callq 0xf85e
leaq 0x25a47(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xd209(%rip), %rdx      # 0x1b69c
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: aqDepth
int
aqDepth(int qg_idx, struct acc100_conf *acc100_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = accFromQgid(qg_idx, acc100_conf);
	qtopFromAcc(&q_top, acc_enum, acc100_conf);
	if (q_top == NULL)
		return 1;
	return MAX(1, q_top->aq_depth_log2);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsp, %r14
movq $0x0, (%r14)
callq 0xe3e0
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0xe444
movq (%r14), %rax
testq %rax, %rax
je 0xe4ea
movzwl 0x4(%rax), %eax
cmpw $0x1, %ax
adcl $0x0, %eax
movzwl %ax, %eax
jmp 0xe4ef
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: aqNum
int
aqNum(int qg_idx, struct acc100_conf *acc100_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = accFromQgid(qg_idx, acc100_conf);
	qtopFromAcc(&q_top, acc_enum, acc100_conf);
	if (q_top == NULL)
		return 0;
	return q_top->num_aqs_per_groups;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsp, %r14
movq $0x0, (%r14)
callq 0xe3e0
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0xe444
movq (%r14), %rax
testq %rax, %rax
je 0xe528
movzwl 0x2(%rax), %eax
jmp 0xe52a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: acc100_queue_range_check
int
acc100_queue_range_check(struct q_topology_t q_conf)
{
	if ((q_conf.num_aqs_per_groups < 1) ||
			(q_conf.num_aqs_per_groups > ACC100_NUM_AQS)) {
		printf("ERROR: Number of AQs out of range %d\n",
				q_conf.num_aqs_per_groups);
		return -1;
	}
	if ((q_conf.aq_depth_log2 < 1) ||
			(q_conf.aq_depth_log2 > ACC100_MAX_QDEPTH)) {
		printf("ERROR: AQ Depth out of range %d\n",
				q_conf.aq_depth_log2);
		return -1;
	}
	if (q_conf.num_qgroups > ACC100_NUM_QGRPS) {
		printf("ERROR: Number of QG out of range %d\n",
				q_conf.num_qgroups);
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rax
movq %rdi, %rax
leal -0x110000(%rdi), %ecx
cmpl $0xffefffff, %ecx       # imm = 0xFFEFFFFF
ja 0xf8c8
shrl $0x10, %eax
leaq 0xc25c(%rip), %rdi      # 0x1bb20
movl %eax, %esi
jmp 0xf8f4
movq %rax, %rcx
shrq $0x20, %rcx
movzwl %cx, %esi
leal -0xd(%rsi), %ecx
cmpl $-0xd, %ecx
ja 0xf8e3
leaq 0xc265(%rip), %rdi      # 0x1bb46
jmp 0xf8f4
movzwl %ax, %esi
xorl %eax, %eax
cmpl $0x9, %esi
jb 0xf900
leaq 0xc273(%rip), %rdi      # 0x1bb67
xorl %eax, %eax
callq 0xd150
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: acc100_range_check
int
acc100_range_check(struct acc100_conf *acc100_conf)
{
	uint16_t totalQgs = acc100_conf->q_ul_4g.num_qgroups +
			acc100_conf->q_ul_5g.num_qgroups +
			acc100_conf->q_dl_4g.num_qgroups +
			acc100_conf->q_dl_5g.num_qgroups;
	if (totalQgs > ACC100_NUM_QGRPS) {
		printf("ERROR: Number of Qgroups %d > %d\n",
				totalQgs, ACC100_NUM_QGRPS);
		return -1;
	}
	if (acc100_conf->num_vf_bundles > ACC100_NUM_VFS) {
		printf("ERROR: Number of VFs bundle %d > %d\n",
				acc100_conf->num_vf_bundles, ACC100_NUM_VFS);
		return -1;
	}

	if (acc100_queue_range_check(acc100_conf->q_ul_4g) != 0)
		return -1;
	if (acc100_queue_range_check(acc100_conf->q_dl_4g) != 0)
		return -1;
	if (acc100_queue_range_check(acc100_conf->q_ul_5g) != 0)
		return -1;
	if (acc100_queue_range_check(acc100_conf->q_dl_5g) != 0)
		return -1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movzwl 0x12(%rdi), %eax
addw 0x6(%rdi), %ax
addw 0xc(%rdi), %ax
addw 0x18(%rdi), %ax
cmpw $0x9, %ax
jb 0xf92c
movzwl %ax, %esi
leaq 0xc267(%rip), %rdi      # 0x1bb8c
movl $0x8, %edx
jmp 0xf944
movq %rdi, %rbx
movzwl 0x4(%rdi), %esi
cmpl $0x11, %esi
jb 0xf959
leaq 0xc26f(%rip), %rdi      # 0x1bbae
movl $0x10, %edx
xorl %eax, %eax
callq 0xd150
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x6(%rbx), %eax
movzwl 0xa(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf8a8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xf950
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf8a8
testl %eax, %eax
jne 0xf950
movl 0x12(%rbx), %eax
movzwl 0x16(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf8a8
testl %eax, %eax
jne 0xf950
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf8a8
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
jmp 0xf950
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: acc100_parse_conf_file
int
acc100_parse_conf_file(const char *file_name, struct acc100_conf *acc100_conf)
{
	int ret;

	set_default_config(acc100_conf);

	ret = cfg_parse(file_name, acc100_handler, acc100_conf);

	if (ret != 0) {
		printf("ERROR: Config file parser error\n");
		set_default_config(acc100_conf);
		return -1;
	}

	ret = acc100_range_check(acc100_conf);
	if (ret != 0) {
		printf("ERROR: Parameter out of range\n");
		set_default_config(acc100_conf);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xfa1e
leaq 0x107(%rip), %rsi       # 0xfadc
movq %r14, %rdi
movq %rbx, %rdx
callq 0x13bb7
testl %eax, %eax
je 0xf9ed
leaq 0xc3a6(%rip), %rdi      # 0x1bd91
jmp 0xfa00
movq %rbx, %rdi
callq 0xf902
testl %eax, %eax
je 0xfa1a
leaq 0xc373(%rip), %rdi      # 0x1bd73
callq 0xd0c0
movq %rbx, %rdi
callq 0xfa1e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0xfa12
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: parse_number16
static int
parse_number16(const char *str, uint16_t *value)
{
	uint64_t val = 0;
	char *end;

	if (str == NULL)
		return -EINVAL;

	val = strtoul(str, &end, 0);
	if (val > UINT16_MAX || str == end) {
		printf("ERROR: Invalid value %" PRIu64 "\n", val);
		return -ERANGE;
	}

	*value = (uint16_t) val;
	return 1;
}

// Assembly:
testq %rdi, %rdi
je 0x10270
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
xorl %edx, %edx
callq 0xd3a0
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x10276
cmpq %r14, (%rsp)
je 0x10276
movw %ax, (%rbx)
movl $0x1, %eax
jmp 0x1028c
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
retq
leaq 0xbab6(%rip), %rdi      # 0x1bd33
movq %rax, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xffffffde, %eax       # imm = 0xFFFFFFDE
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: parse_item_no
static int
parse_item_no(const char *full_name, const char *base_name)
{
	int postfix_len, number_start, ret;
	uint16_t item_no = 0;

	postfix_len = strlen(full_name) - strlen(base_name);
	if (postfix_len > 0) {
		number_start = strlen((const char *) base_name);
		ret = parse_number16(&full_name[number_start], &item_no);
		if (ret != 1)
			printf("ERROR: Parsing item (%d) failed (%d)\n", item_no, ret);
	}

	return item_no;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movw $0x0, 0xe(%rsp)
callq 0xd110
movq %rax, %r15
movq %r14, %rdi
callq 0xd110
subl %eax, %r15d
testl %r15d, %r15d
jle 0x102ee
cltq
addq %rax, %rbx
leaq 0xe(%rsp), %rsi
movq %rbx, %rdi
callq 0x1023f
cmpl $0x1, %eax
je 0x102ee
movzwl 0xe(%rsp), %esi
leaq 0xba68(%rip), %rdi      # 0x1bd4d
movl %eax, %edx
xorl %eax, %eax
callq 0xd150
movzwl 0xe(%rsp), %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: parse_number32
static int
parse_number32(const char *str, uint32_t *value)
{
	uint64_t val = 0;
	char *end;

	if (str == NULL)
		return -EINVAL;

	val = strtoul(str, &end, 0);
	if (val > UINT32_MAX || str == end) {
		printf("ERROR: Invalid value %" PRIu64 "\n", val);
		return -ERANGE;
	}
	*value = (uint32_t) val;
	return 1;
}

// Assembly:
testq %rdi, %rdi
je 0x1032e
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
xorl %edx, %edx
callq 0xd3a0
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x10334
cmpq %r14, (%rsp)
je 0x10334
movl %eax, (%rbx)
movl $0x1, %eax
jmp 0x1034a
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
retq
leaq 0xb9f8(%rip), %rdi      # 0x1bd33
movq %rax, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xffffffde, %eax       # imm = 0xFFFFFFDE
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/fpga_lte/fpga_lte_cfg_parser.c
// Function: fpga_lte_parse_conf_file
int
fpga_lte_parse_conf_file(const char *file_name,
		struct fpga_lte_fec_conf *fpga_conf)
{
	int ret;

	set_default_config(fpga_conf);

	ret = cfg_parse(file_name, fpga_handler, fpga_conf);

	if (ret == -1) {
		printf("ERROR: Error loading configuration file %s\n",
			file_name);
		set_default_config(fpga_conf);
		return -ENOENT;
	} else if (ret == -2) {
		printf("ERROR: Memory allocation error\n");
		set_default_config(fpga_conf);
		return -ENOMEM;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, (%rsi)
movl $0x40400303, 0x11(%rsi) # imm = 0x40400303
movaps 0xb981(%rip), %xmm0     # 0x1c030
movups %xmm0, 0x1(%rsi)
leaq 0x5f(%rip), %rsi        # 0x10719
movq %rbx, %rdx
callq 0x13bb7
cmpl $-0x2, %eax
je 0x106e8
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x10711
leaq 0xb969(%rip), %rdi      # 0x1c040
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x106f9
leaq 0xba07(%rip), %rdi      # 0x1c0f6
callq 0xd0c0
movl $0xfffffff4, %eax       # imm = 0xFFFFFFF4
leaq 0x1(%rbx), %rcx
movb $0x1, (%rbx)
movl $0x40400303, 0x11(%rbx) # imm = 0x40400303
movaps 0xb922(%rip), %xmm0     # 0x1c030
movups %xmm0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/fpga_lte/fpga_lte_cfg_parser.c
// Function: parse_number8
static int
parse_number8(const char *str, uint8_t *value)
{
	uint64_t val = 0;
	char *end;

	if (str == NULL)
		return -EINVAL;

	val = strtoul(str, &end, 0);
	if (val > UINT8_MAX || str == end) {
		printf("ERROR: Invalid value %" PRIu64 "\n", val);
		return -ERANGE;
	}

	*value = (uint8_t) val;
	return 1;
}

// Assembly:
testq %rdi, %rdi
je 0x10978
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
xorl %edx, %edx
callq 0xd3a0
cmpq $0xff, %rax
ja 0x1097e
cmpq %r14, (%rsp)
je 0x1097e
movb %al, (%rbx)
movl $0x1, %eax
jmp 0x10994
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
retq
leaq 0xb3ae(%rip), %rdi      # 0x1bd33
movq %rax, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xffffffde, %eax       # imm = 0xFFFFFFDE
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/fpga_lte/fpga_lte_cfg_parser.c
// Function: parse_array8
static int
parse_array8(const char *str, uint8_t *array)
{
	int i;
	uint64_t val = 0;
	char *end;

	if (str == NULL)
		return -EINVAL;

	char *val_ch = strtok((char *)str, ",");
	for (i = 0; i < 8 && NULL != val_ch; i++) {

		val = strtoul(val_ch, &end, 0);
		if (val > UINT8_MAX || val_ch == end) {
			printf("ERROR: Invalid value %" PRIu64 "\n", val);
			return -ERANGE;
		}
		array[i] = (uint8_t) val;

		val_ch = strtok(NULL, ",");
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x10a10
movq %rsi, %r14
leaq 0xb73e(%rip), %rsi      # 0x1c0f4
callq 0xd350
movl $0x1, %ebx
testq %rax, %rax
je 0x10a2d
movq %rax, %r13
xorl %ebp, %ebp
movq %rsp, %r15
leaq 0xb720(%rip), %r12      # 0x1c0f4
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xd3a0
cmpq $0xff, %rax
ja 0x10a17
cmpq (%rsp), %r13
je 0x10a17
movb %al, (%r14,%rbp)
xorl %edi, %edi
movq %r12, %rsi
callq 0xd350
cmpq $0x6, %rbp
ja 0x10a2d
movq %rax, %r13
incq %rbp
testq %rax, %rax
jne 0x109d4
jmp 0x10a2d
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
jmp 0x10a2d
leaq 0xb315(%rip), %rdi      # 0x1bd33
movq %rax, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xffffffde, %ebx       # imm = 0xFFFFFFDE
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/fpga_5gnr/fpga_5gnr_cfg_parser.c
// Function: fpga_5gnr_parse_conf_file
int
fpga_5gnr_parse_conf_file(const char *file_name,
		struct fpga_5gnr_fec_conf *fpga_conf)
{
	int ret;

	set_default_config(fpga_conf);

	ret = cfg_parse(file_name, fpga_handler, fpga_conf);

	if (ret == -1) {
		printf("ERROR: Error loading configuration file %s\n",
			file_name);
		set_default_config(fpga_conf);
		return -ENOENT;
	} else if (ret == -2) {
		printf("ERROR: Memory allocation error\n");
		set_default_config(fpga_conf);
		return -ENOMEM;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, (%rsi)
movl $0x40400303, 0x11(%rsi) # imm = 0x40400303
movaps 0xb2c1(%rip), %xmm0     # 0x1c030
movups %xmm0, 0x1(%rsi)
leaq 0x5f(%rip), %rsi        # 0x10dd9
movq %rbx, %rdx
callq 0x13bb7
cmpl $-0x2, %eax
je 0x10da8
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x10dd1
leaq 0xb2a9(%rip), %rdi      # 0x1c040
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x10db9
leaq 0xb347(%rip), %rdi      # 0x1c0f6
callq 0xd0c0
movl $0xfffffff4, %eax       # imm = 0xFFFFFFF4
leaq 0x1(%rbx), %rcx
movb $0x1, (%rbx)
movl $0x40400303, 0x11(%rbx) # imm = 0x40400303
movaps 0xb262(%rip), %xmm0     # 0x1c030
movups %xmm0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb_fft_win_check
void
vrb_fft_win_check(int16_t *gTDWinCoff, hw_device *accel_pci_dev)
{
	int16_t i, offset_p = 0, offset_i, fft_sz, lut_sz, wrap1, wrap2, win_start, win_size, win;

	for (fft_sz = 32; fft_sz <= 2048; fft_sz *= 2) {
		/*
		 * Manage FFT wrap for negative and positive halves.
		 * Each table width is fft_sz / 2.
		 */
		lut_sz = fft_sz / 2;
		wrap1 = lut_sz / 2 * 3;
		wrap2 = lut_sz / 2;
		for (win = 0;  win < BB_ACC_MAX_WIN; win++) {
			offset_i = BB_ACC_MAX_WIN * offset_p + win * lut_sz;
			win_size = 0;
			win_start = 0;
			/* Check non null value in LUT for size and start of window shape. */
			for (i = 0; i < lut_sz; i++) {
				if (gTDWinCoff[offset_i + ((wrap1 - i) % lut_sz)] > 0) {
					win_size++;
					win_start = wrap2 - i;
				}
			}
			win_size = MAX(1, win_size);
			if (fft_sz == 2048) {
				accel_pci_dev->fft_win_size[win] = win_size;
				accel_pci_dev->fft_win_start[win] = win_start;
			}
			if ((win == 0) && (fft_sz == 2048))
				LOG(INFO, "  FFT Size %d Window %d Size %d Start %d",
						fft_sz, win, win_size, win_start);
		}
		offset_p += lut_sz;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, %r14
movl $0x200000, %r10d        # imm = 0x200000
xorl %eax, %eax
movl %r10d, %ebp
sarl $0x11, %ebp
movl %r10d, %ecx
sarl $0x12, %ecx
movl %ecx, 0x1c(%rsp)
movl %r10d, %ecx
sarl %ecx
movl %ecx, 0x18(%rsp)
movl %eax, 0xc(%rsp)
shll $0x14, %eax
movl %eax, 0x14(%rsp)
movl %r10d, %eax
sarl $0x2, %eax
leal (%rax,%rax,2), %r15d
sarl $0x10, %r15d
xorl %r12d, %r12d
movl %r10d, 0x10(%rsp)
testl %ebp, %ebp
jle 0x1159d
movl 0x18(%rsp), %ecx
imull %r12d, %ecx
addl 0x14(%rsp), %ecx
sarl $0x10, %ecx
xorl %edx, %edx
movw $0x1, %di
movl 0x1c(%rsp), %r8d
xorl %esi, %esi
xorl %r9d, %r9d
movl %r15d, %eax
subl %edx, %eax
cltd
idivl %ebp
addl %ecx, %edx
movslq %edx, %rax
xorl %edx, %edx
cmpw $0x0, (%r14,%rax,2)
setg %dl
cmovgl %r8d, %r9d
addl %edx, %esi
movswl %di, %edx
incl %edi
decl %r8d
cmpl %edx, %ebp
jg 0x1156d
movswl %r9w, %ebx
jmp 0x115a1
xorl %ebx, %ebx
xorl %esi, %esi
cmpw $0x2, %si
movl $0x1, %r13d
cmovgel %esi, %r13d
cmpl $0x8000000, %r10d       # imm = 0x8000000
jne 0x115d1
movzwl %r13w, %eax
movq 0x20(%rsp), %rcx
movl %eax, 0x540(%rcx,%r12,4)
movl %ebx, 0x500(%rcx,%r12,4)
cmpl $0x8000000, %r10d       # imm = 0x8000000
setne %al
testq %r12, %r12
setne %cl
orb %al, %cl
jne 0x11629
callq 0x12cd5
leaq 0x228df(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movzwl %r13w, %r10d
subq $0x8, %rsp
movl $0x2, %edi
xorl %esi, %esi
leaq 0xab77(%rip), %rdx      # 0x1c182
movq %rax, %rcx
movl $0x800, %r9d            # imm = 0x800
xorl %eax, %eax
pushq %rbx
pushq %r10
pushq $0x0
callq 0x19ca8
movl 0x30(%rsp), %r10d
addq $0x20, %rsp
incq %r12
cmpq $0x10, %r12
jne 0x1154a
movl 0xc(%rsp), %eax
addl %ebp, %eax
addl %r10d, %r10d
cmpl $0x8000001, %r10d       # imm = 0x8000001
jl 0x11510
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb_fft_lut_md5sum
void
vrb_fft_lut_md5sum(const char *lut_filename, hw_device *accel_pci_dev)
{
	uint16_t ver_md;
	char md_prefix[8];
	char *cmd;
	FILE *fp;

	uint16_t size_cmd = snprintf(NULL, 0, "%s", lut_filename) + 8;
	cmd = malloc(size_cmd);
	sprintf(cmd, "md5sum %s", lut_filename);
	fp = popen(cmd, "r");
	free(cmd);
	if (fp == NULL) {
		LOG(ERR, "Unable to open FFT LUT %s", lut_filename);
		return;
	}
	if (fgets(md_prefix, 5, fp) == NULL) {
		LOG(ERR, "Unable to access FFT LUT %s", lut_filename);
		pclose(fp);
		return;
	}
	ver_md = (int)strtol(md_prefix, NULL, 16);
	LOG(INFO, "  FFT Version Number %X", ver_md);
	pclose(fp);
	accel_pci_dev->fft_version_md5sum = ver_md;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd35d(%rip), %rdx      # 0x1e9cd
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xd170
addl $0x8, %eax
movzwl %ax, %edi
callq 0xd280
movq %rax, %r12
leaq 0xab1f(%rip), %rsi      # 0x1c1b2
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xd3e0
leaq 0xaad9(%rip), %rsi      # 0x1c180
movq %r12, %rdi
callq 0xd320
movq %rax, %r15
movq %r12, %rdi
callq 0xd030
testq %r15, %r15
je 0x11728
movq %rsp, %rdi
movl $0x5, %esi
movq %r15, %rdx
callq 0xd1f0
testq %rax, %rax
je 0x1175a
movq %rsp, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd240
movq %rax, %r14
callq 0x12cd5
leaq 0x227da(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movzwl %r14w, %r9d
leaq 0xaafb(%rip), %rdx      # 0x1c200
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movq %r15, %rdi
callq 0xd160
movw %r14w, 0x4fc(%rbx)
jmp 0x11789
callq 0x12cd5
leaq 0x2279c(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xaa7e(%rip), %rdx      # 0x1c1bc
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x19ca8
callq 0x12cd5
leaq 0x2276a(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xaa6d(%rip), %rdx      # 0x1c1dd
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
callq 0x19ca8
movq %r15, %rdi
callq 0xd160
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_acc_from_qgid
int
vrb1_acc_from_qgid(int qg_idx, struct vrb1_conf *vrb1_conf)
{
	int acc_qg[VRB1_NUM_QGRPS];
	int num_qgroups_per_fn[NUM_ACC];
	int acc, qgid, qg_index = 0;

	for (qgid = 0; qgid < VRB1_NUM_QGRPS; qgid++)
		acc_qg[qgid] = 0;
	num_qgroups_per_fn[UL_4G] = vrb1_conf->q_ul_4g.num_qgroups;
	num_qgroups_per_fn[UL_5G] = vrb1_conf->q_ul_5g.num_qgroups;
	num_qgroups_per_fn[DL_4G] = vrb1_conf->q_dl_4g.num_qgroups;
	num_qgroups_per_fn[DL_5G] = vrb1_conf->q_dl_5g.num_qgroups;
	num_qgroups_per_fn[FFT] = vrb1_conf->q_fft.num_qgroups;
	for (acc = UL_4G;  acc < NUM_ACC; acc++)
		for (qgid = 0; qgid < num_qgroups_per_fn[acc]; qgid++)
			acc_qg[qg_index++] = acc;
	acc = acc_qg[qg_idx];
	return acc;
}

// Assembly:
xorps %xmm0, %xmm0
movaps %xmm0, -0x48(%rsp)
movaps %xmm0, -0x38(%rsp)
movaps %xmm0, -0x28(%rsp)
movaps %xmm0, -0x18(%rsp)
movzwl 0x6(%rsi), %eax
movl %eax, -0x68(%rsp)
movzwl 0x12(%rsi), %eax
movl %eax, -0x64(%rsp)
movzwl 0xc(%rsi), %eax
movl %eax, -0x60(%rsp)
movzwl 0x18(%rsi), %eax
movl %eax, -0x5c(%rsp)
movzwl 0x1e(%rsi), %eax
movl %eax, -0x58(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
movl -0x68(%rsp,%rax,4), %edx
testl %edx, %edx
jle 0x117fa
movslq %ecx, %rsi
leaq (%rsp,%rsi,4), %r8
addq $-0x48, %r8
xorl %esi, %esi
movl %eax, (%r8,%rsi,4)
incq %rsi
cmpl %esi, %edx
jne 0x117ed
addl %esi, %ecx
incq %rax
cmpq $0x5, %rax
jne 0x117d8
movslq %edi, %rax
movl -0x48(%rsp,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_qtop_from_acc
void
vrb1_qtop_from_acc(struct q_topology_t **qtop, int acc_enum,
		     struct vrb1_conf *vrb1_conf)
{
	struct q_topology_t *p_qtop;

	p_qtop = NULL;
	switch (acc_enum) {
	case UL_4G:
		p_qtop = &vrb1_conf->q_ul_4g;
		break;
	case UL_5G:
		p_qtop = &vrb1_conf->q_ul_5g;
		break;
	case DL_4G:
		p_qtop = &vrb1_conf->q_dl_4g;
		break;
	case DL_5G:
		p_qtop = &vrb1_conf->q_dl_5g;
		break;
	case FFT:
		p_qtop = &vrb1_conf->q_fft;
		break;
	default:
		/* NOTREACHED */
		printf("Unexpected error evaluating queue topology %d", acc_enum);
		break;
	}
	*qtop = p_qtop;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x4, %esi
ja 0x1184a
movq %rdx, %r14
movl %esi, %eax
leaq 0xa8f5(%rip), %rcx      # 0x1c118
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %r14
jmp 0x1185b
addq $0x1e, %r14
jmp 0x1185b
addq $0xc, %r14
jmp 0x1185b
addq $0x18, %r14
jmp 0x1185b
addq $0x12, %r14
jmp 0x1185b
leaq 0xa9ce(%rip), %rdi      # 0x1c21f
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xd150
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_aq_depth
int
vrb1_aq_depth(int qg_idx, struct vrb1_conf *vrb1_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = vrb1_acc_from_qgid(qg_idx, vrb1_conf);

	vrb1_qtop_from_acc(&q_top, acc_enum, vrb1_conf);
	if (q_top == NULL)
		return 1;
	return MAX(1, q_top->aq_depth_log2);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x11795
cmpl $0x4, %eax
ja 0x118a4
movl %eax, %eax
leaq 0xa8af(%rip), %rcx      # 0x1c12c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %rbx
jmp 0x118b6
addq $0x1e, %rbx
jmp 0x118b6
addq $0xc, %rbx
jmp 0x118b6
addq $0x18, %rbx
jmp 0x118b6
addq $0x12, %rbx
jmp 0x118b6
leaq 0xa974(%rip), %rdi      # 0x1c21f
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0xd150
testq %rbx, %rbx
je 0x118cb
movzwl 0x4(%rbx), %eax
cmpw $0x1, %ax
adcl $0x0, %eax
movzwl %ax, %eax
jmp 0x118d0
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_aq_num
int
vrb1_aq_num(int qg_idx, struct vrb1_conf *vrb1_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = vrb1_acc_from_qgid(qg_idx, vrb1_conf);

	vrb1_qtop_from_acc(&q_top, acc_enum, vrb1_conf);
	if (!q_top)
		return 0;
	return q_top->num_aqs_per_groups;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x11795
cmpl $0x4, %eax
ja 0x11910
movl %eax, %eax
leaq 0xa857(%rip), %rcx      # 0x1c140
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %rbx
jmp 0x11922
addq $0x1e, %rbx
jmp 0x11922
addq $0xc, %rbx
jmp 0x11922
addq $0x18, %rbx
jmp 0x11922
addq $0x12, %rbx
jmp 0x11922
leaq 0xa908(%rip), %rdi      # 0x1c21f
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0xd150
testq %rbx, %rbx
je 0x1192d
movzwl 0x2(%rbx), %eax
jmp 0x1192f
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_cluster_reset
void vrb1_cluster_reset(void *dev)
{
	hw_device *accel_dev = (hw_device *)dev;
	void *bar0addr = accel_dev->bar0Addr;
	uint16_t template_idx, i;

	vrb1_disable_ir_regs(bar0addr);

	LOG(DEBUG, "vrb1cluster reset");
	/* Disable Qmgr Template Configuration */
	vrb1_disable_aqueues(bar0addr);
	for (template_idx = 0; template_idx < VRB1_NUM_TMPL; template_idx++) {
		vrb1_reg_fast_write(bar0addr, HWPfQmgrGrpTmplateReg4Indx +
				sizeof(uint32_t) * template_idx, 0);
	}

	/* Stop the DMA and ask Ocode to go idle and wait for 1 msec. */
	vrb1_reg_fast_write(bar0addr, HWPfHiOcodeMailBox, 0);
	vrb1_reg_fast_write(bar0addr, HWPfDmaSoftResetReg, 0x2);
	usleep(1000);
	vrb1_reg_fast_write(bar0addr, HWPfDmaSoftResetReg, 0x0);

	for (i = 0; i < 2; i++) {
		/* cluster reset */
		vrb1_reg_fast_write(bar0addr, HWPfHiCoresHardResetReg, 0xFFFFFFFF);
		vrb1_reg_fast_write(bar0addr, HWPfHi5GHardResetReg, 0xFFFFFFFF);
		vrb1_reg_fast_write(bar0addr, HWPfHiHardResetReg, 0x3FF);

		/* wait for 10 usecs */
		usleep(10);
	}

	vrb1_reset_info_ring(accel_dev);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
xorl %r15d, %r15d
movl %r15d, 0xc84020(%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc84040(%r14)
movl %r15d, 0xc84024(%r14)
movl %r15d, 0xc84028(%r14)
movl %eax, 0xc84048(%r14)
movl %eax, 0xc84044(%r14)
callq 0x12cd5
leaq 0x22506(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
leaq 0xa878(%rip), %rdx      # 0x1c24d
leaq 0xa890(%rip), %r9       # 0x1c26c
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
xorl %eax, %eax
movl %eax, 0xa10000(%r14,%r15,4)
addl $0x10000, %eax          # imm = 0x10000
cmpl $0x100000, %eax         # imm = 0x100000
jne 0x119ef
incq %r15
cmpq $0x10, %r15
jne 0x119ed
xorl %eax, %eax
movl $0x0, 0xa00a00(%r14,%rax,4)
incq %rax
cmpq $0x20, %rax
jne 0x11a0e
xorl %ebp, %ebp
movl %ebp, 0xc84018(%r14)
movl $0x2, 0xb8000c(%r14)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xd460
movl %ebp, 0xb8000c(%r14)
movw $0x1, %bp
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, 0xc84010(%r14)
movl %r15d, 0xc8400c(%r14)
movl $0x3ff, 0xc84008(%r14) # imm = 0x3FF
movl $0xa, %edi
callq 0xd460
decw %bp
je 0x11a52
movq 0x98(%rbx), %rax
movq 0xb0(%rbx), %rcx
movq %rax, %rdx
shrq $0x20, %rdx
movl %edx, 0xc8401c(%rcx)
movl %eax, 0xc84014(%rcx)
movl $0xf000, 0xc8401c(%rcx) # imm = 0xF000
movl 0xc8401c(%rcx), %eax
shrl $0x2, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movw %ax, 0xa8(%rbx)
movq 0x90(%rbx), %rax
testq %rax, %rax
je 0x11adb
xorl %ecx, %ecx
movl $0x0, (%rax,%rcx)
incq %rcx
cmpq $0x400, %rcx            # imm = 0x400
jne 0x11ac8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_enable_intr
int vrb1_enable_intr(void *dev)
{
	int ret;
	hw_device *accel_pci_dev = (hw_device *)dev;
	void *bar0addr = accel_pci_dev->bar0Addr;

	LOG(DEBUG, "Enable VRB1 interrupts");
	/* allocate info ring */
	ret = vrb1_allocate_info_ring(dev);
	if (ret < 0) {
		LOG(ERR, "vrb1allocate info ring failed");
		return -1;
	}

	vrb1_enable_ir_regs(bar0addr);

	LOG(DEBUG, "Done");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0xb0(%rdi), %r13
callq 0x12cd5
leaq 0x223c6(%rip), %r12     # 0x33ed0
movq 0x18(%r12), %r8
leaq 0xa769(%rip), %rdx      # 0x1c27f
leaq 0xa786(%rip), %r9       # 0x1c2a3
xorl %ebx, %ebx
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
cmpq $0x0, 0x90(%r14)
jne 0x11bea
movq 0xb0(%r14), %rbp
leaq 0x98(%r14), %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x18f47
movq %rax, %r15
movq %rax, 0x90(%r14)
callq 0x12cd5
testq %r15, %r15
je 0x11c4e
movq 0x18(%r12), %r8
movups 0x90(%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0xac5b(%rip), %rdx      # 0x1c7e4
leaq 0xac85(%rip), %r15      # 0x1c815
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x19ca8
movl 0xc8401c(%rbp), %eax
shrl $0x2, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movw %ax, 0xa8(%r14)
callq 0x12cd5
movq 0x18(%r12), %r8
movzwl 0xa8(%r14), %ecx
movl %ecx, (%rsp)
leaq 0xac57(%rip), %rdx      # 0x1c82d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x19ca8
movl %ebx, 0xc84020(%r13)
movl %ebx, 0xc84040(%r13)
movl %ebx, 0xc84028(%r13)
movl %ebx, 0xc84024(%r13)
movl %ebx, 0xc84048(%r13)
movl %ebx, 0xc84044(%r13)
callq 0x12cd5
movq 0x18(%r12), %r8
leaq 0x98ff(%rip), %rdx      # 0x1b524
leaq 0xa677(%rip), %r9       # 0x1c2a3
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %r8
leaq 0xab5d(%rip), %rdx      # 0x1c7b6
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
callq 0x12cd5
movq (%r12), %r8
leaq 0xa63d(%rip), %rdx      # 0x1c2b4
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x11c3d
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_disable_intr
int
vrb1_disable_intr(void *dev)
{
	hw_device *accel_pci_dev = (hw_device *)dev;
	void *bar0addr = accel_pci_dev->bar0Addr;

	LOG(DEBUG, "Disable interrupts");

	vrb1_disable_ir_regs(bar0addr);

	vrb1_free_info_ring(dev);

	LOG(DEBUG, "Done");
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb0(%rdi), %r15
callq 0x12cd5
leaq 0x22227(%rip), %r14     # 0x33ed0
movq 0x18(%r14), %r8
leaq 0xa625(%rip), %rdx      # 0x1c2d9
leaq 0xa63e(%rip), %r9       # 0x1c2f9
xorl %ebp, %ebp
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl %ebp, 0xc84020(%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc84040(%r15)
movl %ebp, 0xc84024(%r15)
movl %ebp, 0xc84028(%r15)
movl %eax, 0xc84048(%r15)
movl %eax, 0xc84044(%r15)
callq 0x12cd5
movq 0x18(%r14), %r8
leaq 0xab40(%rip), %rdx      # 0x1c84d
leaq 0xab55(%rip), %r9       # 0x1c869
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x11d7c
leaq 0x90(%rbx), %r15
movq 0xa0(%rbx), %rsi
callq 0x18f61
movw $0x0, 0xa8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
callq 0x12cd5
movq 0x18(%r14), %r8
leaq 0x97c0(%rip), %rdx      # 0x1b524
leaq 0xaafe(%rip), %r9       # 0x1c869
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
callq 0x12cd5
movq 0x18(%r14), %r8
leaq 0x9798(%rip), %rdx      # 0x1b524
leaq 0xa566(%rip), %r9       # 0x1c2f9
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_parser.c
// Function: vrb1_queue_range_check
int
vrb1_queue_range_check(struct q_topology_t q_conf)
{
	if ((q_conf.num_aqs_per_groups < 1) ||
			(q_conf.num_aqs_per_groups > VRB1_NUM_AQS)) {
		printf("ERROR: Number of AQs out of range %d\n",
				q_conf.num_aqs_per_groups);
		return -1;
	}
	if ((q_conf.aq_depth_log2 < 1) ||
			(q_conf.aq_depth_log2 > VRB1_MAX_QDEPTH)) {
		printf("ERROR: AQ Depth out of range %d\n",
				q_conf.aq_depth_log2);
		return -1;
	}
	if (q_conf.num_qgroups > VRB1_NUM_QGRPS) {
		printf("ERROR: Number of QG out of range %d\n",
				q_conf.num_qgroups);
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rax
movq %rdi, %rax
leal -0x110000(%rdi), %ecx
cmpl $0xffefffff, %ecx       # imm = 0xFFEFFFFF
ja 0x12d40
shrl $0x10, %eax
leaq 0x8de4(%rip), %rdi      # 0x1bb20
movl %eax, %esi
jmp 0x12d6c
movq %rax, %rcx
shrq $0x20, %rcx
movzwl %cx, %esi
leal -0xd(%rsi), %ecx
cmpl $-0xd, %ecx
ja 0x12d5b
leaq 0x8ded(%rip), %rdi      # 0x1bb46
jmp 0x12d6c
movzwl %ax, %esi
xorl %eax, %eax
cmpl $0x11, %esi
jb 0x12d78
leaq 0x8dfb(%rip), %rdi      # 0x1bb67
xorl %eax, %eax
callq 0xd150
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_parser.c
// Function: vrb1_range_check
int
vrb1_range_check(struct vrb1_conf *vrb1_conf)
{
	uint16_t totalQgs = vrb1_conf->q_ul_4g.num_qgroups +
			vrb1_conf->q_ul_5g.num_qgroups +
			vrb1_conf->q_dl_4g.num_qgroups +
			vrb1_conf->q_dl_5g.num_qgroups +
			vrb1_conf->q_fft.num_qgroups;
	if (totalQgs > VRB1_NUM_QGRPS) {
		printf("ERROR: Number of Qgroups %d > %d\n",
				totalQgs, VRB1_NUM_QGRPS);
		return -1;
	}
	if (vrb1_conf->num_vf_bundles > VRB1_NUM_VFS) {
		printf("ERROR: Number of VFs bundle %d > %d\n",
				vrb1_conf->num_vf_bundles, VRB1_NUM_VFS);
		return -1;
	}
	if (vrb1_queue_range_check(vrb1_conf->q_ul_4g) != 0)
		return -1;
	if (vrb1_queue_range_check(vrb1_conf->q_dl_4g) != 0)
		return -1;
	if (vrb1_queue_range_check(vrb1_conf->q_ul_5g) != 0)
		return -1;
	if (vrb1_queue_range_check(vrb1_conf->q_dl_5g) != 0)
		return -1;
	if (vrb1_queue_range_check(vrb1_conf->q_fft) != 0)
		return -1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movzwl 0x12(%rdi), %eax
addw 0x6(%rdi), %ax
addw 0xc(%rdi), %ax
addw 0x18(%rdi), %ax
addw 0x1e(%rdi), %ax
cmpw $0x11, %ax
jb 0x12da3
movzwl %ax, %esi
leaq 0x8deb(%rip), %rdi      # 0x1bb8c
jmp 0x12db6
movq %rdi, %rbx
movzwl 0x4(%rdi), %esi
cmpl $0x11, %esi
jb 0x12dd0
leaq 0x8df8(%rip), %rdi      # 0x1bbae
movl $0x10, %edx
xorl %eax, %eax
callq 0xd150
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x6(%rbx), %eax
movzwl 0xa(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12d20
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x12dc7
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12d20
testl %eax, %eax
jne 0x12dc7
movl 0x12(%rbx), %eax
movzwl 0x16(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12d20
testl %eax, %eax
jne 0x12dc7
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12d20
testl %eax, %eax
jne 0x12dc7
movl 0x1e(%rbx), %eax
movzwl 0x22(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12d20
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
jmp 0x12dc7
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb1/vrb1_cfg_parser.c
// Function: vrb1_parse_conf_file
int
vrb1_parse_conf_file(const char *file_name, struct vrb1_conf *vrb1_conf)
{
	int ret;

	set_default_config(vrb1_conf);

	ret = cfg_parse(file_name, vrb1_handler, vrb1_conf);
	if (ret != 0) {
		printf("ERROR: Config file parser error\n");
		set_default_config(vrb1_conf);
		return -1;
	}

	ret = vrb1_range_check(vrb1_conf);
	if (ret != 0) {
		printf("ERROR: Parameter out of range\n");
		set_default_config(vrb1_conf);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x12eaf
leaq 0x134(%rip), %rsi       # 0x12f9a
movq %r14, %rdi
movq %rbx, %rdx
callq 0x13bb7
testl %eax, %eax
je 0x12e7e
leaq 0x8f15(%rip), %rdi      # 0x1bd91
jmp 0x12e91
movq %rbx, %rdi
callq 0x12d7a
testl %eax, %eax
je 0x12eab
leaq 0x8ee2(%rip), %rdi      # 0x1bd73
callq 0xd0c0
movq %rbx, %rdi
callq 0x12eaf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x12ea3
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/cfg_reader/cfg_reader.c
// Function: rstrip
static char*
rstrip(char *s)
{
	char *p = s + strlen(s);
	while (p > s) {
		p--;
		if (*p == ' ' || *s == '\t' || *p == '\n')
			*p = '\0';
		else
			break;
	}
	return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xd110
testq %rax, %rax
jle 0x13bb2
addq %rbx, %rax
movb -0x1(%rax), %cl
cmpb $0x20, %cl
je 0x13ba7
cmpb $0xa, %cl
je 0x13ba7
cmpb $0x9, (%rbx)
jne 0x13bb2
decq %rax
movb $0x0, (%rax)
cmpq %rbx, %rax
ja 0x13b95
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/cfg_reader/cfg_reader.c
// Function: cfg_parse
int
cfg_parse(const char *filename, cfg_handler handler, void *user)
{

	FILE *file;
	int error_line_index;
	file = fopen(filename, "r");
	if (!file) {
		printf("error, cannot load cfg files\n");
		return -1;
	}
	error_line_index = cfg_parse_contents(file, handler, user);
	fclose(file);
	return error_line_index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x85b7(%rip), %rsi      # 0x1c180
callq 0xd330
testq %rax, %rax
je 0x13bf2
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x13970
movl %eax, %ebx
movq %r15, %rdi
callq 0xd0f0
movl %ebx, %eax
jmp 0x13c03
leaq 0x8e2c(%rip), %rdi      # 0x1ca25
callq 0xd0c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/cfg_reader/cfg_reader.c
// Function: cfg_file_check_path_safety
bool
cfg_file_check_path_safety(const char *cfg_filename) {
	if (cfg_filename == NULL) {
		/* check if the config path is "NULL" */
		return true;
	}
	int offset = 0;
	int len = strlen(cfg_filename) + 1;
	if (len < 3)
		return false;
	/* check if the config path includes "../" */
	for (offset = 0; offset <= len - 3; offset++) {
		int a = (*(cfg_filename + offset) == '.');
		int b = (*(cfg_filename + offset + 1) == '.');
		int c = (*(cfg_filename + offset + 2) == '/');
		if (a && b && c)
			return true;
	}
	return false;
}

// Assembly:
testq %rdi, %rdi
je 0x13c29
pushq %rbx
movq %rdi, %rbx
callq 0xd110
leal -0x7fffffff(%rax), %ecx
cmpl $0x80000003, %ecx       # imm = 0x80000003
jae 0x13c2d
xorl %ecx, %ecx
jmp 0x13c61
movb $0x1, %cl
jmp 0x13c62
decl %eax
movl $0x1, %edx
movb -0x1(%rbx,%rdx), %cl
movb (%rbx,%rdx), %sil
xorb $0x2e, %cl
xorb $0x2e, %sil
orb %cl, %sil
movb 0x1(%rbx,%rdx), %cl
xorb $0x2f, %cl
orb %sil, %cl
sete %cl
je 0x13c61
leaq 0x1(%rdx), %rsi
cmpq %rdx, %rax
movq %rsi, %rdx
jne 0x13c34
popq %rbx
movl %ecx, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_accFromQgid
int
vrb2_accFromQgid(int qg_idx, struct vrb2_conf *vrb2_conf)
{
	int accQg[VRB2_NUM_QGRPS];
	int NumQGroupsPerFn[NUM_ACC];
	int acc, qgIdx, qgIndex = 0;
	for (qgIdx = 0; qgIdx < VRB2_NUM_QGRPS; qgIdx++)
		accQg[qgIdx] = 0;
	NumQGroupsPerFn[UL_4G] = vrb2_conf->q_ul_4g.num_qgroups;
	NumQGroupsPerFn[UL_5G] = vrb2_conf->q_ul_5g.num_qgroups;
	NumQGroupsPerFn[DL_4G] = vrb2_conf->q_dl_4g.num_qgroups;
	NumQGroupsPerFn[DL_5G] = vrb2_conf->q_dl_5g.num_qgroups;
	NumQGroupsPerFn[FFT] = vrb2_conf->q_fft.num_qgroups;
	NumQGroupsPerFn[MLD] = vrb2_conf->q_mld.num_qgroups;
	for (acc = UL_4G;  acc < NUM_ACC; acc++)
		for (qgIdx = 0; qgIdx < NumQGroupsPerFn[acc]; qgIdx++)
			accQg[qgIndex++] = acc;
	acc = accQg[qg_idx];
	return acc;
}

// Assembly:
subq $0x28, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rsp)
movaps %xmm0, -0x50(%rsp)
movaps %xmm0, -0x40(%rsp)
movaps %xmm0, -0x30(%rsp)
movaps %xmm0, -0x20(%rsp)
movaps %xmm0, -0x10(%rsp)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movzwl 0x6(%rsi), %eax
movl %eax, -0x80(%rsp)
movzwl 0x12(%rsi), %eax
movl %eax, -0x7c(%rsp)
movzwl 0xc(%rsi), %eax
movl %eax, -0x78(%rsp)
movzwl 0x18(%rsi), %eax
movl %eax, -0x74(%rsp)
movzwl 0x1e(%rsi), %eax
movl %eax, -0x70(%rsp)
movzwl 0x24(%rsi), %eax
movl %eax, -0x6c(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
movl -0x80(%rsp,%rax,4), %edx
testl %edx, %edx
jle 0x14b3f
movslq %ecx, %rsi
leaq (%rsp,%rsi,4), %r8
addq $-0x60, %r8
xorl %esi, %esi
movl %eax, (%r8,%rsi,4)
incq %rsi
cmpl %esi, %edx
jne 0x14b32
addl %esi, %ecx
incq %rax
cmpq $0x6, %rax
jne 0x14b1d
movslq %edi, %rax
movl -0x60(%rsp,%rax,4), %eax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_qtopFromAcc
void
vrb2_qtopFromAcc(struct q_topology_t **qtop, int acc_enum,
		struct vrb2_conf *vrb2_conf)
{
	struct q_topology_t *p_qtop;
	p_qtop = NULL;
	switch (acc_enum) {
	case UL_4G:
		p_qtop = &(vrb2_conf->q_ul_4g);
		break;
	case UL_5G:
		p_qtop = &(vrb2_conf->q_ul_5g);
		break;
	case DL_4G:
		p_qtop = &(vrb2_conf->q_dl_4g);
		break;
	case DL_5G:
		p_qtop = &(vrb2_conf->q_dl_5g);
		break;
	case FFT:
		p_qtop = &(vrb2_conf->q_fft);
		break;
	case MLD:
		p_qtop = &(vrb2_conf->q_mld);
		break;
	default:
		/* NOTREACHED */
		LOG(ERR, "Unexpected error evaluating vrb2_qtopFromAcc %d", acc_enum);
		break;
	}
	*qtop = p_qtop;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x5, %esi
ja 0x14b9b
movq %rdx, %r14
movl %ebp, %eax
leaq 0x7f56(%rip), %rcx      # 0x1cac4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %r14
jmp 0x14bc5
addq $0x1e, %r14
jmp 0x14bc5
addq $0xc, %r14
jmp 0x14bc5
addq $0x18, %r14
jmp 0x14bc5
addq $0x12, %r14
jmp 0x14bc5
addq $0x24, %r14
jmp 0x14bc5
callq 0x16854
leaq 0x1f329(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0x8393(%rip), %rdx      # 0x1cf44
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x19ca8
movq %r14, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_aqNum
int
vrb2_aqNum(int qg_idx, struct vrb2_conf *vrb2_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = vrb2_accFromQgid(qg_idx, vrb2_conf);
	vrb2_qtopFromAcc(&q_top, acc_enum, vrb2_conf);
	if (q_top == NULL)
		return 0;
	return q_top->num_aqs_per_groups;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsp, %r14
movq $0x0, (%r14)
callq 0x14abb
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0x14b54
movq (%r14), %rax
testq %rax, %rax
je 0x14c04
movzwl 0x2(%rax), %eax
jmp 0x14c06
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_cluster_reset
void vrb2_cluster_reset(void *dev)
{
	hw_device *accel_dev = (hw_device *)dev;
	void *bar0addr = accel_dev->bar0Addr;
	uint16_t template_idx;

	vrb2_disable_ir_regs(bar0addr);

	LOG(DEBUG, "VRB2 cluster reset");
	/* Disable Qmgr Template Configuration */
	for (template_idx = 0; template_idx < VRB2_NUM_TMPL; template_idx++) {
		vrb2_reg_write(bar0addr, HWPfQmgrGrpTmplateEnRegIndx +
				sizeof(uint32_t) * template_idx, 0);
	}
	/* Stop the DMA and wait for 100 usec */
	vrb2_reg_write(bar0addr, HWPfDmaSoftResetReg, 0x2);
	usleep(100);
	/* cluster reset */
	vrb2_reg_write(bar0addr, HWPfHiCoresHardResetReg, 0xFFFFFFFF);
	vrb2_reg_write(bar0addr, HWPfHi5GHardResetReg, 0xFFFFFFFF);
	vrb2_reg_write(bar0addr, HWPfHiHardResetReg, 0x3FF);
	/* wait for 10 usecs */
	usleep(10);
	vrb2_reset_info_ring(accel_dev);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
movq %r14, %rdi
callq 0x14d48
callq 0x16854
leaq 0x1f29d(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
leaq 0x833d(%rip), %rdx      # 0x1cf7b
leaq 0x8356(%rip), %r9       # 0x1cf9b
xorl %r15d, %r15d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl $0x0, 0xa00e00(%r14,%r15,4)
movl $0x1, %edi
callq 0xd460
incq %r15
cmpq $0x20, %r15
jne 0x14c59
movl $0x2, 0xb8000c(%r14)
movl $0x1, %edi
callq 0xd460
movl $0x64, %edi
callq 0xd460
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, 0xc84010(%r14)
movl $0x1, %edi
callq 0xd460
movl %ebp, 0xc8400c(%r14)
movl $0x1, %edi
callq 0xd460
movl $0x3ff, %ebp            # imm = 0x3FF
movl %ebp, 0xc84008(%r14)
movl $0x1, %edi
callq 0xd460
movl $0xa, %edi
callq 0xd460
movq 0x98(%rbx), %r14
movq 0xb0(%rbx), %r15
movq %r14, %rax
shrq $0x20, %rax
movl %eax, 0xc8401c(%r15)
movl $0x1, %edi
callq 0xd460
movl %r14d, 0xc84014(%r15)
movl $0x1, %edi
callq 0xd460
movl $0xf000, 0xc8401c(%r15) # imm = 0xF000
movl $0x1, %edi
callq 0xd460
movl 0xc8401c(%r15), %eax
shrl $0x2, %eax
andl %ebp, %eax
movw %ax, 0xa8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_disable_ir_regs
static void
vrb2_disable_ir_regs(uint8_t *bar0addr)
{
	/* Disable all interrupts and IR */
	vrb2_reg_write(bar0addr, HWPfHiInfoRingIntWrEnRegPf, 0x0);
	vrb2_reg_write(bar0addr, HWPfHiCfgMsiIntWrEnRegPf, 0xFFFFFFFF);
	vrb2_reg_write(bar0addr, HWPfHiInfoRingVf2pfLoWrEnReg, 0x0);
	vrb2_reg_write(bar0addr, HWPfHiInfoRingVf2pfHiWrEnReg, 0x0);
	vrb2_reg_write(bar0addr, HWPfHiCfgMsiVf2pfHighWrEnReg, 0xFFFFFFFF);
	vrb2_reg_write(bar0addr, HWPfHiCfgMsiVf2pfLoWrEnReg, 0xFFFFFFFF);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
movl %ebp, 0xc84020(%rdi)
movl $0x1, %edi
callq 0xd460
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, 0xc84040(%rbx)
movl $0x1, %edi
callq 0xd460
movl %ebp, 0xc84024(%rbx)
movl $0x1, %edi
callq 0xd460
movl %ebp, 0xc84028(%rbx)
movl $0x1, %edi
callq 0xd460
movl %r14d, 0xc84048(%rbx)
movl $0x1, %edi
callq 0xd460
movl %r14d, 0xc84044(%rbx)
movl $0x1, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0xd460