	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_tpt_entry
_write_tpt_entry:                       ## @write_tpt_entry
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -76(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movq	%rdx, %r14
	movl	%esi, %r13d
	movq	%rdi, %rbx
	callq	_c4iw_fatal_error
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kmalloc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	testl	%r12d, %r12d
	setg	%sil
	movl	(%r14), %eax
	movl	%eax, %ebx
	sarl	$8, %ebx
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	testl	%r13d, %r13d
	jne	LBB0_12
## %bb.6:
	movq	_T4_STAG_UNSET@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_12
## %bb.7:
	movq	%r14, %r15
	movb	%sil, -44(%rbp)                 ## 1-byte Spill
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	leaq	32(%r13), %rdi
	callq	_c4iw_get_resource
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.9:
	movq	8(%r13), %rax
	addq	$32, %rax
	movq	%rax, 8(%r13)
	cmpq	16(%r13), %rax
	jle	LBB0_11
## %bb.10:
	movq	%rax, 16(%r13)
LBB0_11:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	%ebx, %r13d
	shll	$8, %r13d
	leaq	_write_tpt_entry.key(%rip), %rdi
	callq	_atomic_inc_return
	movzbl	%al, %eax
	orl	%r13d, %eax
	movl	%eax, (%r15)
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	xorl	%edx, %edx
	movb	-44(%rbp), %sil                 ## 1-byte Reload
LBB0_12:
	movb	%sil, %dl
	leaq	L_.str(%rip), %rdi
	movl	%edx, %r15d
	movl	%edx, %esi
	movl	-76(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, %r8d
	callq	_pr_debug
	testl	%r13d, %r13d
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_14
## %bb.13:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$64, %edx
	callq	_memset
	jmp	LBB0_23
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_14:
	movl	24(%rbp), %r13d
	movq	_FW_RI_TPTE_VALID_F@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_FW_RI_TPTE_STAGKEY_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%r14), %edi
	callq	_FW_RI_TPTE_STAGKEY_V
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_FW_RI_TPTE_STAGSTATE_V
	orl	%eax, %ebx
	movl	%r12d, %edi
	callq	_FW_RI_TPTE_STAGTYPE_V
	orl	%eax, %ebx
	orl	%r14d, %ebx
	movl	%r13d, %r14d
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_FW_RI_TPTE_PDID_V
	orl	%eax, %ebx
	movl	%ebx, %edi
	callq	_cpu_to_be32
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 56(%rcx)
	movl	16(%rbp), %edi
	callq	_FW_RI_TPTE_PERM_V
	testl	%r13d, %r13d
	je	LBB0_16
## %bb.15:
	movq	_FW_RI_TPTE_MWBINDEN_F@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
LBB0_16:
	movl	64(%rbp), %r12d
	movl	56(%rbp), %r13d
	orl	%eax, %r14d
	cmpl	$0, 32(%rbp)
	jne	LBB0_17
## %bb.18:
	movq	_FW_RI_VA_BASED_TO@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_8:
	incl	24(%r13)
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_17:
	movq	_FW_RI_ZERO_BASED_TO@GOTPCREL(%rip), %rax
LBB0_19:
	movl	48(%rbp), %r15d
	movl	(%rax), %edi
	callq	_FW_RI_TPTE_ADDRTYPE_V
	movl	%eax, %ebx
	movl	%r13d, %edi
	callq	_FW_RI_TPTE_PS_V
	orl	%eax, %r14d
	orl	%ebx, %r14d
	movl	%r14d, %edi
	callq	_cpu_to_be32
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%rax, 48(%r13)
	testl	%r12d, %r12d
	je	LBB0_20
## %bb.21:
	movl	72(%rbp), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_PBL_OFF
	sarl	$3, %eax
	movl	%eax, %edi
	callq	_FW_RI_TPTE_PBLADDR_V
	movl	%eax, %edi
	callq	_cpu_to_be32
	jmp	LBB0_22
LBB0_20:
	xorl	%eax, %eax
LBB0_22:
	movq	%rax, 40(%r13)
	movl	%r15d, %edi
	callq	_cpu_to_be32
	movq	%rax, 32(%r13)
	callq	_cpu_to_be32
	movq	%rax, 24(%r13)
	movl	40(%rbp), %edi
	callq	_cpu_to_be32
	movq	%rax, 16(%r13)
	xorl	%edi, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%r13)
	callq	_cpu_to_be32
	movq	%rax, (%r13)
