	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_config_bmon
_goya_config_bmon:                      ## @goya_config_bmon
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rsi), %rbx
	movq	_debug_bmon_regs@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	cmpq	%rax, %rbx
	jae	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %r13
	movq	_CFG_BASE@GOTPCREL(%rip), %rax
	subq	(%rax), %r13
	leaq	260(%r13), %r12
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_WREG32
	cmpq	$0, 16(%r15)
	je	LBB0_6
## %bb.3:
	movq	8(%r15), %r12
	testq	%r12, %r12
	je	LBB0_4
## %bb.5:
	leaq	512(%r13), %r14
	movl	24(%r12), %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	516(%r13), %r14
	movl	24(%r12), %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	520(%r13), %r14
	movl	20(%r12), %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	524(%r13), %r14
	movl	20(%r12), %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	576(%r13), %r14
	movl	16(%r12), %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	580(%r13), %r14
	movl	16(%r12), %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	584(%r13), %r14
	movl	12(%r12), %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	588(%r13), %r14
	movl	12(%r12), %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_WREG32
	leaq	548(%r13), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_WREG32
	leaq	564(%r13), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	leaq	780(%r13), %rdi
	movl	(%r12), %esi
	callq	_WREG32
	leaq	776(%r13), %rdi
	movl	4(%r12), %esi
	callq	_WREG32
	movq	(%r15), %rax
	movq	_GOYA_BMON_PCIE_MSTR_RD@GOTPCREL(%rip), %rcx
	movq	_GOYA_BMON_PCIE_MSTR_WR@GOTPCREL(%rip), %rdx
	movq	_GOYA_BMON_PCIE_SLV_RD@GOTPCREL(%rip), %rsi
	movq	_GOYA_BMON_PCIE_SLV_WR@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rax
	movl	$167772160, %ebx                ## imm = 0xA000000
	cmovel	%r14d, %ebx
	cmpq	(%rsi), %rax
	cmovel	%r14d, %ebx
	cmpq	(%rdx), %rax
	cmovel	%r14d, %ebx
	cmpq	(%rcx), %rax
	cmovel	%r14d, %ebx
	leaq	1792(%r13), %rdi
	movl	8(%r12), %esi
	shll	$12, %esi
	orl	%ebx, %esi
	orl	$2816, %esi                     ## imm = 0xB00
	callq	_WREG32
	leaq	1800(%r13), %rdi
	movl	8(%r12), %esi
	shll	$12, %esi
	orl	%ebx, %esi
	orl	$2560, %esi                     ## imm = 0xA00
	callq	_WREG32
	leaq	1804(%r13), %rdi
	movl	8(%r12), %esi
	shll	$12, %esi
	orl	%ebx, %esi
	orl	$3072, %esi                     ## imm = 0xC00
	callq	_WREG32
	leaq	256(%r13), %rdi
	movl	$17, %esi
	callq	_WREG32
	addq	$772, %r13                      ## imm = 0x304
	movq	%r13, %rdi
	movl	$1, %esi
	jmp	LBB0_7
LBB0_1:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_8
LBB0_6:
	leaq	512(%r13), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_WREG32
	leaq	516(%r13), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	leaq	520(%r13), %rdi
	movl	$-1, %esi
	callq	_WREG32
	leaq	524(%r13), %rdi
	movl	$-1, %esi
	callq	_WREG32
	leaq	576(%r13), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	leaq	580(%r13), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	leaq	584(%r13), %rdi
	movl	$-1, %esi
	callq	_WREG32
	leaq	588(%r13), %rdi
	movl	$-1, %esi
	callq	_WREG32
	leaq	548(%r13), %rdi
	movl	$-1, %esi
	callq	_WREG32
	leaq	564(%r13), %rdi
	movl	$67343, %esi                    ## imm = 0x1070F
	callq	_WREG32
	leaq	780(%r13), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	leaq	776(%r13), %rdi
	movl	$65535, %esi                    ## imm = 0xFFFF
	callq	_WREG32
	leaq	1792(%r13), %rdi
	movl	$167774976, %esi                ## imm = 0xA000B00
	callq	_WREG32
	leaq	1800(%r13), %rdi
	movl	$167774720, %esi                ## imm = 0xA000A00
	callq	_WREG32
	leaq	1804(%r13), %rdi
	movl	$167775232, %esi                ## imm = 0xA000C00
	callq	_WREG32
	leaq	256(%r13), %rdi
	movl	$1, %esi
	callq	_WREG32
	addq	$772, %r13                      ## imm = 0x304
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_WREG32
	movq	%r12, %rdi
	xorl	%esi, %esi
LBB0_7:
	callq	_WREG32
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug_bmon_regs,8,3            ## @debug_bmon_regs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid register index in BMON\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CFG_BASE,8,3                   ## @CFG_BASE
	.comm	_GOYA_BMON_PCIE_MSTR_RD,8,3     ## @GOYA_BMON_PCIE_MSTR_RD
	.comm	_GOYA_BMON_PCIE_MSTR_WR,8,3     ## @GOYA_BMON_PCIE_MSTR_WR
	.comm	_GOYA_BMON_PCIE_SLV_RD,8,3      ## @GOYA_BMON_PCIE_SLV_RD
	.comm	_GOYA_BMON_PCIE_SLV_WR,8,3      ## @GOYA_BMON_PCIE_SLV_WR
	.no_dead_strip	_goya_config_bmon
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_config_bmon
_goya_config_bmon:                      ; @goya_config_bmon
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x1]
Lloh0:
	adrp	x21, _debug_bmon_regs@GOTPAGE
