	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lsapi_changeUGid
_lsapi_changeUGid:                      ## @lsapi_changeUGid
	.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
	movq	_s_uid@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	cmpl	$0, (%r13)
	je	LBB0_1
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r12
	movq	_s_defaultUid@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	_s_defaultGid@GOTPCREL(%rip), %rsi
	movl	(%rsi), %edx
	movq	8(%rdi), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.2:
	decl	%eax
	movq	16(%r12), %rbx
	leaq	(%rax,%rax,2), %r14
	movq	(%rbx,%r14,8), %rdi
	cmpb	$0, (%rdi)
	jne	LBB0_10
## %bb.3:
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	incq	%rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	_s_defaultUid@GOTPCREL(%rip), %rcx
	movq	_s_defaultGid@GOTPCREL(%rip), %rsi
	jmp	LBB0_10
LBB0_5:
	movq	8(%r12), %rax
	decl	(%rax)
	leaq	(%rbx,%r14,8), %r15
	movq	-24(%r15), %rdi
	cmpb	$0, (%rdi)
	jne	LBB0_7
## %bb.6:
	incq	%rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_8
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	callq	_lsapi_log
	movl	-44(%rbp), %edx                 ## 4-byte Reload
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	movl	%edx, %ebx
	callq	_lsapi_log
	movq	_s_defaultGid@GOTPCREL(%rip), %rsi
	movq	_s_defaultUid@GOTPCREL(%rip), %rcx
	movl	%ebx, %edx
	xorl	%r15d, %r15d
LBB0_10:
	testl	%r15d, %r15d
	jne	LBB0_12
## %bb.11:
	movl	(%rsi), %edx
	movl	(%rcx), %r15d
LBB0_12:
	movq	%r12, %rdi
	movl	%r15d, %esi
	xorl	%ecx, %ecx
	callq	_setUID_LVE
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.14:
	movl	%r15d, (%r13)
	movl	(%r12), %edi
	cmpl	$-1, %edi
	je	LBB0_16
## %bb.15:
	callq	_close
	movl	$-1, (%r12)
LBB0_16:
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	callq	_LSAPI_GetEnv_r
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	%rax, %rdi
	callq	_lsapi_reopen_stderr
	jmp	LBB0_18
LBB0_13:
	movl	$-1, %ebx
	jmp	LBB0_18
LBB0_8:
	movq	8(%r12), %rax
	decl	(%rax)
	movq	-8(%r15), %rcx
	movq	%r15, %rax
	movl	(%rcx), %r15d
	movl	4(%rcx), %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	16(%rbx,%r14,8), %rsi
	movl	8(%rbx,%r14,8), %edx
	movl	-16(%rax), %r8d
	movq	%r12, %rdi
	callq	_lsapi_suexec_auth
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testq	%rax, %rax
	movq	_s_defaultUid@GOTPCREL(%rip), %rcx
	movq	_s_defaultGid@GOTPCREL(%rip), %rsi
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_s_defaultUid,4,2               ## @s_defaultUid
	.comm	_s_defaultGid,4,2               ## @s_defaultGid
	.comm	_s_uid,4,2                      ## @s_uid
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SUEXEC_AUTH"

L_.str.1:                               ## @.str.1
	.asciz	"SUEXEC_UGID"

L_.str.2:                               ## @.str.2
	.asciz	"LSAPI: missing SUEXEC_UGID env, use default user!\n"

L_.str.3:                               ## @.str.3
	.asciz	"LSAPI: SUEXEC_AUTH authentication failed, use default user!\n"

L_.str.4:                               ## @.str.4
	.asciz	"LSAPI_STDERR_LOG"

	.no_dead_strip	_lsapi_changeUGid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lsapi_changeUGid
_lsapi_changeUGid:                      ; @lsapi_changeUGid
	.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
Lloh0:
	adrp	x21, _s_uid@GOTPAGE
Lloh1:
	ldr	x21, [x21, _s_uid@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	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_3:
	mov	x19, x0
Lloh2:
	adrp	x20, _s_defaultUid@GOTPAGE
Lloh3:
	ldr	x20, [x20, _s_defaultUid@GOTPAGEOFF]
	ldr	w24, [x20]
Lloh4:
	adrp	x22, _s_defaultGid@GOTPAGE
Lloh5:
	ldr	x22, [x22, _s_defaultGid@GOTPAGEOFF]
	ldr	w23, [x22]
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	subs	w25, w8, #1
	b.lt	LBB0_10
; %bb.4:
	ldr	x27, [x19, #16]
	mov	w8, #24
	umaddl	x26, w25, w8, x27
	ldr	x8, [x26]
	ldrb	w9, [x8]
	cbnz	w9, LBB0_10
; %bb.5:
	add	x0, x8, #1
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbnz	x0, LBB0_10
; %bb.6:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
	ldur	x8, [x26, #-24]
	ldrb	w9, [x8]
	cbnz	w9, LBB0_8
; %bb.7:
	add	x0, x8, #1
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_15
LBB0_8:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_lsapi_log
LBB0_9:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_lsapi_log
	mov	w24, #0
LBB0_10:
	ldr	w8, [x20]
	ldr	w9, [x22]
	cmp	w24, #0
	csel	w2, w9, w23, eq
	csel	w20, w8, w24, eq
	mov	x0, x19
	mov	x1, x20
	mov	x3, #0
	bl	_setUID_LVE
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.11:
	str	w20, [x21]
	ldr	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.12:
	bl	_close
	mov	w8, #-1
	str	w8, [x19]
LBB0_13:
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_LSAPI_GetEnv_r
	cbz	x0, LBB0_2
; %bb.14:
	bl	_lsapi_reopen_stderr
	b	LBB0_1
LBB0_15:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
	ldur	x3, [x26, #-8]
	ldp	w24, w23, [x3]
	mov	w8, #24
	madd	x8, x25, x8, x27
	ldr	x1, [x8, #16]
	ldr	w2, [x8, #8]
	ldur	w4, [x26, #-16]
	mov	x0, x19
	bl	_lsapi_suexec_auth
	cbnz	x0, LBB0_9
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_s_defaultUid,4,2               ; @s_defaultUid
	.comm	_s_defaultGid,4,2               ; @s_defaultGid
	.comm	_s_uid,4,2                      ; @s_uid
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SUEXEC_AUTH"

l_.str.1:                               ; @.str.1
	.asciz	"SUEXEC_UGID"

l_.str.2:                               ; @.str.2
	.asciz	"LSAPI: missing SUEXEC_UGID env, use default user!\n"

l_.str.3:                               ; @.str.3
	.asciz	"LSAPI: SUEXEC_AUTH authentication failed, use default user!\n"

l_.str.4:                               ; @.str.4
	.asciz	"LSAPI_STDERR_LOG"

	.no_dead_strip	_lsapi_changeUGid
.subsections_via_symbols
