// File: /workspace/github_c_makefile_star2_O1/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, %ebx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
movq %rdx, %rdi
callq 0x13c09
testb %al, %al
je 0x11dec
leaq 0x9fe0(%rip), %rdi      # 0x1bdc0
movq %r15, %rsi
xorl %eax, %eax
callq 0xd150
jmp 0x11dfd
leaq 0x4c(%rsp), %rsi
movq %r15, %rdi
callq 0x12e4d
testl %eax, %eax
je 0x11e20
leaq 0xa14a(%rip), %rdi      # 0x1bf4e
callq 0xd0c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10238, %rsp          # imm = 0x10238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xc8412c(%r13), %r15d
testl %r15d, %r15d
je 0x11fae
cmpl $0x1f, %r15d
jne 0x11ed0
movl $0x1f00881, 0xc8410c(%r13) # imm = 0x1F00881
movl $0x1, %edi
callq 0xd460
movl $0xf, 0xc84128(%r13)
movl $0x1, %edi
callq 0xd460
movl 0xc8412c(%r13), %r15d
cmpl $0xf, %r15d
jne 0x11ee8
movl $0x1, 0xc84128(%r13)
movl $0x1, %edi
callq 0xd460
movl 0xc8412c(%r13), %r15d
cmpl $0x1, %r15d
jne 0x11f00
movl $0x0, 0xc84128(%r13)
movl $0x1, %edi
callq 0xd460
movl 0xc8412c(%r13), %r15d
testl %r15d, %r15d
je 0x11f38
callq 0x12cd5
leaq 0x2200c(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x0, (%rsp)
jmp 0x11f16
callq 0x12cd5
leaq 0x21ff4(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x1f, (%rsp)
jmp 0x11f16
callq 0x12cd5
leaq 0x21fdc(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0xf, (%rsp)
jmp 0x11f16
callq 0x12cd5
leaq 0x21fc4(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x1, (%rsp)
leaq 0xa960(%rip), %rdx      # 0x1c87d
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %r15d, %r9d
xorl %eax, %eax
callq 0x19ca8
movl $0xffffffed, %ebx       # imm = 0xFFFFFFED
jmp 0x12894
leaq 0xb9040c(%r13), %rax
leaq 0xb900c0(%r13), %rcx
xorl %edx, %edx
movl $0x10000, %esi          # imm = 0x10000
xorl %edi, %edi
xorl %r8d, %r8d
movl %edx, -0xc(%rax,%r8)
movl %edx, -0x8(%rax,%r8)
movl %edx, -0x4(%rax,%r8)
movl %edx, (%rax,%r8)
addq $0x10, %r8
cmpq $0x100, %r8             # imm = 0x100
jne 0x11f52
xorl %r8d, %r8d
movl $0x0, (%rcx,%r8,4)
incq %r8
cmpq $0x8, %r8
jne 0x11f75
incq %rdi
addq %rsi, %rax
addq %rsi, %rcx
cmpq $0x3, %rdi
jne 0x11f4f
xorl %eax, %eax
movl $0x0, 0xa01000(%r13,%rax,4)
incq %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0x11f97
movl $0x881, 0xc8410c(%r13) # imm = 0x881
movl $0x1, %edi
callq 0xd460
movl $0x1, 0xb8002c(%r13)
movl $0x8000103, 0xb30000(%r13) # imm = 0x8000103
xorl %eax, %eax
movl %eax, 0xb80868(%r13)
movl $0x3df, 0xb80870(%r13) # imm = 0x3DF
movl $0x22, 0xb80010(%r13)
movl %eax, 0xb80814(%r13)
movl %eax, 0xb80000(%r13)
movl %eax, 0xb80040(%r13)
movl $0x80000001, 0xb80004(%r13) # imm = 0x80000001
movl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xb58020(%r13)
movl %ecx, 0xb58024(%r13)
movl $0x7fc00, 0xb80008(%r13) # imm = 0x7FC00
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0xb80800(%r13)
movl $0x2000, 0xb80804(%r13) # imm = 0x2000
movl %ecx, 0xb808b0(%r13)
movl %ecx, 0xb80890(%r13)
movl %ecx, 0xb808a0(%r13)
movl %ecx, 0xb808a4(%r13)
movl %ecx, 0xb808a8(%r13)
movl %ecx, 0xb808ac(%r13)
movl %ecx, 0xb808b0(%r13)
movl %ecx, 0xa00040(%r13)
movl %ecx, 0xa00044(%r13)
movl %ecx, 0xa00048(%r13)
movl %ecx, 0xa0004c(%r13)
movl $0xffffffff, 0xa00060(%r13,%rax,4) # imm = 0xFFFFFFFF
incq %rax
cmpq $0x8, %rax
jne 0x1209a
movl %ebx, 0x34(%rsp)
movl $0xffffffff, 0xa00050(%r13) # imm = 0xFFFFFFFF
movl $0xff, 0xa00054(%r13)
xorl %eax, %eax
movl $0x200f2, 0xb4c104(%r13,%rax) # imm = 0x200F2
addq $0x1000, %rax           # imm = 0x1000
cmpq $0x5000, %rax           # imm = 0x5000
jne 0x120cb
movzwl 0x52(%rsp), %eax
movzwl 0x5e(%rsp), %ecx
addl %eax, %ecx
movzwl 0x58(%rsp), %eax
movzwl 0x64(%rsp), %ebx
addl %eax, %ebx
addl %ecx, %ebx
movzwl 0x6a(%rsp), %r15d
callq 0x12cd5
leaq 0x21dbf(%rip), %rbp     # 0x33ed0
movq 0x10(%rbp), %r8
movzwl 0x52(%rsp), %r9d
movzwl 0x58(%rsp), %ecx
movzwl 0x5e(%rsp), %edx
movzwl 0x64(%rsp), %esi
movzwl 0x6a(%rsp), %edi
movl %edi, 0x18(%rsp)
movl %esi, 0x10(%rsp)
movl %edx, 0x8(%rsp)
movl %ecx, (%rsp)
leaq 0xa757(%rip), %rdx      # 0x1c89c
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
addl %ebx, %r15d
movl %r15d, 0x30(%rsp)
movl %r15d, %ebx
je 0x121b4
xorl %r15d, %r15d
leaq 0x4c(%rsp), %r12
movl %r15d, %edi
movq %r12, %rsi
callq 0x11866
movl %eax, 0xa00200(%r13,%r15,4)
movl %r15d, %edi
movq %r12, %rsi
callq 0x11866
leal -0x1(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
addl $0x10000, %eax          # imm = 0x10000
movl %eax, 0xa00300(%r13,%r15,4)
movl $0x2, 0xa02f00(%r13,%r15,4)
incq %r15
cmpq %r15, %rbx
jne 0x1216b
xorl %eax, %eax
movl $0x3020100, 0xa00600(%r13,%rax,4) # imm = 0x3020100
movl $0x7060504, 0xa00700(%r13,%rax,4) # imm = 0x7060504
movl $0xb0a0908, 0xa00800(%r13,%rax,4) # imm = 0xB0A0908
movl $0xf0e0d0c, 0xa00900(%r13,%rax,4) # imm = 0xF0E0D0C
incq %rax
cmpq $0x20, %rax
jne 0x121b6
movl $0xf0f, 0xa02f48(%r13) # imm = 0xF0F
xorl %eax, %eax
movl $0x0, 0xa00a00(%r13,%rax,4)
incq %rax
cmpq $0x20, %rax
jne 0x121fc
movq %rbx, 0x40(%rsp)
movzwl 0x52(%rsp), %r12d
movl %r12d, %ecx
negb %cl
movq $-0x1, %rax
shrq %cl, %rax
testl %r12d, %r12d
cmovel %r12d, %eax
xorl %ecx, %ecx
movl %eax, 0xa00a30(%r13,%rcx,4)
incq %rcx
cmpq $0x5, %rcx
jne 0x12234
movzwl 0x5e(%rsp), %r15d
xorl %ebx, %ebx
movl $0x0, %eax
testl %r15d, %r15d
je 0x12276
movq $-0x1, %rdx
movl %r12d, %ecx
shlq %cl, %rdx
movq $-0x1, %rax
leal (%r12,%r15), %ecx
negb %cl
shrq %cl, %rax
andl %edx, %eax
leaq 0xa00a00(%r13), %rcx
xorl %edx, %edx
movl 0xb40200(%r13,%rdx,4), %esi
andl $0x70, %esi
cmpl $0x10, %esi
jne 0x12295
movl %eax, (%rcx)
incl %ebx
jmp 0x1229b
movl $0x0, (%rcx)
addq $0x400, %rdx            # imm = 0x400
addq $0x4, %rcx
cmpq $0x1400, %rdx           # imm = 0x1400
jne 0x1227f
callq 0x12cd5
movq 0x18(%rbp), %r8
movl %ebx, (%rsp)
leaq 0x95ef(%rip), %rdx      # 0x1b8b1
leaq 0xa60e(%rip), %r9       # 0x1c8d7
xorl %ebx, %ebx
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
addl %r12d, %r15d
movzwl 0x58(%rsp), %eax
testl %eax, %eax
je 0x12307
movq $-0x1, %rdx
movl %r15d, %ecx
shlq %cl, %rdx
movq $-0x1, %rbx
leal (%r15,%rax), %ecx
negb %cl
shrq %cl, %rbx
andl %edx, %ebx
xorl %ecx, %ecx
movl %ebx, 0xa00a54(%r13,%rcx,4)
incq %rcx
cmpq $0x3, %rcx
jne 0x12309
addl %eax, %r15d
movzwl 0x64(%rsp), %eax
testl %eax, %eax
je 0x12347
movq $-0x1, %rsi
movl %r15d, %ecx
shlq %cl, %rsi
movq $-0x1, %rdx
leal (%r15,%rax), %ecx
negb %cl
shrq %cl, %rdx
andl %esi, %edx
jmp 0x12349
xorl %edx, %edx
xorl %ecx, %ecx
movl %edx, 0xa00a28(%r13,%rcx,4)
incq %rcx
cmpq $0x2, %rcx
jne 0x1234b
movzwl 0x6a(%rsp), %esi
xorl %r12d, %r12d
movl $0x0, %edx
testl %esi, %esi
je 0x12392
addl %eax, %r15d
movq $-0x1, %rax
movl %r15d, %ecx
shlq %cl, %rax
movq $-0x1, %rdx
addl %esi, %r15d
negb %r15b
movl %r15d, %ecx
shrq %cl, %rdx
andl %eax, %edx
movq %r13, 0x28(%rsp)
movl %edx, 0xa00a60(%r13)
leaq 0x4c(%rsp), %r15
leaq 0x9756(%rip), %rbx      # 0x1bb00
xorl %ebp, %ebp
xorl %r13d, %r13d
movl %r13d, %edi
movq %r15, %rsi
callq 0x11795
cltq
movl (%rbx,%rax,4), %eax
movl %r12d, %ecx
shll %cl, %eax
orl %eax, %ebp
incl %r13d
addl $0x4, %r12d
cmpl $0x8, %r13d
jne 0x123af
movq 0x28(%rsp), %rax
movl %ebp, 0xa02f40(%rax)
movl $0x8, %r15d
xorl %r12d, %r12d
leaq 0x4c(%rsp), %r13
xorl %ebp, %ebp
movl %r15d, %edi
movq %r13, %rsi
callq 0x11795
cltq
movl (%rbx,%rax,4), %eax
movl %r12d, %ecx
shll %cl, %eax
orl %eax, %ebp
incl %r15d
addl $0x4, %r12d
cmpl $0x10, %r15d
jne 0x123ee
movq 0x28(%rsp), %rcx
movl %ebp, 0xa02f44(%rcx)
xorl %eax, %eax
movl $0x0, 0xa02f00(%rcx,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x1241f
movq %r14, 0x38(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x124a0
leaq 0xa01000(%rcx), %rbp
xorl %r12d, %r12d
leaq 0x4c(%rsp), %r13
xorl %r15d, %r15d
cmpw $0x0, 0x50(%rsp)
je 0x1248d
xorl %r14d, %r14d
movl %r15d, (%rbp,%r14,4)
movl %r12d, %edi
movq %r13, %rsi
callq 0x118d2
movl %eax, %ebx
movl %r12d, %edi
movq %r13, %rsi
callq 0x11866
movl %eax, %ecx
shll %cl, %ebx
addl %ebx, %r15d
incq %r14
movzwl 0x50(%rsp), %eax
cmpq %rax, %r14
jb 0x1245c
incq %r12
addq $0x100, %rbp            # imm = 0x100
cmpq 0x40(%rsp), %r12
jne 0x12451
jmp 0x124a3
xorl %r15d, %r15d
cmpl $0x10001, %r15d         # imm = 0x10001
jb 0x124e9
callq 0x12cd5
leaq 0x21a18(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x10000, (%rsp)        # imm = 0x10000
leaq 0xa420(%rip), %rdx      # 0x1c8e9
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %r15d, %r9d
xorl %eax, %eax
callq 0x19ca8
movl $0xffffffed, %ebx       # imm = 0xFFFFFFED
movq 0x38(%rsp), %r14
jmp 0x12894
movq 0x28(%rsp), %r13
movl $0x30, 0x810000(%r13)
movl $0xfff, 0xb31044(%r13) # imm = 0xFFF
movl $0x1f10, 0xb800cc(%r13) # imm = 0x1F10
movl $0x0, 0xc84038(%r13)
movl $0x1, %ebx
movl %ebx, 0xc84114(%r13)
movzbl 0x4c(%rsp), %r14d
leal (%r14,%r14), %eax
movl %eax, 0xc84108(%r13)
movl %ebx, 0xb90008(%r13)
movl %ebx, 0xba0008(%r13)
callq 0x12cd5
leaq 0x2197f(%rip), %rbp     # 0x33ed0
movq 0x10(%rbp), %r8
leaq 0x93c1(%rip), %rcx      # 0x1b91d
leaq 0x9407(%rip), %rdx      # 0x1b96a
testl %r14d, %r14d
cmovneq %rcx, %rdx
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
movl %ebx, 0xb80084(%r13)
movzwl 0x50(%rsp), %eax
testq %rax, %rax
je 0x125c4
leaq 0xb98000(%r13), %rcx
xorl %edx, %edx
xorl %esi, %esi
movl $0x1, (%rcx,%rsi)
movl $0x2, (%rcx,%rsi)
addq $0x10000, %rsi          # imm = 0x10000
cmpq $0x30000, %rsi          # imm = 0x30000
jne 0x12597
incq %rdx
addq $0x100, %rcx            # imm = 0x100
cmpq %rax, %rdx
jne 0x12595
xorl %eax, %eax
movl $0x1, 0xb9c0f0(%r13,%rax)
movl $0x2, 0xb9c0f0(%r13,%rax)
addq $0x10000, %rax          # imm = 0x10000
cmpq $0x30000, %rax          # imm = 0x30000
jne 0x125c6
movl $0x1, %ecx
movl %ecx, 0xb9c400(%r13)
movl %ecx, 0xb9c404(%r13)
xorl %eax, %eax
movl %eax, 0xb9c408(%r13)
movl $0x2, %edx
movl %edx, 0xb9c400(%r13)
movl %ecx, 0xbbc400(%r13)
movl $0x201, 0xbbc404(%r13) # imm = 0x201
movl %eax, 0xbbc408(%r13)
movl %edx, 0xbbc400(%r13)
movl $0x80000040, 0xb5800c(%r13) # imm = 0x80000040
leaq 0x20c0a(%rip), %rcx     # 0x33250
movq 0x38(%rsp), %r14
movl (%rax,%rcx), %edx
movl %edx, 0xb58800(%r13,%rax)
addq $0x4, %rax
cmpq $0x800, %rax            # imm = 0x800
jne 0x1264b
movl $0x0, 0xb5800c(%r13)
cmpw $0x0, 0x6a(%rsp)
je 0x127f2
movl $0x2001, 0xb58004(%r13) # imm = 0x2001
xorl %eax, %eax
movl $0x0, %ebx
cmpb $0x0, 0x34(%rsp)
je 0x127ea
movq 0x10(%r14), %r15
movq %r15, %rdi
callq 0x13c09
testb %al, %al
je 0x126bb
callq 0x12cd5
movq (%rbp), %r8
leaq 0xa282(%rip), %rdx      # 0x1c938
jmp 0x127d2
leaq 0xa2a7(%rip), %rsi      # 0x1c969
movq %r15, %rdi
callq 0xd330
testq %rax, %rax
je 0x127c2
movq %rax, %r12
leaq 0x430(%rsp), %rdi
movl $0xfe00, %esi           # imm = 0xFE00
movl $0x1, %edx
movq %rax, %rcx
callq 0xd0d0
movq %rax, %rbx
callq 0x12cd5
testw %bx, %bx
jle 0x128b7
movq 0x10(%rbp), %r8
leaq 0xa287(%rip), %rdx      # 0x1c993
xorl %ebx, %ebx
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x19ca8
movl $0x80000000, 0xb5800c(%r13) # imm = 0x80000000
movw $0x100, %ax             # imm = 0x100
movq 0x20898(%rip), %r13     # 0x32fd0
xorl %ebp, %ebp
movswl %ax, %ecx
leal 0xb58800(,%rcx,4), %ecx
movswl 0x430(%rsp,%rbx,2), %edx
movq 0x28(%rsp), %rsi
movl %edx, (%rsi,%rcx)
incl %eax
testl $0x1ff, %eax            # imm = 0x1FF
jne 0x1277d
incl %ebp
movq (%r13), %rdi
callq 0xd290
movswl %bp, %eax
addl $0x80000000, %eax       # imm = 0x80000000
movq 0x28(%rsp), %rcx
movl %eax, 0xb5800c(%rcx)
xorl %eax, %eax
incq %rbx
cmpq $0x7f00, %rbx           # imm = 0x7F00
jne 0x1273a
movq 0x28(%rsp), %r13
movl $0x0, 0xb5800c(%r13)
movq %r12, %rdi
callq 0xd0f0
leaq 0x430(%rsp), %rdi
movq %r14, %rsi
callq 0x114f2
movq %r15, %rdi
movq %r14, %rsi
callq 0x1165b
xorl %eax, %eax
xorl %ebx, %ebx
jmp 0x127ea
callq 0x12cd5
movq (%rbp), %r8
leaq 0xa19a(%rip), %rdx      # 0x1c96c
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x19ca8
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movb $0x1, %al
testb %al, %al
jne 0x12894
xorl %ebx, %ebx
leaq 0x4c(%rsp), %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movzwl 0x50(%rsp), %eax
xorl %edx, %edx
cmpq %rax, %rbx
jae 0x12825
cmpl 0x30(%rsp), %ebp
jae 0x12825
movl %ebp, %edi
movq %r15, %rsi
callq 0x118d2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %r12d, %edx
movl %edx, 0xa10000(%r13,%rbx,4)
incl %ebp
addl $0x10000, %r12d         # imm = 0x10000
cmpl $0x10, %ebp
jne 0x127fe
incq %rbx
cmpq $0x10, %rbx
jne 0x127f9
xorl %eax, %eax
movl 0xc80000(%r13,%rax), %ecx
addq $0x100, %rax            # imm = 0x100
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x12849
movl $0xffff0c0d, 0xc84018(%r13) # imm = 0xFFFF0C0D
callq 0x12cd5
leaq 0x2165a(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
leaq 0xa094(%rip), %rdx      # 0x1c915
xorl %ebx, %ebx
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19ca8
testl %ebx, %ebx
je 0x128a4
leaq 0xa122(%rip), %rdi      # 0x1c9c1
jmp 0x11e04
movzwl 0x50(%rsp), %eax
movl %eax, 0x4f8(%r14)
xorl %eax, %eax
jmp 0x11e0e
movq (%rbp), %r8
leaq 0xa0aa(%rip), %rdx      # 0x1c96c
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x19ca8
movq %r12, %rdi
callq 0xd0f0
jmp 0x127e3