	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ci_copy_bytes_to_smc
_ci_copy_bytes_to_smc:                  ## @ci_copy_bytes_to_smc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $ecx killed $ecx def $rcx
	movl	%esi, %ebx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	testb	$3, %bl
	jne	LBB0_4
## %bb.1:
	leal	(%rcx,%rbx), %eax
	cmpl	%r8d, %eax
	jge	LBB0_4
## %bb.2:
	movq	%rdx, %r15
	cmpl	$4, %ecx
	jl	LBB0_3
## %bb.5:
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r13d
	movl	4(%r15), %r12d
	movl	8(%r15), %r14d
	movl	12(%r15), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	%r8d, %edx
	callq	_ci_set_smc_sram_address
	testl	%eax, %eax
	jne	LBB0_22
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	shll	$24, %r13d
	shll	$16, %r12d
	addl	%r13d, %r12d
	shll	$8, %r14d
	addl	%r12d, %r14d
	addl	-64(%rbp), %r14d                ## 4-byte Folded Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_mmSMC_IND_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_cgs_write_register
	addq	$16, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	-4(%rax), %r14d
	addl	$4, %ebx
	cmpl	$7, %eax
	movl	%r14d, %ecx
	movl	-60(%rbp), %r8d                 ## 4-byte Reload
	jg	LBB0_6
## %bb.8:
	testl	%r14d, %r14d
	jne	LBB0_9
	jmp	LBB0_21
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_22
LBB0_3:
	movl	%ecx, %r14d
	testl	%r14d, %r14d
	je	LBB0_21
LBB0_9:
	movq	%r15, %r13
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	%r8d, %edx
	movl	%r8d, %r12d
	callq	_ci_set_smc_sram_address
	testl	%eax, %eax
	jne	LBB0_22
## %bb.10:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_mmSMC_IND_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cgs_read_register
	movl	%eax, %r15d
	testl	%r14d, %r14d
	jle	LBB0_11
## %bb.12:
	leal	-1(%r14), %eax
	cmpl	$3, %eax
	movl	%r12d, %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jae	LBB0_14
## %bb.13:
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_11:
	xorl	%ebx, %ebx
	movl	%r12d, %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_19
LBB0_14:
	movl	%r14d, %eax
	andl	$-4, %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %ebx
	addl	(%r13), %ebx
	shll	$8, %ebx
	addl	4(%r13), %ebx
	shll	$8, %ebx
	addl	8(%r13), %ebx
	shll	$8, %ebx
	addl	12(%r13), %ebx
	addq	$16, %r13
	addl	$-4, %eax
	jne	LBB0_15
LBB0_16:
	testb	$3, %r14b
	je	LBB0_19
## %bb.17:
	movl	%r14d, %eax
	andl	$3, %eax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %ebx
	addl	(%r13,%rcx,4), %ebx
	incq	%rcx
	cmpl	%ecx, %eax
	jne	LBB0_18
LBB0_19:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_ci_set_smc_sram_address
	testl	%eax, %eax
	jne	LBB0_22
## %bb.20:
	shll	$3, %r14d
	movl	$32, %ecx
	subl	%r14d, %ecx
	shll	%cl, %ebx
	movq	$-1, %rax
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rax
	notl	%eax
	andl	%eax, %r15d
	orl	%ebx, %r15d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_mmSMC_IND_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_cgs_write_register
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"smc_start_address invalid \n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mmSMC_IND_DATA_0,4,2           ## @mmSMC_IND_DATA_0
	.no_dead_strip	_ci_copy_bytes_to_smc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ci_copy_bytes_to_smc
_ci_copy_bytes_to_smc:                  ; @ci_copy_bytes_to_smc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	tst	w1, #0x3
	b.ne	LBB0_7
; %bb.1:
	mov	x20, x4
	mov	x23, x3
	mov	x21, x1
	add	w8, w3, w1
	cmp	w8, w4
	b.ge	LBB0_7
; %bb.2:
	mov	x22, x2
	mov	x19, x0
	cmp	w23, #4
	b.lt	LBB0_8
; %bb.3:
Lloh0:
	adrp	x25, _mmSMC_IND_DATA_0@GOTPAGE
Lloh1:
	ldr	x25, [x25, _mmSMC_IND_DATA_0@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w24, w28, [x22]
	ldp	w26, w27, [x22, #8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_ci_set_smc_sram_address
	cbnz	w0, LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w8, w28, #16
	add	w8, w8, w24, lsl #24
	add	w8, w8, w26, lsl #8
	add	w2, w8, w27
	ldr	w0, [x19]
	ldr	w1, [x25]
	bl	_cgs_write_register
	add	x22, x22, #16
	sub	w24, w23, #4
	add	w21, w21, #4
	cmp	w23, #7
	mov	x23, x24
	b.gt	LBB0_4
; %bb.6:
	cbnz	w24, LBB0_9
	b	LBB0_16
LBB0_7:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_8:
	mov	x24, x23
	cbz	w24, LBB0_16
LBB0_9:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_ci_set_smc_sram_address
	cbnz	w0, LBB0_17
; %bb.10:
	ldr	w0, [x19]
Lloh7:
	adrp	x25, _mmSMC_IND_DATA_0@GOTPAGE
Lloh8:
	ldr	x25, [x25, _mmSMC_IND_DATA_0@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_cgs_read_register
	mov	x23, x0
	cmp	w24, #1
	b.lt	LBB0_13
; %bb.11:
	mov	w26, #0
	add	w8, w24, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x22], #4
	add	w26, w9, w26, lsl #8
	sub	w8, w8, #1
	cmp	w8, #1
	b.hi	LBB0_12
	b	LBB0_14
LBB0_13:
	mov	w26, #0
LBB0_14:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_ci_set_smc_sram_address
	cbnz	w0, LBB0_17
; %bb.15:
	mov	w8, #32
	sub	w8, w8, w24, lsl #3
	lsl	w9, w26, w8
	mov	x10, #-1
	lsl	x8, x10, x8
	bic	w8, w23, w8
	orr	w2, w9, w8
	ldr	w0, [x19]
	ldr	w1, [x25]
	bl	_cgs_write_register
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"smc_start_address invalid \n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmSMC_IND_DATA_0,4,2           ; @mmSMC_IND_DATA_0
	.no_dead_strip	_ci_copy_bytes_to_smc
.subsections_via_symbols
