	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usb_xfer
_usb_xfer:                              ## @usb_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movzbl	%r14b, %edx
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r14, %rcx
	testl	%ecx, %ecx
	jle	LBB0_17
## %bb.1:
	movl	%ecx, %r13d
	decl	%ecx
	xorl	%r14d, %r14d
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, %r13d
	testq	%r14, %r14
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_CMD_I2C_IO_BEGIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_CMD_I2C_IO@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	movl	$0, %eax
	cmpq	%r14, %rcx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_CMD_I2C_IO_END@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	%eax, %r13d
	movl	(%rbx), %r8d
	movl	4(%rbx), %r9d
	movq	_I2C_M_RD@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	andl	%r8d, %eax
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %rcx
	movl	16(%rbx), %eax
	movl	%eax, (%rsp)
	movzbl	%r14b, %edx
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	(%rbx), %edx
	movl	4(%rbx), %r9d
	movl	16(%rbx), %ecx
	movq	8(%rbx), %r8
	testl	%edx, (%r15)
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_usb_read
	cmpl	4(%rbx), %eax
	je	LBB0_12
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_usb_write
	cmpl	4(%rbx), %eax
	jne	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_CMD_GET_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-41(%rbp), %r8
	movl	$1, %r9d
	callq	_usb_read
	cmpl	$1, %eax
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movzbl	-41(%rbp), %edx
	movq	%r12, %rdi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movzbl	-41(%rbp), %eax
	movq	_STATUS_ADDRESS_NAK@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	addq	$24, %rbx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	cmpq	%r14, %r13
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_2
	jmp	LBB0_17
LBB0_13:
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_9
LBB0_11:
	leaq	L_.str.5(%rip), %rsi
LBB0_9:
	movq	%r12, %rdi
	callq	_dev_err
LBB0_15:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$40, %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	"master xfer %d messages:\n"

	.comm	_CMD_I2C_IO,4,2                 ## @CMD_I2C_IO
	.comm	_CMD_I2C_IO_BEGIN,4,2           ## @CMD_I2C_IO_BEGIN
	.comm	_CMD_I2C_IO_END,4,2             ## @CMD_I2C_IO_END
L_.str.1:                               ## @.str.1
	.asciz	"  %d: %s (flags %d) %d bytes to 0x%02x\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
L_.str.2:                               ## @.str.2
	.asciz	"read"

L_.str.3:                               ## @.str.3
	.asciz	"write"

L_.str.4:                               ## @.str.4
	.asciz	"failure reading data\n"

	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
L_.str.5:                               ## @.str.5
	.asciz	"failure writing data\n"

	.comm	_CMD_GET_STATUS,4,2             ## @CMD_GET_STATUS
L_.str.6:                               ## @.str.6
	.asciz	"failure reading status\n"

L_.str.7:                               ## @.str.7
	.asciz	"  status = %d\n"

	.comm	_STATUS_ADDRESS_NAK,1,0         ## @STATUS_ADDRESS_NAK
	.no_dead_strip	_usb_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usb_xfer
_usb_xfer:                              ; @usb_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
	and	w2, w2, #0xff
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	subs	w24, w19, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x25, #0
	mov	w26, w19
	add	x27, x21, #8
Lloh2:
	adrp	x28, _I2C_M_RD@GOTPAGE
Lloh3:
	ldr	x28, [x28, _I2C_M_RD@GOTPAGEOFF]
Lloh4:
	adrp	x22, l_.str.3@PAGE
Lloh5:
	add	x22, x22, l_.str.3@PAGEOFF
Lloh6:
	adrp	x21, l_.str.1@PAGE
Lloh7:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
Lloh8:
	adrp	x8, _CMD_I2C_IO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CMD_I2C_IO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _CMD_I2C_IO_BEGIN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CMD_I2C_IO_BEGIN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	x25, #0
	csel	w9, w9, wzr, eq
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _CMD_I2C_IO_END@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CMD_I2C_IO_END@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	x24, x25
	csel	w9, w9, wzr, eq
	orr	w23, w8, w9
	ldr	w8, [x28]
	ldp	w9, w10, [x27, #-8]
	tst	w8, w9
Lloh17:
	adrp	x8, l_.str.2@PAGE
Lloh18:
	add	x8, x8, l_.str.2@PAGEOFF
	csel	x8, x22, x8, eq
	ldr	w11, [x27, #8]
	stp	x10, x11, [sp, #16]
	stp	x8, x9, [sp]
	and	w2, w25, #0xff
	mov	x0, x20
	mov	x1, x21
	bl	_dev_dbg
	ldr	w8, [x28]
	ldr	w3, [x27, #8]
	ldr	x4, [x27]
	ldp	w2, w5, [x27, #-8]
	mov	x0, x20
	mov	x1, x23
	tst	w8, w2
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_usb_read
	ldur	w8, [x27, #-4]
	cmp	w0, w8
	b.eq	LBB0_5
	b	LBB0_10
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	bl	_usb_write
	ldur	w8, [x27, #-4]
	cmp	w0, w8
	b.ne	LBB0_11
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh19:
	adrp	x8, _CMD_GET_STATUS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CMD_GET_STATUS@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x4, sp, #47
	mov	x0, x20
	mov	w2, #0
	mov	w3, #0
	mov	w5, #1
	bl	_usb_read
	cmp	w0, #1
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrb	w2, [sp, #47]
	mov	x0, x20
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_dev_dbg
	ldrb	w8, [sp, #47]
Lloh24:
	adrp	x9, _STATUS_ADDRESS_NAK@GOTPAGE
Lloh25:
	ldr	x9, [x9, _STATUS_ADDRESS_NAK@GOTPAGEOFF]
	ldrb	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x25, x25, #1
	add	x27, x27, #24
	cmp	x26, x25
	b.ne	LBB0_2
	b	LBB0_14
LBB0_8:
	mov	w19, #0
	b	LBB0_14
LBB0_9:
Lloh26:
	adrp	x1, l_.str.6@PAGE
Lloh27:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_12
LBB0_10:
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh30:
	adrp	x1, l_.str.5@PAGE
Lloh31:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_dev_err
LBB0_13:
Lloh32:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"master xfer %d messages:\n"

	.comm	_CMD_I2C_IO,4,2                 ; @CMD_I2C_IO
	.comm	_CMD_I2C_IO_BEGIN,4,2           ; @CMD_I2C_IO_BEGIN
	.comm	_CMD_I2C_IO_END,4,2             ; @CMD_I2C_IO_END
l_.str.1:                               ; @.str.1
	.asciz	"  %d: %s (flags %d) %d bytes to 0x%02x\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
l_.str.2:                               ; @.str.2
	.asciz	"read"

l_.str.3:                               ; @.str.3
	.asciz	"write"

l_.str.4:                               ; @.str.4
	.asciz	"failure reading data\n"

	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
l_.str.5:                               ; @.str.5
	.asciz	"failure writing data\n"

	.comm	_CMD_GET_STATUS,4,2             ; @CMD_GET_STATUS
l_.str.6:                               ; @.str.6
	.asciz	"failure reading status\n"

l_.str.7:                               ; @.str.7
	.asciz	"  status = %d\n"

	.comm	_STATUS_ADDRESS_NAK,1,0         ; @STATUS_ADDRESS_NAK
	.no_dead_strip	_usb_xfer
.subsections_via_symbols
