	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpt_query_disk                 ## -- Begin function mpt_query_disk
	.p2align	4, 0x90
_mpt_query_disk:                        ## @mpt_query_disk
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_4
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rdx, %r14
	movq	%rsi, %r12
	xorl	%eax, %eax
	callq	_xpt_open
	testq	%rax, %rax
	js	LBB0_1
## %bb.5:
	leaq	-44(%rbp), %rdi
	callq	_fetch_path_id
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.6:
	leaq	-104(%rbp), %r15
	movq	%r15, %rdi
	movl	$56, %esi
	callq	_bzero
	movq	_CAM_LUN_WILDCARD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -100(%rbp)
	movl	$0, -104(%rbp)
	movq	$20, -96(%rbp)
	movl	$20, %esi
	movl	$1, %edi
	callq	_calloc
	movq	%rax, -64(%rbp)
	movl	$1, -88(%rbp)
	movq	$4, -80(%rbp)
	movl	$4, %esi
	movl	$1, %edi
	callq	_calloc
	movq	%rax, -56(%rbp)
	movq	_DEV_MATCH_PERIPH@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	%rcx, (%rax)
	movq	-56(%rbp), %rbx
	movl	-44(%rbp), %eax
	movl	%eax, 44(%rbx)
	movl	40(%rbx), %edi
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r12, 32(%rbx)
	movq	_PERIPH_MATCH_PATH@GOTPCREL(%rip), %rax
	movq	_PERIPH_MATCH_NAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_PERIPH_MATCH_TARGET@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 24(%rbx)
	movq	_xptfd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CAMIOCOMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_12
## %bb.7:
	movq	-56(%rbp), %rdi
	callq	_free
	movl	-104(%rbp), %esi
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%esi, %eax
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rcx
	movq	-72(%rbp), %rdx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.8:
	movq	_CAM_DEV_MATCH_LAST@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_14
## %bb.9:
	cmpl	$1, %esi
	je	LBB0_15
## %bb.10:
	testl	%esi, %esi
	jne	LBB0_17
## %bb.11:
	movq	-64(%rbp), %rdi
	callq	_free
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-64(%rbp), %rdi
	callq	_free
	movq	-56(%rbp), %rdi
LBB0_13:
	callq	_free
	jmp	LBB0_3
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
	jmp	LBB0_19
LBB0_15:
	movq	-64(%rbp), %rax
	movq	(%rax), %rcx
	cmpq	(%r13), %rcx
	jne	LBB0_18
## %bb.16:
	movl	(%r14), %edi
	movq	56(%rax), %rcx
	movl	64(%rax), %r8d
	leaq	L_.str.4(%rip), %rdx
	xorl	%ebx, %ebx
	movl	$4, %esi
	xorl	%eax, %eax
	callq	_snprintf
	movq	-64(%rbp), %rdi
	jmp	LBB0_13
LBB0_17:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
	jmp	LBB0_19
LBB0_18:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
LBB0_19:
	movq	-64(%rbp), %rdi
	callq	_free
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_XPT_DEV_MATCH,4,2              ## @XPT_DEV_MATCH
	.comm	_CAM_XPT_PATH_ID,4,2            ## @CAM_XPT_PATH_ID
	.comm	_CAM_TARGET_WILDCARD,4,2        ## @CAM_TARGET_WILDCARD
	.comm	_CAM_LUN_WILDCARD,4,2           ## @CAM_LUN_WILDCARD
	.comm	_DEV_MATCH_PERIPH,8,3           ## @DEV_MATCH_PERIPH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"da"

	.comm	_PERIPH_MATCH_PATH,4,2          ## @PERIPH_MATCH_PATH
	.comm	_PERIPH_MATCH_NAME,4,2          ## @PERIPH_MATCH_NAME
	.comm	_PERIPH_MATCH_TARGET,4,2        ## @PERIPH_MATCH_TARGET
	.comm	_xptfd,4,2                      ## @xptfd
	.comm	_CAMIOCOMMAND,4,2               ## @CAMIOCOMMAND
	.comm	_errno,4,2                      ## @errno
	.comm	_CAM_STATUS_MASK,4,2            ## @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ## @CAM_REQ_CMP
	.comm	_CAM_DEV_MATCH_LAST,8,3         ## @CAM_DEV_MATCH_LAST
L_.str.1:                               ## @.str.1
	.asciz	"mpt_query_disk got CAM error %#x, CDM error %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.2:                               ## @.str.2
	.asciz	"mpt_query_disk got %d matches, expected 1"

L_.str.3:                               ## @.str.3
	.asciz	"mpt_query_disk got wrong CAM match"

L_.str.4:                               ## @.str.4
	.asciz	"%s%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpt_query_disk                 ; -- Begin function mpt_query_disk
	.p2align	2
_mpt_query_disk:                        ; @mpt_query_disk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	cbz	x0, LBB0_4
LBB0_1:
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_2:
	ldr	w21, [x8]
LBB0_3:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_4:
	mov	x19, x2
	mov	x20, x1
	bl	_xpt_open
	tbnz	x0, #63, LBB0_1
; %bb.5:
	add	x0, sp, #20
	bl	_fetch_path_id
	mov	x21, x0
	cbnz	w0, LBB0_3
; %bb.6:
	add	x0, sp, #24
	mov	w1, #56
	bl	_bzero
