	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu_v11_0_i2c_receive
_smu_v11_0_i2c_receive:                 ## @smu_v11_0_i2c_receive
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_to_amdgpu_device
	movq	_I2C_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_smu_v11_0_i2c_set_address
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_smu_v11_0_i2c_enable
	testl	%r14d, %r14d
	jle	LBB0_1
## %bb.2:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	decq	%rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	_CKSVII2C_IC_DATA_CMD@GOTPCREL(%rip), %rbx
	movq	_mmCKSVII2C_IC_DATA_CMD@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_smu_v11_0_i2c_clear_status
	movl	$0, %edi
	testq	%r13, %r13
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %esi
	movq	_RESTART@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	movq	_I2C_RESTART@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	setne	%cl
	xorl	%edi, %edi
	callq	_REG_SET_FIELD
	movl	%eax, %edi
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %esi
	movq	_DAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_REG_SET_FIELD
	movl	(%rbx), %esi
	movq	_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
	cmpl	%r13d, -80(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %esi
	movq	_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%ecx, %ecx
	movq	_I2C_NO_STOP@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	andl	-48(%rbp), %edi                 ## 4-byte Folded Reload
	sete	%cl
	movl	%eax, %edi
	callq	_REG_SET_FIELD
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_SMUIO@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	(%r14), %edx
	xorl	%esi, %esi
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_smu_v11_0_i2c_poll_rx_status
	movl	%eax, %r12d
	movq	_I2C_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_8
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edi
	movl	(%r14), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movq	_CKSVII2C_IC_DATA_CMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_DAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	callq	_REG_GET_FIELD
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx,%r13,4)
	incq	%r13
	cmpq	%r13, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_3
## %bb.15:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %r13d
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_16
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_8:
	movq	_I2C_SW_TIMEOUT@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_10:
	movq	_I2C_NAK_7B_ADDR_NOACK@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_12
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_12:
	movq	_I2C_NAK_TXDATA_NOACK@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_16
## %bb.13:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	callq	_DRM_DEBUG_DRIVER
	movq	_drm_debug@GOTPCREL(%rip), %rax
	movq	_DRM_UT_DRIVER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_18
## %bb.17:
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DUMP_PREFIX_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	movl	$16, %ecx
	movl	$1, %r8d
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	pushq	$0
	pushq	%r13
	callq	_print_hex_dump
	addq	$16, %rsp
LBB0_18:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_OK,4,2                     ## @I2C_OK
	.comm	_CKSVII2C_IC_DATA_CMD,4,2       ## @CKSVII2C_IC_DATA_CMD
	.comm	_RESTART,4,2                    ## @RESTART
	.comm	_I2C_RESTART,4,2                ## @I2C_RESTART
	.comm	_DAT,4,2                        ## @DAT
	.comm	_CMD,4,2                        ## @CMD
	.comm	_STOP,4,2                       ## @STOP
	.comm	_I2C_NO_STOP,4,2                ## @I2C_NO_STOP
	.comm	_SMUIO,4,2                      ## @SMUIO
	.comm	_mmCKSVII2C_IC_DATA_CMD,4,2     ## @mmCKSVII2C_IC_DATA_CMD
	.comm	_I2C_SW_TIMEOUT,4,2             ## @I2C_SW_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TIMEOUT ERROR !!!"

	.comm	_I2C_NAK_7B_ADDR_NOACK,4,2      ## @I2C_NAK_7B_ADDR_NOACK
L_.str.1:                               ## @.str.1
	.asciz	"Received I2C_NAK_7B_ADDR_NOACK !!!"

	.comm	_I2C_NAK_TXDATA_NOACK,4,2       ## @I2C_NAK_TXDATA_NOACK
L_.str.2:                               ## @.str.2
	.asciz	"Received I2C_NAK_TXDATA_NOACK !!!"

