	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st21nfca_hci_i2c_write
_st21nfca_hci_i2c_write:                ## @st21nfca_hci_i2c_write
	.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
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %r14
	movq	_ST21NFCA_HCI_LLC_MAX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_I2C_DUMP_SKB
	movq	(%rbx), %r15
	testq	%r15, %r15
	jne	LBB0_19
## %bb.1:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_st21nfca_hci_add_len_crc
	movq	_ST21NFCA_SOF_EOF@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_skb_put_u8
	movl	(%r14), %r15d
	movl	$1, %ebx
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_skb_push
	movl	%r15d, (%rax)
	movq	(%r12), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r13)
	movl	8(%r12), %ecx
	movl	$1, %r9d
	cmpl	$3, %ecx
	jl	LBB0_8
## %bb.2:
	movl	%ecx, %r9d
	decl	%r9d
	movl	(%r14), %r10d
	movq	_ST21NFCA_ESCAPE_BYTE_STUFFING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_ST21NFCA_BYTE_STUFFING_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	$1, %ebx
	movl	$1, %edi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%esi, (%r13,%rcx,4)
	leal	1(%rcx), %ebx
	movl	(%rax,%rdi,4), %edx
	xorl	%r8d, %edx
	movl	%edx, 4(%r13,%rcx,4)
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdi
	incl	%ebx
	cmpq	%rdi, %r9
	je	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rdi,4), %edx
	movslq	%ebx, %rcx
	cmpl	%r10d, %edx
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%esi, %edx
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%edx, (%r13,%rcx,4)
	jmp	LBB0_7
LBB0_8:
	movl	(%rax,%r9,4), %eax
	movslq	%ebx, %rcx
	movl	%eax, (%r13,%rcx,4)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_wait_tab@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_21
## %bb.9:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	incl	%ebx
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_i2c_master_send
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r15), %rax
	movl	-4(%rax,%r12,4), %edi
	callq	_msleep
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r12
	jge	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%r12
	testl	%r14d, %r14d
	js	LBB0_10
LBB0_14:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	testl	%r14d, %r14d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	js	LBB0_15
## %bb.16:
	xorl	%r15d, %r15d
	cmpl	%ebx, %r14d
	je	LBB0_18
## %bb.17:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_21:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	$-1, %r15d
	jmp	LBB0_18
LBB0_15:
	movl	%r14d, %r15d
LBB0_18:
	movq	%r12, %rdi
	callq	_st21nfca_hci_remove_len_crc
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.20:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ST21NFCA_HCI_LLC_MAX_SIZE,4,2  ## @ST21NFCA_HCI_LLC_MAX_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"st21nfca_hci_i2c_write"

	.comm	_ST21NFCA_SOF_EOF,4,2           ## @ST21NFCA_SOF_EOF
	.comm	_ST21NFCA_ESCAPE_BYTE_STUFFING,4,2 ## @ST21NFCA_ESCAPE_BYTE_STUFFING
	.comm	_ST21NFCA_BYTE_STUFFING_MASK,4,2 ## @ST21NFCA_BYTE_STUFFING_MASK
	.comm	_wait_tab,8,3                   ## @wait_tab
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_st21nfca_hci_i2c_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st21nfca_hci_i2c_write
_st21nfca_hci_i2c_write:                ; @st21nfca_hci_i2c_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x20, [x0, #16]
Lloh3:
	adrp	x8, _ST21NFCA_HCI_LLC_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ST21NFCA_HCI_LLC_MAX_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	w8, w8, #1
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_I2C_DUMP_SKB
	ldr	x23, [x22]
	cbnz	x23, LBB0_20
; %bb.1:
	mov	x0, x19
	bl	_st21nfca_hci_add_len_crc
Lloh10:
	adrp	x24, _ST21NFCA_SOF_EOF@GOTPAGE
Lloh11:
	ldr	x24, [x24, _ST21NFCA_SOF_EOF@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_skb_put_u8
	ldr	w25, [x24]
	mov	w23, #1
	mov	x0, x19
	mov	w1, #1
	bl	_skb_push
	str	w25, [x0]
	ldr	x8, [x19]
	ldr	w9, [x8]
	str	w9, [x21]
	ldr	w9, [x19, #8]
	cmp	w9, #3
	b.lt	LBB0_7
; %bb.2:
	sub	w23, w9, #1
	ldr	w9, [x24]
Lloh12:
	adrp	x10, _ST21NFCA_ESCAPE_BYTE_STUFFING@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ST21NFCA_ESCAPE_BYTE_STUFFING@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
Lloh15:
	adrp	x11, _ST21NFCA_BYTE_STUFFING_MASK@GOTPAGE
Lloh16:
	ldr	x11, [x11, _ST21NFCA_BYTE_STUFFING_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	add	x12, x8, #4
	sub	x13, x23, #1
	mov	w24, #1
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	w15, [x21, x14, lsl #2]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w24, w24, #1
	add	x12, x12, #4
	subs	x13, x13, #1
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w15, [x12]
	sxtw	x14, w24
	cmp	w15, w9
	ccmp	w15, w10, #4, ne
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w10, [x21, x14, lsl #2]
	add	x24, x14, #1
	ldr	w14, [x12]
	eor	w14, w11, w14
	str	w14, [x21, x24, lsl #2]
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	b	LBB0_4
LBB0_7:
	mov	x24, x23
LBB0_8:
	ldr	w8, [x8, x23, lsl #2]
	str	w8, [x21, w24, sxtw #2]
	add	x22, x22, #8
	mov	x0, x22
	bl	_mutex_lock
Lloh18:
	adrp	x25, _wait_tab@GOTPAGE
Lloh19:
	ldr	x25, [x25, _wait_tab@GOTPAGEOFF]
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_17
; %bb.9:
	mov	x26, #0
	add	w24, w24, #1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x24
	bl	_i2c_master_send
	mov	x23, x0
	tbz	w0, #31, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x25]
	ldr	w0, [x8, x26, lsl #2]
	bl	_msleep
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	add	x26, x26, #1
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cmp	x26, w0, sxtw
	b.ge	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	tbnz	w23, #31, LBB0_10
LBB0_14:
	mov	x0, x22
	bl	_mutex_unlock
	tbnz	w23, #31, LBB0_19
; %bb.15:
	cmp	w23, w24
	b.ne	LBB0_18
; %bb.16:
	mov	w23, #0
	b	LBB0_19
LBB0_17:
	mov	x0, x22
	bl	_mutex_unlock
	mov	w23, #-1
	b	LBB0_19
LBB0_18:
Lloh20:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_19:
	mov	x0, x19
	bl	_st21nfca_hci_remove_len_crc
LBB0_20:
	ldur	x8, [x29, #-72]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	mov	x0, x23
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ST21NFCA_HCI_LLC_MAX_SIZE,4,2  ; @ST21NFCA_HCI_LLC_MAX_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"st21nfca_hci_i2c_write"

	.comm	_ST21NFCA_SOF_EOF,4,2           ; @ST21NFCA_SOF_EOF
	.comm	_ST21NFCA_ESCAPE_BYTE_STUFFING,4,2 ; @ST21NFCA_ESCAPE_BYTE_STUFFING
	.comm	_ST21NFCA_BYTE_STUFFING_MASK,4,2 ; @ST21NFCA_BYTE_STUFFING_MASK
	.comm	_wait_tab,8,3                   ; @wait_tab
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_st21nfca_hci_i2c_write
.subsections_via_symbols
