	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cht_wc_i2c_adap_smbus_xfer
_cht_wc_i2c_adap_smbus_xfer:            ## @cht_wc_i2c_adap_smbus_xfer
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movl	%ecx, %r14d
	movl	%esi, %ebx
	callq	_i2c_get_adapdata
	movq	%rax, %r13
	leaq	8(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	$0, (%r13)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	20(%r13), %edi
	movq	_CHT_WC_I2C_CLIENT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	cmpb	%r14b, (%rax)
	jne	LBB0_3
## %bb.2:
	movl	20(%r13), %edi
	movq	_CHT_WC_I2C_WRDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%rbp), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
LBB0_3:
	movl	20(%r13), %edi
	movq	_CHT_WC_I2C_REG_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.4:
	movl	20(%r13), %edi
	movq	_CHT_WC_I2C_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	cmpb	%r14b, (%rax)
	jne	LBB0_5
## %bb.6:
	movq	_CHT_WC_I2C_CTRL_WR@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_CHT_WC_I2C_CTRL_RD@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	callq	_regmap_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.8:
	movl	4(%r13), %r12d
	movl	16(%r13), %ebx
	movl	$30, %edi
	callq	_msecs_to_jiffies
	movl	%ebx, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_wait_event_timeout
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movq	%r13, %rsi
	callq	_cht_wc_i2c_adap_thread_handler
	cmpl	$0, 4(%r13)
	je	LBB0_10
LBB0_11:
	movq	%r15, %rdi
	callq	_mutex_lock
	cmpl	$0, (%r13)
	je	LBB0_13
## %bb.12:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_13:
	movq	_I2C_SMBUS_READ@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpb	%r14b, (%rax)
	jne	LBB0_15
## %bb.14:
	movl	12(%r13), %eax
	movq	16(%rbp), %rcx
	movl	%eax, (%rcx)
LBB0_15:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_CHT_WC_I2C_CLIENT_ADDR,4,2     ## @CHT_WC_I2C_CLIENT_ADDR
	.comm	_I2C_SMBUS_WRITE,1,0            ## @I2C_SMBUS_WRITE
	.comm	_CHT_WC_I2C_WRDATA,4,2          ## @CHT_WC_I2C_WRDATA
	.comm	_CHT_WC_I2C_REG_OFFSET,4,2      ## @CHT_WC_I2C_REG_OFFSET
	.comm	_CHT_WC_I2C_CTRL,4,2            ## @CHT_WC_I2C_CTRL
	.comm	_CHT_WC_I2C_CTRL_WR,4,2         ## @CHT_WC_I2C_CTRL_WR
	.comm	_CHT_WC_I2C_CTRL_RD,4,2         ## @CHT_WC_I2C_CTRL_RD
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_EIO,4,2                        ## @EIO
	.comm	_I2C_SMBUS_READ,1,0             ## @I2C_SMBUS_READ
	.no_dead_strip	_cht_wc_i2c_adap_smbus_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cht_wc_i2c_adap_smbus_xfer
_cht_wc_i2c_adap_smbus_xfer:            ; @cht_wc_i2c_adap_smbus_xfer
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x6
	mov	x22, x4
	mov	x24, x3
	mov	x23, x1
	bl	_i2c_get_adapdata
	mov	x21, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	str	xzr, [x21]
	mov	x0, x19
	bl	_mutex_unlock
	ldr	w0, [x21, #20]
Lloh0:
	adrp	x8, _CHT_WC_I2C_CLIENT_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHT_WC_I2C_CLIENT_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x23
	bl	_regmap_write
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.1:
	and	w24, w24, #0xff
Lloh3:
	adrp	x25, _I2C_SMBUS_WRITE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _I2C_SMBUS_WRITE@GOTPAGEOFF]
	ldrb	w8, [x25]
	cmp	w8, w24
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x21, #20]
Lloh5:
	adrp	x8, _CHT_WC_I2C_WRDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CHT_WC_I2C_WRDATA@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w2, [x20]
	bl	_regmap_write
	mov	x23, x0
	cbnz	w0, LBB0_13
LBB0_3:
	ldr	w0, [x21, #20]
Lloh8:
	adrp	x8, _CHT_WC_I2C_REG_OFFSET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CHT_WC_I2C_REG_OFFSET@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_regmap_write
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.4:
	ldr	w0, [x21, #20]
Lloh11:
	adrp	x8, _CHT_WC_I2C_CTRL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CHT_WC_I2C_CTRL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _CHT_WC_I2C_CTRL_WR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CHT_WC_I2C_CTRL_WR@GOTPAGEOFF]
	ldrb	w9, [x25]
Lloh16:
	adrp	x10, _CHT_WC_I2C_CTRL_RD@GOTPAGE
Lloh17:
	ldr	x10, [x10, _CHT_WC_I2C_CTRL_RD@GOTPAGEOFF]
	cmp	w9, w24
	csel	x8, x8, x10, eq
	ldr	w2, [x8]
	bl	_regmap_write
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.5:
	ldr	w22, [x21, #16]
	ldr	w23, [x21, #4]
	mov	w0, #30
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_timeout
	cbnz	w0, LBB0_7
; %bb.6:
	mov	x1, x21
	bl	_cht_wc_i2c_adap_thread_handler
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_14
LBB0_7:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21]
	cbz	w8, LBB0_9
; %bb.8:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_9:
Lloh21:
	adrp	x8, _I2C_SMBUS_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I2C_SMBUS_READ@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w8, w24
	b.ne	LBB0_11
; %bb.10:
	mov	w23, #0
	ldr	w8, [x21, #12]
	str	w8, [x20]
	b	LBB0_12
LBB0_11:
	mov	w23, #0
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_13:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh23:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_CHT_WC_I2C_CLIENT_ADDR,4,2     ; @CHT_WC_I2C_CLIENT_ADDR
	.comm	_I2C_SMBUS_WRITE,1,0            ; @I2C_SMBUS_WRITE
	.comm	_CHT_WC_I2C_WRDATA,4,2          ; @CHT_WC_I2C_WRDATA
	.comm	_CHT_WC_I2C_REG_OFFSET,4,2      ; @CHT_WC_I2C_REG_OFFSET
	.comm	_CHT_WC_I2C_CTRL,4,2            ; @CHT_WC_I2C_CTRL
	.comm	_CHT_WC_I2C_CTRL_WR,4,2         ; @CHT_WC_I2C_CTRL_WR
	.comm	_CHT_WC_I2C_CTRL_RD,4,2         ; @CHT_WC_I2C_CTRL_RD
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_EIO,4,2                        ; @EIO
	.comm	_I2C_SMBUS_READ,1,0             ; @I2C_SMBUS_READ
	.no_dead_strip	_cht_wc_i2c_adap_smbus_xfer
.subsections_via_symbols