L_.str.3:                               ## @.str.3
	.asciz	"I2C_Receive(), address = %x, bytes = %d, data :"

	.comm	_drm_debug,4,2                  ## @drm_debug
	.comm	_DRM_UT_DRIVER,4,2              ## @DRM_UT_DRIVER
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
L_.str.4:                               ## @.str.4
	.asciz	"data: "

	.comm	_DUMP_PREFIX_NONE,4,2           ## @DUMP_PREFIX_NONE
	.no_dead_strip	_smu_v11_0_i2c_receive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu_v11_0_i2c_receive
_smu_v11_0_i2c_receive:                 ; @smu_v11_0_i2c_receive
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x22, x4
	mov	x25, x3
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x19, x1
	mov	x23, x0
	bl	_to_amdgpu_device
Lloh0:
	adrp	x8, _I2C_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_OK@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x0, x23
	mov	x1, x19
	bl	_smu_v11_0_i2c_set_address
	mov	x0, x23
	mov	w1, #1
	bl	_smu_v11_0_i2c_enable
	cmp	w25, #1
	b.lt	LBB0_10
; %bb.1:
	str	w19, [sp, #4]                   ; 4-byte Folded Spill
	mov	x21, #0
	mov	w25, w25
	sub	x27, x25, #1
Lloh3:
	adrp	x28, _CKSVII2C_IC_DATA_CMD@GOTPAGE
Lloh4:
	ldr	x28, [x28, _CKSVII2C_IC_DATA_CMD@GOTPAGEOFF]
Lloh5:
	adrp	x20, _DAT@GOTPAGE
Lloh6:
	ldr	x20, [x20, _DAT@GOTPAGEOFF]
Lloh7:
	adrp	x26, _SMUIO@GOTPAGE
Lloh8:
	ldr	x26, [x26, _SMUIO@GOTPAGEOFF]
Lloh9:
	adrp	x19, _mmCKSVII2C_IC_DATA_CMD@GOTPAGE
Lloh10:
	ldr	x19, [x19, _mmCKSVII2C_IC_DATA_CMD@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_smu_v11_0_i2c_clear_status
	cbz	x21, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x28]
Lloh11:
	adrp	x8, _RESTART@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RESTART@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _I2C_RESTART@GOTPAGE
Lloh15:
	ldr	x8, [x8, _I2C_RESTART@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w22
	cset	w3, ne
	mov	w0, #0
	bl	_REG_SET_FIELD
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x28]
	ldr	w2, [x20]
	mov	w3, #0
	bl	_REG_SET_FIELD
	ldr	w1, [x28]
Lloh17:
	adrp	x8, _CMD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CMD@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	w3, #1
	bl	_REG_SET_FIELD
	mov	x4, x0
	cmp	w27, w21
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x28]
Lloh20:
	adrp	x8, _STOP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _STOP@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x8, _I2C_NO_STOP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _I2C_NO_STOP@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w22
	cset	w3, eq
	mov	x0, x4
	bl	_REG_SET_FIELD
	mov	x4, x0
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x26]
	ldr	w2, [x19]
	mov	w1, #0
	mov	x3, x4
	bl	_WREG32_SOC15
	mov	x0, x23
	bl	_smu_v11_0_i2c_poll_rx_status
	mov	x24, x0
