	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chkattached
_chkattached:                           ## @chkattached
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_getsel
	movl	%eax, -32(%rbp)
	movq	__PATH_DEVPCI@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_open
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	movq	_PCIOCATTACHED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movl	%ebx, %edi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_4:
	xorl	%eax, %eax
	cmpq	$0, -40(%rbp)
	leaq	L_.str.3(%rip), %rcx
	leaq	L_.str.4(%rip), %rdx
	cmoveq	%rcx, %rdx
	sete	%al
	addl	%eax, %eax
	movq	_exitstatus@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.5(%rip), %rcx
	movq	%r14, %rsi
	callq	_printf
	movl	%ebx, %edi
	callq	_close
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__PATH_DEVPCI,4,2               ## @_PATH_DEVPCI
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_PCIOCATTACHED,4,2              ## @PCIOCATTACHED
L_.str.1:                               ## @.str.1
	.asciz	"ioctl(PCIOCATTACHED)"

	.comm	_exitstatus,4,2                 ## @exitstatus
L_.str.2:                               ## @.str.2
	.asciz	"%s: %s%s\n"

L_.str.3:                               ## @.str.3
	.asciz	"not "

L_.str.4:                               ## @.str.4
	.space	1

L_.str.5:                               ## @.str.5
	.asciz	"attached"

	.no_dead_strip	_chkattached
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chkattached
_chkattached:                           ; @chkattached
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	bl	_getsel
	str	w0, [sp, #24]
Lloh0:
	adrp	x21, __PATH_DEVPCI@GOTPAGE
Lloh1:
	ldr	x21, [x21, __PATH_DEVPCI@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_open
	mov	x20, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
	ldr	w8, [x21]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
Lloh7:
	adrp	x8, _PCIOCATTACHED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCIOCATTACHED@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x20
	bl	_ioctl
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
	ldr	x8, [sp, #16]
Lloh12:
	adrp	x9, l_.str.4@PAGE
Lloh13:
	add	x9, x9, l_.str.4@PAGEOFF
Lloh14:
	adrp	x10, l_.str.3@PAGE
Lloh15:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	x8, #0
	csel	x2, x10, x9, eq
	cset	w8, eq
	lsl	w8, w8, #1
Lloh16:
	adrp	x9, _exitstatus@GOTPAGE
Lloh17:
	ldr	x9, [x9, _exitstatus@GOTPAGEOFF]
Lloh18:
	str	w8, [x9]
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh21:
	adrp	x3, l_.str.5@PAGE
Lloh22:
	add	x3, x3, l_.str.5@PAGEOFF
	mov	x1, x19
	bl	_printf
	mov	x0, x20
	bl	_close
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	__PATH_DEVPCI,4,2               ; @_PATH_DEVPCI
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_PCIOCATTACHED,4,2              ; @PCIOCATTACHED
l_.str.1:                               ; @.str.1
	.asciz	"ioctl(PCIOCATTACHED)"

	.comm	_exitstatus,4,2                 ; @exitstatus
l_.str.2:                               ; @.str.2
	.asciz	"%s: %s%s\n"

l_.str.3:                               ; @.str.3
	.asciz	"not "

l_.str.4:                               ; @.str.4
	.space	1

l_.str.5:                               ; @.str.5
	.asciz	"attached"

	.no_dead_strip	_chkattached
.subsections_via_symbols
