	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsi_usb_card_write
_rsi_usb_card_write:                    ## @rsi_usb_card_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	(%rdi), %r13
	movq	(%r13), %r14
	movq	8(%r13), %rax
	movslq	%ecx, %rcx
	movl	-4(%rax,%rcx,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_RSI_USB_TX_HEAD_ROOM@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	addl	%ebx, %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_memset
	movslq	(%r12), %rax
	leaq	(%r14,%rax,4), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	addl	(%r12), %ebx
	movl	%ebx, -48(%rbp)
	movl	20(%r13), %r15d
	movl	%r15d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_usb_sndbulkpipe
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	(%rcx,%rcx,4), %r9d
	leaq	-48(%rbp), %r8
	movl	%r15d, %edi
	movl	%eax, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	callq	_usb_bulk_msg
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movq	_ERR_ZONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_rsi_dbg
	movl	$1, 16(%r13)
LBB0_2:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RSI_USB_TX_HEAD_ROOM,4,2       ## @RSI_USB_TX_HEAD_ROOM
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ERR_ZONE,4,2                   ## @ERR_ZONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Card write failed with error code :%10d\n"

	.no_dead_strip	_rsi_usb_card_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsi_usb_card_write
_rsi_usb_card_write:                    ; @rsi_usb_card_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x2
	mov	x20, x1
	ldr	x23, [x0]
	ldp	x21, x8, [x23]
	sub	w9, w3, #1
	ldr	w22, [x8, w9, sxtw #2]
Lloh0:
	adrp	x24, _RSI_USB_TX_HEAD_ROOM@GOTPAGE
Lloh1:
	ldr	x24, [x24, _RSI_USB_TX_HEAD_ROOM@GOTPAGEOFF]
	ldr	w8, [x24]
	add	w2, w8, w2
	mov	x0, x21
	mov	w1, #0
	bl	_memset
	ldrsw	x8, [x24]
	add	x0, x21, x8, lsl #2
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
	ldr	w8, [x24]
	add	w19, w8, w19
	str	w19, [sp, #12]
	ldr	w20, [x23, #20]
	mov	x0, x20
	mov	x1, x22
	bl	_usb_sndbulkpipe
	mov	x1, x0
Lloh2:
	adrp	x8, _HZ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	add	w5, w8, w8, lsl #2
	add	x4, sp, #12
	mov	x0, x20
	mov	x2, x21
	mov	x3, x19
	bl	_usb_bulk_msg
	mov	x19, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _ERR_ZONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_ZONE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_rsi_dbg
	mov	w8, #1
	str	w8, [x23, #16]
LBB0_2:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_RSI_USB_TX_HEAD_ROOM,4,2       ; @RSI_USB_TX_HEAD_ROOM
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ERR_ZONE,4,2                   ; @ERR_ZONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Card write failed with error code :%10d\n"

	.no_dead_strip	_rsi_usb_card_write
.subsections_via_symbols
