	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_local_lock
_handle_local_lock:                     ## @handle_local_lock
	.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, %r13d
	movq	%rsi, %r15
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movl	(%rax), %edi
	callq	_HEADER_GET_TCODE
	movl	%eax, %ebx
	movq	(%r15), %rax
	movl	12(%rax), %edi
	callq	_HEADER_GET_DATA_LENGTH
	movl	%eax, %r12d
	movq	(%r15), %rax
	movq	8(%r15), %r14
	movl	12(%rax), %edi
	callq	_HEADER_GET_EXTENDED_TCODE
	movq	_TCODE_LOCK_REQUEST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_6
## %bb.1:
	movq	_EXTCODE_COMPARE_SWAP@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.2:
	cmpl	$8, %r12d
	jne	LBB0_6
## %bb.3:
	movl	(%r14), %edi
	callq	_be32_to_cpu
	movl	%eax, %r12d
	movl	4(%r14), %edi
	callq	_be32_to_cpu
	movl	%eax, %edx
	jmp	LBB0_4
LBB0_6:
	movq	_TCODE_READ_QUADLET_REQUEST@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	movl	$0, %edx
	cmpl	(%rax), %ebx
	jne	LBB0_7
LBB0_4:
	movq	_CSR_BUS_MANAGER_ID@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	leal	3(%r13), %ebx
	testl	%r13d, %r13d
	cmovnsl	%r13d, %ebx
	sarl	$2, %ebx
	movq	_OHCI1394_CSRData@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_reg_write
	movq	_OHCI1394_CSRCompareData@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_reg_write
	movq	_OHCI1394_CSRControl@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_reg_write
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_reg_read
	testl	%eax, %eax
	js	LBB0_5
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_fw_notify
	jmp	LBB0_9
LBB0_7:
	movq	(%r15), %rsi
	movq	_RCODE_TYPE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-72(%rbp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_fw_fill_response
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_5:
	movq	_OHCI1394_CSRData@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_reg_read
	movl	%eax, %edi
	callq	_cpu_to_be32
	movl	%eax, -44(%rbp)
LBB0_9:
	movq	(%r15), %rsi
	movq	_RCODE_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-72(%rbp), %rdi
	leaq	-44(%rbp), %rcx
	movl	$4, %r8d
	callq	_fw_fill_response
LBB0_10:
	leaq	-72(%rbp), %rsi
	movq	%r13, %rdi
	callq	_fw_core_handle_response
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TCODE_LOCK_REQUEST,4,2         ## @TCODE_LOCK_REQUEST
	.comm	_EXTCODE_COMPARE_SWAP,4,2       ## @EXTCODE_COMPARE_SWAP
	.comm	_TCODE_READ_QUADLET_REQUEST,4,2 ## @TCODE_READ_QUADLET_REQUEST
	.comm	_RCODE_TYPE_ERROR,4,2           ## @RCODE_TYPE_ERROR
	.comm	_CSR_BUS_MANAGER_ID,4,2         ## @CSR_BUS_MANAGER_ID
	.comm	_OHCI1394_CSRData,4,2           ## @OHCI1394_CSRData
	.comm	_OHCI1394_CSRCompareData,4,2    ## @OHCI1394_CSRCompareData
	.comm	_OHCI1394_CSRControl,4,2        ## @OHCI1394_CSRControl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"swap not done yet\n"

	.comm	_RCODE_COMPLETE,4,2             ## @RCODE_COMPLETE
	.no_dead_strip	_handle_local_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_local_lock
_handle_local_lock:                     ; @handle_local_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1]
	ldr	w0, [x8]
	bl	_HEADER_GET_TCODE
	mov	x22, x0
	ldr	x8, [x20]
	ldr	w0, [x8, #12]
	bl	_HEADER_GET_DATA_LENGTH
	mov	x23, x0
	ldp	x8, x24, [x20]
	ldr	w0, [x8, #12]
	bl	_HEADER_GET_EXTENDED_TCODE
Lloh0:
	adrp	x8, _TCODE_LOCK_REQUEST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TCODE_LOCK_REQUEST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EXTCODE_COMPARE_SWAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EXTCODE_COMPARE_SWAP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	ccmp	w23, #8, #0, eq
	b.eq	LBB0_5
LBB0_2:
Lloh6:
	adrp	x8, _TCODE_READ_QUADLET_REQUEST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TCODE_READ_QUADLET_REQUEST@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_4
; %bb.3:
	mov	w22, #0
	mov	w2, #0
	b	LBB0_6
LBB0_4:
	ldr	x1, [x20]
Lloh9:
	adrp	x8, _RCODE_TYPE_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RCODE_TYPE_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x0, sp, #16
	mov	x3, #0
	mov	w4, #0
	b	LBB0_10
LBB0_5:
	ldr	w0, [x24]
	bl	_be32_to_cpu
	mov	x22, x0
	ldr	w0, [x24, #4]
	bl	_be32_to_cpu
	mov	x2, x0
LBB0_6:
Lloh12:
	adrp	x8, _CSR_BUS_MANAGER_ID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CSR_BUS_MANAGER_ID@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	sub	w8, w21, w8
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w21, w8, #2
Lloh15:
	adrp	x23, _OHCI1394_CSRData@GOTPAGE
Lloh16:
	ldr	x23, [x23, _OHCI1394_CSRData@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_reg_write
Lloh17:
	adrp	x8, _OHCI1394_CSRCompareData@GOTPAGE
Lloh18:
	ldr	x8, [x8, _OHCI1394_CSRCompareData@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_reg_write
Lloh20:
	adrp	x22, _OHCI1394_CSRControl@GOTPAGE
Lloh21:
	ldr	x22, [x22, _OHCI1394_CSRControl@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_reg_write
	ldr	w1, [x22]
	mov	x0, x19
	bl	_reg_read
	tbnz	w0, #31, LBB0_8
; %bb.7:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fw_notify
	b	LBB0_9
LBB0_8:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_reg_read
	bl	_cpu_to_be32
	str	w0, [sp, #12]
LBB0_9:
	ldr	x1, [x20]
Lloh24:
	adrp	x8, _RCODE_COMPLETE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RCODE_COMPLETE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	add	x0, sp, #16
	add	x3, sp, #12
	mov	w4, #4
LBB0_10:
	bl	_fw_fill_response
	add	x1, sp, #16
	mov	x0, x19
	bl	_fw_core_handle_response
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_TCODE_LOCK_REQUEST,4,2         ; @TCODE_LOCK_REQUEST
	.comm	_EXTCODE_COMPARE_SWAP,4,2       ; @EXTCODE_COMPARE_SWAP
	.comm	_TCODE_READ_QUADLET_REQUEST,4,2 ; @TCODE_READ_QUADLET_REQUEST
	.comm	_RCODE_TYPE_ERROR,4,2           ; @RCODE_TYPE_ERROR
	.comm	_CSR_BUS_MANAGER_ID,4,2         ; @CSR_BUS_MANAGER_ID
	.comm	_OHCI1394_CSRData,4,2           ; @OHCI1394_CSRData
	.comm	_OHCI1394_CSRCompareData,4,2    ; @OHCI1394_CSRCompareData
	.comm	_OHCI1394_CSRControl,4,2        ; @OHCI1394_CSRControl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"swap not done yet\n"

	.comm	_RCODE_COMPLETE,4,2             ; @RCODE_COMPLETE
	.no_dead_strip	_handle_local_lock
.subsections_via_symbols
