	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adf_ctl_ioctl_dev_stop
_adf_ctl_ioctl_dev_stop:                ## @adf_ctl_ioctl_dev_stop
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	leaq	-16(%rbp), %rdi
	movq	%rdx, %rsi
	callq	_adf_ctl_alloc_resources
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdi
	callq	_adf_devmgr_verify_id
	movq	-16(%rbp), %rcx
	movq	(%rcx), %rsi
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_3:
	movq	%rsi, %rdi
	callq	_adf_ctl_is_device_in_use
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	-16(%rbp), %rax
	movq	(%rax), %rsi
	movq	_ADF_CFG_ALL_DEVICES@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
LBB0_7:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdi
	callq	_adf_ctl_stop_devices
	xorl	%ebx, %ebx
LBB0_8:
	movq	-16(%rbp), %rdi
	callq	_kfree
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QAT: Device %d not found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ADF_CFG_ALL_DEVICES,8,3        ## @ADF_CFG_ALL_DEVICES
L_.str.1:                               ## @.str.1
	.asciz	"QAT: Stopping all acceleration devices.\n"

L_.str.2:                               ## @.str.2
	.asciz	"QAT: Stopping acceleration device qat_dev%d.\n"

	.no_dead_strip	_adf_ctl_ioctl_dev_stop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adf_ctl_ioctl_dev_stop
_adf_ctl_ioctl_dev_stop:                ; @adf_ctl_ioctl_dev_stop
	.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
	mov	x1, x2
	add	x0, sp, #8
	bl	_adf_ctl_alloc_resources
	mov	x19, x0
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	x0, [x8]
	bl	_adf_devmgr_verify_id
	ldr	x8, [sp, #8]
	ldr	x1, [x8]
	cbz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_3:
	mov	x0, x1
	bl	_adf_ctl_is_device_in_use
	mov	x19, x0
	cbnz	w0, LBB0_8
; %bb.4:
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _ADF_CFG_ALL_DEVICES@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ADF_CFG_ALL_DEVICES@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_pr_info
	ldr	x8, [sp, #8]
	ldr	x0, [x8]
	bl	_adf_ctl_stop_devices
	mov	w19, #0
LBB0_8:
	ldr	x0, [sp, #8]
	bl	_kfree
LBB0_9:
	mov	x0, x19
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QAT: Device %d not found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ADF_CFG_ALL_DEVICES,8,3        ; @ADF_CFG_ALL_DEVICES
l_.str.1:                               ; @.str.1
	.asciz	"QAT: Stopping all acceleration devices.\n"

l_.str.2:                               ; @.str.2
	.asciz	"QAT: Stopping acceleration device qat_dev%d.\n"

	.no_dead_strip	_adf_ctl_ioctl_dev_stop
.subsections_via_symbols
