	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msg_queue_remove
_msg_queue_remove:                      ## @msg_queue_remove
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_SDL_LockMutex
	cmpl	$0, 40(%r15)
	jne	LBB0_8
## %bb.1:
	movq	16(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.2:
	leaq	16(%r15), %r13
	movq	%rbx, %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx), %rax
	movq	%rax, (%r13)
	movq	%rbx, %rdi
	callq	_msg_free_res
	movq	32(%r15), %rax
	movq	%rax, 8(%rbx)
	movq	%rbx, 32(%r15)
	decl	24(%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r14d, (%rbx)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	8(%rbx), %r13
	movq	%rbx, %r12
	jmp	LBB0_6
LBB0_7:
	movq	16(%r15), %rax
	testq	%rax, %rax
	cmoveq	%rax, %r12
	movq	%r12, 8(%r15)
LBB0_8:
	movl	(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_SDL_UnlockMutex                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_msg_queue_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msg_queue_remove
_msg_queue_remove:                      ; @msg_queue_remove
	.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
	mov	x19, x0
	ldr	w0, [x0]
	bl	_SDL_LockMutex
	mov	x22, x19
	ldr	x21, [x22, #16]!
	ldr	w8, [x22, #24]
	cmp	w8, #0
	ccmp	x21, #0, #4, eq
	b.eq	LBB0_6
; %bb.1:
	mov	x23, x21
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21, #8]
	str	x8, [x22]
	mov	x0, x21
	bl	_msg_free_res
	ldr	x8, [x19, #32]
	str	x8, [x21, #8]
	str	x21, [x19, #32]
	ldr	w8, [x19, #24]
	sub	w8, w8, #1
	str	w8, [x19, #24]
	ldr	x21, [x22]
	cbz	x21, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x8, x21
	ldr	w9, [x8], #8
	cmp	w9, w20
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x8
	mov	x23, x21
	ldr	x21, [x22]
	cbnz	x21, LBB0_3
LBB0_5:
	ldr	x8, [x19, #16]
	cmp	x8, #0
	csel	x8, xzr, x23, eq
	str	x8, [x19, #8]
LBB0_6:
	ldr	w0, [x19]
	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
	b	_SDL_UnlockMutex
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_msg_queue_remove
.subsections_via_symbols
