	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_scu_ipc_i2c_cntrl        ## -- Begin function intel_scu_ipc_i2c_cntrl
	.p2align	4, 0x90
_intel_scu_ipc_i2c_cntrl:               ## @intel_scu_ipc_i2c_cntrl
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	_ipclock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_ipcdev@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movl	%ebx, %edx
	shrl	$24, %edx
	movq	_IPC_I2C_READ@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_5
## %bb.4:
	movq	_IPC_I2C_CNTRL_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	_I2C_DATA_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	movl	%eax, (%r14)
	jmp	LBB0_7
LBB0_1:
	movq	_ipclock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_5:
	movq	_IPC_I2C_WRITE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_9
## %bb.6:
	movl	(%r14), %edi
	movq	_I2C_DATA_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	callq	_writel
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	_IPC_I2C_CNTRL_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
LBB0_7:
	movq	_ipclock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_9:
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ipclock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ipcdev,16,3                    ## @ipcdev
	.comm	_ipclock,4,2                    ## @ipclock
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_IPC_I2C_READ,4,2               ## @IPC_I2C_READ
	.comm	_IPC_I2C_CNTRL_ADDR,8,3         ## @IPC_I2C_CNTRL_ADDR
	.comm	_I2C_DATA_ADDR,8,3              ## @I2C_DATA_ADDR
	.comm	_IPC_I2C_WRITE,4,2              ## @IPC_I2C_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"intel_scu_ipc: I2C INVALID_CMD = 0x%x\n"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_scu_ipc_i2c_cntrl        ; -- Begin function intel_scu_ipc_i2c_cntrl
	.p2align	2
_intel_scu_ipc_i2c_cntrl:               ; @intel_scu_ipc_i2c_cntrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, _ipclock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _ipclock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x21, _ipcdev@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ipcdev@GOTPAGEOFF]
	ldr	x0, [x21]
	cbz	x0, LBB0_3
; %bb.1:
	lsr	w2, w19, #24
Lloh4:
	adrp	x8, _IPC_I2C_READ@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IPC_I2C_READ@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [x21, #8]
Lloh7:
	adrp	x9, _IPC_I2C_CNTRL_ADDR@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IPC_I2C_CNTRL_ADDR@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_writel
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	x8, [x21, #8]
Lloh10:
	adrp	x9, _I2C_DATA_ADDR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _I2C_DATA_ADDR@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	w0, [x20]
	b	LBB0_6
LBB0_3:
Lloh13:
	adrp	x0, _ipclock@GOTPAGE
Lloh14:
	ldr	x0, [x0, _ipclock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
Lloh17:
	adrp	x8, _IPC_I2C_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IPC_I2C_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_7
; %bb.5:
	ldr	w0, [x20]
	ldr	x8, [x21, #8]
Lloh20:
	adrp	x9, _I2C_DATA_ADDR@GOTPAGE
Lloh21:
	ldr	x9, [x9, _I2C_DATA_ADDR@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	x8, [x21, #8]
Lloh23:
	adrp	x9, _IPC_I2C_CNTRL_ADDR@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IPC_I2C_CNTRL_ADDR@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_writel
LBB0_6:
Lloh26:
	adrp	x0, _ipclock@GOTPAGE
Lloh27:
	ldr	x0, [x0, _ipclock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh30:
	adrp	x0, _ipclock@GOTPAGE
Lloh31:
	ldr	x0, [x0, _ipclock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ipcdev,16,3                    ; @ipcdev
	.comm	_ipclock,4,2                    ; @ipclock
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_IPC_I2C_READ,4,2               ; @IPC_I2C_READ
	.comm	_IPC_I2C_CNTRL_ADDR,8,3         ; @IPC_I2C_CNTRL_ADDR
	.comm	_I2C_DATA_ADDR,8,3              ; @I2C_DATA_ADDR
	.comm	_IPC_I2C_WRITE,4,2              ; @IPC_I2C_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"intel_scu_ipc: I2C INVALID_CMD = 0x%x\n"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
