// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x13a38
testb %al, %al
je 0x11d06
leaq 0xa0d6(%rip), %rdi      # 0x1bdd0
movq %r15, %rsi
xorl %eax, %eax
callq 0xd150
jmp 0x11d17
leaq 0x4c(%rsp), %rsi
movq %r15, %rdi
callq 0x12d71
testl %eax, %eax
je 0x11d3c
leaq 0xa240(%rip), %rdi      # 0x1bf5e
callq 0xd0c0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x10238, %rsp          # imm = 0x10238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xc8412c(%r14), %r15d
testl %r15d, %r15d
je 0x11ecc
cmpl $0x1f, %r15d
jne 0x11dec
movl $0x1f00881, 0xc8410c(%r14) # imm = 0x1F00881
movl $0x1, %edi
callq 0xd450
movl $0xf, 0xc84128(%r14)
movl $0x1, %edi
callq 0xd450
movl 0xc8412c(%r14), %r15d
cmpl $0xf, %r15d
jne 0x11e04
movl $0x1, 0xc84128(%r14)
movl $0x1, %edi
callq 0xd450
movl 0xc8412c(%r14), %r15d
cmpl $0x1, %r15d
jne 0x11e1c
movl $0x0, 0xc84128(%r14)
movl $0x1, %edi
callq 0xd450
movl 0xc8412c(%r14), %r15d
testl %r15d, %r15d
je 0x11e56
callq 0x12bf7
leaq 0x220f0(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x0, (%rsp)
jmp 0x11e32
callq 0x12bf7
leaq 0x220d8(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x1f, (%rsp)
jmp 0x11e32
callq 0x12bf7
leaq 0x220c0(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0xf, (%rsp)
jmp 0x11e32
callq 0x12bf7
leaq 0x220a8(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x1, (%rsp)
leaq 0xaa58(%rip), %rdx      # 0x1c891
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movl %r15d, %r9d
xorl %eax, %eax
callq 0x199b4
leaq 0xab84(%rip), %rdi      # 0x1c9d5
jmp 0x11d1e
leaq 0xb9040c(%r14), %rax
leaq 0xb900c0(%r14), %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 0x11e70
xorl %r8d, %r8d
movl $0x0, (%rcx,%r8,4)
incq %r8
cmpq $0x8, %r8
jne 0x11e93
incq %rdi
addq %rsi, %rax
addq %rsi, %rcx
cmpq $0x3, %rdi
jne 0x11e6d
xorl %eax, %eax
movl $0x0, 0xa01000(%r14,%rax,4)
incq %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0x11eb5
movl $0x881, 0xc8410c(%r14) # imm = 0x881
movl $0x1, %edi
callq 0xd450
movl $0x1, 0xb8002c(%r14)
movl $0x8000103, 0xb30000(%r14) # imm = 0x8000103
xorl %eax, %eax
movl %eax, 0xb80868(%r14)
movl $0x3df, 0xb80870(%r14) # imm = 0x3DF
movl $0x22, 0xb80010(%r14)
movl %eax, 0xb80814(%r14)
movl %eax, 0xb80000(%r14)
movl %eax, 0xb80040(%r14)
movl $0x80000001, 0xb80004(%r14) # imm = 0x80000001
movl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xb58020(%r14)
movl %ecx, 0xb58024(%r14)
movl $0x7fc00, 0xb80008(%r14) # imm = 0x7FC00
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0xb80800(%r14)
movl $0x2000, 0xb80804(%r14) # imm = 0x2000
movl %ecx, 0xb808b0(%r14)
movl %ecx, 0xb80890(%r14)
movl %ecx, 0xb808a0(%r14)
movl %ecx, 0xb808a4(%r14)
movl %ecx, 0xb808a8(%r14)
movl %ecx, 0xb808ac(%r14)
movl %ecx, 0xb808b0(%r14)
movl %ecx, 0xa00040(%r14)
movl %ecx, 0xa00044(%r14)
movl %ecx, 0xa00048(%r14)
movl %ecx, 0xa0004c(%r14)
movl $0xffffffff, 0xa00060(%r14,%rax,4) # imm = 0xFFFFFFFF
incq %rax
cmpq $0x8, %rax
jne 0x11fb8
movl %ebp, 0x3c(%rsp)
movl $0xffffffff, 0xa00050(%r14) # imm = 0xFFFFFFFF
movl $0xff, 0xa00054(%r14)
xorl %eax, %eax
movl $0x200f2, 0xb4c104(%r14,%rax) # imm = 0x200F2
addq $0x1000, %rax           # imm = 0x1000
cmpq $0x5000, %rax           # imm = 0x5000
jne 0x11fe9
movzwl 0x52(%rsp), %eax
movzwl 0x5e(%rsp), %ecx
addl %eax, %ecx
movzwl 0x58(%rsp), %eax
movzwl 0x64(%rsp), %ebp
addl %eax, %ebp
addl %ecx, %ebp
movzwl 0x6a(%rsp), %r15d
callq 0x12bf7
leaq 0x21ea1(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %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 0xa84d(%rip), %rdx      # 0x1c8b0
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
addl %ebp, %r15d
movl %r15d, 0x2c(%rsp)
movl %r15d, %r13d
je 0x120d2
xorl %r15d, %r15d
leaq 0x4c(%rsp), %r12
movl %r15d, %edi
movq %r12, %rsi
callq 0x117bb
movl %eax, 0xa00200(%r14,%r15,4)
movl %r15d, %edi
movq %r12, %rsi
callq 0x117bb
leal -0x1(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
addl $0x10000, %eax          # imm = 0x10000
movl %eax, 0xa00300(%r14,%r15,4)
movl $0x2, 0xa02f00(%r14,%r15,4)
incq %r15
cmpq %r15, %r13
jne 0x12089
xorl %eax, %eax
movl $0x3020100, 0xa00600(%r14,%rax,4) # imm = 0x3020100
movl $0x7060504, 0xa00700(%r14,%rax,4) # imm = 0x7060504
movl $0xb0a0908, 0xa00800(%r14,%rax,4) # imm = 0xB0A0908
movl $0xf0e0d0c, 0xa00900(%r14,%rax,4) # imm = 0xF0E0D0C
incq %rax
cmpq $0x20, %rax
jne 0x120d4
movq %r13, 0x30(%rsp)
movl $0xf0f, 0xa02f48(%r14) # imm = 0xF0F
leaq 0xa00a00(%r14), %rax
xorl %ecx, %ecx
movl $0x0, (%rax,%rcx,4)
incq %rcx
cmpq $0x20, %rcx
jne 0x12126
movzwl 0x52(%rsp), %r12d
movl %r12d, %ecx
negb %cl
movq $-0x1, %rdx
movq $-0x1, %rsi
shrq %cl, %rsi
testl %r12d, %r12d
cmovel %r12d, %esi
movl %esi, 0xa00a30(%r14)
movl %esi, 0xa00a34(%r14)
movl %esi, 0xa00a38(%r14)
movl %esi, 0xa00a3c(%r14)
movl %esi, 0xa00a40(%r14)
movzwl 0x5e(%rsp), %r15d
xorl %r13d, %r13d
movl $0x0, %ecx
testl %r15d, %r15d
je 0x121a9
movq $-0x1, %rsi
movl %r12d, %ecx
shlq %cl, %rsi
leal (%r12,%r15), %ecx
negb %cl
shrq %cl, %rdx
andl %esi, %edx
movl %edx, %ecx
xorl %edx, %edx
movl 0xb40200(%r14,%rdx,4), %esi
andl $0x70, %esi
cmpl $0x10, %esi
jne 0x121c2
movl %ecx, (%rax)
incl %r13d
jmp 0x121c8
movl $0x0, (%rax)
addq $0x400, %rdx            # imm = 0x400
addq $0x4, %rax
cmpq $0x1400, %rdx           # imm = 0x1400
jne 0x121ab
callq 0x12bf7
leaq 0x21ce8(%rip), %rcx     # 0x33ed0
movq 0x18(%rcx), %r8
movl %r13d, (%rsp)
leaq 0x96ba(%rip), %rdx      # 0x1b8b1
leaq 0xa6ed(%rip), %r9       # 0x1c8eb
xorl %r13d, %r13d
movl $0x3, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
addl %r12d, %r15d
movzwl 0x58(%rsp), %eax
testl %eax, %eax
je 0x12243
movq $-0x1, %rsi
movl %r15d, %ecx
shlq %cl, %rsi
movq $-0x1, %rdx
addl %r15d, %eax
movl %eax, %ecx
negb %cl
shrq %cl, %rdx
andl %esi, %edx
movl %eax, %r15d
jmp 0x12245
xorl %edx, %edx
movl %edx, 0xa00a54(%r14)
movl %edx, 0xa00a58(%r14)
movl %edx, 0xa00a5c(%r14)
movzwl 0x64(%rsp), %eax
testl %eax, %eax
je 0x12283
movq $-0x1, %rdx
movl %r15d, %ecx
shlq %cl, %rdx
movq $-0x1, %r13
leal (%r15,%rax), %ecx
negb %cl
shrq %cl, %r13
andl %edx, %r13d
movq %rbx, 0x40(%rsp)
movl %r13d, 0xa00a28(%r14)
movl %r13d, 0xa00a2c(%r14)
movzwl 0x6a(%rsp), %esi
xorl %r12d, %r12d
movl $0x0, %edx
testl %esi, %esi
je 0x122cc
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
movl %edx, 0xa00a60(%r14)
leaq 0x4c(%rsp), %r15
leaq 0x9821(%rip), %rbp      # 0x1bb00
xorl %ebx, %ebx
xorl %r13d, %r13d
movl %r13d, %edi
movq %r15, %rsi
callq 0x116ea
cltq
movl (%rbp,%rax,4), %eax
movl %r12d, %ecx
shll %cl, %eax
orl %eax, %ebx
incl %r13d
addl $0x4, %r12d
cmpl $0x8, %r13d
jne 0x122e4
movl %ebx, 0xa02f40(%r14)
movl $0x8, %r15d
xorl %r12d, %r12d
leaq 0x4c(%rsp), %r13
xorl %ebx, %ebx
movl %r15d, %edi
movq %r13, %rsi
callq 0x116ea
cltq
movl (%rbp,%rax,4), %eax
movl %r12d, %ecx
shll %cl, %eax
orl %eax, %ebx
incl %r15d
addl $0x4, %r12d
cmpl $0x10, %r15d
jne 0x12320
movl %ebx, 0xa02f44(%r14)
xorl %eax, %eax
movl $0x0, 0xa02f00(%r14,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x1234e
cmpl $0x0, 0x2c(%rsp)
movq %r14, 0x20(%rsp)
je 0x1240d
leaq 0x4c(%rsp), %r12
movzwl 0x4(%r12), %eax
leaq 0xa01000(%r14), %rbp
xorl %r13d, %r13d
xorl %r15d, %r15d
testw %ax, %ax
je 0x123cf
xorl %ebx, %ebx
movl %r15d, %r14d
movl %r15d, (%rbp,%rbx,4)
movl %r13d, %edi
movq %r12, %rsi
callq 0x117fe
movl %eax, %r15d
movl %r13d, %edi
movq %r12, %rsi
callq 0x117bb
movl %eax, %ecx
shll %cl, %r15d
addl %r14d, %r15d
incq %rbx
movzwl 0x50(%rsp), %eax
cmpq %rax, %rbx
jb 0x12392
movq 0x20(%rsp), %r14
jmp 0x123d1
xorl %eax, %eax
incq %r13
addq $0x100, %rbp            # imm = 0x100
cmpq 0x30(%rsp), %r13
jne 0x1238b
cmpl $0x10001, %r15d         # imm = 0x10001
jb 0x1240d
callq 0x12bf7
leaq 0x21ad9(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
movl $0x10000, (%rsp)        # imm = 0x10000
leaq 0xa4f5(%rip), %rdx      # 0x1c8fd
jmp 0x11e39
movl $0x30, 0x810000(%r14)
movl $0xfff, 0xb31044(%r14) # imm = 0xFFF
movl $0x1f10, 0xb800cc(%r14) # imm = 0x1F10
movl $0x0, 0xc84038(%r14)
movl $0x1, %ebx
movl %ebx, 0xc84114(%r14)
movzbl 0x4c(%rsp), %r14d
leal (%r14,%r14), %eax
movq 0x20(%rsp), %rcx
movl %eax, 0xc84108(%rcx)
movq 0x20(%rsp), %rax
movl %ebx, 0xb90008(%rax)
movq 0x20(%rsp), %rax
movl %ebx, 0xba0008(%rax)
callq 0x12bf7
leaq 0x21a54(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
leaq 0x9496(%rip), %rcx      # 0x1b91d
leaq 0x94dc(%rip), %rdx      # 0x1b96a
testl %r14d, %r14d
movq 0x20(%rsp), %r14
cmovneq %rcx, %rdx
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movl %ebx, 0xb80084(%r14)
movzwl 0x50(%rsp), %eax
testq %rax, %rax
movq 0x40(%rsp), %rbx
movl 0x3c(%rsp), %edi
je 0x124fd
leaq 0xb98000(%r14), %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 0x124d0
incq %rdx
addq $0x100, %rcx            # imm = 0x100
cmpq %rax, %rdx
jne 0x124ce
xorl %eax, %eax
movl $0x1, 0xb9c0f0(%r14,%rax)
movl $0x2, 0xb9c0f0(%r14,%rax)
addq $0x10000, %rax          # imm = 0x10000
cmpq $0x30000, %rax          # imm = 0x30000
jne 0x124ff
movl $0x1, %ecx
movl %ecx, 0xb9c400(%r14)
movl %ecx, 0xb9c404(%r14)
xorl %eax, %eax
movl %eax, 0xb9c408(%r14)
movl $0x2, %edx
movl %edx, 0xb9c400(%r14)
movl %ecx, 0xbbc400(%r14)
movl $0x201, 0xbbc404(%r14) # imm = 0x201
movl %eax, 0xbbc408(%r14)
movl %edx, 0xbbc400(%r14)
movl $0x80000040, 0xb5800c(%r14) # imm = 0x80000040
leaq 0x20cd1(%rip), %rcx     # 0x33250
movl (%rax,%rcx), %edx
movl %edx, 0xb58800(%r14,%rax)
addq $0x4, %rax
cmpq $0x800, %rax            # imm = 0x800
jne 0x1257f
movl $0x0, 0xb5800c(%r14)
cmpw $0x0, 0x6a(%rsp)
je 0x126f4
movl $0x2001, 0xb58004(%r14) # imm = 0x2001
testb %dil, %dil
je 0x126f4
movq 0x10(%rbx), %r15
movq %r15, %rdi
callq 0x13a38
testb %al, %al
je 0x125ec
callq 0x12bf7
leaq 0x218f3(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xa365(%rip), %rdx      # 0x1c94c
jmp 0x127bd
leaq 0xa38a(%rip), %rsi      # 0x1c97d
movq %r15, %rdi
callq 0xd320
testq %rax, %rax
je 0x127a7
movq %rax, %r12
leaq 0x430(%rsp), %rdi
movl $0xfe00, %esi           # imm = 0xFE00
movl $0x1, %edx
movq %rax, %rcx
callq 0xd0d0
movq %rax, %r13
callq 0x12bf7
testw %r13w, %r13w
jle 0x127d3
movq %r12, 0x30(%rsp)
leaq 0x21891(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
leaq 0xa35d(%rip), %rdx      # 0x1c9a7
xorl %r13d, %r13d
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x199b4
movl $0x80000000, 0xb5800c(%r14) # imm = 0x80000000
movw $0x100, %ax             # imm = 0x100
movq 0x20959(%rip), %rbp     # 0x32fd0
xorl %r12d, %r12d
movswl %ax, %ecx
leal 0xb58800(,%rcx,4), %ecx
movswl 0x430(%rsp,%r13,2), %edx
movl %edx, (%r14,%rcx)
incl %eax
testl $0x1ff, %eax            # imm = 0x1FF
jne 0x126b8
incl %r12d
movq (%rbp), %rdi
callq 0xd280
movswl %r12w, %eax
addl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0xb5800c(%r14)
xorl %eax, %eax
incq %r13
cmpq $0x7f00, %r13           # imm = 0x7F00
jne 0x1267a
movl $0x0, 0xb5800c(%r14)
movq 0x30(%rsp), %rdi
callq 0xd0f0
leaq 0x430(%rsp), %rdi
movq %rbx, %rsi
callq 0x1145d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x115b0
xorl %r12d, %r12d
leaq 0x4c(%rsp), %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
movzwl 0x50(%rsp), %eax
xorl %edx, %edx
cmpq %rax, %r12
jae 0x12728
cmpl 0x2c(%rsp), %ebp
jae 0x12728
movl %ebp, %edi
movq %r15, %rsi
callq 0x117fe
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %r13d, %edx
movl %edx, 0xa10000(%r14,%r12,4)
incl %ebp
addl $0x10000, %r13d         # imm = 0x10000
cmpl $0x10, %ebp
jne 0x12701
incq %r12
cmpq $0x10, %r12
jne 0x126fc
xorl %eax, %eax
movl 0xc80000(%r14,%rax), %ecx
addq $0x100, %rax            # imm = 0x100
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x1274c
movl $0xffff0c0d, 0xc84018(%r14) # imm = 0xFFFF0C0D
callq 0x12bf7
leaq 0x21757(%rip), %rcx     # 0x33ed0
movq 0x10(%rcx), %r8
leaq 0xa1a5(%rip), %rdx      # 0x1c929
xorl %ebp, %ebp
movl $0x2, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x199b4
movzwl 0x50(%rsp), %eax
movl %eax, 0x4f8(%rbx)
jmp 0x11d28
callq 0x12bf7
leaq 0x2171d(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xa1c3(%rip), %rdx      # 0x1c980
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x199b4
jmp 0x11e4a
leaq 0x216f6(%rip), %rcx     # 0x33ed0
movq (%rcx), %r8
leaq 0xa19c(%rip), %rdx      # 0x1c980
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x199b4
movq %r12, %rdi
callq 0xd0f0
jmp 0x11e4a