	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idt_check_setup
_idt_check_setup:                       ## @idt_check_setup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_IDT_NT_BARSETUP0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_pci_read_config_dword
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_9
LBB0_2:
	movl	-20(%rbp), %eax
	movq	_IDT_BARSETUP_EN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_IDT_BARSETUP_MODE_CFG@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.6:
	movq	_IDT_BARSETUP_SIZE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_IDT_BARSETUP_SIZE_CFG@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.8:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
LBB0_5:
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDT_NT_BARSETUP0,4,2           ## @IDT_NT_BARSETUP0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read BARSETUP0 config register"

	.comm	_IDT_BARSETUP_EN,4,2            ## @IDT_BARSETUP_EN
	.comm	_IDT_BARSETUP_MODE_CFG,4,2      ## @IDT_BARSETUP_MODE_CFG
L_.str.1:                               ## @.str.1
	.asciz	"BAR0 doesn't map config space"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IDT_BARSETUP_SIZE_MASK,4,2     ## @IDT_BARSETUP_SIZE_MASK
	.comm	_IDT_BARSETUP_SIZE_CFG,4,2      ## @IDT_BARSETUP_SIZE_CFG
L_.str.2:                               ## @.str.2
	.asciz	"Invalid size of config space"

L_.str.3:                               ## @.str.3
	.asciz	"NTB device pre-initialized correctly"

	.no_dead_strip	_idt_check_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idt_check_setup
_idt_check_setup:                       ; @idt_check_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _IDT_NT_BARSETUP0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDT_NT_BARSETUP0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pci_read_config_dword
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_9
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _IDT_BARSETUP_EN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IDT_BARSETUP_EN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.3:
Lloh8:
	adrp	x9, _IDT_BARSETUP_MODE_CFG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IDT_BARSETUP_MODE_CFG@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh11:
	adrp	x9, _IDT_BARSETUP_SIZE_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IDT_BARSETUP_SIZE_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh14:
	adrp	x9, _IDT_BARSETUP_SIZE_CFG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _IDT_BARSETUP_SIZE_CFG@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w20, #0
	b	LBB0_9
LBB0_6:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_dev_err
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_IDT_NT_BARSETUP0,4,2           ; @IDT_NT_BARSETUP0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read BARSETUP0 config register"

	.comm	_IDT_BARSETUP_EN,4,2            ; @IDT_BARSETUP_EN
	.comm	_IDT_BARSETUP_MODE_CFG,4,2      ; @IDT_BARSETUP_MODE_CFG
l_.str.1:                               ; @.str.1
	.asciz	"BAR0 doesn't map config space"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IDT_BARSETUP_SIZE_MASK,4,2     ; @IDT_BARSETUP_SIZE_MASK
	.comm	_IDT_BARSETUP_SIZE_CFG,4,2      ; @IDT_BARSETUP_SIZE_CFG
l_.str.2:                               ; @.str.2
	.asciz	"Invalid size of config space"

l_.str.3:                               ; @.str.3
	.asciz	"NTB device pre-initialized correctly"

	.no_dead_strip	_idt_check_setup
.subsections_via_symbols
