// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/fpga_5gnr/fpga_5gnr_cfg_app.c
// Function: fpga_5gnr_configure
int
fpga_5gnr_configure(void *dev, void *bar0addr, const char *cfg_filename, const bool first_cfg)
{
	struct fpga_5gnr_fec_conf fpga_conf;
	int ret;

	ret = fpga_read_config_file(cfg_filename, &fpga_conf);
	if (ret != 0) {
		printf("Error reading config file.\n");
		return -1;
	}

	ret = fpga_write_config(dev, bar0addr, &fpga_conf);
	if (ret != 0) {
		printf("Error writing configuration for FPGA.\n");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdx, %rdi
callq 0x13c09
testb %al, %al
je 0x10a73
leaq 0xb359(%rip), %rdi      # 0x1bdc0
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
jmp 0x10a84
leaq 0xb(%rsp), %rsi
movq %r14, %rdi
callq 0x10d54
testl %eax, %eax
je 0x10aa6
leaq 0xb4c3(%rip), %rdi      # 0x1bf4e
callq 0xd0c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl 0x1c(%rsp), %eax
movw %ax, 0x4(%rbx)
movl $0x10, %eax
movl $0xffffffff, (%rbx,%rax,4) # imm = 0xFFFFFFFF
incq %rax
cmpq $0x50, %rax
jne 0x10ab4
cmpb $0x1, 0xb(%rsp)
jne 0x10ae3
xorl %eax, %eax
movl $0x1, 0x40(%rbx,%rax,4)
incq %rax
cmpq $0x40, %rax
jne 0x10acd
jmp 0x10b85
movq $-0x8, %rdx
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0x14(%rsp,%rdx), %esi
addl %esi, %ecx
movzbl 0x1c(%rsp,%rdx), %esi
addl %esi, %eax
incq %rdx
jne 0x10aee
cmpw $0x20, %cx
ja 0x10d2d
cmpw $0x20, %ax
ja 0x10d2d
leal (%rax,%rcx), %edx
cmpw $0x40, %dx
ja 0x10d2d
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0xc(%rsp,%rax), %edx
testw %dx, %dx
je 0x10b49
movl %eax, %esi
shll $0x10, %esi
orl $0x800001, %esi         # imm = 0x800001
movzwl %cx, %edi
movl %esi, 0x40(%rbx,%rdi,4)
incl %ecx
decw %dx
jne 0x10b3b
incq %rax
cmpq $0x8, %rax
jne 0x10b26
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0x14(%rsp,%rax), %edx
testw %dx, %dx
je 0x10b7c
movl %eax, %esi
shll $0x10, %esi
orl $0x800001, %esi         # imm = 0x800001
movzwl %cx, %edi
movl %esi, 0xc0(%rbx,%rdi,4)
incl %ecx
decw %dx
jne 0x10b6b
incq %rax
cmpq $0x8, %rax
jne 0x10b56
movzwl 0x1e(%rsp), %eax
movw %ax, 0xa(%rbx)
movw $0x8, 0xc(%rbx)
movw $0x1, 0x8(%rbx)
movl (%rbx), %esi
movzwl 0x4(%rbx), %r15d
movzwl %si, %edx
shrl $0x10, %esi
cmpb $0x0, 0x8(%rbx)
movzwl 0xa(%rbx), %r12d
movzwl 0xc(%rbx), %ebp
leaq 0xb2a3(%rip), %rdi      # 0x1be5e
leaq 0xb304(%rip), %rax      # 0x1bec6
leaq 0xb301(%rip), %r14      # 0x1beca
cmoveq %rax, %r14
xorl %eax, %eax
callq 0xd150
movl $0xff, %r13d
movl %r15d, %esi
andl %r13d, %esi
shrl $0x8, %r15d
leaq 0xb288(%rip), %rdi      # 0x1be73
movl %r15d, %edx
xorl %eax, %eax
callq 0xd150
andl %r12d, %r13d
shrl $0x8, %r12d
leaq 0xb287(%rip), %rdi      # 0x1be8a
movl %r13d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0xd150
leaq 0xb28f(%rip), %rdi      # 0x1bea6
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
shll $0x5, %ebp
leaq 0xb2a5(%rip), %rdi      # 0x1bed0
movl %ebp, %esi
xorl %eax, %eax
callq 0xd150
leaq 0xb32e(%rip), %rdi      # 0x1bf69
callq 0xd0c0
leaq 0xb363(%rip), %rdi      # 0x1bfaa
callq 0xd0c0
leaq 0xb317(%rip), %rdi      # 0x1bf6a
callq 0xd0c0
leaq 0xb2c2(%rip), %rbp      # 0x1bf21
leaq 0xb2b4(%rip), %r12      # 0x1bf1a
xorl %r15d, %r15d
movq %rbx, 0x20(%rsp)
cmpq $0x20, %r15
leaq 0xb29e(%rip), %rsi      # 0x1bf17
leaq 0xb294(%rip), %rax      # 0x1bf14
cmovbq %rax, %rsi
leaq 0xb27d(%rip), %rdi      # 0x1bf08
movl %r15d, %edx
xorl %eax, %eax
callq 0xd150
movl 0x40(%rbx,%r15,4), %r14d
movl %r14d, %r13d
andl $0x800000, %r13d        # imm = 0x800000
shrl $0x10, %r14d
andl $0x7f, %r14d
incl %r14d
xorl %ebx, %ebx
cmpl %ebx, %r14d
movq %r12, %rdi
cmovneq %rbp, %rdi
testl %r13d, %r13d
cmoveq %rbp, %rdi
movl %ebx, %eax
orl %r13d, %eax
cmoveq %r12, %rdi
xorl %eax, %eax
callq 0xd150
incl %ebx
cmpl $0x9, %ebx
jne 0x10cb1
movl $0xa, %edi
callq 0xd050
incq %r15
cmpq $0x40, %r15
movq 0x20(%rsp), %rbx
jne 0x10c6e
leaq 0xb2ee(%rip), %rdi      # 0x1bfea
callq 0xd0c0
leaq 0xc741(%rip), %rax      # 0x1d449
leaq 0xb14c(%rip), %rsi      # 0x1be5b
cmpb $0x0, 0xb(%rsp)
cmovneq %rax, %rsi
leaq 0xb11f(%rip), %rdi      # 0x1be3e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xd150
jmp 0x10a95
movzwl %ax, %edx
movzwl %cx, %esi
leaq 0xb0af(%rip), %rdi      # 0x1bde9
movl $0x40, %ecx
xorl %eax, %eax
callq 0xd150
leaq 0xb1db(%rip), %rdi      # 0x1bf28
jmp 0x10a8b
nop