// File: /workspace/github_c_makefile_star2_O1/intel[P]pf-bb-config/fpga_lte/fpga_lte_cfg_app.c
// Function: fpga_lte_configure
int
fpga_lte_configure(void *dev, void *bar0addr, const char *cfg_filename, const bool first_cfg)
{
	struct fpga_lte_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 0x10387
leaq 0xba45(%rip), %rdi      # 0x1bdc0
movq %r14, %rsi
xorl %eax, %eax
callq 0xd150
jmp 0x10398
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x10694
testl %eax, %eax
je 0x103ba
leaq 0xbbaf(%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 0x19(%rsp), %eax
movw %ax, 0x4(%rbx)
movl $0x10, %eax
movl $0xffffffff, (%rbx,%rax,4) # imm = 0xFFFFFFFF
incq %rax
cmpq $0x50, %rax
jne 0x103c8
cmpb $0x1, 0x8(%rsp)
jne 0x103f7
xorl %eax, %eax
movl $0x1, 0x40(%rbx,%rax,4)
incq %rax
cmpq $0x40, %rax
jne 0x103e1
jmp 0x10499
movq $-0x8, %rdx
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0x11(%rsp,%rdx), %esi
addl %esi, %ecx
movzbl 0x19(%rsp,%rdx), %esi
addl %esi, %eax
incq %rdx
jne 0x10402
cmpw $0x20, %cx
ja 0x1066e
cmpw $0x20, %ax
ja 0x1066e
leal (%rax,%rcx), %edx
cmpw $0x40, %dx
ja 0x1066e
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0x9(%rsp,%rax), %edx
testw %dx, %dx
je 0x1045d
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 0x1044f
incq %rax
cmpq $0x8, %rax
jne 0x1043a
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0x11(%rsp,%rax), %edx
testw %dx, %dx
je 0x10490
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 0x1047f
incq %rax
cmpq $0x8, %rax
jne 0x1046a
movzwl 0x1b(%rsp), %eax
movw %ax, 0xa(%rbx)
movw $0x8, 0xc(%rbx)
movzwl 0x1e(%rsp), %eax
movw %ax, 0xe(%rbx)
movw $0x1, 0x8(%rbx)
movl (%rbx), %esi
movzwl 0x4(%rbx), %r14d
movzwl %si, %edx
shrl $0x10, %esi
cmpb $0x0, 0x8(%rbx)
movzwl 0xa(%rbx), %r12d
movzwl 0xc(%rbx), %ebp
movzwl 0xe(%rbx), %eax
movl %eax, 0x4(%rsp)
leaq 0xb97e(%rip), %rdi      # 0x1be5e
leaq 0xb9df(%rip), %rax      # 0x1bec6
leaq 0xb9dc(%rip), %r15      # 0x1beca
cmoveq %rax, %r15
xorl %eax, %eax
callq 0xd150
movl $0xff, %r13d
movl %r14d, %esi
andl %r13d, %esi
shrl $0x8, %r14d
leaq 0xb963(%rip), %rdi      # 0x1be73
movl %r14d, %edx
xorl %eax, %eax
callq 0xd150
andl %r12d, %r13d
shrl $0x8, %r12d
leaq 0xb962(%rip), %rdi      # 0x1be8a
movl %r13d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0xd150
leaq 0xb96a(%rip), %rdi      # 0x1bea6
movq %r15, %rsi
xorl %eax, %eax
callq 0xd150
shll $0x5, %ebp
leaq 0xb980(%rip), %rdi      # 0x1bed0
movl %ebp, %esi
xorl %eax, %eax
callq 0xd150
cvtsi2sdl 0x4(%rsp), %xmm0
mulsd 0xb851(%rip), %xmm0     # 0x1bdb8
leaq 0xb983(%rip), %rdi      # 0x1bef1
movb $0x1, %al
callq 0xd150
leaq 0xb9ed(%rip), %rdi      # 0x1bf69
callq 0xd0c0
leaq 0xba22(%rip), %rdi      # 0x1bfaa
callq 0xd0c0
leaq 0xb9d6(%rip), %rdi      # 0x1bf6a
callq 0xd0c0
leaq 0xb981(%rip), %rbp      # 0x1bf21
leaq 0xb973(%rip), %r12      # 0x1bf1a
xorl %r15d, %r15d
movq %rbx, 0x20(%rsp)
cmpq $0x20, %r15
leaq 0xb95d(%rip), %rsi      # 0x1bf17
leaq 0xb953(%rip), %rax      # 0x1bf14
cmovbq %rax, %rsi
leaq 0xb93c(%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 0x105f2
movl $0xa, %edi
callq 0xd050
incq %r15
cmpq $0x40, %r15
movq 0x20(%rsp), %rbx
jne 0x105af
leaq 0xb9ad(%rip), %rdi      # 0x1bfea
callq 0xd0c0
leaq 0xce00(%rip), %rax      # 0x1d449
leaq 0xb80b(%rip), %rsi      # 0x1be5b
cmpb $0x0, 0x8(%rsp)
cmovneq %rax, %rsi
leaq 0xb7de(%rip), %rdi      # 0x1be3e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xd150
jmp 0x103a9
movzwl %ax, %edx
movzwl %cx, %esi
leaq 0xb76e(%rip), %rdi      # 0x1bde9
movl $0x40, %ecx
xorl %eax, %eax
callq 0xd150
leaq 0xb89a(%rip), %rdi      # 0x1bf28
jmp 0x1039f
nop