	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_setusercontext              ## -- Begin function do_setusercontext
	.p2align	4, 0x90
_do_setusercontext:                     ## @do_setusercontext
	.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	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_platform_setusercontext
	xorl	%eax, %eax
	callq	_platform_privileged_uidswap
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movl	8(%rbx), %edi
	callq	_setlogin
	testq	%rax, %rax
	jns	LBB0_3
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_error
LBB0_3:
	movl	16(%rbx), %edi
	callq	_setgid
	testq	%rax, %rax
	js	LBB0_4
## %bb.7:
	movl	8(%rbx), %edi
	movl	16(%rbx), %esi
	callq	_initgroups
	testq	%rax, %rax
	js	LBB0_8
## %bb.9:
	xorl	%eax, %eax
	callq	_endgrent
	movq	%rbx, %rdi
	callq	_platform_setusercontext_post_groups
	movq	_in_chroot@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jne	LBB0_13
## %bb.10:
	movq	_options@GOTPCREL(%rip), %r13
	movq	(%r13), %r14
	testq	%r14, %r14
	je	LBB0_13
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_tilde_expand_filename
	movq	%rax, %r14
	movq	(%rbx), %rcx
	leaq	L_.str.4(%rip), %rdx
	leaq	-80(%rbp), %r15
	movq	%r15, %rdi
	movl	$32, %esi
	callq	_snprintf
	movl	8(%rbx), %r8d
	movl	12(%rbx), %edx
	leaq	L_.str.5(%rip), %rsi
	leaq	L_.str.6(%rip), %rcx
	leaq	L_.str.7(%rip), %r9
	movq	%r14, %rdi
	pushq	$0
	pushq	%r15
	callq	_percent_expand
	addq	$16, %rsp
	movq	%rax, %r15
	movq	(%rbx), %rsi
	movq	%rax, %rdi
	callq	_safely_chroot
	movq	%r14, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_free
	movq	(%r13), %rdi
	callq	_free
	movq	$0, (%r13)
	movl	$1, (%r12)
LBB0_13:
	movq	%rbx, %rdi
	callq	_permanently_set_uid
	jmp	LBB0_17
