// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb1_configure
int
vrb1_configure(void *dev, void *bar0addr, const char *cfg_filename, const bool first_cfg)
{
	struct vrb1_conf vrb1_conf;
	int ret;

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

	ret = vrb1_write_config(dev, bar0addr, &vrb1_conf, first_cfg);
	if (ret != 0) {
		printf("Error writing configuration for VRB1.\n");
		return -1;
	}
	hw_device *accel_dev = (hw_device *)dev;
	accel_dev->numvfs = vrb1_conf.num_vf_bundles;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10238, %rsp          # imm = 0x10238
movl %ecx, %r12d
movq %rdx, %r14
movq %rsi, 0x28(%rsp)
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x137d0
pushq $-0x1
popq %r15
testb %al, %al
je 0x11b1a
leaq 0xa2c2(%rip), %rdi      # 0x1bdd0
movq %r14, %rsi
xorl %eax, %eax
callq 0xd160
jmp 0x11b2b
leaq 0x4c(%rsp), %rsi
movq %r14, %rdi
callq 0x12afd
testl %eax, %eax
je 0x11b4c
leaq 0xa42c(%rip), %rdi      # 0x1bf5e
callq 0xd0c0
movl %r15d, %eax
addq $0x10238, %rsp          # imm = 0x10238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rax
movl 0xc8412c(%rax), %ebp
testl %ebp, %ebp
je 0x11cd7
cmpl $0x1f, %ebp
jne 0x11bf2
movq 0x28(%rsp), %r14
movl $0x1f00881, 0xc8410c(%r14) # imm = 0x1F00881
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0xd460
movl $0xf, 0xc84128(%r14)
movl %ebp, %edi
callq 0xd460
movl 0xc8412c(%r14), %ebp
cmpl $0xf, %ebp
jne 0x11c0a
movl $0x1, 0xc84128(%r14)
pushq $0x1
popq %rdi
callq 0xd460
movl 0xc8412c(%r14), %ebp
cmpl $0x1, %ebp
jne 0x11c22
movl $0x0, 0xc84128(%r14)
pushq $0x1
popq %rdi
callq 0xd460
movl 0xc8412c(%r14), %ebp
testl %ebp, %ebp
je 0x11c55
callq 0x1298b
leaq 0x232e7(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
andl $0x0, (%rsp)
jmp 0x11c38
callq 0x1298b
leaq 0x232d2(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
movl $0x1f, (%rsp)
jmp 0x11c38
callq 0x1298b
leaq 0x232ba(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
movl $0xf, (%rsp)
jmp 0x11c38
callq 0x1298b
leaq 0x232a2(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
movl $0x1, (%rsp)
leaq 0xac0e(%rip), %rdx      # 0x1c84d
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x19400
jmp 0x121e1
leaq 0xb9040c(%r14), %rax
leaq 0xb900c0(%r14), %rcx
xorl %edx, %edx
movl $0x10000, %esi          # imm = 0x10000
xorl %edi, %edi
cmpq $0x3, %rdi
je 0x11cb8
xorl %r8d, %r8d
cmpq $0x100, %r8             # imm = 0x100
je 0x11c97
movl %edx, -0xc(%rax,%r8)
movl %edx, -0x8(%rax,%r8)
movl %edx, -0x4(%rax,%r8)
movl %edx, (%rax,%r8)
addq $0x10, %r8
jmp 0x11c75
xorl %r8d, %r8d
cmpq $0x8, %r8
je 0x11cad
movl $0x0, (%rcx,%r8,4)
incq %r8
jmp 0x11c9a
incq %rdi
addq %rsi, %rax
addq %rsi, %rcx
jmp 0x11c6c
xorl %eax, %eax
movq 0x28(%rsp), %rcx
cmpq $0x400, %rax            # imm = 0x400
je 0x11cd7
movl $0x0, 0xa01000(%rcx,%rax,4)
incq %rax
jmp 0x11cbf
movq 0x28(%rsp), %r15
movl $0x881, 0xc8410c(%r15) # imm = 0x881
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0xd460
movl $0x1, 0xb8002c(%r15)
movl $0x8000103, 0xb30000(%r15) # imm = 0x8000103
xorl %eax, %eax
movl %eax, 0xb80868(%r15)
movl $0x3df, 0xb80870(%r15) # imm = 0x3DF
movl $0x22, 0xb80010(%r15)
movl %eax, 0xb80814(%r15)
movl %eax, 0xb80000(%r15)
movl %eax, 0xb80040(%r15)
movl $0x80000001, 0xb80004(%r15) # imm = 0x80000001
movl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xb58020(%r15)
movl %ecx, 0xb58024(%r15)
movl $0x7fc00, 0xb80008(%r15) # imm = 0x7FC00
pushq $-0x1
popq %rcx
movl %ecx, 0xb80800(%r15)
movl $0x2000, 0xb80804(%r15) # imm = 0x2000
movl %ecx, 0xb808b0(%r15)
movl %ecx, 0xb80890(%r15)
movl %ecx, 0xb808a0(%r15)
movl %ecx, 0xb808a4(%r15)
movl %ecx, 0xb808a8(%r15)
movl %ecx, 0xb808ac(%r15)
movl %ecx, 0xb808b0(%r15)
movl %ecx, 0xa00040(%r15)
movl %ecx, 0xa00044(%r15)
movl %ecx, 0xa00048(%r15)
movl %ecx, 0xa0004c(%r15)
cmpq $0x8, %rax
je 0x11ddd
movl $0xffffffff, 0xa00060(%r15,%rax,4) # imm = 0xFFFFFFFF
incq %rax
jmp 0x11dc6
movl $0xffffffff, 0xa00050(%r15) # imm = 0xFFFFFFFF
movl $0xff, 0xa00054(%r15)
xorl %eax, %eax
cmpq $0x5000, %rax           # imm = 0x5000
je 0x11e11
movl $0x200f2, 0xb4c104(%r15,%rax) # imm = 0x200F2
addq $0x1000, %rax           # imm = 0x1000
jmp 0x11df5
movl %r12d, 0x3c(%rsp)
movq %rbx, 0x40(%rsp)
leaq 0x4c(%rsp), %r14
movzwl 0x6(%r14), %eax
movzwl 0x12(%r14), %ecx
addl %eax, %ecx
movzwl 0xc(%r14), %eax
movzwl 0x18(%r14), %edx
addl %eax, %edx
addl %ecx, %edx
movzwl 0x1e(%r14), %eax
addl %edx, %eax
movq %rax, 0x30(%rsp)
callq 0x1298b
leaq 0x2307e(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
movzwl 0x6(%r14), %r9d
movzwl 0xc(%r14), %ecx
movzwl 0x12(%r14), %edx
movzwl 0x18(%r14), %esi
movzwl 0x1e(%r14), %edi
movl %edi, 0x18(%rsp)
movl %esi, 0x10(%rsp)
movl %edx, 0x8(%rsp)
movl %ecx, (%rsp)
leaq 0xa9e7(%rip), %rdx      # 0x1c86c
xorl %r13d, %r13d
pushq $0x2
popq %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
cmpq %r13, 0x30(%rsp)
je 0x11ee1
movl %r13d, %edi
movq %r14, %rsi
callq 0x11609
movl %eax, 0xa00200(%r15,%r13,4)
movl %r13d, %edi
movq %r14, %rsi
callq 0x11609
leal -0x1(%rax), %ecx
movl %ebp, %eax
shll %cl, %eax
addl $0x10000, %eax          # imm = 0x10000
movl %eax, 0xa00300(%r15,%r13,4)
movl $0x2, 0xa02f00(%r15,%r13,4)
incq %r13
jmp 0x11e97
xorl %eax, %eax
cmpq $0x20, %rax
je 0x11f1e
movl $0x3020100, 0xa00600(%r15,%rax,4) # imm = 0x3020100
movl $0x7060504, 0xa00700(%r15,%rax,4) # imm = 0x7060504
movl $0xb0a0908, 0xa00800(%r15,%rax,4) # imm = 0xB0A0908
movl $0xf0e0d0c, 0xa00900(%r15,%rax,4) # imm = 0xF0E0D0C
incq %rax
jmp 0x11ee3
movl $0xf0f, 0xa02f48(%r15) # imm = 0xF0F
xorl %eax, %eax
cmpq $0x20, %rax
je 0x11f42
movl $0x0, 0xa00a00(%r15,%rax,4)
incq %rax
jmp 0x11f2b
movzwl 0x52(%rsp), %r14d
movl %r14d, %ecx
negb %cl
pushq $-0x1
popq %rbx
movq %rbx, %rax
shrq %cl, %rax
testl %r14d, %r14d
cmovel %r14d, %eax
xorl %ecx, %ecx
cmpq $0x5, %rcx
je 0x11f72
movl %eax, 0xa00a30(%r15,%rcx,4)
incq %rcx
jmp 0x11f5f
movzwl 0x5e(%rsp), %r13d
xorl %ebp, %ebp
movl $0x0, %eax
testl %r13d, %r13d
je 0x11f9b
movq %rbx, %rdx
movl %r14d, %ecx
shlq %cl, %rdx
leal (%r14,%r13), %ecx
negb %cl
movq %rbx, %rax
shrq %cl, %rax
andl %edx, %eax
leaq 0xa00a00(%r15), %rcx
xorl %edx, %edx
cmpq $0x1400, %rdx           # imm = 0x1400
je 0x11fd6
movl 0xb40200(%r15,%rdx,4), %esi
andl $0x70, %esi
cmpl $0x10, %esi
jne 0x11fc3
movl %eax, (%rcx)
incl %ebp
jmp 0x11fc9
movl $0x0, (%rcx)
addq $0x4, %rcx
addq $0x400, %rdx            # imm = 0x400
jmp 0x11fa4
callq 0x1298b
leaq 0x22eee(%rip), %rcx     # 0x34ed0
movq 0x18(%rcx), %r8
movl %ebp, (%rsp)
leaq 0x98c1(%rip), %rdx      # 0x1b8b1
leaq 0xa8b0(%rip), %r9       # 0x1c8a7
xorl %ebp, %ebp
pushq $0x3
popq %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
addl %r14d, %r13d
movzwl 0x58(%rsp), %eax
movl $0x0, %edx
testl %eax, %eax
je 0x12030
movq %rbx, %rsi
movl %r13d, %ecx
shlq %cl, %rsi
leal (%rax,%r13), %ecx
negb %cl
movq %rbx, %rdx
shrq %cl, %rdx
andl %esi, %edx
movl %edx, 0xa00a54(%r15)
movl %edx, 0xa00a58(%r15)
movl %edx, 0xa00a5c(%r15)
addl %eax, %r13d
movzwl 0x64(%rsp), %eax
testl %eax, %eax
je 0x12068
movq %rbx, %rdx
movl %r13d, %ecx
shlq %cl, %rdx
leal (%rax,%r13), %ecx
negb %cl
movq %rbx, %rbp
shrq %cl, %rbp
andl %edx, %ebp
movl %ebp, 0xa00a28(%r15)
movl %ebp, 0xa00a2c(%r15)
movzwl 0x6a(%rsp), %edx
xorl %r14d, %r14d
movl $0x0, %ecx
testl %edx, %edx
je 0x120a3
addl %eax, %r13d
movq %rbx, %rax
movl %r13d, %ecx
shlq %cl, %rax
addl %edx, %r13d
negb %r13b
movl %r13d, %ecx
shrq %cl, %rbx
andl %eax, %ebx
movl %ebx, %ecx
movl %ecx, 0xa00a60(%r15)
leaq 0x4c(%rsp), %r13
leaq 0x9a4a(%rip), %rbx      # 0x1bb00
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl $0x8, %ebp
je 0x120df
movl %ebp, %edi
movq %r13, %rsi
callq 0x11536
cltq
movl (%rbx,%rax,4), %eax
movl %r14d, %ecx
shll %cl, %eax
orl %eax, %r15d
incl %ebp
addl $0x4, %r14d
jmp 0x120bb
movq 0x28(%rsp), %rax
movl %r15d, 0xa02f40(%rax)
xorl %ebp, %ebp
leaq 0x4c(%rsp), %r14
xorl %r12d, %r12d
xorl %r15d, %r15d
cmpl $0x20, %ebp
je 0x1211f
movl %r12d, %edi
orl $0x8, %edi
movq %r14, %rsi
callq 0x11536
cltq
movl (%rbx,%rax,4), %eax
movl %ebp, %ecx
shll %cl, %eax
orl %eax, %r15d
incl %r12d
addl $0x4, %ebp
jmp 0x120f8
movq 0x28(%rsp), %rax
movl %r15d, 0xa02f44(%rax)
movq %rax, %r15
xorl %eax, %eax
cmpq $0x10, %rax
je 0x12147
movl $0x0, 0xa02f00(%r15,%rax,4)
incq %rax
jmp 0x12130
leaq 0xa01000(%r15), %r12
xorl %r13d, %r13d
leaq 0x4c(%rsp), %rbp
xorl %r14d, %r14d
cmpq 0x30(%rsp), %r13
je 0x121a6
xorl %r15d, %r15d
movzwl 0x50(%rsp), %eax
cmpq %rax, %r15
jae 0x12195
movl %r14d, (%r12,%r15,4)
movl %r13d, %edi
movq %rbp, %rsi
callq 0x1164c
movl %eax, %ebx
movl %r13d, %edi
movq %rbp, %rsi
callq 0x11609
movl %eax, %ecx
shll %cl, %ebx
addl %ebx, %r14d
incq %r15
jmp 0x12163
incq %r13
addq $0x100, %r12            # imm = 0x100
movq 0x28(%rsp), %r15
jmp 0x12159
cmpl $0x10001, %r14d         # imm = 0x10001
jb 0x121ed
callq 0x1298b
leaq 0x22d15(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
movl $0x10000, (%rsp)        # imm = 0x10000
leaq 0xa6ed(%rip), %rdx      # 0x1c8b9
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %r14d, %r9d
xorl %eax, %eax
callq 0x19400
pushq $-0x1
popq %r15
leaq 0xa7a9(%rip), %rdi      # 0x1c991
jmp 0x11b32
movl $0x30, 0x810000(%r15)
movl $0xfff, 0xb31044(%r15) # imm = 0xFFF
movl $0x1f10, 0xb800cc(%r15) # imm = 0x1F10
movl $0x0, 0xc84038(%r15)
pushq $0x1
popq %rbp
movl %ebp, 0xc84114(%r15)
movzbl 0x4c(%rsp), %ebx
leal (%rbx,%rbx), %eax
movl %eax, 0xc84108(%r15)
movl %ebp, 0xb90008(%r15)
movl %ebp, 0xba0008(%r15)
callq 0x1298b
leaq 0x22c84(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
leaq 0x96c6(%rip), %rcx      # 0x1b91d
leaq 0x970c(%rip), %rdx      # 0x1b96a
testl %ebx, %ebx
cmovneq %rcx, %rdx
xorl %ebx, %ebx
pushq $0x2
popq %r14
movl %r14d, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
movl %ebp, 0xb80084(%r15)
movzwl 0x50(%rsp), %eax
leaq 0xb98000(%r15), %rcx
pushq $-0x1
popq %r15
movq 0x40(%rsp), %r13
cmpq %rax, %rbx
je 0x122c8
xorl %edx, %edx
cmpq $0x30000, %rdx          # imm = 0x30000
je 0x122bc
movl $0x1, (%rcx,%rdx)
movl $0x2, (%rcx,%rdx)
addq $0x10000, %rdx          # imm = 0x10000
jmp 0x1229c
incq %rbx
addq $0x100, %rcx            # imm = 0x100
jmp 0x12295
xorl %eax, %eax
movq 0x28(%rsp), %rcx
cmpq $0x30000, %rax          # imm = 0x30000
je 0x122f5
movl $0x1, 0xb9c0f0(%rcx,%rax)
movl $0x2, 0xb9c0f0(%rcx,%rax)
addq $0x10000, %rax          # imm = 0x10000
jmp 0x122cf
movq 0x28(%rsp), %rcx
movl %ebp, 0xb9c400(%rcx)
movl %ebp, 0xb9c404(%rcx)
xorl %eax, %eax
movl %eax, 0xb9c408(%rcx)
movl %r14d, 0xb9c400(%rcx)
movl %ebp, 0xbbc400(%rcx)
movl $0x201, 0xbbc404(%rcx)  # imm = 0x201
movl %eax, 0xbbc408(%rcx)
movl %r14d, 0xbbc400(%rcx)
movl $0x80000040, 0xb5800c(%rcx) # imm = 0x80000040
leaq 0x21f0d(%rip), %rcx     # 0x34250
movq 0x28(%rsp), %rsi
cmpq $0x800, %rax            # imm = 0x800
je 0x12360
movl (%rax,%rcx), %edx
movl %edx, 0xb58800(%rsi,%rax)
addq $0x4, %rax
jmp 0x12348
movq 0x28(%rsp), %rax
movl $0x0, 0xb5800c(%rax)
cmpw $0x0, 0x6a(%rsp)
je 0x124c2
movq 0x28(%rsp), %rax
movl $0x2001, 0xb58004(%rax) # imm = 0x2001
cmpb $0x0, 0x3c(%rsp)
je 0x124c2
movq 0x10(%r13), %r14
movq %r14, %rdi
callq 0x137d0
testb %al, %al
je 0x123c0
callq 0x1298b
leaq 0x22b1f(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leaq 0xa54d(%rip), %rdx      # 0x1c908
jmp 0x12594
leaq 0xa572(%rip), %rsi      # 0x1c939
movq %r14, %rdi
callq 0xd330
testq %rax, %rax
je 0x1257e
movq %rax, %r13
leaq 0x430(%rsp), %rdi
pushq $0x1
popq %rdx
movl $0xfe00, %esi           # imm = 0xFE00
movq %rax, %rcx
callq 0xd0d0
movq %rax, %rbx
callq 0x1298b
leaq 0x22ace(%rip), %rcx     # 0x34ed0
testw %bx, %bx
jle 0x125aa
movq 0x10(%rcx), %r8
leaq 0xa54d(%rip), %rdx      # 0x1c963
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
callq 0x19400
movq 0x28(%rsp), %r15
movl $0x80000000, 0xb5800c(%r15) # imm = 0x80000000
movw $0x100, %ax             # imm = 0x100
movq 0x21b8b(%rip), %r12     # 0x33fd0
xorl %ebp, %ebp
cmpq $0x7f00, %rbx           # imm = 0x7F00
je 0x1248f
movswl %ax, %ecx
leal 0xb58800(,%rcx,4), %ecx
movswl 0x430(%rsp,%rbx,2), %edx
movl %edx, (%r15,%rcx)
incl %eax
testw $0x1ff, %ax             # imm = 0x1FF
jne 0x1248a
incl %ebp
movq (%r12), %rdi
callq 0xd290
movswl %bp, %eax
addl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0xb5800c(%r15)
xorl %eax, %eax
incq %rbx
jmp 0x12447
movl $0x0, 0xb5800c(%r15)
movq %r13, %rdi
callq 0xd0f0
leaq 0x430(%rsp), %rdi
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x112ad
movq %r14, %rdi
movq %r13, %rsi
callq 0x11406
xorl %r14d, %r14d
leaq 0x4c(%rsp), %rbx
movq 0x28(%rsp), %r15
cmpq $0x10, %r14
je 0x1251f
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpl $0x10, %ebp
je 0x1251a
movzwl 0x50(%rsp), %eax
xorl %edx, %edx
cmpq %rax, %r14
jae 0x12504
cmpl 0x30(%rsp), %ebp
jae 0x12504
movl %ebp, %edi
movq %rbx, %rsi
callq 0x1164c
pushq $-0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %r12d, %edx
movl %edx, 0xa10000(%r15,%r14,4)
incl %ebp
addl $0x10000, %r12d         # imm = 0x10000
jmp 0x124da
incq %r14
jmp 0x124cf
xorl %eax, %eax
cmpq $0x1000, %rax           # imm = 0x1000
je 0x12539
movl 0xc80000(%r15,%rax), %ecx
addq $0x100, %rax            # imm = 0x100
jmp 0x12521
movl $0xffff0c0d, 0xc84018(%r15) # imm = 0xFFFF0C0D
callq 0x1298b
leaq 0x22980(%rip), %rcx     # 0x34ed0
movq 0x10(%rcx), %r8
leaq 0xa38a(%rip), %rdx      # 0x1c8e5
xorl %r15d, %r15d
pushq $0x2
popq %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
movzwl 0x50(%rsp), %eax
movl %eax, 0x4f8(%r13)
jmp 0x11b37
callq 0x1298b
leaq 0x22946(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leaq 0xa3a8(%rip), %rdx      # 0x1c93c
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
callq 0x19400
jmp 0x121e1
movq (%rcx), %r8
leaq 0xa388(%rip), %rdx      # 0x1c93c
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r14, %r9
xorl %eax, %eax
callq 0x19400
movq %r13, %rdi
callq 0xd0f0
jmp 0x121e1