	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function raydium_i2c_fw_update
_raydium_i2c_fw_update:                 ## @raydium_i2c_fw_update
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %r13
	movq	$0, -48(%rbp)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	8(%rdi), %edi
	callq	_le32_to_cpu
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_kasprintf
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	leaq	4(%r13), %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	callq	_dev_dbg
	leaq	-48(%rbp), %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_11
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_4:
	movl	(%r13), %edi
	callq	_disable_irq
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_raydium_i2c_do_update_firmware
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	movq	%r14, %rdi
	callq	_raydium_i2c_initialize
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
LBB0_9:
	movq	%r12, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_RAYDIUM_TS_BLDR@GOTPCREL(%rip), %rax
LBB0_10:
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movl	(%r13), %edi
	callq	_enable_irq
	movl	$100, %edi
	callq	_msleep
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_11:
	movq	%r15, %rdi
	callq	_kfree
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%ebx, %ebx
	movq	_RAYDIUM_TS_MAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"raydium_%#04x.fw"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"firmware name: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to open firmware %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"firmware update failed: %d\n"

	.comm	_RAYDIUM_TS_BLDR,8,3            ## @RAYDIUM_TS_BLDR
L_.str.4:                               ## @.str.4
	.asciz	"failed to initialize device after firmware update: %d\n"

	.comm	_RAYDIUM_TS_MAIN,8,3            ## @RAYDIUM_TS_MAIN
	.no_dead_strip	_raydium_i2c_fw_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function raydium_i2c_fw_update
_raydium_i2c_fw_update:                 ; @raydium_i2c_fw_update
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	ldr	x23, [x0, #16]
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	ldr	w0, [x0, #8]
	bl	_le32_to_cpu
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_kasprintf
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x22, x23, #4
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x19
	bl	_dev_dbg
	add	x0, sp, #8
	mov	x1, x19
	mov	x2, x22
	bl	_request_firmware
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
	str	x19, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_10
LBB0_3:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_4:
	ldr	w0, [x23]
	bl	_disable_irq
	ldr	x1, [sp, #8]
	mov	x0, x20
	bl	_raydium_i2c_do_update_firmware
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
	str	x21, [sp]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh14:
	adrp	x8, _RAYDIUM_TS_BLDR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RAYDIUM_TS_BLDR@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	mov	x0, x20
	bl	_raydium_i2c_initialize
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.7:
	str	x21, [sp]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh18:
	adrp	x8, _RAYDIUM_TS_BLDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RAYDIUM_TS_BLDR@GOTPAGEOFF]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_9
LBB0_8:
Lloh20:
	adrp	x8, _RAYDIUM_TS_MAIN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RAYDIUM_TS_MAIN@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
	str	x8, [x20]
	ldr	w0, [x23]
	bl	_enable_irq
	mov	w0, #100
	bl	_msleep
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_10:
	mov	x0, x19
	bl	_kfree
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"raydium_%#04x.fw"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"firmware name: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to open firmware %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"firmware update failed: %d\n"

	.comm	_RAYDIUM_TS_BLDR,8,3            ; @RAYDIUM_TS_BLDR
l_.str.4:                               ; @.str.4
	.asciz	"failed to initialize device after firmware update: %d\n"

	.comm	_RAYDIUM_TS_MAIN,8,3            ; @RAYDIUM_TS_MAIN
	.no_dead_strip	_raydium_i2c_fw_update
.subsections_via_symbols
