	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function roccat_release
_roccat_release:                        ## @roccat_release
	.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, %rbx
	callq	_iminor
	movl	%eax, %r15d
	movq	(%rbx), %r14
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r15d, %ecx
	movq	(%rax,%rcx,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	leaq	20(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	24(%r14), %rdi
	callq	_list_del
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_kfree
	decl	16(%rbx)
	jne	LBB0_6
## %bb.3:
	cmpq	$0, 8(%rbx)
	je	LBB0_5
## %bb.4:
	movl	(%rbx), %edi
	movq	_PM_HINT_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hid_hw_power
	movl	(%rbx), %edi
	callq	_hid_hw_close
	jmp	LBB0_6
LBB0_1:
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_pr_emerg
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_6:
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_devices_lock,4,2               ## @devices_lock
	.comm	_devices,8,3                    ## @devices
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"roccat device with minor %d doesn't exist\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PM_HINT_NORMAL,4,2             ## @PM_HINT_NORMAL
	.no_dead_strip	_roccat_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function roccat_release
_roccat_release:                        ; @roccat_release
	.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	x21, x0
	ldr	x20, [x19]
Lloh0:
	adrp	x0, _devices_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x8, _devices@GOTPAGE
Lloh3:
	ldr	x8, [x8, _devices@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x19, [x8, w21, uxtw #3]
	cbz	x19, LBB0_4
; %bb.1:
	add	x21, x19, #20
	mov	x0, x21
	bl	_mutex_lock
	add	x0, x20, #24
	bl	_list_del
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	bl	_kfree
	ldr	w8, [x19, #16]
	subs	w8, w8, #1
	str	w8, [x19, #16]
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w0, [x19]
Lloh5:
	adrp	x8, _PM_HINT_NORMAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PM_HINT_NORMAL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_hid_hw_power
	ldr	w0, [x19]
	bl	_hid_hw_close
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x0, _devices_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_emerg
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_5:
	mov	x0, x19
	bl	_kfree
LBB0_6:
Lloh15:
	adrp	x0, _devices_lock@GOTPAGE
Lloh16:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	w0, #0
LBB0_7:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_devices_lock,4,2               ; @devices_lock
	.comm	_devices,8,3                    ; @devices
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"roccat device with minor %d doesn't exist\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PM_HINT_NORMAL,4,2             ; @PM_HINT_NORMAL
	.no_dead_strip	_roccat_release
.subsections_via_symbols
