	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function winmm_midi_queue_write
_winmm_midi_queue_write:                ## @winmm_midi_queue_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %eax
	movl	4(%rdi), %ecx
	movl	%eax, %edx
	subl	%ecx, %edx
	jle	LBB0_1
## %bb.2:
	movl	%ecx, %edx
	notl	%edx
	addl	%edx, %eax
	movl	%eax, %edx
	jmp	LBB0_3
LBB0_1:
	movq	_WINMM_MIDI_BUF_LEN@GOTPCREL(%rip), %rax
	addl	(%rax), %edx
LBB0_3:
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	LBB0_10
## %bb.4:
	movl	(%rsi), %edx
	cmpl	$4, %edx
	jg	LBB0_10
## %bb.5:
	movslq	%ecx, %r10
	movq	8(%rdi), %r9
	xorl	%r8d, %r8d
	movl	$0, %eax
	testl	%edx, %edx
	je	LBB0_9
## %bb.6:
	movq	8(%rsi), %r11
	movq	%r10, %rax
	shlq	$4, %rax
	movq	8(%r9,%rax), %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r11,%rcx,4), %eax
	movl	%eax, (%rdx,%rcx,4)
	incq	%rcx
	movl	(%rsi), %eax
	cmpq	%rax, %rcx
	jb	LBB0_7
## %bb.8:
	movl	4(%rdi), %ecx
LBB0_9:
	shlq	$4, %r10
	movl	%eax, (%r9,%r10)
	movl	4(%rsi), %eax
	movl	%eax, 4(%r9,%r10)
	incl	%ecx
	movq	_WINMM_MIDI_BUF_LEN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	cmovel	%r8d, %ecx
	movl	%ecx, 4(%rdi)
	movl	$1, %eax
LBB0_10:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINMM_MIDI_BUF_LEN,4,2         ## @WINMM_MIDI_BUF_LEN
	.no_dead_strip	_winmm_midi_queue_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function winmm_midi_queue_write
_winmm_midi_queue_write:                ; @winmm_midi_queue_write
	.cfi_startproc
; %bb.0:
	ldp	w9, w8, [x0]
	subs	w10, w9, w8
	b.le	LBB0_4
; %bb.1:
	mvn	w10, w8
	add	w9, w9, w10
	cmp	w9, #1
	b.lt	LBB0_5
LBB0_2:
	ldr	w11, [x1]
	cmp	w11, #4
	b.le	LBB0_6
; %bb.3:
	mov	w0, #0
	ret
LBB0_4:
Lloh0:
	adrp	x9, _WINMM_MIDI_BUF_LEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINMM_MIDI_BUF_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w9, w10, w9
	cmp	w9, #1
	b.ge	LBB0_2
LBB0_5:
	mov	w0, #0
	ret
LBB0_6:
	sxtw	x9, w8
	ldr	x10, [x0, #8]
	cbz	w11, LBB0_10
; %bb.7:
	mov	x8, #0
	ldr	x11, [x1, #8]
	add	x12, x10, x9, lsl #4
	ldr	x13, [x12, #8]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x8, #2
	ldr	w14, [x11, x12]
	str	w14, [x13, x12]
	add	x8, x8, #1
	ldr	w12, [x1]
	cmp	x8, x12
	b.lo	LBB0_8
; %bb.9:
	ldr	w8, [x0, #4]
	b	LBB0_11
LBB0_10:
	mov	w12, #0
LBB0_11:
	add	x9, x10, x9, lsl #4
	ldr	w10, [x1, #4]
	stp	w12, w10, [x9]
Lloh3:
	adrp	x9, _WINMM_MIDI_BUF_LEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WINMM_MIDI_BUF_LEN@GOTPAGEOFF]
	add	w10, w8, #1
Lloh5:
	ldr	w9, [x9]
	cmp	w10, w9
	csinc	w8, wzr, w8, eq
	str	w8, [x0, #4]
	mov	w0, #1
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WINMM_MIDI_BUF_LEN,4,2         ; @WINMM_MIDI_BUF_LEN
	.no_dead_strip	_winmm_midi_queue_write
.subsections_via_symbols
