	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dw_i3c_master_i2c_xfers
_dw_i3c_master_i2c_xfers:               ## @dw_i3c_master_i2c_xfers
	.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, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_i2c_dev_get_master_data
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_i2c_dev_get_master
	movq	%rax, %rdi
	callq	_to_dw_i3c_master
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.2:
	cmpl	%r15d, (%rax)
	jl	LBB0_5
## %bb.3:
	testl	%r15d, %r15d
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_4
## %bb.7:
	movl	%r15d, %eax
	shlq	$2, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%r14,%r13), %r12d
	movl	4(%r14,%r13), %edi
	movl	$4, %esi
	callq	_DIV_ROUND_UP
	testl	%r12d, %r12d
	movl	$0, %ecx
	cmovel	%eax, %ecx
	cmovnel	%eax, %r12d
	addl	%ecx, %ebx
	addl	%r12d, %r15d
	addq	$12, %r13
	cmpq	%r13, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_8
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_4:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
LBB0_9:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %eax
	cmpl	%eax, %ebx
	ja	LBB0_5
## %bb.10:
	cmpl	%eax, %r15d
	ja	LBB0_5
## %bb.11:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_dw_i3c_master_alloc_xfer
	testq	%rax, %rax
	je	LBB0_24
## %bb.12:
	movq	%rax, %r13
	testl	%ebx, %ebx
	jle	LBB0_20
