	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_dbgfs_sta_drain_write
_iwl_dbgfs_sta_drain_write:             ## @iwl_dbgfs_sta_drain_write
	.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	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_iwl_mvm_firmware_running
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	8(%r14), %rax
	movq	_IWL_UCODE_REGULAR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.4:
	leaq	L_.str(%rip), %rsi
	leaq	-32(%rbp), %rdx
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdi
	callq	_sscanf
	cmpl	$2, %eax
	jne	LBB0_5
## %bb.6:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	movq	_IWL_MVM_STATION_COUNT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_5
## %bb.8:
	cmpl	$2, -28(%rbp)
	jb	LBB0_9
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	-32(%rbp), %esi
	movq	%r14, %rdi
	callq	_iwl_mvm_sta_from_staid_protected
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movl	-28(%rbp), %edx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_iwl_mvm_drain_sta
	testq	%rax, %rax
	cmovnel	%eax, %ebx
	jmp	LBB0_12
LBB0_10:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_UCODE_REGULAR,8,3          ## @IWL_UCODE_REGULAR
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IWL_MVM_STATION_COUNT,4,2      ## @IWL_MVM_STATION_COUNT
	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_iwl_dbgfs_sta_drain_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_dbgfs_sta_drain_write
_iwl_dbgfs_sta_drain_write:             ; @iwl_dbgfs_sta_drain_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_iwl_mvm_firmware_running
	cbz	w0, LBB0_7
; %bb.1:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _IWL_UCODE_REGULAR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IWL_UCODE_REGULAR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x21
	bl	_sscanf
	cmp	w0, #2
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [sp, #12]
	tbnz	w8, #31, LBB0_6
; %bb.4:
Lloh5:
	adrp	x9, _IWL_MVM_STATION_COUNT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IWL_MVM_STATION_COUNT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.5:
	ldr	w8, [sp, #8]
	cmp	w8, #2
	b.lo	LBB0_10
LBB0_6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_10:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_iwl_mvm_sta_from_staid_protected
	cbz	x0, LBB0_12
; %bb.11:
	mov	x1, x0
	ldr	w2, [sp, #8]
	mov	x0, x19
	bl	_iwl_mvm_drain_sta
	cmp	x0, #0
	csel	w20, w20, w0, eq
	b	LBB0_13
LBB0_12:
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IWL_UCODE_REGULAR,8,3          ; @IWL_UCODE_REGULAR
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IWL_MVM_STATION_COUNT,4,2      ; @IWL_MVM_STATION_COUNT
	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_iwl_dbgfs_sta_drain_write
.subsections_via_symbols
