	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dce_i2c_hw_engine_submit_payload ## -- Begin function dce_i2c_hw_engine_submit_payload
	.p2align	4, 0x90
_dce_i2c_hw_engine_submit_payload:      ## @dce_i2c_hw_engine_submit_payload
	.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	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	(%rsi), %rbx
	callq	_get_hw_buffer_available_size
	xorl	%r14d, %r14d
	cmpq	%rax, %rbx
	jge	LBB0_6
## %bb.1:
	xorl	%eax, %eax
	cmpl	$0, 12(%r13)
	movq	_DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT@GOTPCREL(%rip), %rcx
	cmoveq	_DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT@GOTPCREL(%rip), %rcx
	movq	_DCE_I2C_TRANSACTION_ACTION_I2C_WRITE@GOTPCREL(%rip), %rdx
	cmoveq	_DCE_I2C_TRANSACTION_ACTION_I2C_READ@GOTPCREL(%rip), %rdx
	sete	%al
	testl	%r12d, %r12d
	cmovneq	%rcx, %rdx
	movl	(%rdx), %ecx
	movl	%ecx, -48(%rbp)
	movl	8(%r13), %ecx
	leal	(%rax,%rcx,2), %eax
	cltq
	movq	%rax, -56(%rbp)
	movq	(%r13), %rsi
	movq	%rsi, -80(%rbp)
	movl	16(%r13), %eax
	movl	%eax, -64(%rbp)
	incq	%rsi
	movq	%r15, %rdi
	callq	_get_transaction_timeout_hw
	movl	%eax, %r12d
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdi
	callq	_submit_channel_request_hw
	movq	-72(%rbp), %rax
	movq	_I2C_CHANNEL_OPERATION_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.2:
	movq	_I2C_CHANNEL_OPERATION_ENGINE_BUSY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	cmpq	%rdx, %rax
	je	LBB0_6
## %bb.3:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_dce_i2c_hw_engine_wait_on_operation_result
	movq	_I2C_CHANNEL_OPERATION_SUCCEEDED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.4:
	movl	$1, %r14d
	cmpl	$0, 12(%r13)
	jne	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_process_channel_reply
LBB0_6:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT,4,2 ## @DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_READ,4,2 ## @DCE_I2C_TRANSACTION_ACTION_I2C_READ
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT,4,2 ## @DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_WRITE,4,2 ## @DCE_I2C_TRANSACTION_ACTION_I2C_WRITE
	.comm	_I2C_CHANNEL_OPERATION_FAILED,8,3 ## @I2C_CHANNEL_OPERATION_FAILED
	.comm	_I2C_CHANNEL_OPERATION_ENGINE_BUSY,8,3 ## @I2C_CHANNEL_OPERATION_ENGINE_BUSY
	.comm	_I2C_CHANNEL_OPERATION_SUCCEEDED,4,2 ## @I2C_CHANNEL_OPERATION_SUCCEEDED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dce_i2c_hw_engine_submit_payload ; -- Begin function dce_i2c_hw_engine_submit_payload
	.p2align	2
_dce_i2c_hw_engine_submit_payload:      ; @dce_i2c_hw_engine_submit_payload
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x1]
	bl	_get_hw_buffer_available_size
	cmp	x22, x0
	b.ge	LBB0_7
; %bb.1:
	ldp	w9, w8, [x19, #8]
	cmp	w8, #0
Lloh0:
	adrp	x8, _DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT@GOTPAGEOFF]
Lloh2:
	adrp	x10, _DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT@GOTPAGEOFF]
	csel	x8, x8, x10, eq
Lloh4:
	adrp	x10, _DCE_I2C_TRANSACTION_ACTION_I2C_READ@GOTPAGE
Lloh5:
	ldr	x10, [x10, _DCE_I2C_TRANSACTION_ACTION_I2C_READ@GOTPAGEOFF]
Lloh6:
	adrp	x11, _DCE_I2C_TRANSACTION_ACTION_I2C_WRITE@GOTPAGE
Lloh7:
	ldr	x11, [x11, _DCE_I2C_TRANSACTION_ACTION_I2C_WRITE@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	cset	w11, eq
	cmp	w21, #0
	csel	x8, x10, x8, eq
	ldr	w8, [x8]
	str	w8, [sp, #40]
	bfi	w11, w9, #1, #31
	sxtw	x8, w11
	str	x8, [sp, #32]
	ldr	x8, [x19]
	str	x8, [sp, #8]
	ldr	w9, [x19, #16]
	str	w9, [sp, #24]
	add	x1, x8, #1
	mov	x0, x20
	bl	_get_transaction_timeout_hw
	mov	x21, x0
	add	x1, sp, #8
	mov	x0, x20
	bl	_submit_channel_request_hw
	ldr	x8, [sp, #16]
Lloh8:
	adrp	x9, _I2C_CHANNEL_OPERATION_FAILED@GOTPAGE
Lloh9:
	ldr	x9, [x9, _I2C_CHANNEL_OPERATION_FAILED@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.2:
Lloh11:
	adrp	x9, _I2C_CHANNEL_OPERATION_ENGINE_BUSY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _I2C_CHANNEL_OPERATION_ENGINE_BUSY@GOTPAGEOFF]
Lloh13:
	ldr	x2, [x9]
	cmp	x8, x2
	b.eq	LBB0_7
; %bb.3:
	mov	x0, x20
	mov	x1, x21
	bl	_dce_i2c_hw_engine_wait_on_operation_result
Lloh14:
	adrp	x8, _I2C_CHANNEL_OPERATION_SUCCEEDED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _I2C_CHANNEL_OPERATION_SUCCEEDED@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.4:
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_process_channel_reply
LBB0_6:
	mov	w0, #1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT,4,2 ; @DCE_I2C_TRANSACTION_ACTION_I2C_READ_MOT
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_READ,4,2 ; @DCE_I2C_TRANSACTION_ACTION_I2C_READ
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT,4,2 ; @DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT
	.comm	_DCE_I2C_TRANSACTION_ACTION_I2C_WRITE,4,2 ; @DCE_I2C_TRANSACTION_ACTION_I2C_WRITE
	.comm	_I2C_CHANNEL_OPERATION_FAILED,8,3 ; @I2C_CHANNEL_OPERATION_FAILED
	.comm	_I2C_CHANNEL_OPERATION_ENGINE_BUSY,8,3 ; @I2C_CHANNEL_OPERATION_ENGINE_BUSY
	.comm	_I2C_CHANNEL_OPERATION_SUCCEEDED,4,2 ; @I2C_CHANNEL_OPERATION_SUCCEEDED
.subsections_via_symbols