## %bb.13:
	leal	-1(%rbx), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$8, %r15d
	xorl	%ebx, %ebx
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%rbx
	addq	$12, %r15
	cmpq	%rbx, -48(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_20
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r12
	movl	-4(%r14,%r15), %edi
	callq	_COMMAND_PORT_ARG_DATA_LEN
	movq	_COMMAND_PORT_TRANSFER_ARG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -16(%r12,%r15,2)
	movl	%ebx, %edi
	callq	_COMMAND_PORT_TID
	movl	%eax, %r13d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_COMMAND_PORT_DEV_INDEX
	orl	%r13d, %eax
	movq	_COMMAND_PORT_ROC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -12(%r12,%r15,2)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, -8(%r14,%r15)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_COMMAND_PORT_READ_TRANSFER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -12(%r12,%r15,2)
	movl	(%r14,%r15), %ecx
	movl	%ecx, 4(%r12,%r15,2)
	movl	-4(%r14,%r15), %ecx
	movl	%ecx, (%r12,%r15,2)
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	(%r14,%r15), %ecx
	movl	%ecx, -4(%r12,%r15,2)
	movl	-4(%r14,%r15), %ecx
	movl	%ecx, -8(%r12,%r15,2)
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_COMMAND_PORT_TOC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -12(%r12,%r15,2)
	jmp	LBB0_19
LBB0_5:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_dw_i3c_master_enqueue_xfer
	movq	%r13, %rdi
	addq	$4, %rdi
	movq	_XFER_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	jne	LBB0_22
## %bb.21:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_dw_i3c_master_dequeue_xfer
LBB0_22:
	movl	(%r13), %ebx
	movq	%r13, %rdi
	callq	_dw_i3c_master_free_xfer
	jmp	LBB0_23
LBB0_24:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_COMMAND_PORT_TRANSFER_ARG,4,2  ## @COMMAND_PORT_TRANSFER_ARG
	.comm	_COMMAND_PORT_ROC,4,2           ## @COMMAND_PORT_ROC
	.comm	_COMMAND_PORT_READ_TRANSFER,4,2 ## @COMMAND_PORT_READ_TRANSFER
	.comm	_COMMAND_PORT_TOC,4,2           ## @COMMAND_PORT_TOC
	.comm	_XFER_TIMEOUT,4,2               ## @XFER_TIMEOUT
	.no_dead_strip	_dw_i3c_master_i2c_xfers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dw_i3c_master_i2c_xfers
_dw_i3c_master_i2c_xfers:               ; @dw_i3c_master_i2c_xfers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_i2c_dev_get_master_data
	mov	x20, x0
	mov	x0, x19
	bl	_i2c_dev_get_master
	bl	_to_dw_i3c_master
	cbz	w22, LBB0_5
; %bb.1:
	ldr	w8, [x0]
	cmp	w8, w22
	b.lt	LBB0_8
; %bb.2:
	cmp	w22, #1
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	b.lt	LBB0_6
; %bb.3:
	mov	w21, #0
	mov	w24, #0
	add	x25, x23, #4
Lloh0:
	adrp	x26, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x26, [x26, _I2C_M_RD@GOTPAGEOFF]
	mov	w27, w22
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w19, w0, [x25, #-4]
	ldr	w28, [x26]
	mov	w1, #4
	bl	_DIV_ROUND_UP
	tst	w28, w19
	csel	w8, w0, wzr, eq
	add	w24, w24, w8
	csel	w8, wzr, w0, eq
	add	w21, w21, w8
	add	x25, x25, #12
	subs	x27, x27, #1
	b.ne	LBB0_4
	b	LBB0_7
LBB0_5:
	mov	w19, #0
	b	LBB0_10
LBB0_6:
	mov	w24, #0
	mov	w21, #0
LBB0_7:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w8, [x0, #4]
	cmp	w24, w8
	ccmp	w21, w8, #2, ls
	b.ls	LBB0_11
LBB0_8:
Lloh2:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	mov	x1, x22
	bl	_dw_i3c_master_alloc_xfer
	cbz	x0, LBB0_23
; %bb.12:
	mov	x21, x0
	subs	w25, w22, #1
	b.lt	LBB0_20
; %bb.13:
	mov	x24, #0
	add	x23, x23, #4
	mov	w26, #4
	mov	w28, w22
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x24, x24, #1
	add	x23, x23, #12
	add	x26, x26, #24
	cmp	x28, x24
	b.eq	LBB0_20
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x21, #8]
	ldr	w0, [x23]
	bl	_COMMAND_PORT_ARG_DATA_LEN
Lloh4:
	adrp	x8, _COMMAND_PORT_TRANSFER_ARG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _COMMAND_PORT_TRANSFER_ARG@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	orr	w8, w8, w0
	add	x19, x27, x26
	stur	w8, [x19, #-4]
	mov	x0, x24
	bl	_COMMAND_PORT_TID
	mov	x22, x0
	ldr	w0, [x20]
	bl	_COMMAND_PORT_DEV_INDEX
	orr	w8, w0, w22
Lloh7:
	adrp	x9, _COMMAND_PORT_ROC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _COMMAND_PORT_ROC@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
	ldur	w9, [x23, #-4]
Lloh10:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh11:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
Lloh13:
	adrp	x9, _COMMAND_PORT_READ_TRANSFER@GOTPAGE
Lloh14:
	ldr	x9, [x9, _COMMAND_PORT_READ_TRANSFER@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x27, x26]
	mov	w9, #24
	madd	x9, x24, x9, x27
	add	x9, x9, #16
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x9, x19, #4
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	d0, [x23]
	str	d0, [x9]
	cmp	x25, x24
	b.ne	LBB0_14
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
Lloh16:
	adrp	x9, _COMMAND_PORT_TOC@GOTPAGE
Lloh17:
	ldr	x9, [x9, _COMMAND_PORT_TOC@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x27, x26]
	b	LBB0_14
LBB0_20:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x21
	bl	_dw_i3c_master_enqueue_xfer
	add	x0, x21, #4
Lloh19:
	adrp	x8, _XFER_TIMEOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _XFER_TIMEOUT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_wait_for_completion_timeout
	cbnz	w0, LBB0_22
; %bb.21:
	mov	x0, x19
	mov	x1, x21
	bl	_dw_i3c_master_dequeue_xfer
LBB0_22:
	ldr	w19, [x21]
	mov	x0, x21
	bl	_dw_i3c_master_free_xfer
	b	LBB0_10
LBB0_23:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_COMMAND_PORT_TRANSFER_ARG,4,2  ; @COMMAND_PORT_TRANSFER_ARG
	.comm	_COMMAND_PORT_ROC,4,2           ; @COMMAND_PORT_ROC
	.comm	_COMMAND_PORT_READ_TRANSFER,4,2 ; @COMMAND_PORT_READ_TRANSFER
	.comm	_COMMAND_PORT_TOC,4,2           ; @COMMAND_PORT_TOC
	.comm	_XFER_TIMEOUT,4,2               ; @XFER_TIMEOUT
	.no_dead_strip	_dw_i3c_master_i2c_xfers
.subsections_via_symbols
