	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idt_check_dev
_idt_check_dev:                         ## @idt_check_dev
	.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_VIDDID_CSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_idt_csr_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_2:
	movl	-20(%rbp), %ecx
	movq	_IDT_VID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%ecx, %edx
	movq	_PCI_VENDOR_ID_IDT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_3
## %bb.4:
	sarl	$16, %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDT_VIDDID_CSR,4,2             ## @IDT_VIDDID_CSR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read VID/DID"

	.comm	_IDT_VID_MASK,4,2               ## @IDT_VID_MASK
	.comm	_PCI_VENDOR_ID_IDT,4,2          ## @PCI_VENDOR_ID_IDT
L_.str.1:                               ## @.str.1
	.asciz	"Got unsupported VID/DID: 0x%08x"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.2:                               ## @.str.2
	.asciz	"Found IDT 89HPES device VID:0x%04x, DID:0x%04x"

	.no_dead_strip	_idt_check_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idt_check_dev
_idt_check_dev:                         ; @idt_check_dev
	.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
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _IDT_VIDDID_CSR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDT_VIDDID_CSR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_idt_csr_read
	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_5
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _IDT_VID_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IDT_VID_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w2, w9, w8
Lloh8:
	adrp	x9, _PCI_VENDOR_ID_IDT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCI_VENDOR_ID_IDT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w2, w9
	b.ne	LBB0_4
; %bb.3:
	asr	w3, w8, #16
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w20, #0
	b	LBB0_5
LBB0_4:
	str	x8, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IDT_VIDDID_CSR,4,2             ; @IDT_VIDDID_CSR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read VID/DID"

	.comm	_IDT_VID_MASK,4,2               ; @IDT_VID_MASK
	.comm	_PCI_VENDOR_ID_IDT,4,2          ; @PCI_VENDOR_ID_IDT
l_.str.1:                               ; @.str.1
	.asciz	"Got unsupported VID/DID: 0x%08x"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.2:                               ; @.str.2
	.asciz	"Found IDT 89HPES device VID:0x%04x, DID:0x%04x"

	.no_dead_strip	_idt_check_dev
.subsections_via_symbols
