	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hix5hd2_i2c_xfer_msg
_hix5hd2_i2c_xfer_msg:                  ## @hix5hd2_i2c_xfer_msg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	%rsi, 24(%rdi)
	movq	$0, 40(%rdi)
	movl	4(%rsi), %eax
	movl	%eax, 32(%rdi)
	movl	%edx, (%rdi)
	movl	$0, 4(%rdi)
	movq	_HIX5I2C_STAT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rdi)
	leaq	20(%rdi), %r12
	movq	%r12, %rdi
	callq	_reinit_completion
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_hix5hd2_i2c_message_start
	movl	12(%rbx), %esi
	movq	%r12, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_HIX5I2C_STAT_RW_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 4(%rbx)
	movl	12(%rbx), %ecx
	movl	16(%rbx), %edi
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_2:
	movl	8(%rbx), %eax
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.3:
	movq	_HIX5I2C_STAT_RW_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_hix5hd2_i2c_wait_bus_idle
LBB0_5:
	testl	%eax, %eax
	jns	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_hix5hd2_i2c_reset
LBB0_7:
	movl	4(%rbx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIX5I2C_STAT_INIT,4,2          ## @HIX5I2C_STAT_INIT
	.comm	_HIX5I2C_STAT_RW_ERR,4,2        ## @HIX5I2C_STAT_RW_ERR
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s timeout=%d\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
L_.str.1:                               ## @.str.1
	.asciz	"rx"

L_.str.2:                               ## @.str.2
	.asciz	"tx"

	.comm	_HIX5I2C_STAT_RW_SUCCESS,4,2    ## @HIX5I2C_STAT_RW_SUCCESS
	.no_dead_strip	_hix5hd2_i2c_xfer_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hix5hd2_i2c_xfer_msg
_hix5hd2_i2c_xfer_msg:                  ; @hix5hd2_i2c_xfer_msg
	.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, x2
	mov	x21, x1
	mov	x19, x0
	str	x1, [x0, #24]
	str	xzr, [x0, #40]
	ldr	w8, [x1, #4]
	str	w8, [x0, #32]
	stp	w2, wzr, [x0]
Lloh0:
	adrp	x8, _HIX5I2C_STAT_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HIX5I2C_STAT_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	add	x22, x0, #20
	mov	x0, x22
	bl	_reinit_completion
	mov	x0, x19
	mov	x1, x20
	bl	_hix5hd2_i2c_message_start
	ldr	w1, [x19, #12]
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _HIX5I2C_STAT_RW_ERR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HIX5I2C_STAT_RW_ERR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ETIMEDOUT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	neg	w9, w9
	stp	w9, w8, [x19, #4]
	ldr	w8, [x21]
Lloh9:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh10:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, l_.str.1@PAGE
Lloh13:
	add	x10, x10, l_.str.1@PAGEOFF
Lloh14:
	adrp	x11, l_.str.2@PAGE
Lloh15:
	add	x11, x11, l_.str.2@PAGEOFF
	tst	w9, w8
	csel	x2, x11, x10, eq
	ldp	w3, w0, [x19, #12]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_2:
	ldr	w0, [x19, #8]
	cbz	w20, LBB0_5
; %bb.3:
Lloh18:
	adrp	x8, _HIX5I2C_STAT_RW_SUCCESS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HIX5I2C_STAT_RW_SUCCESS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_hix5hd2_i2c_wait_bus_idle
LBB0_5:
	tbz	w0, #31, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_hix5hd2_i2c_reset
LBB0_7:
	ldr	w0, [x19, #4]
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_HIX5I2C_STAT_INIT,4,2          ; @HIX5I2C_STAT_INIT
	.comm	_HIX5I2C_STAT_RW_ERR,4,2        ; @HIX5I2C_STAT_RW_ERR
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s timeout=%d\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
l_.str.1:                               ; @.str.1
	.asciz	"rx"

l_.str.2:                               ; @.str.2
	.asciz	"tx"

	.comm	_HIX5I2C_STAT_RW_SUCCESS,4,2    ; @HIX5I2C_STAT_RW_SUCCESS
	.no_dead_strip	_hix5hd2_i2c_xfer_msg
.subsections_via_symbols
