	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_rawmidi_receive            ## -- Begin function snd_rawmidi_receive
	.p2align	4, 0x90
_snd_rawmidi_receive:                   ## @snd_rawmidi_receive
	.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
	cmpl	$0, 8(%rdi)
	je	LBB0_1
## %bb.3:
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	cmpq	$0, (%r15)
	je	LBB0_4
## %bb.5:
	movl	%edx, %r14d
	movq	%rsi, %r13
	leaq	20(%r15), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	cmpl	$1, %r14d
	jne	LBB0_9
## %bb.6:
	incq	(%r12)
	movl	8(%r15), %eax
	cmpl	12(%r15), %eax
	jge	LBB0_8
## %bb.7:
	movb	(%r13), %al
	movq	(%r15), %rcx
	movslq	16(%r15), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 16(%r15)
	movb	%al, (%rcx,%rdx)
	movl	16(%r15), %eax
	cltd
	idivl	12(%r15)
	movl	%edx, 16(%r15)
	incl	8(%r15)
	movl	$1, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_1:
	movq	_EBADFD@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_snd_printd
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_9:
	movslq	%r14d, %rax
	addq	%rax, (%r12)
	movl	12(%r15), %ebx
	movslq	16(%r15), %rdi
	movl	%ebx, %eax
	subl	%edi, %eax
	cmpl	%r14d, %eax
	cmovgel	%r14d, %eax
	subl	8(%r15), %ebx
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
	addq	(%r15), %rdi
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	16(%r15), %eax
	addl	%ebx, %eax
	movl	12(%r15), %ecx
	cltd
	idivl	%ecx
	movl	%edx, 16(%r15)
	movl	8(%r15), %eax
	addl	%ebx, %eax
	movl	%eax, 8(%r15)
	subl	%ebx, %r14d
	jle	LBB0_13
## %bb.10:
	subl	%eax, %ecx
	movl	%r14d, %eax
	subl	%ecx, %eax
	jle	LBB0_12
## %bb.11:
	cltq
	addq	%rax, 40(%r15)
	movl	%ecx, %r14d
	testl	%ecx, %ecx
	jle	LBB0_13
LBB0_12:
	movslq	%ebx, %rax
	addq	%rax, %r13
	movq	(%r15), %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movl	%r14d, 16(%r15)
	addl	%r14d, 8(%r15)
	addl	%r14d, %ebx
LBB0_13:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	testl	%ebx, %ebx
	jle	LBB0_18
LBB0_14:
	cmpq	$0, 32(%r15)
	je	LBB0_16
## %bb.15:
	addq	$28, %r15
	movq	%r15, %rdi
	callq	_tasklet_schedule
	jmp	LBB0_18
LBB0_8:
	incq	40(%r15)
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_16:
	movq	%r12, %rdi
	callq	_snd_rawmidi_ready
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	addq	$24, %r15
	movq	%r15, %rdi
	callq	_wake_up
LBB0_18:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADFD,4,2                     ## @EBADFD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"snd_rawmidi_receive: input is not active!!!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_rawmidi_receive            ; -- Begin function snd_rawmidi_receive
	.p2align	2
_snd_rawmidi_receive:                   ; @snd_rawmidi_receive
	.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
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	x24, [x0, #16]
	ldr	x8, [x24]
	cbz	x8, LBB0_6
; %bb.2:
	mov	x23, x2
	mov	x22, x1
	add	x19, x24, #20
	mov	x0, x19
	bl	_spin_lock_irqsave
	cmp	w23, #1
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x20]
	add	x8, x8, #1
	str	x8, [x20]
	ldp	w8, w9, [x24, #8]
	cmp	w8, w9
	b.ge	LBB0_15
; %bb.4:
	ldrb	w8, [x22]
	ldr	x9, [x24]
	ldrsw	x10, [x24, #16]
	add	w11, w10, #1
	str	w11, [x24, #16]
	strb	w8, [x9, x10]
	ldp	w9, w8, [x24, #12]
	ldr	w10, [x24, #8]
	sdiv	w11, w8, w9
	msub	w8, w11, w9, w8
	str	w8, [x24, #16]
	add	w8, w10, #1
	str	w8, [x24, #8]
	mov	w21, #1
	b	LBB0_13
LBB0_5:
Lloh0:
	adrp	x8, _EBADFD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBADFD@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_snd_printd
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_8:
	ldr	x8, [x20]
	add	x8, x8, w23, sxtw
	str	x8, [x20]
	ldp	w9, w8, [x24, #12]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	ldr	w10, [x24, #8]
	sub	w11, w9, w8
	cmp	w11, w23
	csel	w11, w11, w23, lt
	sub	w9, w9, w10
	cmp	w11, w9
	csel	w21, w11, w9, lt
	ldr	x9, [x24]
	add	x0, x9, x8
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	ldr	w8, [x24, #16]
	add	w9, w8, w21
	ldp	w10, w8, [x24, #8]
	sdiv	w11, w9, w8
	msub	w9, w11, w8, w9
	str	w9, [x24, #16]
	add	w9, w10, w21
	str	w9, [x24, #8]
	sub	w23, w23, w21
	cmp	w23, #1
	b.lt	LBB0_12
; %bb.9:
	sub	w8, w8, w9
	subs	w9, w23, w8
	b.le	LBB0_11
; %bb.10:
	ldr	x10, [x24, #40]
	add	x9, x10, w9, sxtw
	str	x9, [x24, #40]
	mov	x23, x8
	cmp	w8, #1
	b.lt	LBB0_12
LBB0_11:
	add	x1, x22, w21, sxtw
	ldr	x0, [x24]
	mov	x2, x23
	bl	_memcpy
	str	w23, [x24, #16]
	ldr	w8, [x24, #8]
	add	w8, w8, w23
	str	w8, [x24, #8]
	add	w21, w23, w21
LBB0_12:
	cmp	w21, #1
	b.lt	LBB0_18
LBB0_13:
	ldr	x8, [x24, #32]
	cbz	x8, LBB0_16
; %bb.14:
	add	x0, x24, #28
	bl	_tasklet_schedule
	b	LBB0_18
LBB0_15:
	mov	w21, #0
	ldr	x8, [x24, #40]
	add	x8, x8, #1
	str	x8, [x24, #40]
	b	LBB0_18
LBB0_16:
	mov	x0, x20
	bl	_snd_rawmidi_ready
	cbz	x0, LBB0_18
; %bb.17:
	add	x0, x24, #24
	bl	_wake_up
LBB0_18:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_19:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADFD,4,2                     ; @EBADFD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"snd_rawmidi_receive: input is not active!!!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
