	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9015_copy_firmware
_af9015_copy_firmware:                  ## @af9015_copy_firmware
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_d_to_priv
	movq	%rax, %r12
	movq	(%r15), %r14
	movq	_COPY_FIRMWARE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movl	$0, -100(%rbp)
	movq	$20736, -96(%rbp)               ## imm = 0x5100
	movq	$0, -88(%rbp)
	movl	$4, -80(%rbp)
	leaq	-64(%rbp), %rax
	movl	%eax, -76(%rbp)
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movzbl	1(%r12), %eax
	movl	%eax, -64(%rbp)
	movzbl	(%r12), %eax
	movl	%eax, -60(%rbp)
	movzbl	5(%r12), %eax
	movl	%eax, -56(%rbp)
	movzbl	4(%r12), %eax
	movl	%eax, -52(%rbp)
	movq	8(%r12), %rax
	movl	4(%rax), %esi
	leaq	-68(%rbp), %rcx
	movq	%r15, %rdi
	movl	$39102, %edx                    ## imm = 0x98BE
	callq	_af9015_read_reg_i2c
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_18:
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%ebx, %r13d
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-68(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpl	$12, -68(%rbp)
	je	LBB0_19
## %bb.2:
	movl	16(%r12), %edi
	movl	$54294, %esi                    ## imm = 0xD416
	movl	$4, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:
	leaq	-104(%rbp), %rsi
	movq	%r15, %rdi
	callq	_af9015_ctrl_msg
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_5:
	movl	16(%r12), %edi
	movl	$54294, %esi                    ## imm = 0xD416
	movl	$20, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.6:
	movq	8(%r12), %rax
	movl	4(%rax), %esi
	movq	%r15, %rdi
	movl	$57861, %edx                    ## imm = 0xE205
	movl	$1, %ecx
	callq	_af9015_write_reg_i2c
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.7:
	movl	$0, -68(%rbp)
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%rax, %r13
	addq	%rbx, %r13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r13, %rsi
	callq	_time_after
	testl	%eax, %eax
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	-68(%rbp), %eax
	orl	$8, %eax
	cmpl	$12, %eax
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$20, %edi
	callq	_msleep
	movq	8(%r12), %rax
	movl	4(%rax), %esi
	movq	%r15, %rdi
	movl	$39102, %edx                    ## imm = 0x98BE
	leaq	-68(%rbp), %rcx
	callq	_af9015_read_reg_i2c
	testl	%eax, %eax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	-68(%rbp), %edx
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_8
LBB0_13:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_jiffies_to_msecs
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_jiffies_to_msecs
	subl	%eax, %ebx
	addl	$1000, %ebx                     ## imm = 0x3E8
	leaq	L_.str.3(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	-68(%rbp), %eax
	cmpl	$12, %eax
	je	LBB0_19
## %bb.14:
	cmpl	$4, %eax
	jne	LBB0_16
## %bb.15:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_17
LBB0_16:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.5(%rip), %rsi
LBB0_17:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_11:
	movl	%eax, %ebx
	jmp	LBB0_18
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_COPY_FIRMWARE,4,2              ## @COPY_FIRMWARE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

L_.str.1:                               ## @.str.1
	.asciz	"firmware status %02x\n"

L_.str.2:                               ## @.str.2
	.asciz	"firmware copy cmd failed %d\n"

	.comm	_jiffies,8,3                    ## @jiffies
L_.str.3:                               ## @.str.3
	.asciz	"firmware boot took %u ms\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.4:                               ## @.str.4
	.asciz	"firmware did not run\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.5:                               ## @.str.5
	.asciz	"firmware boot timeout\n"

L_.str.6:                               ## @.str.6
	.asciz	"failed %d\n"

	.no_dead_strip	_af9015_copy_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9015_copy_firmware
_af9015_copy_firmware:                  ; @af9015_copy_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	bl	_d_to_priv
	mov	x21, x0
Lloh3:
	adrp	x8, _COPY_FIRMWARE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _COPY_FIRMWARE@GOTPAGEOFF]
	ldr	x19, [x20]
Lloh5:
	ldr	w8, [x8]
	stp	w8, wzr, [sp, #16]
	mov	w8, #20736
	stp	x8, xzr, [sp, #24]
	mov	w8, #4
	add	x9, sp, #56
	stp	w8, w9, [sp, #40]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldrb	w8, [x21, #1]
	str	w8, [sp, #56]
	ldrb	w8, [x21]
	str	w8, [sp, #60]
	ldrb	w8, [x21, #5]
	str	w8, [sp, #64]
	ldrb	w8, [x21, #4]
	str	w8, [sp, #68]
	ldr	x8, [x21, #8]
	ldr	w1, [x8, #4]
	add	x3, sp, #52
	mov	x0, x20
	mov	w2, #39102
	bl	_af9015_read_reg_i2c
	mov	x22, x0
	cbz	w0, LBB0_4
LBB0_1:
	str	x22, [sp]
Lloh8:
	adrp	x1, l_.str.6@PAGE
Lloh9:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_2:
	ldr	x8, [sp, #72]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.3:
	mov	x0, x22
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_4:
	ldr	w8, [sp, #52]
	str	x8, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w8, [sp, #52]
	cmp	w8, #12
	b.ne	LBB0_6
LBB0_5:
	mov	w22, #0
	b	LBB0_2
LBB0_6:
	ldr	w0, [x21, #16]
	mov	w1, #54294
	mov	w2, #4
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_1
; %bb.7:
	add	x1, sp, #16
	mov	x0, x20
	bl	_af9015_ctrl_msg
	cbz	w0, LBB0_9
; %bb.8:
	mov	x22, x0
	str	x22, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_1
LBB0_9:
	ldr	w0, [x21, #16]
	mov	w1, #54294
	mov	w2, #20
	bl	_regmap_write
	mov	x22, x0
	cbnz	w0, LBB0_1
; %bb.10:
	ldr	x8, [x21, #8]
	ldr	w1, [x8, #4]
	mov	x0, x20
	mov	w2, #57861
	mov	w3, #1
	bl	_af9015_write_reg_i2c
	mov	x22, x0
	cbnz	w0, LBB0_1
; %bb.11:
	str	wzr, [sp, #52]
Lloh17:
	adrp	x25, _jiffies@GOTPAGE
Lloh18:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	ldr	x22, [x25]
	mov	w0, #1000
	bl	_msecs_to_jiffies
	add	x23, x0, x22
	ldr	x0, [x25]
	mov	x1, x23
	bl	_time_after
	cbz	w0, LBB0_15
LBB0_12:
	ldr	x0, [x25]
	bl	_jiffies_to_msecs
	mov	x20, x0
	mov	x0, x23
	bl	_jiffies_to_msecs
	sub	w8, w20, w0
	add	w8, w8, #1000
	str	x8, [sp]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w8, [sp, #52]
	cmp	w8, #12
	b.eq	LBB0_5
; %bb.13:
	cmp	w8, #4
	b.ne	LBB0_19
; %bb.14:
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w22, w8
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_20
LBB0_15:
Lloh26:
	adrp	x24, l_.str.1@PAGE
Lloh27:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #52]
	orr	w8, w8, #0x8
	cmp	w8, #12
	b.eq	LBB0_12
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w0, #20
	bl	_msleep
	ldr	x8, [x21, #8]
	ldr	w1, [x8, #4]
	add	x3, sp, #52
	mov	x0, x20
	mov	w2, #39102
	bl	_af9015_read_reg_i2c
	cbnz	w0, LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [sp, #52]
	str	x8, [sp]
	mov	x0, x19
	mov	x1, x24
	bl	_dev_dbg
	ldr	x0, [x25]
	mov	x1, x23
	bl	_time_after
	cbz	w0, LBB0_16
	b	LBB0_12
LBB0_19:
Lloh28:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w22, w8
Lloh31:
	adrp	x1, l_.str.5@PAGE
Lloh32:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_20:
	mov	x0, x19
	bl	_dev_err
	b	LBB0_1
LBB0_21:
	mov	x22, x0
	b	LBB0_1
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_COPY_FIRMWARE,4,2              ; @COPY_FIRMWARE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

l_.str.1:                               ; @.str.1
	.asciz	"firmware status %02x\n"

l_.str.2:                               ; @.str.2
	.asciz	"firmware copy cmd failed %d\n"

	.comm	_jiffies,8,3                    ; @jiffies
l_.str.3:                               ; @.str.3
	.asciz	"firmware boot took %u ms\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.4:                               ; @.str.4
	.asciz	"firmware did not run\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.5:                               ; @.str.5
	.asciz	"firmware boot timeout\n"

l_.str.6:                               ; @.str.6
	.asciz	"failed %d\n"

	.no_dead_strip	_af9015_copy_firmware
.subsections_via_symbols
