// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/fpga_lte/fpga_lte_cfg_parser.c
// Function: fpga_handler
static int
fpga_handler(void *user, const char *section,
	     const char *name, const char *value)
{
	struct fpga_lte_fec_conf *fpga_conf = (struct fpga_lte_fec_conf *) user;
	int ret = 1;

	if (!strcmp(section, MODE) && !strcmp(name, PFMODE)) {
		if (!strcmp(value, ZERO))
			fpga_conf->pf_mode_en = false;
		else if (!strcmp(value, ONE))
			fpga_conf->pf_mode_en = true;
		else
			ret = 0;
	} else if (!strcmp(section, UL) && !strcmp(name, BANDWIDTH)) {
		ret = parse_number8(value, &fpga_conf->ul_bandwidth);
	} else if (!strcmp(section, DL) && !strcmp(name, BANDWIDTH)) {
		ret = parse_number8(value, &fpga_conf->dl_bandwidth);
	} else if (!strcmp(section, UL) && !strcmp(name, LOAD_BALANCE)) {
		ret = parse_number8(value, &fpga_conf->ul_load_balance);
	} else if (!strcmp(section, DL) && !strcmp(name, LOAD_BALANCE)) {
		ret = parse_number8(value, &fpga_conf->dl_load_balance);
	} else if (!strcmp(section, UL) && !strcmp(name, QUEUE_MAP)) {
		ret = parse_array8(value, fpga_conf->vf_ul_queues_number);
	} else if (!strcmp(section, DL) && !strcmp(name, QUEUE_MAP)) {
		ret = parse_array8(value, fpga_conf->vf_dl_queues_number);
	} else if (!strcmp(section, FLR) && !strcmp(name, FLR_TIME_OUT)) {
		ret = parse_number16(value, &fpga_conf->flr_time_out);
	} else {
		printf("ERROR: Section (%s) or name (%s) is not valid.\n",
		       section, name);
		return 0;
	}
	if (ret != 1)
		printf("Error: Conversion of value (%s) failed.\n", value);

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0xb687(%rip), %rsi      # 0x1bbe3
movq %r12, %rdi
callq 0xd200
testl %eax, %eax
jne 0x1057f
leaq 0xb679(%rip), %rsi      # 0x1bbe8
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
je 0x1063c
movzbl (%r12), %eax
cmpl $0x44, %eax
je 0x105e7
cmpl $0x55, %eax
jne 0x105fb
cmpb $0x4c, 0x1(%r12)
jne 0x105fb
cmpb $0x0, 0x2(%r12)
jne 0x105fb
leaq 0xbac2(%rip), %rsi      # 0x1c067
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
je 0x1070e
leaq 0xbab5(%rip), %rsi      # 0x1c071
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
je 0x1071a
leaq 0xbaab(%rip), %rsi      # 0x1c07e
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
jne 0x105fb
incq %r14
jmp 0x106db
cmpb $0x4c, 0x1(%r12)
jne 0x105fb
cmpb $0x0, 0x2(%r12)
je 0x1069a
leaq 0xba83(%rip), %rsi      # 0x1c085
movq %r12, %rdi
callq 0xd200
testl %eax, %eax
jne 0x10621
leaq 0xba74(%rip), %rsi      # 0x1c089
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
je 0x10666
leaq 0xba6e(%rip), %rdi      # 0x1c096
xorl %ebp, %ebp
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xd160
jmp 0x1074c
movzbl (%rbx), %eax
xorl %ebp, %ebp
cmpl $0x31, %eax
je 0x106e8
cmpl $0x30, %eax
jne 0x1073b
cmpb $0x0, 0x1(%rbx)
jne 0x1073b
movb $0x0, (%r14)
jmp 0x10736
testq %rbx, %rbx
je 0x106f4
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xd3a0
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x106f8
cmpq %rbx, 0x8(%rsp)
je 0x106f8
pushq $0x1
popq %rbp
movw %ax, 0x16(%r14)
jmp 0x10731
leaq 0xb9c6(%rip), %rsi      # 0x1c067
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
je 0x10714
leaq 0xb9bd(%rip), %rsi      # 0x1c071
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
je 0x10720
leaq 0xb9b7(%rip), %rsi      # 0x1c07e
movq %r15, %rdi
callq 0xd200
testl %eax, %eax
jne 0x105fb
addq $0x9, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x107a8
jmp 0x1072f
cmpb $0x0, 0x1(%rbx)
jne 0x1073b
movb $0x1, (%r14)
jmp 0x10736
pushq $-0x16
jmp 0x1070b
leaq 0xb644(%rip), %rdi      # 0x1bd43
movq %rax, %rsi
xorl %eax, %eax
callq 0xd160
pushq $-0x22
popq %rbp
jmp 0x10731
addq $0x11, %r14
jmp 0x10724
addq $0x12, %r14
jmp 0x10724
addq $0x13, %r14
jmp 0x10724
addq $0x14, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1075b
movl %eax, %ebp
cmpl $0x1, %ebp
jne 0x1073b
pushq $0x1
popq %rbp
jmp 0x1074c
leaq 0xb984(%rip), %rdi      # 0x1c0c6
movq %rbx, %rsi
xorl %eax, %eax
callq 0xd160
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq