	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_collection
_open_collection:                       ## @open_collection
	.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, %r13
	movq	24(%rdi), %rax
	movl	(%rax), %r12d
	movl	(%rdi), %ebx
	cmpl	4(%rdi), %ebx
	jne	LBB0_4
## %bb.1:
	movq	_HID_COLLECTION_STACK_SIZE@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	8(%r13), %rdi
	leal	(,%rbx,4), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_krealloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, 8(%r13)
	movl	%ebx, 4(%r13)
LBB0_4:
	movq	16(%r13), %rcx
	movl	(%rcx), %esi
	cmpl	4(%rcx), %esi
	jne	LBB0_5
## %bb.6:
	movl	$16, %edi
	movl	$2, %edx
	callq	_array3_size
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kmalloc
	movq	16(%r13), %rdi
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r15
	movq	16(%rdi), %rsi
	movl	4(%rdi), %edx
	shll	$4, %edx
	movq	%rax, %rdi
	callq	_memcpy
	movq	16(%r13), %rax
	movslq	4(%rax), %rdx
	movq	%rdx, %rdi
	shlq	$4, %rdi
	addq	%r15, %rdi
	shll	$4, %edx
	xorl	%esi, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	movq	16(%r13), %rax
	movq	16(%rax), %rdi
	callq	_kfree
	movq	16(%r13), %rcx
	movq	%r15, 16(%rcx)
	shll	4(%rcx)
	movl	(%rcx), %esi
	jmp	LBB0_9
LBB0_5:
	movq	16(%rcx), %r15
LBB0_9:
	movq	8(%r13), %rdx
	movslq	(%r13), %rax
	leal	1(%rax), %edi
	movl	%edi, (%r13)
	movl	%esi, (%rdx,%rax,4)
	movslq	(%rcx), %rax
	leal	1(%rax), %esi
	movl	%esi, (%rcx)
	shlq	$4, %rax
	movl	%r14d, (%r15,%rax)
	movl	%r12d, 4(%r15,%rax)
	movslq	(%r13), %rsi
	movl	%esi, %edi
	decl	%edi
	movl	%edi, 8(%r15,%rax)
	je	LBB0_10
## %bb.11:
	movl	-8(%rdx,%rsi,4), %edx
	jmp	LBB0_12
LBB0_10:
	movl	$-1, %edx
LBB0_12:
	movl	%edx, 12(%r15,%rax)
	movq	_HID_COLLECTION_APPLICATION@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpl	%r14d, (%rdx)
	jne	LBB0_14
## %bb.13:
	incl	8(%rcx)
	jmp	LBB0_14
LBB0_7:
	leaq	L_.str(%rip), %rsi
	callq	_hid_err
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HID_COLLECTION_STACK_SIZE,4,2  ## @HID_COLLECTION_STACK_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to reallocate collection array\n"

	.comm	_HID_COLLECTION_APPLICATION,4,2 ## @HID_COLLECTION_APPLICATION
	.no_dead_strip	_open_collection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_collection
_open_collection:                       ; @open_collection
	.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	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #24]
	ldr	w22, [x8]
	ldp	w8, w9, [x0]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, _HID_COLLECTION_STACK_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HID_COLLECTION_STACK_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w21, w9, w8
	ldr	x0, [x20, #8]
	lsl	w1, w21, #2
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_krealloc
	cbz	x0, LBB0_14
; %bb.2:
	str	x0, [x20, #8]
	str	w21, [x20, #4]
LBB0_3:
	ldr	x8, [x20, #16]
	ldp	w1, w9, [x8]
	cmp	w1, w9
	b.ne	LBB0_6
; %bb.4:
	mov	w0, #16
	mov	w2, #2
	bl	_array3_size
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_kmalloc
	mov	x21, x0
	ldr	x0, [x20, #16]
	cbz	x21, LBB0_13
; %bb.5:
	ldr	x1, [x0, #16]
	ldr	w8, [x0, #4]
	lsl	w2, w8, #4
	mov	x0, x21
	bl	_memcpy
	ldr	x8, [x20, #16]
	ldrsw	x8, [x8, #4]
	add	x0, x21, x8, lsl #4
	lsl	w2, w8, #4
	mov	w1, #0
	bl	_memset
	ldr	x8, [x20, #16]
	ldr	x0, [x8, #16]
	bl	_kfree
	ldr	x8, [x20, #16]
	str	x21, [x8, #16]
	ldp	w1, w9, [x8]
	lsl	w9, w9, #1
	str	w9, [x8, #4]
	b	LBB0_7
LBB0_6:
	ldr	x21, [x8, #16]
LBB0_7:
	ldr	x9, [x20, #8]
	ldrsw	x10, [x20]
	add	w11, w10, #1
	str	w11, [x20]
	str	w1, [x9, x10, lsl #2]
	ldrsw	x10, [x8]
	add	w11, w10, #1
	str	w11, [x8]
	add	x10, x21, x10, lsl #4
	stp	w19, w22, [x10]
	ldr	w11, [x20]
	subs	w12, w11, #1
	str	w12, [x10, #8]
	b.eq	LBB0_9
; %bb.8:
	sub	w11, w11, #2
	ldr	w9, [x9, w11, sxtw #2]
	b	LBB0_10
LBB0_9:
	mov	w9, #-1
LBB0_10:
	str	w9, [x10, #12]
Lloh9:
	adrp	x9, _HID_COLLECTION_APPLICATION@GOTPAGE
Lloh10:
	ldr	x9, [x9, _HID_COLLECTION_APPLICATION@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w9, w19
	b.ne	LBB0_12
; %bb.11:
	mov	w0, #0
	ldr	w9, [x8, #8]
	add	w9, w9, #1
	str	w9, [x8, #8]
	b	LBB0_15
LBB0_12:
	mov	w0, #0
	b	LBB0_15
LBB0_13:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_hid_err
LBB0_14:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_HID_COLLECTION_STACK_SIZE,4,2  ; @HID_COLLECTION_STACK_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to reallocate collection array\n"

	.comm	_HID_COLLECTION_APPLICATION,4,2 ; @HID_COLLECTION_APPLICATION
	.no_dead_strip	_open_collection
.subsections_via_symbols
