	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enclosure_component_alloc      ## -- Begin function enclosure_component_alloc
	.p2align	4, 0x90
_enclosure_component_alloc:             ## @enclosure_component_alloc
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_COMPONENT_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	cmpl	%r14d, (%r13)
	jbe	LBB0_1
## %bb.3:
	movq	8(%r13), %rcx
	movl	%r14d, %eax
	leaq	(%rax,%rax,4), %rax
	cmpl	$-1, (%rcx,%rax,4)
	je	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.2:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %r15
	leaq	(%rcx,%rax,4), %rax
	movl	%ebx, 4(%rcx,%r15,4)
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, (%rax)
	leaq	8(%rcx,%r15,4), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	4(%r13), %rdi
	movq	%rcx, %rbx
	callq	_get_device
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, 16(%rbx,%r15,4)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	cmpb	$0, (%rax)
	je	LBB0_10
## %bb.6:
	movq	%rax, %r14
	movq	_COMPONENT_NAME_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_enclosure_component_find_by_name
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movl	$1, %r8d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	leal	1(%r8), %r15d
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rcx
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_enclosure_component_find_by_name
	movl	%r15d, %r8d
	movq	_COMPONENT_NAME_SIZE@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	jne	LBB0_8
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_dev_set_name
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_set_name
LBB0_11:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	_enclosure_component_release@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%esi, 12(%rcx,%rdx,4)
	movq	_enclosure_component_groups@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r15)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_13
## %bb.12:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_COMPONENT_NAME_SIZE,4,2        ## @COMPONENT_NAME_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

L_.str.1:                               ## @.str.1
	.asciz	"%s-%i"

L_.str.2:                               ## @.str.2
	.asciz	"%u"

	.comm	_enclosure_component_release,4,2 ## @enclosure_component_release
	.comm	_enclosure_component_groups,4,2 ## @enclosure_component_groups
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enclosure_component_alloc      ; -- Begin function enclosure_component_alloc
	.p2align	2
_enclosure_component_alloc:             ; @enclosure_component_alloc
	.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
	sub	sp, sp, #16
	mov	x20, x3
	mov	x24, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x27, _COMPONENT_NAME_SIZE@GOTPAGE
Lloh4:
	ldr	x27, [x27, _COMPONENT_NAME_SIZE@GOTPAGEOFF]
	ldr	w8, [x27]
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	ldr	w8, [x0]
	cmp	w8, w1
	b.ls	LBB0_2
; %bb.1:
	ldr	x25, [x21, #8]
	mov	w8, #20
	umaddl	x19, w24, w8, x25
	ldr	w8, [x19]
	cmn	w8, #1
	b.eq	LBB0_4
LBB0_2:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldur	x9, [x29, #-88]
Lloh10:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_13
; %bb.3:
	neg	w0, w8
	sub	sp, x29, #80
	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
	b	_ERR_PTR
LBB0_4:
	mov	w26, w24
	mov	w8, #20
	madd	x28, x26, x8, x25
	str	w2, [x28, #4]
	str	w24, [x19]
	add	x22, x28, #8
	add	x0, x21, #4
	bl	_get_device
	str	w0, [x28, #16]
	cbz	x20, LBB0_10
; %bb.5:
	ldrb	w8, [x20]
	cbz	w8, LBB0_10
; %bb.6:
	ldr	w1, [x27]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	mov	x3, x20
	bl	_snprintf
	mov	x0, x21
	mov	x1, x23
	bl	_enclosure_component_find_by_name
	cbz	x0, LBB0_9
; %bb.7:
	mov	w8, #1
Lloh15:
	adrp	x24, l_.str.1@PAGE
Lloh16:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	add	w28, w8, #1
	str	x8, [sp, #-16]!
	mov	x0, x23
	mov	x2, x24
	mov	x3, x20
	bl	_snprintf
	add	sp, sp, #16
	mov	x0, x21
	mov	x1, x23
	bl	_enclosure_component_find_by_name
	mov	x8, x28
	cbnz	x0, LBB0_8
LBB0_9:
	str	x23, [sp, #-16]!
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_11
LBB0_10:
	str	x24, [sp, #-16]!
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_11:
	mov	x0, x22
	bl	_dev_set_name
	add	sp, sp, #16
Lloh21:
	adrp	x8, _enclosure_component_release@GOTPAGE
Lloh22:
	ldr	x8, [x8, _enclosure_component_release@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	mov	w9, #20
	madd	x9, x26, x9, x25
Lloh24:
	adrp	x10, _enclosure_component_groups@GOTPAGE
Lloh25:
	ldr	x10, [x10, _enclosure_component_groups@GOTPAGEOFF]
	str	w8, [x9, #12]
Lloh26:
	ldr	w8, [x10]
	str	w8, [x22]
	ldur	x8, [x29, #-88]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	sub	sp, x29, #80
	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_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_COMPONENT_NAME_SIZE,4,2        ; @COMPONENT_NAME_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

l_.str.1:                               ; @.str.1
	.asciz	"%s-%i"

l_.str.2:                               ; @.str.2
	.asciz	"%u"

	.comm	_enclosure_component_release,4,2 ; @enclosure_component_release
	.comm	_enclosure_component_groups,4,2 ; @enclosure_component_groups
.subsections_via_symbols
