	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsxx_save_config
_rsxx_save_config:                      ## @rsxx_save_config
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	-32(%rbp), %rdi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_memcpy
	movq	-32(%rbp), %rax
	movq	_RSXX_CFG_VERSION@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_CARD_TO_DEV
	movq	-32(%rbp), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	leaq	-32(%rbp), %r14
	movq	%r14, %rdi
	callq	_config_data_cpu_to_le
	movq	%r14, %rdi
	callq	_config_data_crc32
	movl	%eax, -24(%rbp)
	movq	%r14, %rdi
	callq	_config_data_swab
	movq	%r14, %rdi
	callq	_config_hdr_cpu_to_be
	movq	_CREG_ADD_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$16, %edx
	movq	%r14, %rcx
	movl	$1, %r8d
	callq	_rsxx_creg_write
LBB0_3:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RSXX_CFG_VERSION,8,3           ## @RSXX_CFG_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot save config with invalid version %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CREG_ADD_CONFIG,4,2            ## @CREG_ADD_CONFIG
	.no_dead_strip	_rsxx_save_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsxx_save_config
_rsxx_save_config:                      ; @rsxx_save_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	mov	x0, sp
	mov	x1, x19
	mov	w2, #16
	bl	_memcpy
	ldr	x8, [sp]
Lloh0:
	adrp	x9, _RSXX_CFG_VERSION@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RSXX_CFG_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_CARD_TO_DEV
	ldr	x2, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x0, sp
	bl	_config_data_cpu_to_le
	mov	x0, sp
	bl	_config_data_crc32
	str	w0, [sp, #8]
	mov	x0, sp
	bl	_config_data_swab
	mov	x0, sp
	bl	_config_hdr_cpu_to_be
Lloh8:
	adrp	x8, _CREG_ADD_CONFIG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CREG_ADD_CONFIG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x3, sp
	mov	x0, x19
	mov	w2, #16
	mov	w4, #1
	bl	_rsxx_creg_write
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RSXX_CFG_VERSION,8,3           ; @RSXX_CFG_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot save config with invalid version %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CREG_ADD_CONFIG,4,2            ; @CREG_ADD_CONFIG
	.no_dead_strip	_rsxx_save_config
.subsections_via_symbols
