	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_cgd
_get_cgd:                               ## @get_cgd
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_cam_getccb
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_CCB_CLEAR_ALL_EXCEPT_HDR
	movq	_XPT_GDEV_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cam_send_ccb
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	movl	(%rbx), %eax
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_5
## %bb.7:
	movl	%eax, (%r15)
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_warnx
	movl	$1, %r15d
	jmp	LBB0_9
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_warn
	movl	$1, %r15d
	jmp	LBB0_8
LBB0_5:
	movq	_arglist@GOTPCREL(%rip), %rax
	movq	_CAM_ARG_VERBOSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$1, %r15d
	testl	%ecx, (%rax)
	je	LBB0_8
## %bb.6:
	movq	_CAM_ESF_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CAM_EPF_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cam_error_print
LBB0_8:
	movq	%rbx, %rdi
	callq	_cam_freeccb
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"get_cgd: couldn't allocate CCB"

	.comm	_XPT_GDEV_TYPE,4,2              ## @XPT_GDEV_TYPE
L_.str.1:                               ## @.str.1
	.asciz	"get_cgd: error sending Get type information CCB"

	.comm	_CAM_STATUS_MASK,4,2            ## @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ## @CAM_REQ_CMP
	.comm	_arglist,4,2                    ## @arglist
	.comm	_CAM_ARG_VERBOSE,4,2            ## @CAM_ARG_VERBOSE
	.comm	_CAM_ESF_ALL,4,2                ## @CAM_ESF_ALL
	.comm	_CAM_EPF_ALL,4,2                ## @CAM_EPF_ALL
	.comm	_stderr,4,2                     ## @stderr
	.no_dead_strip	_get_cgd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_cgd
_get_cgd:                               ; @get_cgd
	.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	x21, x1
	mov	x20, x0
	bl	_cam_getccb
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	bl	_CCB_CLEAR_ALL_EXCEPT_HDR
Lloh0:
	adrp	x8, _XPT_GDEV_TYPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XPT_GDEV_TYPE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_cam_send_ccb
	tbnz	x0, #63, LBB0_5
; %bb.2:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w9, w9, w8
Lloh6:
	adrp	x10, _CAM_REQ_CMP@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_6
; %bb.3:
	mov	w20, #0
	str	w8, [x21]
	b	LBB0_9
LBB0_4:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
	mov	w20, #1
	b	LBB0_10
LBB0_5:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x8, _arglist@GOTPAGE
Lloh14:
	ldr	x8, [x8, _arglist@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _CAM_ARG_VERBOSE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CAM_ARG_VERBOSE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh19:
	adrp	x8, _CAM_ESF_ALL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CAM_ESF_ALL@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
Lloh22:
	adrp	x8, _CAM_EPF_ALL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CAM_EPF_ALL@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
Lloh25:
	adrp	x8, _stderr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh27:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_cam_error_print
LBB0_8:
	mov	w20, #1
LBB0_9:
	mov	x0, x19
	bl	_cam_freeccb
LBB0_10:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"get_cgd: couldn't allocate CCB"

	.comm	_XPT_GDEV_TYPE,4,2              ; @XPT_GDEV_TYPE
l_.str.1:                               ; @.str.1
	.asciz	"get_cgd: error sending Get type information CCB"

	.comm	_CAM_STATUS_MASK,4,2            ; @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ; @CAM_REQ_CMP
	.comm	_arglist,4,2                    ; @arglist
	.comm	_CAM_ARG_VERBOSE,4,2            ; @CAM_ARG_VERBOSE
	.comm	_CAM_ESF_ALL,4,2                ; @CAM_ESF_ALL
	.comm	_CAM_EPF_ALL,4,2                ; @CAM_EPF_ALL
	.comm	_stderr,4,2                     ; @stderr
	.no_dead_strip	_get_cgd
.subsections_via_symbols