LBB0_14:
	movq	_options@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.15:
	leaq	L_.str.3(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_fatal
LBB0_17:
	xorl	%eax, %eax
	callq	_getuid
	movq	(%rbx), %rsi
	cmpq	%rsi, %rax
	jne	LBB0_19
## %bb.18:
	xorl	%eax, %eax
	callq	_geteuid
	movq	(%rbx), %rsi
	cmpq	%rsi, %rax
	je	LBB0_5
LBB0_19:
	leaq	L_.str.9(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_fatal
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	_do_setusercontext.cold.1
	jmp	LBB0_5
LBB0_8:
	callq	_do_setusercontext.cold.2
	jmp	LBB0_5
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function do_setusercontext.cold.1
_do_setusercontext.cold.1:              ## @do_setusercontext.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function do_setusercontext.cold.2
_do_setusercontext.cold.2:              ## @do_setusercontext.cold.2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.2(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setlogin failed: %s"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"setgid"

L_.str.2:                               ## @.str.2
	.asciz	"initgroups"

	.comm	_in_chroot,4,2                  ## @in_chroot
	.comm	_options,8,3                    ## @options
L_.str.3:                               ## @.str.3
	.asciz	"none"

L_.str.4:                               ## @.str.4
	.asciz	"%llu"

L_.str.5:                               ## @.str.5
	.asciz	"h"

L_.str.6:                               ## @.str.6
	.asciz	"u"

L_.str.7:                               ## @.str.7
	.asciz	"U"

L_.str.8:                               ## @.str.8
	.asciz	"server lacks privileges to chroot to ChrootDirectory"

L_.str.9:                               ## @.str.9
	.asciz	"Failed to set uids to %u."

	.comm	_LOGIN_SETALL,4,2               ## @LOGIN_SETALL
	.comm	_LOGIN_SETENV,4,2               ## @LOGIN_SETENV
	.comm	_LOGIN_SETPATH,4,2              ## @LOGIN_SETPATH
	.comm	_LOGIN_SETUMASK,4,2             ## @LOGIN_SETUMASK
	.comm	_LOGIN_SETUSER,4,2              ## @LOGIN_SETUSER
	.comm	_lc,4,2                         ## @lc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_setusercontext              ; -- Begin function do_setusercontext
	.p2align	2
_do_setusercontext:                     ; @do_setusercontext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_platform_setusercontext
	bl	_platform_privileged_uidswap
	cbz	x0, LBB0_15
; %bb.1:
	ldr	w0, [x19, #8]
	bl	_setlogin
	tbz	x0, #63, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _errno@GOTPAGE
Lloh4:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_strerror
	mov	x1, x0
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_3:
	ldr	w0, [x19, #16]
	bl	_setgid
	tbnz	x0, #63, LBB0_19
; %bb.4:
	ldr	w0, [x19, #8]
	ldr	w1, [x19, #16]
	bl	_initgroups
	tbnz	x0, #63, LBB0_20
; %bb.5:
	bl	_endgrent
	mov	x0, x19
	bl	_platform_setusercontext_post_groups
Lloh8:
	adrp	x22, _in_chroot@GOTPAGE
Lloh9:
	ldr	x22, [x22, _in_chroot@GOTPAGEOFF]
	ldr	w8, [x22]
	cbnz	w8, LBB0_9
; %bb.6:
Lloh10:
	adrp	x23, _options@GOTPAGE
Lloh11:
	ldr	x23, [x23, _options@GOTPAGEOFF]
	ldr	x20, [x23]
	cbz	x20, LBB0_9
; %bb.7:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x1, [x19]
	mov	x0, x20
	bl	_tilde_expand_filename
	mov	x20, x0
	ldr	x3, [x19]
Lloh14:
	adrp	x2, l_.str.4@PAGE
Lloh15:
	add	x2, x2, l_.str.4@PAGEOFF
	add	x0, sp, #8
	mov	w1, #32
	bl	_snprintf
	ldp	w4, w2, [x19, #8]
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
Lloh18:
	adrp	x3, l_.str.6@PAGE
Lloh19:
	add	x3, x3, l_.str.6@PAGEOFF
Lloh20:
	adrp	x5, l_.str.7@PAGE
Lloh21:
	add	x5, x5, l_.str.7@PAGEOFF
	add	x6, sp, #8
	mov	x0, x20
	mov	x7, #0
	bl	_percent_expand
	mov	x21, x0
	ldr	x1, [x19]
	bl	_safely_chroot
	mov	x0, x20
	bl	_free
	mov	x0, x21
	bl	_free
	ldr	x0, [x23]
	bl	_free
	str	xzr, [x23]
	mov	w8, #1
	str	w8, [x22]
LBB0_9:
	mov	x0, x19
	bl	_permanently_set_uid
LBB0_10:
	bl	_getuid
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.11:
	bl	_geteuid
	ldr	x8, [x19]
	cmp	x0, x8
	b.eq	LBB0_13
LBB0_12:
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.9@PAGE
Lloh23:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_fatal
LBB0_13:
	ldr	x8, [sp, #40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
Lloh27:
	adrp	x8, _options@GOTPAGE
Lloh28:
	ldr	x8, [x8, _options@GOTPAGEOFF]
Lloh29:
	ldr	x0, [x8]
	cbz	x0, LBB0_10
; %bb.16:
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_10
; %bb.17:
Lloh32:
	adrp	x0, l_.str.8@PAGE
Lloh33:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_fatal
	b	LBB0_10
LBB0_18:
	bl	___stack_chk_fail
LBB0_19:
	bl	_do_setusercontext.cold.1
LBB0_20:
	bl	_do_setusercontext.cold.2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function do_setusercontext.cold.1
_do_setusercontext.cold.1:              ; @do_setusercontext.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function do_setusercontext.cold.2
_do_setusercontext.cold.2:              ; @do_setusercontext.cold.2
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh36:
	adrp	x0, l_.str.2@PAGE
Lloh37:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setlogin failed: %s"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"setgid"

l_.str.2:                               ; @.str.2
	.asciz	"initgroups"

	.comm	_in_chroot,4,2                  ; @in_chroot
	.comm	_options,8,3                    ; @options
l_.str.3:                               ; @.str.3
	.asciz	"none"

l_.str.4:                               ; @.str.4
	.asciz	"%llu"

l_.str.5:                               ; @.str.5
	.asciz	"h"

l_.str.6:                               ; @.str.6
	.asciz	"u"

l_.str.7:                               ; @.str.7
	.asciz	"U"

l_.str.8:                               ; @.str.8
	.asciz	"server lacks privileges to chroot to ChrootDirectory"

l_.str.9:                               ; @.str.9
	.asciz	"Failed to set uids to %u."

	.comm	_LOGIN_SETALL,4,2               ; @LOGIN_SETALL
	.comm	_LOGIN_SETENV,4,2               ; @LOGIN_SETENV
	.comm	_LOGIN_SETPATH,4,2              ; @LOGIN_SETPATH
	.comm	_LOGIN_SETUMASK,4,2             ; @LOGIN_SETUMASK
	.comm	_LOGIN_SETUSER,4,2              ; @LOGIN_SETUSER
	.comm	_lc,4,2                         ; @lc
.subsections_via_symbols
