	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lookup_existing_device
_lookup_existing_device:                ## @lookup_existing_device
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_fw_device
	movq	%rax, %r15
	movq	48(%rbx), %r14
	movq	%r12, %rdi
	callq	_is_fw_device
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_fw_device_rwsem@GOTPCREL(%rip), %rdi
	callq	_down_read
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movl	44(%r15), %edi
	movl	44(%rbx), %esi
	movl	$24, %edx
	callq	_memcmp
	xorl	%r13d, %r13d
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movq	%r15, %rdi
	addq	$40, %rdi
	movq	_FW_DEVICE_GONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_FW_DEVICE_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_atomic_cmpxchg
	movq	_FW_DEVICE_GONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movq	32(%rbx), %rcx
	movq	32(%r15), %rax
	movq	%rax, 32(%rbx)
	movq	%rbx, 8(%rax)
	movq	%rcx, 32(%r15)
	movq	%r15, 8(%rcx)
	movl	24(%rbx), %eax
	movl	%eax, 24(%r15)
	movl	(%rcx), %eax
	movq	%rcx, %rbx
	movl	%eax, 20(%r15)
	xorl	%eax, %eax
	callq	_smp_wmb
	movl	16(%r14), %eax
	movl	%eax, 16(%r15)
	movq	$0, 8(%r15)
	movq	%r12, %rdi
	callq	_dev_name
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_fw_notify
	movq	_fw_device_update@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_PREPARE_DELAYED_WORK
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_schedule_delayed_work
	movl	$1, %r13d
	cmpq	8(%r14), %rbx
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_fw_schedule_bm_work
LBB0_6:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movq	_fw_device_rwsem@GOTPCREL(%rip), %rdi
	callq	_up_read
	jmp	LBB0_7
LBB0_1:
	xorl	%r13d, %r13d
LBB0_7:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fw_device_rwsem,4,2            ## @fw_device_rwsem
	.comm	_FW_DEVICE_GONE,8,3             ## @FW_DEVICE_GONE
	.comm	_FW_DEVICE_RUNNING,4,2          ## @FW_DEVICE_RUNNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rediscovered device %s\n"

	.comm	_fw_device_update,4,2           ## @fw_device_update
	.no_dead_strip	_lookup_existing_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lookup_existing_device
_lookup_existing_device:                ; @lookup_existing_device
	.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	x22, x1
	mov	x21, x0
	bl	_fw_device
	mov	x20, x0
	ldr	x19, [x22, #48]
	mov	x0, x21
	bl	_is_fw_device
	cbz	w0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x0, _fw_device_rwsem@GOTPAGE
Lloh1:
	ldr	x0, [x0, _fw_device_rwsem@GOTPAGEOFF]
	bl	_down_read
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	w0, [x20, #44]
	ldr	w1, [x22, #44]
	mov	w2, #24
	bl	_memcmp
	cbnz	x0, LBB0_6
; %bb.2:
	add	x0, x20, #40
Lloh2:
	adrp	x23, _FW_DEVICE_GONE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _FW_DEVICE_GONE@GOTPAGEOFF]
	ldr	x1, [x23]
Lloh4:
	adrp	x8, _FW_DEVICE_RUNNING@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FW_DEVICE_RUNNING@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	bl	_atomic_cmpxchg
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:
	ldr	x23, [x22, #32]
	ldr	x8, [x20, #32]
	str	x8, [x22, #32]
	str	x22, [x8, #8]
	str	x23, [x20, #32]
	str	x20, [x23, #8]
	ldr	w8, [x22, #24]
	ldr	w9, [x23]
	stp	w9, w8, [x20, #20]
	bl	_smp_wmb
	ldr	w8, [x19, #16]
	str	w8, [x20, #16]
	str	xzr, [x20, #8]
	mov	x0, x21
	bl	_dev_name
	mov	x1, x0
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fw_notify
Lloh9:
	adrp	x8, _fw_device_update@GOTPAGE
Lloh10:
	ldr	x8, [x8, _fw_device_update@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_PREPARE_DELAYED_WORK
	mov	x0, x20
	mov	w1, #0
	bl	_schedule_delayed_work
	ldr	x8, [x19, #8]
	cmp	x23, x8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	mov	w1, #0
	bl	_fw_schedule_bm_work
LBB0_5:
	mov	w20, #1
	b	LBB0_7
LBB0_6:
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	bl	_spin_unlock_irq
Lloh12:
	adrp	x0, _fw_device_rwsem@GOTPAGE
Lloh13:
	ldr	x0, [x0, _fw_device_rwsem@GOTPAGEOFF]
	bl	_up_read
	b	LBB0_9
LBB0_8:
	mov	w20, #0
LBB0_9:
	mov	x0, x20
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_fw_device_rwsem,4,2            ; @fw_device_rwsem
	.comm	_FW_DEVICE_GONE,8,3             ; @FW_DEVICE_GONE
	.comm	_FW_DEVICE_RUNNING,4,2          ; @FW_DEVICE_RUNNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rediscovered device %s\n"

	.comm	_fw_device_update,4,2           ; @fw_device_update
	.no_dead_strip	_lookup_existing_device
.subsections_via_symbols
