	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipath_diag_open
_ipath_diag_open:                       ## @ipath_diag_open
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_iminor
	movl	%eax, %ebx
	movq	_IPATH_DIAG_MINOR_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_ipath_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_ipath_diag_inuse@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_3
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	subl	%r12d, %ebx
	movl	%ebx, %edi
	callq	_ipath_lookup
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	_IPATH_PRESENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.5:
	cmpl	$0, 16(%rax)
	je	LBB0_6
## %bb.7:
	movq	%rax, (%r14)
	movl	$-2, (%r15)
	movq	_diag_set_link@GOTPCREL(%rip), %rcx
	movq	$0, (%rcx)
	movq	8(%rax), %rdi
	callq	_ipath_expose_reset
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	_ipath_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IPATH_DIAG_MINOR_BASE,4,2      ## @IPATH_DIAG_MINOR_BASE
	.comm	_ipath_mutex,4,2                ## @ipath_mutex
	.comm	_ipath_diag_inuse,4,2           ## @ipath_diag_inuse
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_IPATH_PRESENT,4,2              ## @IPATH_PRESENT
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_diag_set_link,8,3              ## @diag_set_link
	.no_dead_strip	_ipath_diag_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipath_diag_open
_ipath_diag_open:                       ; @ipath_diag_open
	.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
	bl	_iminor
	mov	x20, x0
Lloh0:
	adrp	x8, _IPATH_DIAG_MINOR_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IPATH_DIAG_MINOR_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x0, _ipath_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _ipath_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh5:
	adrp	x21, _ipath_diag_inuse@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ipath_diag_inuse@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	sub	w0, w20, w22
	bl	_ipath_lookup
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w8, [x0]
Lloh9:
	adrp	x9, _IPATH_PRESENT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IPATH_PRESENT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_6
; %bb.5:
	str	x0, [x19]
	mov	w8, #-2
	str	w8, [x21]
Lloh12:
	adrp	x8, _diag_set_link@GOTPAGE
Lloh13:
	ldr	x8, [x8, _diag_set_link@GOTPAGEOFF]
Lloh14:
	str	xzr, [x8]
	ldr	x0, [x0, #8]
	bl	_ipath_expose_reset
	mov	w19, #0
	b	LBB0_8
LBB0_6:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_8:
Lloh17:
	adrp	x0, _ipath_mutex@GOTPAGE
Lloh18:
	ldr	x0, [x0, _ipath_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	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	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_IPATH_DIAG_MINOR_BASE,4,2      ; @IPATH_DIAG_MINOR_BASE
	.comm	_ipath_mutex,4,2                ; @ipath_mutex
	.comm	_ipath_diag_inuse,4,2           ; @ipath_diag_inuse
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_IPATH_PRESENT,4,2              ; @IPATH_PRESENT
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_diag_set_link,8,3              ; @diag_set_link
	.no_dead_strip	_ipath_diag_open
.subsections_via_symbols
