	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_rawmidi_output_params      ## -- Begin function snd_rawmidi_output_params
	.p2align	4, 0x90
_snd_rawmidi_output_params:             ## @snd_rawmidi_output_params
	.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
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	cmpq	$0, 8(%rdi)
	je	LBB0_4
## %bb.1:
	cmpl	$2, (%rbx)
	jl	LBB0_4
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_4:
	movq	%rbx, %rdi
	callq	_snd_rawmidi_drain_output
	movl	(%r14), %edi
	leal	-1048577(%rdi), %eax
	cmpl	$-1048546, %eax                 ## imm = 0xFFF0001E
	ja	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	4(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.7:
	cmpl	%edi, %eax
	jg	LBB0_5
## %bb.8:
	cmpl	(%r12), %edi
	je	LBB0_12
## %bb.9:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %r15
	movq	8(%r12), %rdi
	callq	_kfree
	movq	%r15, 8(%r12)
	movl	(%r14), %eax
	movl	%eax, (%r12)
	movl	%eax, 16(%r12)
	movl	4(%r14), %eax
LBB0_12:
	movl	%eax, 20(%r12)
	xorl	%eax, %eax
	cmpl	$0, 8(%r14)
	sete	%al
	movl	%eax, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_rawmidi_output_params      ; -- Begin function snd_rawmidi_output_params
	.p2align	2
_snd_rawmidi_output_params:             ; @snd_rawmidi_output_params
	.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
	mov	x20, x1
	mov	x19, x0
	ldp	x8, x22, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #2
	b.lt	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_snd_rawmidi_drain_output
	ldr	w0, [x20]
	sub	w8, w0, #256, lsl #12           ; =1048576
	sub	w8, w8, #1
	mov	w9, #30
	movk	w9, #65520, lsl #16
	cmp	w8, w9
	b.ls	LBB0_5
; %bb.4:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	ccmp	w8, w0, #0, ge
	b.le	LBB0_8
LBB0_5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	ldr	w9, [x22]
	cmp	w0, w9
	b.eq	LBB0_11
; %bb.9:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_12
; %bb.10:
	mov	x21, x0
	ldr	x0, [x22, #8]
	bl	_kfree
	str	x21, [x22, #8]
	ldp	w9, w8, [x20]
	str	w9, [x22]
	str	w9, [x22, #16]
LBB0_11:
	mov	w0, #0
	str	w8, [x22, #20]
	ldr	w8, [x20, #8]
	cmp	w8, #0
	cset	w8, eq
	str	w8, [x19, #4]
	b	LBB0_7
LBB0_12:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
