// File: /workspace/github_c_makefile_star2_O2/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 0x137d0
testb %al, %al
je 0x101ab
leaq 0xbc31(%rip), %rdi      # 0x1bdd0
movq %r14, %rsi
xorl %eax, %eax
callq 0xd160
jmp 0x101bc
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x104b8
testl %eax, %eax
je 0x101dc
leaq 0xbd9b(%rip), %rdi      # 0x1bf5e
callq 0xd0c0
pushq $-0x1
popq %rbx
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)
pushq $0x10
popq %rax
cmpq $0x50, %rax
je 0x101fa
movl $0xffffffff, (%rbx,%rax,4) # imm = 0xFFFFFFFF
incq %rax
jmp 0x101e8
cmpb $0x1, 0x8(%rsp)
jne 0x1021a
xorl %eax, %eax
cmpq $0x40, %rax
je 0x102e4
movl $0x1, 0x40(%rbx,%rax,4)
incq %rax
jmp 0x10203
pushq $-0x8
popq %rdx
xorl %eax, %eax
xorl %ecx, %ecx
testq %rdx, %rdx
je 0x10239
movzbl 0x11(%rsp,%rdx), %esi
addl %esi, %eax
movzbl 0x19(%rsp,%rdx), %esi
addl %esi, %ecx
incq %rdx
jmp 0x10221
cmpw $0x20, %ax
ja 0x10286
cmpw $0x20, %cx
ja 0x10286
leal (%rcx,%rax), %edx
cmpw $0x40, %dx
ja 0x10286
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x8, %rax
je 0x102a9
movl %eax, %edx
shll $0x10, %edx
orl $0x800001, %edx         # imm = 0x800001
movzbl 0x9(%rsp,%rax), %edi
movl %edi, %esi
addl %ecx, %esi
subw $0x1, %di
jb 0x1027f
movzwl %cx, %r8d
movl %edx, 0x40(%rbx,%r8,4)
incl %ecx
jmp 0x1026c
incq %rax
movl %esi, %ecx
jmp 0x10252
movzwl %cx, %edx
movzwl %ax, %esi
leaq 0xbb66(%rip), %rdi      # 0x1bdf9
pushq $0x40
popq %rcx
xorl %eax, %eax
callq 0xd160
leaq 0xbc94(%rip), %rdi      # 0x1bf38
jmp 0x101c3
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x8, %rax
je 0x102e4
movl %eax, %edx
shll $0x10, %edx
orl $0x800001, %edx         # imm = 0x800001
movzbl 0x11(%rsp,%rax), %edi
movl %edi, %esi
addl %ecx, %esi
subw $0x1, %di
jb 0x102dd
movzwl %cx, %r8d
movl %edx, 0xc0(%rbx,%r8,4)
incl %ecx
jmp 0x102c7
incq %rax
movl %esi, %ecx
jmp 0x102ad
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 0xbb43(%rip), %rdi      # 0x1be6e
leaq 0xbba4(%rip), %rax      # 0x1bed6
leaq 0xbba1(%rip), %r15      # 0x1beda
cmoveq %rax, %r15
xorl %eax, %eax
callq 0xd160
movl $0xff, %r13d
movl %r14d, %esi
andl %r13d, %esi
shrl $0x8, %r14d
leaq 0xbb28(%rip), %rdi      # 0x1be83
movl %r14d, %edx
xorl %eax, %eax
callq 0xd160
andl %r12d, %r13d
shrl $0x8, %r12d
leaq 0xbb27(%rip), %rdi      # 0x1be9a
movl %r13d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0xd160
leaq 0xbb2f(%rip), %rdi      # 0x1beb6
movq %r15, %rsi
xorl %eax, %eax
callq 0xd160
shll $0x5, %ebp
leaq 0xbb45(%rip), %rdi      # 0x1bee0
movl %ebp, %esi
xorl %eax, %eax
callq 0xd160
cvtsi2sdl 0x4(%rsp), %xmm0
mulsd 0xba16(%rip), %xmm0     # 0x1bdc8
leaq 0xbb48(%rip), %rdi      # 0x1bf01
movb $0x1, %al
callq 0xd160
leaq 0xbbb2(%rip), %rdi      # 0x1bf79
callq 0xd0c0
leaq 0xbbe7(%rip), %rdi      # 0x1bfba
callq 0xd0c0
leaq 0xbb9b(%rip), %rdi      # 0x1bf7a
callq 0xd0c0
leaq 0xbb46(%rip), %r12      # 0x1bf31
leaq 0xbb38(%rip), %r13      # 0x1bf2a
xorl %r15d, %r15d
movq %rbx, 0x20(%rsp)
cmpq $0x40, %r15
je 0x1047f
cmpq $0x20, %r15
leaq 0xbb1c(%rip), %rsi      # 0x1bf27
leaq 0xbb12(%rip), %rax      # 0x1bf24
cmovbq %rax, %rsi
xorl %r14d, %r14d
leaq 0xbaf8(%rip), %rdi      # 0x1bf18
movl %r15d, %edx
xorl %eax, %eax
callq 0xd160
movl 0x40(%rbx,%r15,4), %ebx
movl %ebx, %ebp
andl $0x800000, %ebp         # imm = 0x800000
shrl $0x10, %ebx
andl $0x7f, %ebx
incl %ebx
cmpl $0x9, %r14d
je 0x1046a
cmpl %r14d, %ebx
movq %r13, %rdi
cmovneq %r12, %rdi
testl %ebp, %ebp
cmoveq %r12, %rdi
movl %r14d, %eax
orl %ebp, %eax
cmoveq %r13, %rdi
xorl %eax, %eax
callq 0xd160
incl %r14d
jmp 0x1043f
pushq $0xa
popq %rdi
callq 0xd050
incq %r15
movq 0x20(%rsp), %rbx
jmp 0x103fa
leaq 0xbb74(%rip), %rdi      # 0x1bffa
callq 0xd0c0
leaq 0xcf87(%rip), %rax      # 0x1d419
leaq 0xb9d2(%rip), %rsi      # 0x1be6b
cmpb $0x0, 0x8(%rsp)
cmovneq %rax, %rsi
leaq 0xb9a5(%rip), %rdi      # 0x1be4e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xd160
jmp 0x101cb
nop