LBB0_23:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	40(%r14), %rax
	movl	(%rax), %esi
	sarl	$5, %esi
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	addl	%r15d, %esi
	movq	%r14, %rdi
	movl	$64, %edx
	movq	%r13, %rcx
	movq	80(%rbp), %r8
	movq	88(%rbp), %r9
	callq	_write_adapter_mem
	movl	%eax, %ebx
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_25
## %bb.24:
	leaq	32(%r14), %rdi
	movl	%r15d, %esi
	callq	_c4iw_put_resource
	movq	%r14, %rdi
	callq	_mutex_lock
	addq	$-32, 8(%r14)
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_25:
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_write_tpt_entry.key,4,2 ## @write_tpt_entry.key
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_T4_STAG_UNSET,4,2              ## @T4_STAG_UNSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stag_state 0x%0x type 0x%0x pdid 0x%0x, stag_idx 0x%x\n"

	.comm	_FW_RI_TPTE_VALID_F,4,2         ## @FW_RI_TPTE_VALID_F
	.comm	_FW_RI_TPTE_STAGKEY_M,4,2       ## @FW_RI_TPTE_STAGKEY_M
	.comm	_FW_RI_TPTE_MWBINDEN_F,4,2      ## @FW_RI_TPTE_MWBINDEN_F
	.comm	_FW_RI_ZERO_BASED_TO,4,2        ## @FW_RI_ZERO_BASED_TO
	.comm	_FW_RI_VA_BASED_TO,4,2          ## @FW_RI_VA_BASED_TO
	.no_dead_strip	_write_tpt_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_tpt_entry
_write_tpt_entry:                       ; @write_tpt_entry
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x7
	mov	x26, x6
	mov	x28, x5
	mov	x27, x4
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	bl	_c4iw_fatal_error
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_15
LBB0_2:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_14
; %bb.3:
	mov	x20, x0
	cmp	w22, #0
	cset	w24, gt
	ldr	w8, [x23]
	asr	w22, w8, #8
	cbnz	w21, LBB0_9
; %bb.4:
Lloh5:
	adrp	x9, _T4_STAG_UNSET@GOTPAGE