Lloh1:
	ldr	x21, [x21, _debug_bmon_regs@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	x22, x0
	b.hs	LBB0_4
; %bb.1:
	ldr	x8, [x21]
	ldr	x9, [x19]
	ldr	x8, [x8, x9, lsl #3]
Lloh2:
	adrp	x9, _CFG_BASE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CFG_BASE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	sub	x21, x8, x9
	add	x20, x21, #260
	mov	x0, x20
	mov	w1, #1
	bl	_WREG32
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	x22, [x19, #8]
	cbz	x22, LBB0_5
; %bb.3:
	add	x20, x21, #512
	ldr	w0, [x22, #24]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #516
	ldr	w0, [x22, #24]
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #520
	ldr	w0, [x22, #20]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #524
	ldr	w0, [x22, #20]
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #576
	ldr	w0, [x22, #16]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #580
	ldr	w0, [x22, #16]
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #584
	ldr	w0, [x22, #12]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x20, x21, #588
	ldr	w0, [x22, #12]
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	x0, x21, #548
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #564
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #780
	ldr	w1, [x22]
	bl	_WREG32
	add	x0, x21, #776
	ldr	w1, [x22, #4]
	bl	_WREG32
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _GOYA_BMON_PCIE_MSTR_RD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GOYA_BMON_PCIE_MSTR_RD@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x10, _GOYA_BMON_PCIE_MSTR_WR@GOTPAGE
Lloh9:
	ldr	x10, [x10, _GOYA_BMON_PCIE_MSTR_WR@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
Lloh11:
	adrp	x11, _GOYA_BMON_PCIE_SLV_RD@GOTPAGE
Lloh12:
	ldr	x11, [x11, _GOYA_BMON_PCIE_SLV_RD@GOTPAGEOFF]
Lloh13:
	ldr	x11, [x11]
Lloh14:
	adrp	x12, _GOYA_BMON_PCIE_SLV_WR@GOTPAGE
Lloh15:
	ldr	x12, [x12, _GOYA_BMON_PCIE_SLV_WR@GOTPAGEOFF]
Lloh16:
	ldr	x12, [x12]
	cmp	x8, x12
	ccmp	x8, x11, #4, ne
	ccmp	x8, x10, #4, ne
	ccmp	x8, x9, #4, ne
	mov	w8, #167772160
	csel	w19, wzr, w8, eq
	add	x0, x21, #1792
	ldr	w8, [x22, #8]
	orr	w8, w19, w8, lsl #12
	mov	w9, #2816
	orr	w1, w8, w9
	bl	_WREG32
	add	x0, x21, #1800
	ldr	w8, [x22, #8]
	orr	w8, w19, w8, lsl #12
	mov	w9, #2560
	orr	w1, w8, w9
	bl	_WREG32
	add	x0, x21, #1804
	ldr	w8, [x22, #8]
	orr	w8, w19, w8, lsl #12
	orr	w1, w8, #0xc00
	bl	_WREG32
	add	x0, x21, #256
	mov	w1, #17
	bl	_WREG32
	add	x0, x21, #772
	mov	w1, #1
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_5:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_6:
	add	x0, x21, #512
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #516
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #520
	mov	w1, #-1
	bl	_WREG32
	add	x0, x21, #524
	mov	w1, #-1
	bl	_WREG32
	add	x0, x21, #576
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #580
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #584
	mov	w1, #-1
	bl	_WREG32
	add	x0, x21, #588
	mov	w1, #-1
	bl	_WREG32
	add	x0, x21, #548
	mov	w1, #-1
	bl	_WREG32
	add	x0, x21, #564
	mov	w1, #1807
	movk	w1, #1, lsl #16
	bl	_WREG32
	add	x0, x21, #780
	mov	w1, #0
	bl	_WREG32
	add	x0, x21, #776
	mov	w1, #65535
	bl	_WREG32
	add	x0, x21, #1792
	mov	w19, #2560
	movk	w19, #2560, lsl #16
	orr	w1, w19, #0x100
	bl	_WREG32
	add	x0, x21, #1800
	mov	w1, #2560
	movk	w1, #2560, lsl #16
	bl	_WREG32
	add	x0, x21, #1804
	add	w1, w19, #512
	bl	_WREG32
	add	x0, x21, #256
	mov	w1, #1
	bl	_WREG32
	add	x0, x21, #772
	mov	w1, #0
	bl	_WREG32
	mov	x0, x20
	mov	w1, #0
LBB0_7:
	bl	_WREG32
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_debug_bmon_regs,8,3            ; @debug_bmon_regs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid register index in BMON\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CFG_BASE,8,3                   ; @CFG_BASE
	.comm	_GOYA_BMON_PCIE_MSTR_RD,8,3     ; @GOYA_BMON_PCIE_MSTR_RD
	.comm	_GOYA_BMON_PCIE_MSTR_WR,8,3     ; @GOYA_BMON_PCIE_MSTR_WR
	.comm	_GOYA_BMON_PCIE_SLV_RD,8,3      ; @GOYA_BMON_PCIE_SLV_RD
	.comm	_GOYA_BMON_PCIE_SLV_WR,8,3      ; @GOYA_BMON_PCIE_SLV_WR
	.no_dead_strip	_goya_config_bmon
.subsections_via_symbols
