	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i5k_find_amb_registers
_i5k_find_amb_registers:                ## @i5k_find_amb_registers
	.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	%rdi, %r14
	movq	_ENODEV@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	subl	(%r13), %r12d
	movq	_PCI_VENDOR_ID_INTEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%edx, %edx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_I5K_REG_AMB_BASE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movq	-48(%rbp), %rax
	movq	%rax, 8(%r14)
	movq	_I5K_REG_AMB_LEN_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movl	-48(%rbp), %eax
	movl	%eax, (%r14)
	movq	_AMB_CONFIG_SIZE@GOTPCREL(%rip), %rcx
	movq	_MAX_AMBS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	imull	(%rcx), %edx
	xorl	%ebx, %ebx
	cmpl	%eax, %edx
	jle	LBB0_7
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
LBB0_6:
	movl	%r12d, %ebx
LBB0_7:
	movq	%r15, %rdi
	callq	_pci_dev_put
	jmp	LBB0_8
LBB0_1:
	subl	(%r13), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PCI_VENDOR_ID_INTEL,4,2        ## @PCI_VENDOR_ID_INTEL
	.comm	_I5K_REG_AMB_BASE_ADDR,4,2      ## @I5K_REG_AMB_BASE_ADDR
	.comm	_I5K_REG_AMB_LEN_ADDR,4,2       ## @I5K_REG_AMB_LEN_ADDR
	.comm	_AMB_CONFIG_SIZE,4,2            ## @AMB_CONFIG_SIZE
	.comm	_MAX_AMBS,4,2                   ## @MAX_AMBS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AMB region too small!\n"

	.no_dead_strip	_i5k_find_amb_registers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i5k_find_amb_registers
_i5k_find_amb_registers:                ; @i5k_find_amb_registers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
Lloh0:
	adrp	x19, _ENODEV@GOTPAGE
Lloh1:
	ldr	x19, [x19, _ENODEV@GOTPAGEOFF]
	ldr	w22, [x19]
Lloh2:
	adrp	x8, _PCI_VENDOR_ID_INTEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_VENDOR_ID_INTEL@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x2, #0
	bl	_pci_get_device
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	neg	w19, w22
Lloh5:
	adrp	x8, _I5K_REG_AMB_BASE_ADDR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I5K_REG_AMB_BASE_ADDR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_pci_read_config_dword
	cbnz	x0, LBB0_7
; %bb.2:
	ldr	x8, [sp, #8]
	str	x8, [x21, #8]
Lloh8:
	adrp	x8, _I5K_REG_AMB_LEN_ADDR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I5K_REG_AMB_LEN_ADDR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_pci_read_config_dword
	cbnz	x0, LBB0_7
; %bb.3:
	ldr	w8, [sp, #8]
	str	w8, [x21]
Lloh11:
	adrp	x9, _AMB_CONFIG_SIZE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AMB_CONFIG_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _MAX_AMBS@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MAX_AMBS@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	mul	w9, w10, w9
	cmp	w9, w8
	b.le	LBB0_6
; %bb.4:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_7
LBB0_5:
	ldr	w8, [x19]
	neg	w19, w8
	b	LBB0_8
LBB0_6:
	mov	w19, #0
LBB0_7:
	mov	x0, x20
	bl	_pci_dev_put
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PCI_VENDOR_ID_INTEL,4,2        ; @PCI_VENDOR_ID_INTEL
	.comm	_I5K_REG_AMB_BASE_ADDR,4,2      ; @I5K_REG_AMB_BASE_ADDR
	.comm	_I5K_REG_AMB_LEN_ADDR,4,2       ; @I5K_REG_AMB_LEN_ADDR
	.comm	_AMB_CONFIG_SIZE,4,2            ; @AMB_CONFIG_SIZE
	.comm	_MAX_AMBS,4,2                   ; @MAX_AMBS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AMB region too small!\n"

	.no_dead_strip	_i5k_find_amb_registers
.subsections_via_symbols
