	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fw_device_op_mmap
_fw_device_op_mmap:                     ## @fw_device_op_mmap
	.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, %r15
	movq	(%rdi), %r13
	movq	8(%r13), %rdi
	callq	_fw_device_is_shutdown
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	cmpq	$0, 16(%r13)
	je	LBB0_5
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	_VM_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.7:
	movl	4(%r15), %ecx
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	testl	%edx, %ecx
	jne	LBB0_6
## %bb.8:
	movslq	%ecx, %rcx
	movl	%ecx, (%r13)
	movq	8(%r15), %rsi
	subq	%rcx, %rsi
	movslq	(%rax), %rax
	notq	%rax
	testq	%rax, %rsi
	je	LBB0_9
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	16(%r13), %r14
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %rsi
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_fw_iso_buffer_alloc
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	leaq	24(%r13), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	32(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.13:
	movq	8(%r13), %rax
	movl	(%rax), %ebx
	callq	_iso_dma_direction
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_fw_iso_buffer_map_dma
	movl	%eax, %ebx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	sete	%al
	movl	%eax, 4(%r13)
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	testl	%ebx, %ebx
	jns	LBB0_14
	jmp	LBB0_16
LBB0_10:
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_12:
	movq	%r12, %rdi
	callq	_spin_unlock_irq
LBB0_14:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_fw_iso_buffer_map_vma
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jns	LBB0_17
## %bb.15:
	movl	%eax, %ebx
LBB0_16:
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_fw_iso_buffer_destroy
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_VM_SHARED,4,2                  ## @VM_SHARED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.no_dead_strip	_fw_device_op_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fw_device_op_mmap
_fw_device_op_mmap:                     ; @fw_device_op_mmap
	.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	x20, x1
	ldr	x23, [x0]
	ldr	x0, [x23, #8]
	bl	_fw_device_is_shutdown
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_2:
	mov	x19, x23
	ldr	x8, [x19, #16]!
	cbz	x8, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	w8, [x20]
Lloh4:
	adrp	x9, _VM_SHARED@GOTPAGE
Lloh5:
	ldr	x9, [x9, _VM_SHARED@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	ldr	w9, [x20, #4]
Lloh7:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
	ldr	w10, [x8]
	bics	wzr, w9, w10
	b.ne	LBB0_7
; %bb.6:
	sxtw	x10, w9
	str	w9, [x23]
	ldr	x9, [x20, #8]
	sub	x9, x9, x10
	ldr	w8, [x8]
	mvn	w8, w8
	sxtw	x8, w8
	tst	x9, x8
	b.eq	LBB0_10
LBB0_7:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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
LBB0_10:
Lloh11:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	lsr	x1, x9, x8
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_fw_iso_buffer_alloc
	tbnz	w0, #31, LBB0_13
; %bb.11:
	add	x22, x23, #24
	mov	x0, x22
	bl	_spin_lock_irq
	ldr	x0, [x23, #32]
	cbz	x0, LBB0_14
; %bb.12:
	ldr	x8, [x23, #8]
	ldr	w21, [x8]
	bl	_iso_dma_direction
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_fw_iso_buffer_map_dma
	mov	x21, x0
	cmp	w0, #0
	cset	w8, eq
	str	w8, [x23, #4]
	mov	x0, x22
	bl	_spin_unlock_irq
	tbz	w21, #31, LBB0_15
	b	LBB0_18
LBB0_13:
	mov	x21, x0
	b	LBB0_9
LBB0_14:
	mov	x0, x22
	bl	_spin_unlock_irq
LBB0_15:
	mov	x0, x19
	mov	x1, x20
	bl	_fw_iso_buffer_map_vma
	tbnz	w0, #31, LBB0_17
; %bb.16:
	mov	w21, #0
	b	LBB0_9
LBB0_17:
	mov	x21, x0
LBB0_18:
	ldr	x8, [x23, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_fw_iso_buffer_destroy
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_VM_SHARED,4,2                  ; @VM_SHARED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.no_dead_strip	_fw_device_op_mmap
.subsections_via_symbols
