	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_usbmidi_detect_endpoints
_snd_usbmidi_detect_endpoints:          ## @snd_usbmidi_detect_endpoints
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_USB_ID_VENDOR
	cmpl	$1410, %eax                     ## imm = 0x582
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_snd_usbmidi_switch_roland_altsetting
LBB0_2:
	xorl	%eax, %eax
	cmpq	$0, 24(%r13)
	jne	LBB0_23
## %bb.3:
	cmpq	$0, 8(%r13)
	jne	LBB0_23
## %bb.4:
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.7:
	movq	8(%rax), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_get_iface_desc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rax)
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, %r12d
	jle	LBB0_22
## %bb.8:
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%ebx, %ebx
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	%r14d, %r12d
	incl	%r12d
	movl	-48(%rbp), %r14d                ## 4-byte Reload
LBB0_21:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %ebx
	jge	LBB0_22
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_get_endpoint
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_usb_endpoint_xfer_bulk
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	callq	_usb_endpoint_xfer_int
	testq	%rax, %rax
	je	LBB0_21
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpl	%r14d, -44(%rbp)                ## 4-byte Folded Reload
	jge	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	callq	_usb_endpoint_dir_out
	testq	%rax, %rax
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movq	%r15, %rdi
	callq	_usb_endpoint_num
	movslq	-44(%rbp), %r12                 ## 4-byte Folded Reload
	shlq	$5, %r12
	movq	%rax, 24(%r13,%r12)
	movq	%r15, %rdi
	callq	_usb_endpoint_xfer_int
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r15), %eax
	movl	%eax, 16(%r13,%r12)
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpl	%r14d, %r12d
	jge	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	callq	_usb_endpoint_dir_in
	testq	%rax, %rax
	je	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	callq	_usb_endpoint_num
	movl	%r12d, %r14d
	movslq	%r12d, %r12
	shlq	$5, %r12
	movq	%rax, 8(%r13,%r12)
	movq	%r15, %rdi
	callq	_usb_endpoint_xfer_int
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r15), %eax
	movl	%eax, (%r13,%r12)
	jmp	LBB0_20
LBB0_6:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_23
LBB0_22:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	orl	%r12d, -44(%rbp)                ## 4-byte Folded Spill
	movl	$0, %ecx
	cmovnel	%ecx, %eax
LBB0_23:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_snd_usbmidi_detect_endpoints
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_usbmidi_detect_endpoints
_snd_usbmidi_detect_endpoints:          ; @snd_usbmidi_detect_endpoints
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0, #8]
	bl	_USB_ID_VENDOR
	cmp	w0, #1410
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_snd_usbmidi_switch_roland_altsetting
LBB0_2:
	ldr	x8, [x20, #24]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_6
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	x8, [x21]
	cbz	x8, LBB0_23
; %bb.7:
	ldr	w9, [x8]
	cmp	w9, #0
	b.le	LBB0_23
; %bb.8:
	ldr	x21, [x8, #8]
	mov	x0, x21
	bl	_get_iface_desc
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.9:
	mov	x22, x0
	mov	w26, #0
	mov	w25, #0
	mov	w23, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w26, w26, #1
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w23, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	b.ge	LBB0_25
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x23
	bl	_get_endpoint
	mov	x24, x0
	bl	_usb_endpoint_xfer_bulk
	cbnz	w0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x24
	bl	_usb_endpoint_xfer_int
	cbz	x0, LBB0_11
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	cmp	w25, w19
	b.ge	LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x24
	bl	_usb_endpoint_dir_out
	cbz	x0, LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x24
	bl	_usb_endpoint_num
	sxtw	x8, w25
	add	x27, x20, x8, lsl #5
	str	x0, [x27, #24]
	mov	x0, x24
	bl	_usb_endpoint_xfer_int
	cbz	x0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x24]
	str	w8, [x27, #16]
LBB0_18:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w25, w25, #1
LBB0_19:                                ;   in Loop: Header=BB0_12 Depth=1
	cmp	w26, w19
	b.ge	LBB0_11
; %bb.20:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x24
	bl	_usb_endpoint_dir_in
	cbz	x0, LBB0_11
; %bb.21:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x24
	bl	_usb_endpoint_num
	sxtw	x27, w26
	add	x8, x20, x27, lsl #5
	str	x0, [x8, #8]
	mov	x0, x24
	bl	_usb_endpoint_xfer_int
	cbz	x0, LBB0_10
; %bb.22:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x24]
	lsl	x9, x27, #5
	str	w8, [x20, x9]
	b	LBB0_10
LBB0_23:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_24:
	mov	w25, #0
	mov	w26, #0
LBB0_25:
	orr	w8, w25, w26
Lloh3:
	adrp	x9, _ENOENT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, #0
	csneg	w0, wzr, w9, ne
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_snd_usbmidi_detect_endpoints
.subsections_via_symbols
