	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st95hf_send_recv_cmd
_st95hf_send_recv_cmd:                  ## @st95hf_send_recv_cmd
	.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	%r8d, -68(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r14
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_CMD_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rcx
	movq	_cmd_array@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r15d, %ebx
	shlq	$5, %rbx
	cmpl	%r12d, (%rax,%rbx)
	jg	LBB0_1
## %bb.3:
	cmpl	%r13d, 4(%rax,%rbx)
	jl	LBB0_1
## %bb.4:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15), %rdx
	testl	%r13d, %r13d
	je	LBB0_6
## %bb.5:
	testq	%r14, %r14
	jne	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.20:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rbx), %rsi
	addq	$4, %rsi
	movq	_ST95HF_COMMAND_SEND@GOTPCREL(%rip), %rdx
	movb	(%rdx), %dl
	movb	%dl, (%rcx)
	movb	8(%rax,%rbx), %dl
	movb	%dl, 1(%rcx)
	movzbl	(%rsi), %edx
	movb	%dl, 2(%rcx)
	movq	%rcx, %rdi
	addq	$3, %rdi
	movl	24(%rax,%rbx), %esi
	movq	%rcx, %r12
	callq	_memcpy
	movq	_cmd_array@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	testl	%r13d, %r13d
	jle	LBB0_10
## %bb.7:
	leaq	(%r8,%rbx), %rcx
	addq	$4, %rcx
	movl	%r13d, %r9d
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r14,%rdx,8), %rdi
	cmpl	(%rcx), %edi
	jge	LBB0_1
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movzbl	4(%r14,%rdx,8), %eax
	movb	%al, 3(%rdi,%r12)
	incq	%rdx
	cmpq	%rdx, %r9
	jne	LBB0_8
LBB0_10:
	movl	(%r8,%rbx), %edx
	movq	16(%r8,%rbx), %rcx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_st95hf_spi_send
	testl	%eax, %eax
	je	LBB0_14
## %bb.11:
	movl	%eax, %r15d
	movzbl	%r15b, %edx
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	jmp	LBB0_12
LBB0_14:
	xorl	%r15d, %r15d
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_12
## %bb.15:
	movq	_cmd_array@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SYNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, 16(%rax,%rbx)
	jne	LBB0_12
## %bb.16:
	leaq	-50(%rbp), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_st95hf_spi_recv_response
	testl	%eax, %eax
	js	LBB0_17
## %bb.18:
	movb	-50(%rbp), %al
	testb	%al, %al
	je	LBB0_12
## %bb.19:
	movzbl	%al, %edx
	leaq	L_.str.2(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_17:
	movl	%eax, %r14d
	movzbl	%r14b, %edx
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movl	%r14d, %r15d
	jmp	LBB0_12
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_CMD_LEN,4,2                ## @MAX_CMD_LEN
	.comm	_cmd_array,8,3                  ## @cmd_array
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ST95HF_COMMAND_SEND,1,0        ## @ST95HF_COMMAND_SEND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"st95hf_spi_send failed with error %d\n"

	.comm	_SYNC,8,3                       ## @SYNC
L_.str.1:                               ## @.str.1
	.asciz	"spi error from st95hf_spi_recv_response(), err = 0x%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"st95hf error from st95hf_spi_recv_response(), err = 0x%x\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_st95hf_send_recv_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st95hf_send_recv_cmd
_st95hf_send_recv_cmd:                  ; @st95hf_send_recv_cmd
	.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	x21, x4
	mov	x23, x3
	mov	x24, x2
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _MAX_CMD_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_CMD_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x10, x10, #0x1fffffff0
	sub	x22, x9, x10
	mov	sp, x22
Lloh8:
	adrp	x25, _cmd_array@GOTPAGE
Lloh9:
	ldr	x25, [x25, _cmd_array@GOTPAGEOFF]
	ldr	x9, [x25]
	mov	w26, w1
	lsl	x10, x26, #5
	ldr	w10, [x9, x10]
	cmp	w10, w8
	b.gt	LBB0_4
; %bb.1:
	add	x8, x9, x26, lsl #5
	ldr	w10, [x8, #4]!
	cmp	w10, w24
	b.lt	LBB0_4
; %bb.2:
	ldr	x20, [x19]
	cbz	w24, LBB0_8
; %bb.3:
	cbnz	x23, LBB0_8
LBB0_4:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_6:
	ldur	x8, [x29, #-72]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.7:
	mov	x0, x22
	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_8:
Lloh15:
	adrp	x10, _ST95HF_COMMAND_SEND@GOTPAGE
Lloh16:
	ldr	x10, [x10, _ST95HF_COMMAND_SEND@GOTPAGEOFF]
	ldrb	w10, [x10]
	strb	w10, [x22]
	add	x9, x9, x26, lsl #5
	ldrb	w10, [x9, #8]
	strb	w10, [x22, #1]
	ldrb	w2, [x8]
	strb	w2, [x22, #2]
	add	x0, x22, #3
	ldr	w1, [x9, #24]
	bl	_memcpy
	ldr	x8, [x25]
	cmp	w24, #1
	b.lt	LBB0_12
; %bb.9:
	add	x9, x8, x26, lsl #5
	add	x9, x9, #4
	mov	w10, w24
	add	x11, x23, #4
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldursw	x12, [x11, #-4]
	ldr	w13, [x9]
	cmp	w12, w13
	b.ge	LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldrb	w13, [x11], #8
	add	x12, x12, x22
	strb	w13, [x12, #3]
	subs	x10, x10, #1
	b.ne	LBB0_10
LBB0_12:
	add	x8, x8, x26, lsl #5
	ldr	w2, [x8]
	ldr	x3, [x8, #16]
	mov	x0, x19
	mov	x1, x22
	bl	_st95hf_spi_send
	mov	x22, x0
	cbz	w0, LBB0_15
; %bb.13:
	and	w2, w22, #0xff
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
LBB0_14:
	mov	x0, x20
	bl	_dev_err
	b	LBB0_6
LBB0_15:
	cbz	w21, LBB0_6
; %bb.16:
	ldr	x8, [x25]
	add	x8, x8, x26, lsl #5
	ldr	x8, [x8, #16]
Lloh19:
	adrp	x9, _SYNC@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SYNC@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.17:
	sub	x1, x29, #74
	mov	x0, x19
	bl	_st95hf_spi_recv_response
	tbnz	w0, #31, LBB0_20
; %bb.18:
	ldurb	w2, [x29, #-74]
	cbz	w2, LBB0_21
; %bb.19:
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh24:
	adrp	x8, _EIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_5
LBB0_20:
	mov	x22, x0
	and	w2, w0, #0xff
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_21:
	mov	w22, #0
	b	LBB0_6
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_CMD_LEN,4,2                ; @MAX_CMD_LEN
	.comm	_cmd_array,8,3                  ; @cmd_array
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ST95HF_COMMAND_SEND,1,0        ; @ST95HF_COMMAND_SEND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"st95hf_spi_send failed with error %d\n"

	.comm	_SYNC,8,3                       ; @SYNC
l_.str.1:                               ; @.str.1
	.asciz	"spi error from st95hf_spi_recv_response(), err = 0x%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"st95hf error from st95hf_spi_recv_response(), err = 0x%x\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_st95hf_send_recv_cmd
.subsections_via_symbols