Lloh6:
	ldr	x9, [x9, _T4_STAG_UNSET@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.5:
	add	x0, x19, #32
	bl	_c4iw_get_resource
	mov	x22, x0
	mov	x0, x19
	bl	_mutex_lock
	cbz	w22, LBB0_13
; %bb.6:
	ldp	x8, x9, [x19, #8]
	add	x8, x8, #32
	str	x8, [x19, #8]
	cmp	x8, x9
	b.le	LBB0_8
; %bb.7:
	str	x8, [x19, #16]
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
Lloh8:
	adrp	x0, _write_tpt_entry.key@PAGE
Lloh9:
	add	x0, x0, _write_tpt_entry.key@PAGEOFF
	bl	_atomic_inc_return
	bfi	w0, w22, #8, #24
	str	w0, [x23]
LBB0_9:
	ldr	x8, [x29, #48]
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	ldr	x8, [x29, #40]
	str	x8, [sp, #32]                   ; 8-byte Folded Spill
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	mov	x2, x28
	mov	x3, x27
	mov	x4, x22
	bl	_pr_debug
	cbz	w21, LBB0_11
; %bb.10:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #64
	bl	_memset
	b	LBB0_19
LBB0_11:
	str	w22, [sp, #28]                  ; 4-byte Folded Spill
	ldr	w8, [x29, #32]
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
	ldr	w8, [x29, #28]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	w8, [x29, #24]
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	ldr	w8, [x29, #20]
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	ldr	w8, [x29, #16]
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
Lloh12:
	adrp	x8, _FW_RI_TPTE_VALID_F@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FW_RI_TPTE_VALID_F@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	ldr	w8, [x23]
Lloh15:
	adrp	x9, _FW_RI_TPTE_STAGKEY_M@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FW_RI_TPTE_STAGKEY_M@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_FW_RI_TPTE_STAGKEY_V
	orr	w22, w0, w22
	mov	x0, x24
	bl	_FW_RI_TPTE_STAGSTATE_V
	orr	w22, w22, w0
	mov	x0, x28
	bl	_FW_RI_TPTE_STAGTYPE_V
	orr	w22, w22, w0
	mov	x0, x27
	bl	_FW_RI_TPTE_PDID_V
	orr	w0, w22, w0
	bl	_cpu_to_be32
	str	x0, [x20, #56]
	mov	x0, x26
	bl	_FW_RI_TPTE_PERM_V
Lloh18:
	adrp	x8, _FW_RI_TPTE_MWBINDEN_F@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FW_RI_TPTE_MWBINDEN_F@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w25, #0
	csel	w8, wzr, w8, eq
Lloh21:
	adrp	x9, _FW_RI_ZERO_BASED_TO@GOTPAGE
Lloh22:
	ldr	x9, [x9, _FW_RI_ZERO_BASED_TO@GOTPAGEOFF]
	orr	w22, w8, w0
Lloh23:
	adrp	x8, _FW_RI_VA_BASED_TO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _FW_RI_VA_BASED_TO@GOTPAGEOFF]
	ldr	w10, [sp, #8]                   ; 4-byte Folded Reload
	cmp	w10, #0
	csel	x8, x8, x9, eq
	ldr	w0, [x8]
	bl	_FW_RI_TPTE_ADDRTYPE_V
	orr	w22, w22, w0
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_FW_RI_TPTE_PS_V
	orr	w0, w22, w0
	bl	_cpu_to_be32
	str	x0, [x20, #48]
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_17
; %bb.12:
	ldr	w1, [x29, #36]
	mov	x0, x19
	bl	_PBL_OFF
	asr	w0, w0, #3
	bl	_FW_RI_TPTE_PBLADDR_V
	bl	_cpu_to_be32
	b	LBB0_18
LBB0_13:
	ldr	w8, [x19, #24]
	add	w8, w8, #1
	str	w8, [x19, #24]
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	bl	_kfree
LBB0_14:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_17:
	mov	x0, #0
LBB0_18:
	str	x0, [x20, #40]
	ldr	w0, [sp, #20]                   ; 4-byte Folded Reload
	bl	_cpu_to_be32
	str	x0, [x20, #32]
	bl	_cpu_to_be32
	str	x0, [x20, #24]
	ldr	w0, [sp, #24]                   ; 4-byte Folded Reload
	bl	_cpu_to_be32
	str	x0, [x20, #16]
	mov	w0, #0
	bl	_cpu_to_be32
	str	x0, [x20, #8]
	bl	_cpu_to_be32
	str	x0, [x20]
	ldr	w22, [sp, #28]                  ; 4-byte Folded Reload
LBB0_19:
	ldr	x8, [x19, #40]
	ldr	w8, [x8]
	add	w1, w22, w8, asr #5
	mov	x0, x19
	mov	w2, #64
	mov	x3, x20
	ldp	x4, x5, [sp, #32]               ; 16-byte Folded Reload
	bl	_write_adapter_mem
	mov	x23, x0
	cbz	w21, LBB0_21
; %bb.20:
	add	x0, x19, #32
	mov	x1, x22
	bl	_c4iw_put_resource
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	sub	x8, x8, #32
	str	x8, [x19, #8]
	mov	x0, x19
	bl	_mutex_unlock
LBB0_21:
	mov	x0, x20
	bl	_kfree
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_write_tpt_entry.key,4,2 ; @write_tpt_entry.key
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_T4_STAG_UNSET,4,2              ; @T4_STAG_UNSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stag_state 0x%0x type 0x%0x pdid 0x%0x, stag_idx 0x%x\n"

	.comm	_FW_RI_TPTE_VALID_F,4,2         ; @FW_RI_TPTE_VALID_F
	.comm	_FW_RI_TPTE_STAGKEY_M,4,2       ; @FW_RI_TPTE_STAGKEY_M
	.comm	_FW_RI_TPTE_MWBINDEN_F,4,2      ; @FW_RI_TPTE_MWBINDEN_F
	.comm	_FW_RI_ZERO_BASED_TO,4,2        ; @FW_RI_ZERO_BASED_TO
	.comm	_FW_RI_VA_BASED_TO,4,2          ; @FW_RI_VA_BASED_TO
	.no_dead_strip	_write_tpt_entry
.subsections_via_symbols
