	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stm32_i2c_prep_dma_xfer        ## -- Begin function stm32_i2c_prep_dma_xfer
	.p2align	4, 0x90
_stm32_i2c_prep_dma_xfer:               ## @stm32_i2c_prep_dma_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	%r9d, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	xorl	%esi, %esi
	testl	%edx, %edx
	setne	%sil
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	cmoveq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rdx
	cmoveq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	32(%rbx,%rsi,8), %rsi
	movq	%rsi, 16(%rbx)
	movl	%edx, 28(%rbx)
	movl	%eax, (%rbx)
	movl	%ecx, 4(%rbx)
	movq	(%rsi), %rdx
	movq	(%rdx), %r15
	movq	%r15, %rdi
	movq	%r8, %rsi
	movl	%ecx, %edx
	movl	%eax, %ecx
	callq	_dma_map_single
	movl	%eax, 8(%rbx)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_7
LBB0_2:
	movq	16(%rbx), %rdi
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	movl	28(%rbx), %ecx
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_dmaengine_prep_slave_single
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r13
	leaq	24(%rbx), %rdi
	callq	_reinit_completion
	movl	%r12d, 8(%r13)
	movq	16(%rbp), %rax
	movq	%rax, (%r13)
	movq	%r13, %rdi
	callq	_dmaengine_submit
	movl	%eax, %edi
	callq	_dma_submit_error
	testl	%eax, %eax
	js	LBB0_5
## %bb.8:
	movq	16(%rbx), %rdi
	callq	_dma_async_issue_pending
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_6
LBB0_5:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_6:
	movl	8(%rbx), %esi
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	movq	%r15, %rdi
	callq	_dma_unmap_single
LBB0_7:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA mapping failed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DMA_PREP_INTERRUPT,4,2         ## @DMA_PREP_INTERRUPT
L_.str.1:                               ## @.str.1
	.asciz	"Not able to get desc for DMA xfer\n"

L_.str.2:                               ## @.str.2
	.asciz	"DMA submit failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stm32_i2c_prep_dma_xfer        ; -- Begin function stm32_i2c_prep_dma_xfer
	.p2align	2
_stm32_i2c_prep_dma_xfer:               ; @stm32_i2c_prep_dma_xfer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x6
	mov	x23, x5
	mov	x8, x3
	mov	x19, x1
	mov	x20, x0
	cmp	w2, #0
	mov	w9, #40
	mov	w10, #32
	csel	x9, x10, x9, eq
Lloh0:
	adrp	x10, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	adrp	x11, _DMA_FROM_DEVICE@GOTPAGE
Lloh3:
	ldr	x11, [x11, _DMA_FROM_DEVICE@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	ldr	w3, [x10]
Lloh4:
	adrp	x10, _DMA_MEM_TO_DEV@GOTPAGE
Lloh5:
	ldr	x10, [x10, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh6:
	adrp	x11, _DMA_DEV_TO_MEM@GOTPAGE
Lloh7:
	ldr	x11, [x11, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	ldr	w10, [x10]
	ldr	x9, [x1, x9]
	str	x9, [x1, #16]
	str	w10, [x1, #28]
	stp	w3, w8, [x1]
	ldr	x9, [x9]
	ldr	x21, [x9]
	mov	x0, x21
	mov	x1, x4
	mov	x2, x8
	bl	_dma_map_single
	mov	x1, x0
	str	w0, [x19, #8]
	mov	x0, x21
	bl	_dma_mapping_error
	cbz	x0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_2:
	ldr	x0, [x19, #16]
	ldp	w2, w1, [x19, #4]
	ldr	w3, [x19, #28]
Lloh13:
	adrp	x8, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
	bl	_dmaengine_prep_slave_single
	cbz	x0, LBB0_5
; %bb.3:
	mov	x24, x0
	add	x0, x19, #24
	bl	_reinit_completion
	str	w23, [x24, #8]
	str	x22, [x24]
	mov	x0, x24
	bl	_dmaengine_submit
	bl	_dma_submit_error
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	x0, [x19, #16]
	bl	_dma_async_issue_pending
	mov	w22, #0
	b	LBB0_8
LBB0_5:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_6:
	mov	x22, x0
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_7:
	ldp	w2, w1, [x19, #4]
	ldr	w3, [x19]
	mov	x0, x21
	bl	_dma_unmap_single
LBB0_8:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA mapping failed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DMA_PREP_INTERRUPT,4,2         ; @DMA_PREP_INTERRUPT
l_.str.1:                               ; @.str.1
	.asciz	"Not able to get desc for DMA xfer\n"

l_.str.2:                               ; @.str.2
	.asciz	"DMA submit failed\n"

.subsections_via_symbols
