	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function media_request_ioctl_queue
_media_request_ioctl_queue:             ## @media_request_ioctl_queue
	.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	%rdi, %r13
	movq	16(%rdi), %r14
	movl	(%r14), %edi
	movl	8(%r13), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	4(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_media_request_get
	leaq	12(%r13), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	(%r13), %rbx
	movq	_MEDIA_REQUEST_STATE_IDLE@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rbx
	jne	LBB0_2
## %bb.1:
	movq	_MEDIA_REQUEST_STATE_VALIDATING@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	movq	%rbx, (%r13)
LBB0_2:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	_MEDIA_REQUEST_STATE_VALIDATING@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	8(%r14), %rax
	movq	%r13, %rdi
	callq	*(%rax)
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.5:
	movq	_MEDIA_REQUEST_STATE_QUEUED@GOTPCREL(%rip), %r15
LBB0_6:
	movq	(%r15), %rax
	movq	%rax, (%r13)
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	(%r14), %edi
	movl	8(%r13), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r13, %rdi
	callq	_media_request_put
	jmp	LBB0_9
LBB0_3:
	movl	(%r14), %r12d
	movl	8(%r13), %r14d
	movl	%ebx, %edi
	callq	_media_request_state_str
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%r12d, %edi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r13, %rdi
	callq	_media_request_put
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subq	(%rax), %r15
	jmp	LBB0_10
LBB0_7:
	movq	8(%r14), %rax
	movq	%r13, %rdi
	callq	*8(%rax)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_9:
	movslq	%ebx, %r15
LBB0_10:
	movq	%r15, %rax
	addq	$8, %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	"request: queue %s\n"

	.comm	_MEDIA_REQUEST_STATE_IDLE,8,3   ## @MEDIA_REQUEST_STATE_IDLE
	.comm	_MEDIA_REQUEST_STATE_VALIDATING,4,2 ## @MEDIA_REQUEST_STATE_VALIDATING
L_.str.1:                               ## @.str.1
	.asciz	"request: unable to queue %s, request in state %s\n"

	.comm	_EBUSY,8,3                      ## @EBUSY
	.comm	_MEDIA_REQUEST_STATE_QUEUED,8,3 ## @MEDIA_REQUEST_STATE_QUEUED
L_.str.2:                               ## @.str.2
	.asciz	"request: can't queue %s (%d)\n"

	.no_dead_strip	_media_request_ioctl_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function media_request_ioctl_queue
_media_request_ioctl_queue:             ; @media_request_ioctl_queue
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x23, [x0, #16]
	mov	x20, x23
	ldr	w0, [x20], #4
	ldr	w2, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	bl	_media_request_get
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x22, [x19]
Lloh2:
	adrp	x24, _MEDIA_REQUEST_STATE_IDLE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _MEDIA_REQUEST_STATE_IDLE@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh4:
	adrp	x25, _MEDIA_REQUEST_STATE_VALIDATING@GOTPAGE
Lloh5:
	ldr	x25, [x25, _MEDIA_REQUEST_STATE_VALIDATING@GOTPAGEOFF]
	cmp	x22, x8
	b.ne	LBB0_2
; %bb.1:
	ldrsw	x22, [x25]
	str	x22, [x19]
LBB0_2:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	w8, [x25]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x22, x0
	mov	x0, x21
	bl	_spin_lock_irqsave
Lloh6:
	adrp	x8, _MEDIA_REQUEST_STATE_QUEUED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEDIA_REQUEST_STATE_QUEUED@GOTPAGEOFF]
	cmp	w22, #0
	csel	x8, x8, x24, eq
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cbz	w22, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w0, [x23]
	ldr	w2, [x19, #8]
	mov	x8, x22
	str	x8, [sp]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	bl	_media_request_put
	b	LBB0_7
LBB0_5:
	ldr	w21, [x23]
	ldr	w23, [x19, #8]
	mov	x0, x22
	bl	_media_request_state_str
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_dbg
	mov	x0, x19
	bl	_media_request_put
	mov	x0, x20
	bl	_mutex_unlock
Lloh12:
	adrp	x8, _EBUSY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	neg	x0, x8
	b	LBB0_8
LBB0_6:
	ldr	x8, [x23, #8]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	mov	x0, x20
	bl	_mutex_unlock
LBB0_7:
	sxtw	x0, w22
LBB0_8:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"request: queue %s\n"

	.comm	_MEDIA_REQUEST_STATE_IDLE,8,3   ; @MEDIA_REQUEST_STATE_IDLE
	.comm	_MEDIA_REQUEST_STATE_VALIDATING,4,2 ; @MEDIA_REQUEST_STATE_VALIDATING
l_.str.1:                               ; @.str.1
	.asciz	"request: unable to queue %s, request in state %s\n"

	.comm	_EBUSY,8,3                      ; @EBUSY
	.comm	_MEDIA_REQUEST_STATE_QUEUED,8,3 ; @MEDIA_REQUEST_STATE_QUEUED
l_.str.2:                               ; @.str.2
	.asciz	"request: can't queue %s (%d)\n"

	.no_dead_strip	_media_request_ioctl_queue
.subsections_via_symbols
