	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_si_copy_bytes_to_smc    ## -- Begin function amdgpu_si_copy_bytes_to_smc
	.p2align	4, 0x90
_amdgpu_si_copy_bytes_to_smc:           ## @amdgpu_si_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
	movl	%esi, %r12d
	testb	$3, %r12b
	jne	LBB0_1
## %bb.2:
	movl	%ecx, %ebx
	leal	(%rbx,%r12), %eax
	cmpl	%r8d, %eax
	jle	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rdi, %r13
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	callq	_spin_lock_irqsave
	cmpl	$4, %ebx
	jl	LBB0_4
## %bb.5:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%r14), %ebx
	movl	4(%r14), %r13d
	movl	8(%r14), %r15d
	movl	12(%r14), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	callq	_si_set_smc_sram_address
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	shll	$24, %ebx
	shll	$16, %r13d
	orl	%ebx, %r13d
	shll	$8, %r15d
	orl	%r13d, %r15d
	orl	-48(%rbp), %r15d                ## 4-byte Folded Reload
	movq	_SMC_IND_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_WREG32
	addq	$16, %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	-4(%rax), %r15d
	addl	$4, %r12d
	cmpl	$7, %eax
	movl	%r15d, %ebx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	jg	LBB0_6
## %bb.9:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	testl	%r15d, %r15d
	jg	LBB0_12
LBB0_11:
	xorl	%eax, %eax
	movq	%r13, %rbx
	jmp	LBB0_23
LBB0_4:
	movl	%ebx, %r15d
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testl	%r15d, %r15d
	jle	LBB0_11
LBB0_12:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%edx, %ebx
	callq	_si_set_smc_sram_address
	movl	%ebx, %ecx
	testl	%eax, %eax
	movq	%r13, %rbx
	jne	LBB0_23
## %bb.13:
	movl	%ecx, %r14d
	movq	_SMC_IND_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	leal	-1(%r15), %ecx
	cmpl	$3, %ecx
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jae	LBB0_15
## %bb.14:
	xorl	%r13d, %r13d
	movl	%r14d, %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_7:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_15:
	movl	%r15d, %eax
	andl	$-4, %eax
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %r13d
	addl	(%rdi), %r13d
	shll	$8, %r13d
	addl	4(%rdi), %r13d
	shll	$8, %r13d
	addl	8(%rdi), %r13d
	shll	$8, %r13d
	addl	12(%rdi), %r13d
	addq	$16, %rdi
	addl	$-4, %eax
	jne	LBB0_16
## %bb.17:
	movl	%r14d, %edx
LBB0_18:
	testb	$3, %r15b
	je	LBB0_21
## %bb.19:
	movl	%r15d, %eax
	andl	$3, %eax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %r13d
	addl	(%rdi,%rcx,4), %r13d
	incq	%rcx
	cmpl	%ecx, %eax
	jne	LBB0_20
LBB0_21:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_si_set_smc_sram_address
	testl	%eax, %eax
	jne	LBB0_23
## %bb.22:
	shll	$3, %r15d
	movl	$32, %ecx
	subl	%r15d, %ecx
	shll	%cl, %r13d
	movq	$-1, %rax
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rax
	notl	%eax
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	andl	%eax, %esi
	orl	%r13d, %esi
	movq	_SMC_IND_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_WREG32
	xorl	%eax, %eax
LBB0_23:
	movq	%rbx, %rdi
	movl	%eax, %ebx
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SMC_IND_DATA_0,4,2             ## @SMC_IND_DATA_0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_si_copy_bytes_to_smc    ; -- Begin function amdgpu_si_copy_bytes_to_smc
	.p2align	2
_amdgpu_si_copy_bytes_to_smc:           ; @amdgpu_si_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_2
; %bb.1:
	mov	x20, x4
	mov	x23, x3
	mov	x21, x1
	add	w8, w3, w1
	cmp	w8, w4
	b.le	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_3:
	mov	x0, x24
	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
LBB0_4:
	mov	x22, x2
	mov	x19, x0
	bl	_spin_lock_irqsave
	cmp	w23, #4
	b.lt	LBB0_13
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w26, w25, [x22]
	ldp	w27, w28, [x22, #8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_si_set_smc_sram_address
	cbnz	w0, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w25, #16
	orr	w8, w8, w26, lsl #24
	orr	w8, w8, w27, lsl #8
	orr	w1, w8, w28
Lloh3:
	adrp	x8, _SMC_IND_DATA_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SMC_IND_DATA_0@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_WREG32
	add	x22, x22, #16
	sub	w26, w23, #4
	add	w21, w21, #4
	cmp	w23, #7
	mov	x23, x26
	b.gt	LBB0_5
; %bb.7:
	cmp	w26, #1
	b.lt	LBB0_14
LBB0_8:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_si_set_smc_sram_address
	mov	x24, x0
	cbnz	w0, LBB0_16
; %bb.9:
Lloh6:
	adrp	x25, _SMC_IND_DATA_0@GOTPAGE
Lloh7:
	ldr	x25, [x25, _SMC_IND_DATA_0@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_RREG32
	mov	x23, x0
	mov	w28, #0
	mov	w8, #32
	sub	w27, w8, w26, lsl #3
	add	w8, w26, #1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x22], #4
	add	w28, w9, w28, lsl #8
	sub	w8, w8, #1
	cmp	w8, #1
	b.hi	LBB0_10
; %bb.11:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_si_set_smc_sram_address
	mov	x24, x0
	cbnz	w0, LBB0_16
; %bb.12:
	lsl	w8, w28, w27
	mov	x9, #-1
	lsl	x9, x9, x27
	bic	w9, w23, w9
	orr	w1, w8, w9
	ldr	w0, [x25]
	bl	_WREG32
	b	LBB0_16
LBB0_13:
	mov	x26, x23
	cmp	w26, #1
	b.ge	LBB0_8
LBB0_14:
	mov	w24, #0
	b	LBB0_16
LBB0_15:
	mov	x24, x0
LBB0_16:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SMC_IND_DATA_0,4,2             ; @SMC_IND_DATA_0
.subsections_via_symbols
