	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cht_wc_i2c_adap_thread_handler
_cht_wc_i2c_adap_thread_handler:        ## @cht_wc_i2c_adap_thread_handler
	.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, %rbx
	leaq	24(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	32(%rbx), %edi
	movq	_CHT_WC_EXTCHGRIRQ@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	addq	$28, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_IRQ_NONE@GOTPCREL(%rip), %r14
	jmp	LBB0_12
LBB0_2:
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, -28(%rbp)
	movl	32(%rbx), %edi
	movq	_CHT_WC_I2C_RDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	4(%rbx), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	$1, 8(%rbx)
LBB0_4:
	movl	32(%rbx), %edi
	movl	(%r15), %esi
	movl	-28(%rbp), %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	28(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_6:
	movl	-28(%rbp), %eax
	movq	_CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_8
## %bb.7:
	movq	_CHT_WC_EXTCHGRIRQ_NACK_IRQ@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	andl	(%rcx), %eax
	setne	%dl
	orl	%edx, 8(%rbx)
	movl	$1, 12(%rbx)
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	-28(%rbp), %eax
	testl	%eax, (%r15)
	je	LBB0_10
## %bb.9:
	leaq	20(%rbx), %rdi
	callq	_wake_up
	movl	-28(%rbp), %eax
LBB0_10:
	movq	_CHT_WC_EXTCHGRIRQ_CLIENT_IRQ@GOTPCREL(%rip), %rcx
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %r14
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	callq	_local_irq_disable
	movl	16(%rbx), %edi
	callq	_generic_handle_irq
	xorl	%eax, %eax
	callq	_local_irq_enable
LBB0_12:
	movl	(%r14), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHT_WC_EXTCHGRIRQ,4,2          ## @CHT_WC_EXTCHGRIRQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading extchgrirq reg\n"

	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.comm	_CHT_WC_I2C_RDDATA,4,2          ## @CHT_WC_I2C_RDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Error writing extchgrirq reg\n"

	.comm	_CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK,4,2 ## @CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK
	.comm	_CHT_WC_EXTCHGRIRQ_NACK_IRQ,4,2 ## @CHT_WC_EXTCHGRIRQ_NACK_IRQ
	.comm	_CHT_WC_EXTCHGRIRQ_CLIENT_IRQ,4,2 ## @CHT_WC_EXTCHGRIRQ_CLIENT_IRQ
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_cht_wc_i2c_adap_thread_handler
.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_thread_handler
_cht_wc_i2c_adap_thread_handler:        ; @cht_wc_i2c_adap_thread_handler
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
	add	x20, x1, #24
	mov	x0, x20
	bl	_mutex_lock
	ldr	w0, [x19, #32]
Lloh0:
	adrp	x21, _CHT_WC_EXTCHGRIRQ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CHT_WC_EXTCHGRIRQ@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_2
; %bb.1:
	add	x0, x19, #28
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x20
	bl	_mutex_unlock
Lloh4:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
	b	LBB0_13
LBB0_2:
	ldr	w8, [x19]
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w0, [x19, #32]
Lloh6:
	adrp	x8, _CHT_WC_I2C_RDDATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CHT_WC_I2C_RDDATA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, x19, #4
	bl	_regmap_read
	cbz	w0, LBB0_4
; %bb.3:
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_4:
	ldr	w0, [x19, #32]
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	bl	_regmap_write
	cbz	w0, LBB0_6
; %bb.5:
	add	x0, x19, #28
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_6:
	ldr	w8, [sp, #12]
Lloh11:
	adrp	x21, _CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK@GOTPAGE
Lloh12:
	ldr	x21, [x21, _CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh13:
	adrp	x9, _CHT_WC_EXTCHGRIRQ_NACK_IRQ@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CHT_WC_EXTCHGRIRQ_NACK_IRQ@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	mov	w9, #1
	stp	w8, w9, [x19, #8]
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w8, [sp, #12]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	add	x0, x19, #20
	bl	_wake_up
	ldr	w8, [sp, #12]
LBB0_10:
Lloh16:
	adrp	x9, _CHT_WC_EXTCHGRIRQ_CLIENT_IRQ@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CHT_WC_EXTCHGRIRQ_CLIENT_IRQ@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	bl	_local_irq_disable
	ldr	w0, [x19, #16]
	bl	_generic_handle_irq
	bl	_local_irq_enable
LBB0_12:
Lloh19:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CHT_WC_EXTCHGRIRQ,4,2          ; @CHT_WC_EXTCHGRIRQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading extchgrirq reg\n"

	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.comm	_CHT_WC_I2C_RDDATA,4,2          ; @CHT_WC_I2C_RDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Error writing extchgrirq reg\n"

	.comm	_CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK,4,2 ; @CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK
	.comm	_CHT_WC_EXTCHGRIRQ_NACK_IRQ,4,2 ; @CHT_WC_EXTCHGRIRQ_NACK_IRQ
	.comm	_CHT_WC_EXTCHGRIRQ_CLIENT_IRQ,4,2 ; @CHT_WC_EXTCHGRIRQ_CLIENT_IRQ
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_cht_wc_i2c_adap_thread_handler
.subsections_via_symbols
