	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sel_write_relabel
_sel_write_relabel:                     ## @sel_write_relabel
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SECURITY__COMPUTE_RELABEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_task_has_security
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	incq	%rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.2:
	movq	%rax, %r15
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.3:
	movq	%rax, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %r8
	movq	%r12, %rdi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	_sscanf
	cmpl	$3, %eax
	jne	LBB0_16
## %bb.4:
	movq	%r15, %rdi
	callq	_strlen
	leaq	1(%rax), %rsi
	leaq	-60(%rbp), %rdx
	movq	%r15, %rdi
	callq	_security_context_to_sid
	testl	%eax, %eax
	js	LBB0_10
## %bb.5:
	movq	%r14, %rdi
	callq	_strlen
	leaq	1(%rax), %rsi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	callq	_security_context_to_sid
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	movl	-60(%rbp), %edi
	movl	-56(%rbp), %esi
	movl	-48(%rbp), %edx
	leaq	-52(%rbp), %rcx
	callq	_security_change_sid
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:
	movl	-52(%rbp), %edi
	leaq	-72(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	callq	_security_sid_to_context
	testl	%eax, %eax
	js	LBB0_10
## %bb.8:
	movl	-44(%rbp), %edx
	movq	_SIMPLE_TRANSACTION_LIMIT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jle	LBB0_14
## %bb.9:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_15
LBB0_10:
	movl	%eax, %r13d
LBB0_16:
	movq	%r14, %rdi
	callq	_kfree
LBB0_17:
	movq	%r15, %rdi
	callq	_kfree
LBB0_18:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	-72(%rbp), %rsi
	movq	%r12, %rdi
	callq	_memcpy
	movl	-44(%rbp), %r13d
LBB0_15:
	movq	-72(%rbp), %rdi
	callq	_kfree
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_current,4,2                    ## @current
	.comm	_SECURITY__COMPUTE_RELABEL,4,2  ## @SECURITY__COMPUTE_RELABEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s %s %hu"

	.comm	_SIMPLE_TRANSACTION_LIMIT,4,2   ## @SIMPLE_TRANSACTION_LIMIT
	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_sel_write_relabel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sel_write_relabel
_sel_write_relabel:                     ; @sel_write_relabel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	x21, x1
Lloh0:
	adrp	x8, _current@GOTPAGE
Lloh1:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SECURITY__COMPUTE_RELABEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SECURITY__COMPUTE_RELABEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_task_has_security
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.1:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	add	x20, x19, #1
Lloh9:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.2:
	mov	x19, x0
	ldr	w1, [x23]
	mov	x0, x20
	bl	_kzalloc
	cbz	x0, LBB0_13
; %bb.3:
	mov	x20, x0
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w22, [x8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	add	x4, sp, #16
	mov	x0, x21
	mov	x2, x19
	mov	x3, x20
	bl	_sscanf
	cmp	w0, #3
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x19
	bl	_strlen
	add	x1, x0, #1
	add	x2, sp, #28
	mov	x0, x19
	bl	_security_context_to_sid
	tbnz	w0, #31, LBB0_11
; %bb.5:
	mov	x0, x20
	bl	_strlen
	add	x1, x0, #1
	add	x2, sp, #24
	mov	x0, x20
	bl	_security_context_to_sid
	tbnz	w0, #31, LBB0_11
; %bb.6:
	ldp	w1, w0, [sp, #24]
	ldr	w2, [sp, #16]
	add	x3, sp, #20
	bl	_security_change_sid
	tbnz	w0, #31, LBB0_11
; %bb.7:
	ldr	w0, [sp, #20]
	add	x1, sp, #8
	add	x2, sp, #4
	bl	_security_sid_to_context
	tbnz	w0, #31, LBB0_11
; %bb.8:
	ldr	w2, [sp, #4]
Lloh16:
	adrp	x8, _SIMPLE_TRANSACTION_LIMIT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SIMPLE_TRANSACTION_LIMIT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w2, w8
	b.le	LBB0_15
; %bb.9:
Lloh19:
	adrp	x8, _ERANGE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_10:
	neg	w22, w22
	b	LBB0_12
LBB0_11:
	mov	x22, x0
LBB0_12:
	mov	x0, x20
	bl	_kfree
LBB0_13:
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x22
	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
	add	sp, sp, #96
	ret
LBB0_15:
	ldr	x1, [sp, #8]
	mov	x0, x21
	bl	_memcpy
	ldr	w22, [sp, #4]
LBB0_16:
	ldr	x0, [sp, #8]
	bl	_kfree
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_current,4,2                    ; @current
	.comm	_SECURITY__COMPUTE_RELABEL,4,2  ; @SECURITY__COMPUTE_RELABEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s %s %hu"

	.comm	_SIMPLE_TRANSACTION_LIMIT,4,2   ; @SIMPLE_TRANSACTION_LIMIT
	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_sel_write_relabel
.subsections_via_symbols
