	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar5523_cmd
_ar5523_cmd:                            ## @ar5523_cmd
	.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, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	leaq	8(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leal	35(%r12), %r15d
	andl	$-4, %r15d
	movq	48(%rdi), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	%r15d, %edi
	callq	_cpu_to_be32
	movq	%rax, 24(%r13)
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	movl	16(%rbp), %r14d
	callq	_cpu_to_be32
	movq	%rax, 16(%r13)
	movq	_AR5523_CMD_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r13)
	movq	_AR5523_CMD_FLAG_MAGIC@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_2
## %bb.1:
	movl	$16777216, %edi                 ## imm = 0x1000000
	callq	_cpu_to_be32
	movq	%rax, (%r13)
LBB0_2:
	addq	$32, %r13
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%rbx)
	movl	%r14d, 12(%rbx)
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edx
	callq	_ar5523_dbg
	movq	40(%rbx), %r14
	movl	(%rbx), %r12d
	movl	%r12d, %edi
	callq	_ar5523_cmd_tx_pipe
	movq	48(%rbx), %rcx
	movq	_ar5523_cmd_tx_cb@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, (%rsp)
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	movl	%r15d, %r8d
	callq	_usb_fill_bulk_urb
	movq	_URB_NO_TRANSFER_DMA_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	40(%rbx), %rdi
	orl	%eax, (%rdi)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usb_submit_urb
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_ar5523_err
	jmp	LBB0_7
LBB0_4:
	leaq	32(%rbx), %rdi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%esi, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	16(%rbx), %r14d
	jmp	LBB0_7
LBB0_6:
	movq	$0, 24(%rbx)
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_ar5523_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, 16(%rbx)
LBB0_7:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5523_CMD_ID,4,2              ## @AR5523_CMD_ID
	.comm	_AR5523_CMD_FLAG_MAGIC,4,2      ## @AR5523_CMD_FLAG_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"do cmd %02x\n"

	.comm	_ar5523_cmd_tx_cb,4,2           ## @ar5523_cmd_tx_cb
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ## @URB_NO_TRANSFER_DMA_MAP
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"could not send command 0x%x, error=%d\n"

	.comm	_HZ,4,2                         ## @HZ
L_.str.2:                               ## @.str.2
	.asciz	"timeout waiting for command %02x reply\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_ar5523_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar5523_cmd
_ar5523_cmd:                            ; @ar5523_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x6
	mov	x24, x5
	mov	x25, x4
	mov	x26, x3
	mov	x27, x2
	mov	x20, x1
	mov	x19, x0
	add	x21, x0, #8
	add	w8, w3, #35
	and	w22, w8, #0xfffffffc
	ldr	x28, [x0, #48]
	mov	x0, x28
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [x28, #24]
	mov	x0, x20
	bl	_cpu_to_be32
	str	x0, [x28, #16]
Lloh0:
	adrp	x8, _AR5523_CMD_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR5523_CMD_ID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x28, #8]
Lloh3:
	adrp	x8, _AR5523_CMD_FLAG_MAGIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR5523_CMD_FLAG_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_2
; %bb.1:
	mov	w0, #16777216
	bl	_cpu_to_be32
	str	x0, [x28]
LBB0_2:
	add	x0, x28, #32
	mov	x1, x27
	mov	x2, x26
	bl	_memcpy
	str	x25, [x19, #24]
	stp	w24, w23, [x19, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_ar5523_dbg
	ldr	x23, [x19, #40]
	ldr	w24, [x19]
	mov	x0, x24
	bl	_ar5523_cmd_tx_pipe
	mov	x2, x0
	ldr	x3, [x19, #48]
Lloh8:
	adrp	x8, _ar5523_cmd_tx_cb@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ar5523_cmd_tx_cb@GOTPAGEOFF]
Lloh10:
	ldr	w5, [x8]
	mov	x0, x23
	mov	x1, x24
	mov	x4, x22
	mov	x6, x21
	bl	_usb_fill_bulk_urb
Lloh11:
	adrp	x8, _URB_NO_TRANSFER_DMA_MAP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _URB_NO_TRANSFER_DMA_MAP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	x0, [x19, #40]
	ldr	w9, [x0]
	orr	w8, w9, w8
	str	w8, [x0]
Lloh14:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_usb_submit_urb
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	str	x21, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_ar5523_err
	b	LBB0_7
LBB0_4:
	add	x0, x19, #32
Lloh19:
	adrp	x8, _HZ@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	lsl	w1, w8, #1
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_6
; %bb.5:
	ldr	w21, [x19, #16]
	b	LBB0_7
LBB0_6:
	str	xzr, [x19, #24]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_ar5523_err
Lloh24:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w21, w8
	str	w21, [x19, #16]
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5523_CMD_ID,4,2              ; @AR5523_CMD_ID
	.comm	_AR5523_CMD_FLAG_MAGIC,4,2      ; @AR5523_CMD_FLAG_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"do cmd %02x\n"

	.comm	_ar5523_cmd_tx_cb,4,2           ; @ar5523_cmd_tx_cb
	.comm	_URB_NO_TRANSFER_DMA_MAP,4,2    ; @URB_NO_TRANSFER_DMA_MAP
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"could not send command 0x%x, error=%d\n"

	.comm	_HZ,4,2                         ; @HZ
l_.str.2:                               ; @.str.2
	.asciz	"timeout waiting for command %02x reply\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_ar5523_cmd
.subsections_via_symbols
