	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SDL_AMediaCodec_FakeFifo_dequeueInputBuffer ## -- Begin function SDL_AMediaCodec_FakeFifo_dequeueInputBuffer
	.p2align	4, 0x90
_SDL_AMediaCodec_FakeFifo_dequeueInputBuffer: ## @SDL_AMediaCodec_FakeFifo_dequeueInputBuffer
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 16(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_SDL_AMEDIA_ERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_8
LBB0_2:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	callq	_SDL_LockMutex
	movl	$-1, %r15d
	cmpq	$0, 16(%rbx)
	jne	LBB0_7
## %bb.3:
	movq	(%rbx), %rax
	movq	_FAKE_BUFFER_QUEUE_SIZE@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	cmpq	%rcx, %rax
	jl	LBB0_5
## %bb.4:
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	movslq	%r14d, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_SDL_CondWaitTimeout
	movq	(%rbx), %rax
	movq	(%r12), %rcx
LBB0_5:
	cmpq	%rcx, %rax
	jge	LBB0_7
## %bb.6:
	movl	8(%rbx), %r15d
LBB0_7:
	movl	24(%rbx), %edi
	callq	_SDL_UnlockMutex
	xorl	%eax, %eax
	cmpq	16(%rbx), %rax
	sbbl	%eax, %eax
	orl	%r15d, %eax
LBB0_8:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDL_AMEDIA_ERROR_UNKNOWN,4,2   ## @SDL_AMEDIA_ERROR_UNKNOWN
	.comm	_FAKE_BUFFER_QUEUE_SIZE,8,3     ## @FAKE_BUFFER_QUEUE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SDL_AMediaCodec_FakeFifo_dequeueInputBuffer ; -- Begin function SDL_AMediaCodec_FakeFifo_dequeueInputBuffer
	.p2align	2
_SDL_AMediaCodec_FakeFifo_dequeueInputBuffer: ; @SDL_AMediaCodec_FakeFifo_dequeueInputBuffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _SDL_AMEDIA_ERROR_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDL_AMEDIA_ERROR_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #24]
	bl	_SDL_LockMutex
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x19]
Lloh3:
	adrp	x21, _FAKE_BUFFER_QUEUE_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _FAKE_BUFFER_QUEUE_SIZE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.lt	LBB0_5
; %bb.4:
	ldp	w1, w0, [x19, #24]
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	bl	_SDL_CondWaitTimeout
	ldr	x8, [x19]
	ldr	x9, [x21]
LBB0_5:
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.6:
	ldr	w20, [x19, #8]
	b	LBB0_8
LBB0_7:
	mov	w20, #-1
LBB0_8:
	ldr	w0, [x19, #24]
	bl	_SDL_UnlockMutex
	ldr	x8, [x19, #16]
	cmp	x8, #0
	csinv	w0, w20, wzr, eq
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SDL_AMEDIA_ERROR_UNKNOWN,4,2   ; @SDL_AMEDIA_ERROR_UNKNOWN
	.comm	_FAKE_BUFFER_QUEUE_SIZE,8,3     ; @FAKE_BUFFER_QUEUE_SIZE
.subsections_via_symbols