Lloh26:
	adrp	x8, _I2C_OK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _I2C_OK@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x26]
	ldr	w2, [x19]
	mov	w1, #0
	bl	_RREG32_SOC15
	ldr	w1, [x28]
	ldr	w2, [x20]
	bl	_REG_GET_FIELD
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	w0, [x8, x21, lsl #2]
	add	x21, x21, #1
	cmp	x25, x21
	b.ne	LBB0_2
; %bb.9:
	mov	x21, x25
	ldr	w19, [sp, #4]                   ; 4-byte Folded Reload
	b	LBB0_17
LBB0_10:
	mov	w21, #0
	b	LBB0_17
LBB0_11:
Lloh29:
	adrp	x8, _I2C_SW_TIMEOUT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _I2C_SW_TIMEOUT@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_13
; %bb.12:
Lloh32:
	adrp	x0, l_.str@PAGE
Lloh33:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_13:
Lloh34:
	adrp	x8, _I2C_NAK_7B_ADDR_NOACK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _I2C_NAK_7B_ADDR_NOACK@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	tst	w8, w24
	ldr	w19, [sp, #4]                   ; 4-byte Folded Reload
	b.eq	LBB0_15
; %bb.14:
Lloh37:
	adrp	x0, l_.str.1@PAGE
Lloh38:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_15:
Lloh39:
	adrp	x8, _I2C_NAK_TXDATA_NOACK@GOTPAGE
Lloh40:
	ldr	x8, [x8, _I2C_NAK_TXDATA_NOACK@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_17
; %bb.16:
Lloh42:
	adrp	x0, l_.str.2@PAGE
Lloh43:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
LBB0_17:
Lloh44:
	adrp	x0, l_.str.3@PAGE
Lloh45:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	mov	x2, x21
	bl	_DRM_DEBUG_DRIVER
Lloh46:
	adrp	x8, _drm_debug@GOTPAGE
Lloh47:
	ldr	x8, [x8, _drm_debug@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	adrp	x9, _DRM_UT_DRIVER@GOTPAGE
Lloh50:
	ldr	x9, [x9, _DRM_UT_DRIVER@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
Lloh52:
	adrp	x8, _KERN_INFO@GOTPAGE
Lloh53:
	ldr	x8, [x8, _KERN_INFO@GOTPAGEOFF]
Lloh54:
	ldr	w0, [x8]
Lloh55:
	adrp	x8, _DUMP_PREFIX_NONE@GOTPAGE
Lloh56:
	ldr	x8, [x8, _DUMP_PREFIX_NONE@GOTPAGEOFF]
Lloh57:
	ldr	w2, [x8]
Lloh58:
	adrp	x1, l_.str.4@PAGE
Lloh59:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w3, #16
	mov	w4, #1
	ldr	x5, [sp, #8]                    ; 8-byte Folded Reload
	mov	x6, x21
	mov	w7, #0
	bl	_print_hex_dump
LBB0_19:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_OK,4,2                     ; @I2C_OK
	.comm	_CKSVII2C_IC_DATA_CMD,4,2       ; @CKSVII2C_IC_DATA_CMD
	.comm	_RESTART,4,2                    ; @RESTART
	.comm	_I2C_RESTART,4,2                ; @I2C_RESTART
	.comm	_DAT,4,2                        ; @DAT
	.comm	_CMD,4,2                        ; @CMD
	.comm	_STOP,4,2                       ; @STOP
	.comm	_I2C_NO_STOP,4,2                ; @I2C_NO_STOP
	.comm	_SMUIO,4,2                      ; @SMUIO
	.comm	_mmCKSVII2C_IC_DATA_CMD,4,2     ; @mmCKSVII2C_IC_DATA_CMD
	.comm	_I2C_SW_TIMEOUT,4,2             ; @I2C_SW_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TIMEOUT ERROR !!!"

	.comm	_I2C_NAK_7B_ADDR_NOACK,4,2      ; @I2C_NAK_7B_ADDR_NOACK
l_.str.1:                               ; @.str.1
	.asciz	"Received I2C_NAK_7B_ADDR_NOACK !!!"

	.comm	_I2C_NAK_TXDATA_NOACK,4,2       ; @I2C_NAK_TXDATA_NOACK
l_.str.2:                               ; @.str.2
	.asciz	"Received I2C_NAK_TXDATA_NOACK !!!"

l_.str.3:                               ; @.str.3
	.asciz	"I2C_Receive(), address = %x, bytes = %d, data :"

	.comm	_drm_debug,4,2                  ; @drm_debug
	.comm	_DRM_UT_DRIVER,4,2              ; @DRM_UT_DRIVER
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
l_.str.4:                               ; @.str.4
	.asciz	"data: "

	.comm	_DUMP_PREFIX_NONE,4,2           ; @DUMP_PREFIX_NONE
	.no_dead_strip	_smu_v11_0_i2c_receive
.subsections_via_symbols
