	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_send_and_receive               ## -- Begin function send_and_receive
	.p2align	4, 0x90
_send_and_receive:                      ## @send_and_receive
	.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, %r15d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movl	%esi, %r13d
	movl	%edi, %ebx
	callq	_IS_VALID_CARD
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	24(%rbp), %r10
	movb	16(%rbp), %cl
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	%r15d, %esi
	movslq	%ebx, %r15
	movq	(%rdx,%r15,8), %rdx
	movl	$1, (%rdx)
	movzbl	%cl, %eax
	movzbl	%r14b, %edx
	movzbl	%r12b, %ecx
	movzbl	-44(%rbp), %r8d                 ## 1-byte Folded Reload
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movzbl	%sil, %r9d
	movl	%ebx, %edi
	movl	%r13d, %esi
	pushq	%r10
	pushq	%rax
	callq	_sendmessage
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_3
## %bb.11:
	movq	_sc_adapter@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movl	4(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movl	$0, (%rax)
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_3:
	movl	40(%rbp), %ebx
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.4:
	leaq	L_.str.2(%rip), %r13
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	decl	%ebx
	je	LBB0_13
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_schedule_timeout_interruptible
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rax
	cmpb	%r14b, 8(%rax)
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpb	%r12b, 9(%rax)
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpb	%cl, 10(%rax)
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpb	%cl, 11(%rax)
	jne	LBB0_12
## %bb.9:
	movl	4(%rax), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_sc_adapter@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rsi
	addq	$8, %rsi
	movq	32(%rbp), %rdi
	movl	$4, %edx
	callq	_memcpy
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movl	$0, (%rax)
	jmp	LBB0_15
LBB0_10:
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rax
LBB0_13:
	movl	4(%rax), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rax
	movl	$0, (%rax)
	movq	_ETIME@GOTPCREL(%rip), %rax
LBB0_14:
	subl	(%rax), %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid param: %d is not a valid card id\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_sc_adapter,8,3                 ## @sc_adapter
L_.str.1:                               ## @.str.1
	.asciz	"%s: SendMessage failed in SAR\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"SAR waiting..\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: Got ASYNC message\n"

L_.str.4:                               ## @.str.4
	.asciz	"%s: SAR message timeout\n"

	.comm	_ETIME,4,2                      ## @ETIME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_send_and_receive               ; -- Begin function send_and_receive
	.p2align	2
_send_and_receive:                      ; @send_and_receive
	.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	x23, x7
	mov	x24, x6
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x25, x1
	mov	x26, x0
	bl	_IS_VALID_CARD
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x27, _sc_adapter@GOTPAGE
Lloh1:
	ldr	x27, [x27, _sc_adapter@GOTPAGEOFF]
	ldr	x8, [x27]
	sxtw	x28, w26
	ldr	x8, [x8, w26, sxtw #3]
	mov	w9, #1
	str	w9, [x8]
	mov	x0, x26
	mov	x1, x25
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	mov	x5, x19
	mov	x6, x24
	mov	x7, x23
	bl	_sendmessage
	cbz	w0, LBB0_4
; %bb.2:
	ldr	x8, [x27]
	lsl	x19, x28, #3
	ldr	x8, [x8, x19]
	ldr	w8, [x8, #4]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x27]
	ldr	x8, [x8, x19]
	str	wzr, [x8]
Lloh4:
	adrp	x8, _EIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_14
LBB0_3:
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
	str	x26, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_4:
	ldr	w25, [x29, #24]
	cmp	w25, #1
	b.lt	LBB0_12
; %bb.5:
	ldr	x23, [x29, #16]
Lloh10:
	adrp	x24, l_.str.2@PAGE
Lloh11:
	add	x24, x24, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	subs	w25, w25, #1
	b.eq	LBB0_13
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_schedule_timeout_interruptible
	mov	x0, x24
	bl	_pr_debug
	ldr	x8, [x27]
	ldr	x8, [x8, x28, lsl #3]
	ldrb	w9, [x8, #8]
	cmp	w9, w22
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldrb	w9, [x8, #9]
	cmp	w9, w21
	b.ne	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldrb	w9, [x8, #10]
	cmp	w9, w20
	b.ne	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldrb	w9, [x8, #11]
	cmp	w9, w19
	b.ne	LBB0_6
; %bb.11:
	ldr	w8, [x8, #4]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x27]
	lsl	x19, x28, #3
	ldr	x8, [x8, x19]
	add	x1, x8, #8
	mov	x0, x23
	mov	w2, #4
	bl	_memcpy
	mov	w0, #0
	ldr	x8, [x27]
	ldr	x8, [x8, x19]
	str	wzr, [x8]
	b	LBB0_15
LBB0_12:
	ldr	x8, [x27]
	ldr	x8, [x8, x28, lsl #3]
LBB0_13:
	ldr	w8, [x8, #4]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x27]
	ldr	x8, [x8, x28, lsl #3]
	str	wzr, [x8]
Lloh16:
	adrp	x8, _ETIME@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid param: %d is not a valid card id\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_sc_adapter,8,3                 ; @sc_adapter
l_.str.1:                               ; @.str.1
	.asciz	"%s: SendMessage failed in SAR\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"SAR waiting..\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: Got ASYNC message\n"

l_.str.4:                               ; @.str.4
	.asciz	"%s: SAR message timeout\n"

	.comm	_ETIME,4,2                      ; @ETIME
.subsections_via_symbols
