	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tomoyo_find_or_assign_new_profile
_tomoyo_find_or_assign_new_profile:     ## @tomoyo_find_or_assign_new_profile
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_TOMOYO_MAX_PROFILES@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jbe	LBB0_1
## %bb.2:
	movl	%edi, %ebx
	leaq	_tomoyo_find_or_assign_new_profile.lock(%rip), %rdi
	callq	_mutex_lock
	movq	_tomoyo_profile_ptr@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	%ebx, %r15d
	movq	(%rax,%r15,8), %rbx
	testq	%rbx, %rbx
	jne	LBB0_9
## %bb.3:
	movl	$8, %edi
	callq	_tomoyo_alloc_element
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rbx
	movq	_TOMOYO_MAX_CONTROL_INDEX@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_8
## %bb.6:
	movq	_tomoyo_control_array@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rbx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %edi
	movl	%edi, (%rdx,%rsi,4)
	incq	%rsi
	movslq	(%rax), %rdi
	cmpq	%rdi, %rsi
	jl	LBB0_7
LBB0_8:
	xorl	%eax, %eax
	callq	_mb
	movq	(%r14), %rax
	movq	%rbx, (%rax,%r15,8)
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_4:
	xorl	%ebx, %ebx
LBB0_9:
	leaq	_tomoyo_find_or_assign_new_profile.lock(%rip), %rdi
	callq	_mutex_unlock
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_tomoyo_find_or_assign_new_profile.lock,4,2 ## @tomoyo_find_or_assign_new_profile.lock
	.comm	_TOMOYO_MAX_PROFILES,4,2        ## @TOMOYO_MAX_PROFILES
	.comm	_tomoyo_profile_ptr,8,3         ## @tomoyo_profile_ptr
	.comm	_TOMOYO_MAX_CONTROL_INDEX,4,2   ## @TOMOYO_MAX_CONTROL_INDEX
	.comm	_tomoyo_control_array,8,3       ## @tomoyo_control_array
	.no_dead_strip	_tomoyo_find_or_assign_new_profile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tomoyo_find_or_assign_new_profile
_tomoyo_find_or_assign_new_profile:     ; @tomoyo_find_or_assign_new_profile
	.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
Lloh0:
	adrp	x8, _TOMOYO_MAX_PROFILES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TOMOYO_MAX_PROFILES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ls	LBB0_8
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x0, _tomoyo_find_or_assign_new_profile.lock@PAGE
Lloh4:
	add	x0, x0, _tomoyo_find_or_assign_new_profile.lock@PAGEOFF
	bl	_mutex_lock
Lloh5:
	adrp	x21, _tomoyo_profile_ptr@GOTPAGE
Lloh6:
	ldr	x21, [x21, _tomoyo_profile_ptr@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x19, [x8, w20, uxtw #3]
	cbnz	x19, LBB0_7
; %bb.2:
	mov	w0, #8
	bl	_tomoyo_alloc_element
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.3:
	mov	w20, w20
Lloh7:
	adrp	x8, _TOMOYO_MAX_CONTROL_INDEX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TOMOYO_MAX_CONTROL_INDEX@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x9, #0
Lloh9:
	adrp	x10, _tomoyo_control_array@GOTPAGE
Lloh10:
	ldr	x10, [x10, _tomoyo_control_array@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	ldr	x11, [x19]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x9, #2
	ldr	w13, [x10, x12]
	str	w13, [x11, x12]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_5
LBB0_6:
	bl	_mb
	ldr	x8, [x21]
	str	x19, [x8, x20, lsl #3]
LBB0_7:
Lloh12:
	adrp	x0, _tomoyo_find_or_assign_new_profile.lock@PAGE
Lloh13:
	add	x0, x0, _tomoyo_find_or_assign_new_profile.lock@PAGEOFF
	bl	_mutex_unlock
	b	LBB0_9
LBB0_8:
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_tomoyo_find_or_assign_new_profile.lock,4,2 ; @tomoyo_find_or_assign_new_profile.lock
	.comm	_TOMOYO_MAX_PROFILES,4,2        ; @TOMOYO_MAX_PROFILES
	.comm	_tomoyo_profile_ptr,8,3         ; @tomoyo_profile_ptr
	.comm	_TOMOYO_MAX_CONTROL_INDEX,4,2   ; @TOMOYO_MAX_CONTROL_INDEX
	.comm	_tomoyo_control_array,8,3       ; @tomoyo_control_array
	.no_dead_strip	_tomoyo_find_or_assign_new_profile
.subsections_via_symbols
