	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_paprd_create_curve      ## -- Begin function ar9003_paprd_create_curve
	.p2align	4, 0x90
_ar9003_paprd_create_curve:             ## @ar9003_paprd_create_curve
	.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	%edx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r12
	movslq	%edx, %rax
	leaq	(,%rax,4), %rcx
	addq	8(%rsi), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rcx
	movq	(%rcx,%rax,8), %rdi
	xorl	%ebx, %ebx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$96, %edi
	movl	$8, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_AR_PHY_CHAN_INFO_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_CLR_BIT
	movq	_AR_PHY_CHAN_INFO_TAB_0@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rsi
	movq	%r12, %rdi
	callq	_REG_READ
	movq	%rax, (%r14,%rbx,2)
	addq	$4, %rbx
	cmpq	$192, %rbx
	jne	LBB0_3
## %bb.4:
	movq	%r14, %rbx
	addq	$384, %rbx                      ## imm = 0x180
	movl	(%r13), %esi
	movq	_AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_SET_BIT
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%r13), %rsi
	movq	%r12, %rdi
	callq	_REG_READ
	movq	%rax, 384(%r14,%r13,2)
	addq	$4, %r13
	cmpq	$192, %r13
	jne	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_create_pa_curve
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%cl
	leal	(%rcx,%rcx), %r15d
	addl	$-2, %r15d
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_ar9003_paprd_retrain_pa_in
	movq	_EINPROGRESS@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	testq	%rax, %rax
	cmovel	%r15d, %ebx
	movq	_AR_PHY_PAPRD_TRAINER_STAT1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_CLR_BIT
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AR_PHY_CHAN_INFO_MEMORY,4,2    ## @AR_PHY_CHAN_INFO_MEMORY
	.comm	_AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ,4,2 ## @AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ
	.comm	_AR_PHY_CHAN_INFO_TAB_0,8,3     ## @AR_PHY_CHAN_INFO_TAB_0
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_AR_PHY_PAPRD_TRAINER_STAT1,4,2 ## @AR_PHY_PAPRD_TRAINER_STAT1
	.comm	_AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE,4,2 ## @AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_paprd_create_curve      ; -- Begin function ar9003_paprd_create_curve
	.p2align	2
_ar9003_paprd_create_curve:             ; @ar9003_paprd_create_curve
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldp	x8, x24, [x1]
	ldr	x23, [x8, w2, sxtw #3]
	mov	x0, x23
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w0, #96
	mov	w1, #8
	bl	_kmalloc_array
	cbz	x0, LBB0_6
; %bb.1:
	mov	x22, x0
	add	x8, x24, w20, sxtw #2
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
Lloh3:
	adrp	x27, _AR_PHY_CHAN_INFO_MEMORY@GOTPAGE
Lloh4:
	ldr	x27, [x27, _AR_PHY_CHAN_INFO_MEMORY@GOTPAGEOFF]
	ldr	w1, [x27]
Lloh5:
	adrp	x28, _AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ@GOTPAGE
Lloh6:
	ldr	x28, [x28, _AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ@GOTPAGEOFF]
	ldr	w2, [x28]
	mov	x0, x19
	bl	_REG_CLR_BIT
	mov	x24, #0
Lloh7:
	adrp	x8, _AR_PHY_CHAN_INFO_TAB_0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AR_PHY_CHAN_INFO_TAB_0@GOTPAGEOFF]
Lloh9:
	ldr	x25, [x8]
	mov	x26, x25
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x26
	bl	_REG_READ
	str	x0, [x22, x24]
	add	x26, x26, #4
	add	x24, x24, #8
	cmp	x24, #384
	b.ne	LBB0_2
; %bb.3:
	add	x26, x22, #384
	ldr	w1, [x27]
	ldr	w2, [x28]
	mov	x0, x19
	bl	_REG_SET_BIT
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x25
	bl	_REG_READ
	str	x0, [x22, x24]
	add	x25, x25, #4
	add	x24, x24, #8
	cmp	x24, #768
	b.ne	LBB0_4
; %bb.5:
	mov	x0, x22
	mov	x1, x26
	mov	x2, x23
	ldr	x3, [sp, #8]                    ; 8-byte Folded Reload
	bl	_create_pa_curve
	mov	w8, #-2
	cmp	w0, #0
	csel	w23, w8, wzr, eq
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_ar9003_paprd_retrain_pa_in
Lloh10:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w20, w23, w8, eq
Lloh13:
	adrp	x8, _AR_PHY_PAPRD_TRAINER_STAT1@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AR_PHY_PAPRD_TRAINER_STAT1@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_CLR_BIT
	mov	x0, x22
	bl	_kfree
	b	LBB0_7
LBB0_6:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AR_PHY_CHAN_INFO_MEMORY,4,2    ; @AR_PHY_CHAN_INFO_MEMORY
	.comm	_AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ,4,2 ; @AR_PHY_CHAN_INFO_MEMORY_CHANINFOMEM_S2_READ
	.comm	_AR_PHY_CHAN_INFO_TAB_0,8,3     ; @AR_PHY_CHAN_INFO_TAB_0
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_AR_PHY_PAPRD_TRAINER_STAT1,4,2 ; @AR_PHY_PAPRD_TRAINER_STAT1
	.comm	_AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE,4,2 ; @AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE
.subsections_via_symbols