Lloh2:
	adrp	x8, _CAM_LUN_WILDCARD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CAM_LUN_WILDCARD@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #24]
	mov	w8, #20
	str	x8, [sp, #32]
	mov	w21, #1
	mov	w0, #1
	mov	w1, #20
	bl	_calloc
	str	w21, [sp, #40]
	mov	w8, #4
	str	x0, [sp, #64]
	str	x8, [sp, #48]
	mov	w0, #1
	mov	w1, #4
	bl	_calloc
	str	x0, [sp, #72]
Lloh5:
	adrp	x21, _DEV_MATCH_PERIPH@GOTPAGE
Lloh6:
	ldr	x21, [x21, _DEV_MATCH_PERIPH@GOTPAGEOFF]
	ldr	x8, [x21]
	str	x8, [x0]
	ldr	x22, [sp, #72]
	ldr	w8, [sp, #20]
	str	w8, [x22, #44]
	ldr	w0, [x22, #40]
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	str	x20, [x22, #32]
Lloh9:
	adrp	x8, _PERIPH_MATCH_PATH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PERIPH_MATCH_PATH@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _PERIPH_MATCH_NAME@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PERIPH_MATCH_NAME@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _PERIPH_MATCH_TARGET@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PERIPH_MATCH_TARGET@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x22, #24]
Lloh18:
	adrp	x8, _xptfd@GOTPAGE
Lloh19:
	ldr	x8, [x8, _xptfd@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _CAMIOCOMMAND@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CAMIOCOMMAND@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	add	x2, sp, #24
	bl	_ioctl
	tbnz	x0, #63, LBB0_12
; %bb.7:
	ldr	x0, [sp, #72]
	bl	_free
	ldr	w8, [sp, #24]
Lloh24:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	and	w10, w9, w8
Lloh27:
	adrp	x9, _CAM_REQ_CMP@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x9]
	ldr	x9, [sp, #56]
	cmp	w10, w11
	b.ne	LBB0_13
; %bb.8:
Lloh30:
	adrp	x10, _CAM_DEV_MATCH_LAST@GOTPAGE
Lloh31:
	ldr	x10, [x10, _CAM_DEV_MATCH_LAST@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_13
; %bb.9:
	cmp	w8, #1
	b.eq	LBB0_14
; %bb.10:
	cbnz	w8, LBB0_16
; %bb.11:
	ldr	x0, [sp, #64]
	bl	_free
Lloh33:
	adrp	x8, _ENOENT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
Lloh35:
	adrp	x8, _errno@GOTPAGE
Lloh36:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh37:
	ldr	w21, [x8]
	ldr	x0, [sp, #64]
	bl	_free
	ldr	x0, [sp, #72]
	bl	_free
	b	LBB0_3
LBB0_13:
	stp	x8, x9, [sp]
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_14:
	ldr	x8, [sp, #64]
	ldr	x9, [x8]
	ldr	x10, [x21]
	cmp	x9, x10
	b.ne	LBB0_17
; %bb.15:
	ldr	w0, [x19]
	ldr	x9, [x8, #56]
	ldr	w8, [x8, #64]
	stp	x9, x8, [sp]
Lloh40:
	adrp	x2, l_.str.4@PAGE
Lloh41:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	ldr	x0, [sp, #64]
	bl	_free
	mov	w21, #0
	b	LBB0_3
LBB0_16:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh42:
	adrp	x0, l_.str.2@PAGE
Lloh43:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_17:
Lloh44:
	adrp	x0, l_.str.3@PAGE
Lloh45:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_18:
	bl	_warnx
	ldr	x0, [sp, #64]
	bl	_free
Lloh46:
	adrp	x8, _EIO@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_XPT_DEV_MATCH,4,2              ; @XPT_DEV_MATCH
	.comm	_CAM_XPT_PATH_ID,4,2            ; @CAM_XPT_PATH_ID
	.comm	_CAM_TARGET_WILDCARD,4,2        ; @CAM_TARGET_WILDCARD
	.comm	_CAM_LUN_WILDCARD,4,2           ; @CAM_LUN_WILDCARD
	.comm	_DEV_MATCH_PERIPH,8,3           ; @DEV_MATCH_PERIPH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"da"

	.comm	_PERIPH_MATCH_PATH,4,2          ; @PERIPH_MATCH_PATH
	.comm	_PERIPH_MATCH_NAME,4,2          ; @PERIPH_MATCH_NAME
	.comm	_PERIPH_MATCH_TARGET,4,2        ; @PERIPH_MATCH_TARGET
	.comm	_xptfd,4,2                      ; @xptfd
	.comm	_CAMIOCOMMAND,4,2               ; @CAMIOCOMMAND
	.comm	_errno,4,2                      ; @errno
	.comm	_CAM_STATUS_MASK,4,2            ; @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ; @CAM_REQ_CMP
	.comm	_CAM_DEV_MATCH_LAST,8,3         ; @CAM_DEV_MATCH_LAST
l_.str.1:                               ; @.str.1
	.asciz	"mpt_query_disk got CAM error %#x, CDM error %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.2:                               ; @.str.2
	.asciz	"mpt_query_disk got %d matches, expected 1"

l_.str.3:                               ; @.str.3
	.asciz	"mpt_query_disk got wrong CAM match"

l_.str.4:                               ; @.str.4
	.asciz	"%s%d"

.subsections_via_symbols
