	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wcn36xx_smd_feature_caps_exchange ## -- Begin function wcn36xx_smd_feature_caps_exchange
	.p2align	4, 0x90
_wcn36xx_smd_feature_caps_exchange:     ## @wcn36xx_smd_feature_caps_exchange
	.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	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_INIT_HAL_MSG
	movq	_STA_POWERSAVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_feat_caps
	movq	16(%rbx), %rdi
	callq	_PREPARE_HAL_BUF
	movq	%rbx, %rdi
	callq	_wcn36xx_smd_send_and_wait
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_7
LBB0_2:
	cmpl	$16, (%rbx)
	jne	LBB0_6
## %bb.3:
	movq	_WCN36XX_HAL_CAPS_SIZE@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_8
## %bb.4:
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	movq	(%rdx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rsi,4), %edi
	movl	%edi, (%rcx,%rsi,4)
	incq	%rsi
	movslq	(%rax), %rdi
	cmpq	%rdi, %rsi
	jl	LBB0_5
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
LBB0_7:
	callq	_wcn36xx_err
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ,4,2 ## @WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ
	.comm	_STA_POWERSAVE,4,2              ## @STA_POWERSAVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sending hal_feature_caps_exchange failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid hal_feature_caps_exchange response"

	.comm	_WCN36XX_HAL_CAPS_SIZE,4,2      ## @WCN36XX_HAL_CAPS_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wcn36xx_smd_feature_caps_exchange ; -- Begin function wcn36xx_smd_feature_caps_exchange
	.p2align	2
_wcn36xx_smd_feature_caps_exchange:     ; @wcn36xx_smd_feature_caps_exchange
	.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, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_INIT_HAL_MSG
Lloh3:
	adrp	x8, _STA_POWERSAVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STA_POWERSAVE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_set_feat_caps
	ldr	x0, [x21, #16]
	bl	_PREPARE_HAL_BUF
	mov	x0, x21
	bl	_wcn36xx_smd_send_and_wait
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_2:
	ldr	w8, [x21]
	cmp	w8, #16
	b.ne	LBB0_6
; %bb.3:
Lloh8:
	adrp	x8, _WCN36XX_HAL_CAPS_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WCN36XX_HAL_CAPS_SIZE@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x9, #0
	ldp	x10, x11, [x21, #8]
	ldr	x11, [x11]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x9, #2
	ldr	w13, [x11, x12]
	str	w13, [x10, x12]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_5
	b	LBB0_8
LBB0_6:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_wcn36xx_err
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ,4,2 ; @WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ
	.comm	_STA_POWERSAVE,4,2              ; @STA_POWERSAVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sending hal_feature_caps_exchange failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid hal_feature_caps_exchange response"

	.comm	_WCN36XX_HAL_CAPS_SIZE,4,2      ; @WCN36XX_HAL_CAPS_SIZE
.subsections_via_symbols
