	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsb_reset
_rsb_reset:                             ## @rsb_reset
	.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	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_RSB_LOCK
	movq	_RSB_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_SOFT_RESET@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r13, %rdi
	callq	_RSB_WRITE
	movq	_RSB_RESET_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.1:
	incl	%ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_RSB_READ
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%ebx
	cmpl	$1, %ebx
	jg	LBB0_2
## %bb.5:
	movq	%r13, %rdi
	callq	_RSB_UNLOCK
	jmp	LBB0_6
LBB0_7:
	movq	%r13, %rdi
	callq	_RSB_UNLOCK
	testl	%ebx, %ebx
	jne	LBB0_8
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	movq	%r13, %rdi
	callq	_RSB_UNLOCK
LBB0_8:
	movq	_IIC_ENOADDR@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RSB_CTRL,4,2                   ## @RSB_CTRL
	.comm	_SOFT_RESET,4,2                 ## @SOFT_RESET
	.comm	_RSB_RESET_RETRY,4,2            ## @RSB_RESET_RETRY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"soft reset timeout\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_IIC_ENOADDR,4,2                ## @IIC_ENOADDR
	.no_dead_strip	_rsb_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsb_reset
_rsb_reset:                             ; @rsb_reset
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	bl	_device_get_softc
	mov	x20, x0
	bl	_RSB_LOCK
Lloh0:
	adrp	x21, _RSB_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RSB_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x22, _SOFT_RESET@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SOFT_RESET@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	bl	_RSB_WRITE
Lloh4:
	adrp	x8, _RSB_RESET_RETRY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _RSB_RESET_RETRY@GOTPAGEOFF]
Lloh6:
	ldr	w23, [x8]
	cmp	w23, #1
	b.lt	LBB0_5
; %bb.1:
	add	w23, w23, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	bl	_RSB_READ
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w23, w23, #1
	cmp	w23, #1
	b.gt	LBB0_2
; %bb.4:
	mov	x0, x20
	bl	_RSB_UNLOCK
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	bl	_RSB_UNLOCK
	cbnz	w23, LBB0_8
LBB0_6:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh9:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	mov	x0, x20
	bl	_RSB_UNLOCK
LBB0_8:
Lloh11:
	adrp	x8, _IIC_ENOADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IIC_ENOADDR@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_RSB_CTRL,4,2                   ; @RSB_CTRL
	.comm	_SOFT_RESET,4,2                 ; @SOFT_RESET
	.comm	_RSB_RESET_RETRY,4,2            ; @RSB_RESET_RETRY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"soft reset timeout\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_IIC_ENOADDR,4,2                ; @IIC_ENOADDR
	.no_dead_strip	_rsb_reset
.subsections_via_symbols
