LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x108e6
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
xorl %edx, %edx
callq 0xd390
cmpq $0xff, %rax
ja 0x108ec
cmpq %r14, (%rsp)
je 0x108ec
movb %al, (%rbx)
movl $0x1, %eax
jmp 0x10902
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
retq
leaq 0xb450(%rip), %rdi      # 0x1bd43
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_O3/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 0x1097e
movq %rsi, %r14
leaq 0xb7e0(%rip), %rsi      # 0x1c104
callq 0xd340
movl $0x1, %ebx
testq %rax, %rax
je 0x1099b
movq %rax, %r13
xorl %ebp, %ebp
movq %rsp, %r15
leaq 0xb7c2(%rip), %r12      # 0x1c104
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xd390
cmpq $0xff, %rax
ja 0x10985
cmpq (%rsp), %r13
je 0x10985
movb %al, (%r14,%rbp)
xorl %edi, %edi
movq %r12, %rsi
callq 0xd340
cmpq $0x6, %rbp
ja 0x1099b
movq %rax, %r13
incq %rbp
testq %rax, %rax
jne 0x10942
jmp 0x1099b
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
jmp 0x1099b
leaq 0xb3b7(%rip), %rdi      # 0x1bd43
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
// File: /workspace/github_c_makefile_star2_O3/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 0xb351(%rip), %xmm0     # 0x1c040
movups %xmm0, 0x1(%rsi)
leaq 0x5f(%rip), %rsi        # 0x10d59
movq %rbx, %rdx
callq 0x139e6
cmpl $-0x2, %eax
je 0x10d28
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x10d51
leaq 0xb339(%rip), %rdi      # 0x1c050
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x10d39
leaq 0xb3d7(%rip), %rdi      # 0x1c106
callq 0xd0c0
movl $0xfffffff4, %eax       # imm = 0xFFFFFFF4
leaq 0x1(%rbx), %rcx
movb $0x1, (%rbx)
movl $0x40400303, 0x11(%rbx) # imm = 0x40400303
movaps 0xb2f2(%rip), %xmm0     # 0x1c040
movups %xmm0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rdi, %r14
movl $0x200000, %r11d        # imm = 0x200000
xorl %eax, %eax
movq %rsi, 0x20(%rsp)
movl %r11d, %ebp
sarl $0x11, %ebp
movl %ebp, %ecx
shrl %ecx
movl %r11d, %edx
sarl %edx
movl %edx, 0x18(%rsp)
movl %eax, 0xc(%rsp)
shll $0x14, %eax
movl %eax, 0x14(%rsp)
movl %ecx, 0x1c(%rsp)
movl %ecx, %eax
shll $0x10, %eax
leal (%rax,%rax,2), %r13d
sarl $0x10, %r13d
xorl %ebx, %ebx
movl %r11d, 0x10(%rsp)
testl %ebp, %ebp
jle 0x1157d
movl 0x18(%rsp), %ecx
imull %ebx, %ecx
addl 0x14(%rsp), %ecx
sarl $0x10, %ecx
xorl %edx, %edx
movw $0x1, %di
movl 0x1c(%rsp), %r9d
xorl %r10d, %r10d
xorl %r8d, %r8d
movl %r13d, %eax
subl %edx, %eax
cltd
idivl %ebp
addl %ecx, %edx
movslq %edx, %rax
xorl %edx, %edx
cmpw $0x0, (%r14,%rax,2)
setg %dl
cmovgl %r9d, %r8d
addl %edx, %r10d
movswl %di, %edx
incl %edi
decl %r9d
cmpl %edx, %ebp
jg 0x114d8
cmpl $0x8000000, %r11d       # imm = 0x8000000
jne 0x1157d
movswl %r8w, %r15d
cmpw $0x2, %r10w
movl $0x1, %eax
cmovgel %r10d, %eax
movzwl %ax, %r12d
movl %r12d, 0x540(%rsi,%rbx,4)
movl %r15d, 0x500(%rsi,%rbx,4)
testq %rbx, %rbx
jne 0x1157d
callq 0x12bf7
leaq 0x2298d(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
subq $0x8, %rsp
movl $0x2, %edi
xorl %esi, %esi
leaq 0xac3d(%rip), %rdx      # 0x1c196
movq %rax, %rcx
movl $0x800, %r9d            # imm = 0x800
xorl %eax, %eax
pushq %r15
pushq %r12
pushq $0x0
callq 0x199b4
movl 0x30(%rsp), %r11d
movq 0x40(%rsp), %rsi
addq $0x20, %rsp
incq %rbx
cmpq $0x10, %rbx
jne 0x114b1
movswl %bp, %eax
addl 0xc(%rsp), %eax
addl %r11d, %r11d
cmpl $0x8000001, %r11d       # imm = 0x8000001
jl 0x1147b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xd468(%rip), %rdx      # 0x1ea2d
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xd170
addl $0x8, %eax
movzwl %ax, %edi
callq 0xd270
movq %rax, %r12
leaq 0xabde(%rip), %rsi      # 0x1c1c6
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xd3d0
leaq 0xab98(%rip), %rsi      # 0x1c194
movq %r12, %rdi
callq 0xd310
movq %rax, %r15
movq %r12, %rdi
callq 0xd030
testq %r15, %r15
je 0x1167d
movq %rsp, %rdi
movl $0x5, %esi
movq %r15, %rdx
callq 0xd1e0
testq %rax, %rax
je 0x116af
movq %rsp, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd230
movq %rax, %r14
callq 0x12bf7
leaq 0x22885(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movzwl %r14w, %r9d
leaq 0xabba(%rip), %rdx      # 0x1c214
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq %r15, %rdi
callq 0xd160
movw %r14w, 0x4fc(%rbx)
jmp 0x116de
callq 0x12bf7
leaq 0x22847(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xab3d(%rip), %rdx      # 0x1c1d0
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 0x199b4
callq 0x12bf7
leaq 0x22815(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xab2c(%rip), %rdx      # 0x1c1f1
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
callq 0x199b4
movq %r15, %rdi
callq 0xd160
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1174f
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 0x11742
addl %esi, %ecx
incq %rax
cmpq $0x5, %rax
jne 0x1172d
movslq %edi, %rax
movl -0x48(%rsp,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1179f
movq %rdx, %r14
movl %esi, %eax
leaq 0xa9b0(%rip), %rcx      # 0x1c128
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %r14
jmp 0x117b0
addq $0x1e, %r14
jmp 0x117b0
addq $0xc, %r14
jmp 0x117b0
addq $0x18, %r14
jmp 0x117b0
addq $0x12, %r14
jmp 0x117b0
leaq 0xaa8d(%rip), %rdi      # 0x1c233
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_O3/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 0x116ea
cmpl $0x5, %eax
jae 0x117e7
movl %eax, %eax
leaq 0xa96e(%rip), %rcx      # 0x1c140
movq (%rcx,%rax,8), %rax
movzwl 0x4(%rbx,%rax), %eax
cmpw $0x1, %ax
adcl $0x0, %eax
movzwl %ax, %eax
jmp 0x117fc
leaq 0xaa45(%rip), %rdi      # 0x1c233
movl %eax, %esi
xorl %eax, %eax
callq 0xd150
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x116ea
cmpl $0x5, %eax
jae 0x11820
movl %eax, %eax
leaq 0xa92b(%rip), %rcx      # 0x1c140
movq (%rcx,%rax,8), %rax
movzwl 0x2(%rbx,%rax), %ebx
jmp 0x11832
leaq 0xaa0c(%rip), %rdi      # 0x1c233
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0xd150
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12bf7
leaq 0x22601(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
leaq 0xa987(%rip), %rdx      # 0x1c261
leaq 0xa99f(%rip), %r9       # 0x1c280
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
xorl %eax, %eax
movl %eax, 0xa10000(%r14,%r15,4)
addl $0x10000, %eax          # imm = 0x10000
cmpl $0x100000, %eax         # imm = 0x100000
jne 0x118f4
incq %r15
cmpq $0x10, %r15
jne 0x118f2
xorl %eax, %eax
movl $0x0, 0xa00a00(%r14,%rax,4)
incq %rax
cmpq $0x20, %rax
jne 0x11913
xorl %ebp, %ebp
movl %ebp, 0xc84018(%r14)
movl $0x2, 0xb8000c(%r14)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xd450
movl %ebp, 0xb8000c(%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, 0xc84010(%r14)
movl %ebp, 0xc8400c(%r14)
movl $0x3ff, %r15d           # imm = 0x3FF
movl %r15d, 0xc84008(%r14)
movl $0xa, %edi
callq 0xd450
movl %ebp, 0xc84010(%r14)
movl %ebp, 0xc8400c(%r14)
movl %r15d, 0xc84008(%r14)
movl $0xa, %edi
callq 0xd450
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 %r15d, %eax
movw %ax, 0xa8(%rbx)
movq 0x90(%rbx), %rax
testq %rax, %rax
je 0x119f5
xorl %ecx, %ecx
movl $0x0, (%rax,%rcx)
incq %rcx
cmpq $0x400, %rcx            # imm = 0x400
jne 0x119e2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12bf7
leaq 0x224ac(%rip), %r12     # 0x33ed0
movq 0x18(%r12), %r8
leaq 0xa863(%rip), %rdx      # 0x1c293
leaq 0xa880(%rip), %r9       # 0x1c2b7
xorl %ebx, %ebx
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
cmpq $0x0, 0x90(%r14)
jne 0x11b04
movq 0xb0(%r14), %rbp
leaq 0x98(%r14), %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x18c25
movq %rax, %r15
movq %rax, 0x90(%r14)
callq 0x12bf7
testq %r15, %r15
je 0x11b68
movq 0x18(%r12), %r8
movups 0x90(%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0xad55(%rip), %rdx      # 0x1c7f8
leaq 0xad7f(%rip), %r15      # 0x1c829
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x199b4
movl 0xc8401c(%rbp), %eax
shrl $0x2, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movw %ax, 0xa8(%r14)
callq 0x12bf7
movq 0x18(%r12), %r8
movzwl 0xa8(%r14), %ecx
movl %ecx, (%rsp)
leaq 0xad51(%rip), %rdx      # 0x1c841
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x199b4
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 0x12bf7
movq 0x18(%r12), %r8
leaq 0x99e5(%rip), %rdx      # 0x1b524
leaq 0xa771(%rip), %r9       # 0x1c2b7
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %r8
leaq 0xac57(%rip), %rdx      # 0x1c7ca
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
callq 0x12bf7
movq (%r12), %r8
leaq 0xa737(%rip), %rdx      # 0x1c2c8
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x11b57
// File: /workspace/github_c_makefile_star2_O3/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 0x12bf7
leaq 0x2230d(%rip), %r14     # 0x33ed0
movq 0x18(%r14), %r8
leaq 0xa71f(%rip), %rdx      # 0x1c2ed
leaq 0xa738(%rip), %r9       # 0x1c30d
xorl %ebp, %ebp
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
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 0x12bf7
movq 0x18(%r14), %r8
leaq 0xac3a(%rip), %rdx      # 0x1c861
leaq 0xac4f(%rip), %r9       # 0x1c87d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x11c96
leaq 0x90(%rbx), %r15
movq 0xa0(%rbx), %rsi
callq 0x18c3f
movw $0x0, 0xa8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
callq 0x12bf7
movq 0x18(%r14), %r8
leaq 0x98a6(%rip), %rdx      # 0x1b524
leaq 0xabf8(%rip), %r9       # 0x1c87d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
callq 0x12bf7
movq 0x18(%r14), %r8
leaq 0x987e(%rip), %rdx      # 0x1b524
leaq 0xa660(%rip), %r9       # 0x1c30d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12c64
shrl $0x10, %eax
leaq 0x8ed0(%rip), %rdi      # 0x1bb30
movl %eax, %esi
jmp 0x12c90
movq %rax, %rcx
shrq $0x20, %rcx
movzwl %cx, %esi
leal -0xd(%rsi), %ecx
cmpl $-0xd, %ecx
ja 0x12c7f
leaq 0x8ed9(%rip), %rdi      # 0x1bb56
jmp 0x12c90
movzwl %ax, %esi
xorl %eax, %eax
cmpl $0x11, %esi
jb 0x12c9c
leaq 0x8ee7(%rip), %rdi      # 0x1bb77
xorl %eax, %eax
callq 0xd150
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12cc7
movzwl %ax, %esi
leaq 0x8ed7(%rip), %rdi      # 0x1bb9c
jmp 0x12cda
movq %rdi, %rbx
movzwl 0x4(%rdi), %esi
cmpl $0x11, %esi
jb 0x12cf4
leaq 0x8ee4(%rip), %rdi      # 0x1bbbe
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 0x12c44
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x12ceb
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12c44
testl %eax, %eax
jne 0x12ceb
movl 0x12(%rbx), %eax
movzwl 0x16(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12c44
testl %eax, %eax
jne 0x12ceb
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12c44
testl %eax, %eax
jne 0x12ceb
movl 0x1e(%rbx), %eax
movzwl 0x22(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x12c44
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
jmp 0x12ceb
// File: /workspace/github_c_makefile_star2_O3/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 0x12dd3
leaq 0x12a(%rip), %rsi       # 0x12eb4
movq %r14, %rdi
movq %rbx, %rdx
callq 0x139e6
testl %eax, %eax
je 0x12da2
leaq 0x9001(%rip), %rdi      # 0x1bda1
jmp 0x12db5
movq %rbx, %rdi
callq 0x12c9e
testl %eax, %eax
je 0x12dcf
leaq 0x8fce(%rip), %rdi      # 0x1bd83
callq 0xd0c0
movq %rbx, %rdi
callq 0x12dd3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x12dc7
// File: /workspace/github_c_makefile_star2_O3/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 0x139e1
addq %rbx, %rax
movb -0x1(%rax), %cl
cmpb $0x20, %cl
je 0x139d6
cmpb $0xa, %cl
je 0x139d6
cmpb $0x9, (%rbx)
jne 0x139e1
decq %rax
movb $0x0, (%rax)
cmpq %rbx, %rax
ja 0x139c4
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x879c(%rip), %rsi      # 0x1c194
callq 0xd320
testq %rax, %rax
je 0x13a21
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x137dc
movl %eax, %ebx
movq %r15, %rdi
callq 0xd0f0
movl %ebx, %eax
jmp 0x13a32
leaq 0x9023(%rip), %rdi      # 0x1ca4b
callq 0xd0c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x13a52
pushq %rbx
movq %rdi, %rbx
callq 0xd110
leal 0x1(%rax), %ecx
cmpl $0x3, %ecx
jge 0x13a56
xorl %ecx, %ecx
jmp 0x13a8a
movb $0x1, %cl
jmp 0x13a8b
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 0x13a8a
leaq 0x1(%rdx), %rsi
cmpq %rdx, %rax
movq %rsi, %rdx
jne 0x13a5d
popq %rbx
movl %ecx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x14974
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 0x14967
addl %esi, %ecx
incq %rax
cmpq $0x6, %rax
jne 0x14952
movslq %edi, %rax
movl -0x60(%rsp,%rax,4), %eax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x149d0
movq %rdx, %r14
movl %ebp, %eax
leaq 0x8141(%rip), %rcx      # 0x1cae4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %r14
jmp 0x149fa
addq $0x1e, %r14
jmp 0x149fa
addq $0xc, %r14
jmp 0x149fa
addq $0x18, %r14
jmp 0x149fa
addq $0x12, %r14
jmp 0x149fa
addq $0x24, %r14
jmp 0x149fa
callq 0x16674
leaq 0x1f4f4(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0x857e(%rip), %rdx      # 0x1cf64
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x199b4
movq %r14, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x148f0
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0x14989
movq (%r14), %rax
testq %rax, %rax
je 0x14a39
movzwl 0x2(%rax), %eax
jmp 0x14a3b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x14b7d
callq 0x16674
leaq 0x1f468(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
leaq 0x8528(%rip), %rdx      # 0x1cf9b
leaq 0x8541(%rip), %r9       # 0x1cfbb
xorl %r15d, %r15d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl $0x0, 0xa00e00(%r14,%r15,4)
movl $0x1, %edi
callq 0xd450
incq %r15
cmpq $0x20, %r15
jne 0x14a8e
movl $0x2, 0xb8000c(%r14)
movl $0x1, %edi
callq 0xd450
movl $0x64, %edi
callq 0xd450
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, 0xc84010(%r14)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc8400c(%r14)
movl $0x1, %edi
callq 0xd450
movl $0x3ff, %ebp            # imm = 0x3FF
movl %ebp, 0xc84008(%r14)
movl $0x1, %edi
callq 0xd450
movl $0xa, %edi
callq 0xd450
movq 0x98(%rbx), %r14
movq 0xb0(%rbx), %r15
movq %r14, %rax
shrq $0x20, %rax
movl %eax, 0xc8401c(%r15)
movl $0x1, %edi
callq 0xd450
movl %r14d, 0xc84014(%r15)
movl $0x1, %edi
callq 0xd450
movl $0xf000, 0xc8401c(%r15) # imm = 0xF000
movl $0x1, %edi
callq 0xd450
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_O3/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 0xd450
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, 0xc84040(%rbx)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84024(%rbx)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84028(%rbx)
movl $0x1, %edi
callq 0xd450
movl %r14d, 0xc84048(%rbx)
movl $0x1, %edi
callq 0xd450
movl %r14d, 0xc84044(%rbx)
movl $0x1, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0xd450
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_enable_intr
int vrb2_enable_intr(void *dev)
{
	int ret;
	hw_device *accel_pci_dev = (hw_device *)dev;
	void *bar0addr = accel_pci_dev->bar0Addr;

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

	vrb2_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 0x16674
leaq 0x1f2b9(%rip), %r12     # 0x33ed0
movq 0x18(%r12), %r8
leaq 0x83ab(%rip), %rdx      # 0x1cfce
leaq 0x83c8(%rip), %r9       # 0x1cff2
xorl %ebx, %ebx
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
cmpq $0x0, 0x90(%r14)
jne 0x14d52
movq 0xb0(%r14), %rbp
leaq 0x98(%r14), %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x18c25
movq %rax, %r15
movq %rax, 0x90(%r14)
callq 0x16674
testq %r15, %r15
je 0x14df7
movq 0x18(%r12), %r8
movups 0x90(%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x7b62(%rip), %rdx      # 0x1c7f8
leaq 0x8ad5(%rip), %r9       # 0x1d772
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl 0x9c(%r14), %eax
movl %eax, 0xc84018(%rbp)
movl $0x1, %edi
callq 0xd450
movl 0x98(%r14), %eax
movl %eax, 0xc84014(%rbp)
movl $0x1, %edi
callq 0xd450
movl $0xf000, 0xc8401c(%rbp) # imm = 0xF000
movl $0x1, %edi
callq 0xd450
movl 0xc8401c(%rbp), %eax
shrl $0x2, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movw %ax, 0xa8(%r14)
movq 0x90(%r14), %rdi
testq %rdi, %rdi
je 0x14d1e
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0xd180
callq 0x16674
movq 0x18(%r12), %r8
movzwl 0xa8(%r14), %ecx
movl %ecx, (%rsp)
leaq 0x7b07(%rip), %rdx      # 0x1c841
leaq 0x8a31(%rip), %r9       # 0x1d772
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, 0xc84020(%r13)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84040(%r13)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84028(%r13)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84024(%r13)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84048(%r13)
movl $0x1, %edi
callq 0xd450
movl %ebp, 0xc84044(%r13)
movl $0x1, %edi
callq 0xd450
callq 0x16674
movq 0x18(%r12), %r8
leaq 0x6756(%rip), %rdx      # 0x1b524
leaq 0x821d(%rip), %r9       # 0x1cff2
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %r8
leaq 0x79c8(%rip), %rdx      # 0x1c7ca
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
callq 0x16674
movq (%r12), %r8
leaq 0x81e3(%rip), %rdx      # 0x1d003
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x14de6
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_disable_intr
int
vrb2_disable_intr(void *dev)
{
	hw_device *accel_pci_dev = (hw_device *)dev;
	void *bar0addr = accel_pci_dev->bar0Addr;

	LOG(DEBUG, "Disable interrupts");

	vrb2_disable_ir_regs(bar0addr);

	vrb2_free_info_ring(dev);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
callq 0x16674
leaq 0x1f080(%rip), %r15     # 0x33ed0
movq 0x18(%r15), %r8
leaq 0x7492(%rip), %rdx      # 0x1c2ed
leaq 0x81c6(%rip), %r9       # 0x1d028
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq %r14, %rdi
callq 0x14b7d
callq 0x16674
movq 0x18(%r15), %r8
leaq 0x79d6(%rip), %rdx      # 0x1c861
leaq 0x88f8(%rip), %r9       # 0x1d78a
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x14efa
leaq 0x90(%rbx), %r14
movq 0xa0(%rbx), %rsi
callq 0x18c3f
movw $0x0, 0xa8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
callq 0x16674
movq 0x18(%r15), %r8
leaq 0x6642(%rip), %rdx      # 0x1b524
leaq 0x88a1(%rip), %r9       # 0x1d78a
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
callq 0x16674
movq 0x18(%r15), %r8
leaq 0x661a(%rip), %rdx      # 0x1b524
leaq 0x8117(%rip), %r9       # 0x1d028
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb2/vrb2_cfg_app.c
// Function: vrb2_disable_int_src
static void vrb2_disable_int_src(uint8_t *bar0addr, int int_src)
{
	uint32_t mask;

	mask = vrb2_reg_read(bar0addr, HWPfHiInfoRingIntWrEnRegPf);
	mask &= (0xFFFFFFFF - (1ULL << int_src));
	LOG(INFO, "Disable the Interrupt source %d new mask %x", int_src, mask);
	vrb2_reg_write(bar0addr, HWPfHiInfoRingIntWrEnRegPf, mask);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq $-0x1, %r15
movl %ebx, %ecx
shlq %cl, %r15
movq %rdi, %r14
decl %r15d
andl 0xc84020(%rdi), %r15d
callq 0x16674
leaq 0x1d7e2(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
movl %r15d, (%rsp)
leaq 0x6d1b(%rip), %rdx      # 0x1d418
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x199b4
movl %r15d, 0xc84020(%r14)
movl $0x1, %edi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd450
nop
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb2/vrb2_cfg_parser.c
// Function: vrb2_queue_range_check
int
vrb2_queue_range_check(struct q_topology_t q_conf)
{
	if ((q_conf.num_aqs_per_groups < 1) ||
			(q_conf.num_aqs_per_groups > VRB2_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 > VRB2_MAX_QDEPTH)) {
		printf("ERROR: AQ Depth out of range %d\n",
				q_conf.aq_depth_log2);
		return -1;
	}
	if (q_conf.num_qgroups > VRB2_NUM_QGRPS) {
		printf("ERROR: Number of QG out of range %d\n",
				q_conf.num_qgroups);
		return -1;
	}
	if (q_conf.num_qgroups * q_conf.num_aqs_per_groups > VRB2_MAX_QGRPS_PER_OP) {
		printf("ERROR: Number of queues per op out of range %d %d\n",
				q_conf.num_qgroups * q_conf.num_aqs_per_groups,
				VRB2_MAX_QGRPS_PER_OP);
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rax
movl %edi, %esi
shrl $0x10, %esi
leal -0x410000(%rdi), %eax
cmpl $0xffbfffff, %eax       # imm = 0xFFBFFFFF
ja 0x16748
leaq 0x53ea(%rip), %rdi      # 0x1bb30
jmp 0x16776
movq %rdi, %rax
shrq $0x20, %rax
movzwl %ax, %eax
leal -0x9(%rax), %ecx
cmpl $-0x9, %ecx
ja 0x16765
leaq 0x53f5(%rip), %rdi      # 0x1bb56
movl %eax, %esi
jmp 0x16776
movzwl %di, %ecx
cmpl $0x21, %ecx
jb 0x16784
leaq 0x5403(%rip), %rdi      # 0x1bb77
movl %ecx, %esi
xorl %eax, %eax
callq 0xd150
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
imull %esi, %ecx
xorl %eax, %eax
cmpl $0x101, %ecx            # imm = 0x101
jb 0x16782
leaq 0x7178(%rip), %rdi      # 0x1d910
movl %ecx, %esi
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0xd150
jmp 0x1677d
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb2/vrb2_cfg_parser.c
// Function: vrb2_range_check
int
vrb2_range_check(struct vrb2_conf *vrb2_conf)
{
	uint16_t totalQgs = vrb2_conf->q_ul_4g.num_qgroups +
			vrb2_conf->q_ul_5g.num_qgroups +
			vrb2_conf->q_dl_4g.num_qgroups +
			vrb2_conf->q_dl_5g.num_qgroups +
			vrb2_conf->q_fft.num_qgroups +
			vrb2_conf->q_mld.num_qgroups;
	if (totalQgs > VRB2_NUM_QGRPS) {
		printf("ERROR: Number of Qgroups %d > %d\n",
				totalQgs, VRB2_NUM_QGRPS);
		return -1;
	}
	if (vrb2_conf->num_vf_bundles > VRB2_NUM_VFS) {
		printf("ERROR: Number of VFs bundle %d > %d\n",
				vrb2_conf->num_vf_bundles, VRB2_NUM_VFS);
		return -1;
	}
	if (vrb2_queue_range_check(vrb2_conf->q_ul_4g) != 0)
		return -1;
	if (vrb2_queue_range_check(vrb2_conf->q_dl_4g) != 0)
		return -1;
	if (vrb2_queue_range_check(vrb2_conf->q_ul_5g) != 0)
		return -1;
	if (vrb2_queue_range_check(vrb2_conf->q_dl_5g) != 0)
		return -1;
	if (vrb2_queue_range_check(vrb2_conf->q_fft) != 0)
		return -1;
	if (vrb2_queue_range_check(vrb2_conf->q_mld) != 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
addw 0x24(%rdi), %ax
cmpw $0x21, %ax
jb 0x167da
movzwl %ax, %esi
leaq 0x53c9(%rip), %rdi      # 0x1bb9c
movl $0x20, %edx
jmp 0x167f2
movq %rdi, %rbx
movzwl 0x4(%rdi), %esi
cmpl $0x41, %esi
jb 0x16807
leaq 0x53d1(%rip), %rdi      # 0x1bbbe
movl $0x40, %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 0x1672c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x167fe
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x1672c
testl %eax, %eax
jne 0x167fe
movl 0x12(%rbx), %eax
movzwl 0x16(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x1672c
testl %eax, %eax
jne 0x167fe
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x1672c
testl %eax, %eax
jne 0x167fe
movl 0x1e(%rbx), %eax
movzwl 0x22(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x1672c
testl %eax, %eax
jne 0x167fe
movl 0x24(%rbx), %eax
movl 0x28(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0x1672c
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
jmp 0x167fe
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/vrb2/vrb2_cfg_parser.c
// Function: vrb2_parse_conf_file
int
vrb2_parse_conf_file(const char *file_name, struct vrb2_conf *vrb2_conf)
{
	int ret;

	set_default_config(vrb2_conf);

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

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

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x168fc
leaq 0x145(%rip), %rsi       # 0x169f8
movq %r14, %rdi
movq %rbx, %rdx
callq 0x139e6
testl %eax, %eax
je 0x168cb
leaq 0x54d8(%rip), %rdi      # 0x1bda1
jmp 0x168de
movq %rbx, %rdi
callq 0x167a8
testl %eax, %eax
je 0x168f8
leaq 0x54a5(%rip), %rdi      # 0x1bd83
callq 0xd0c0
movq %rbx, %rdi
callq 0x168fc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x168f0
// File: /workspace/github_c_makefile_star2_O3/intel[P]pf-bb-config/agx100/agx100_cfg_parser.c
// Function: agx100_parse_conf_file
int
agx100_parse_conf_file(const char *file_name,
		struct agx100_conf *agx100_conf)
{
	int ret;

	set_default_config(agx100_conf);

	ret = cfg_parse(file_name, agx100_handler, agx100_conf);

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

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, (%rsi)
movw $0x4040, 0x11(%rsi)     # imm = 0x4040
movaps 0x4856(%rip), %xmm0     # 0x1c040
movups %xmm0, 0x1(%rsi)
leaq 0x5e(%rip), %rsi        # 0x17853
movq %rbx, %rdx
callq 0x139e6
cmpl $-0x2, %eax
je 0x17823
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x1784b
leaq 0x483e(%rip), %rdi      # 0x1c050
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x17834
leaq 0x48dc(%rip), %rdi      # 0x1c106
callq 0xd0c0
movl $0xfffffff4, %eax       # imm = 0xFFFFFFF4
leaq 0x1(%rbx), %rcx
movb $0x1, (%rbx)
movw $0x4040, 0x11(%rbx)     # imm = 0x4040
movaps 0x47f8(%rip), %xmm0     # 0x1c040
movups %xmm0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq