	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openpam_restore_cred           ## -- Begin function openpam_restore_cred
	.p2align	4, 0x90
_openpam_restore_cred:                  ## @openpam_restore_cred
	.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	%rdi, %r12
	xorl	%eax, %eax
	callq	_ENTER
	movq	_PAM_SAVED_CRED@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	callq	_pam_get_data
	movq	_PAM_SUCCESS@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %edi
	callq	_RETURNC
LBB0_2:
	movq	-48(%rbp), %rbx
	testq	%rbx, %rbx
	jne	LBB0_4
## %bb.3:
	movq	_PAM_SYSTEM_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RETURNC
	movq	-48(%rbp), %rbx
LBB0_4:
	movq	(%rbx), %r13
	xorl	%eax, %eax
	callq	_geteuid
	cmpq	%rax, %r13
	je	LBB0_9
## %bb.5:
	movq	(%rbx), %rdi
	callq	_seteuid
	testq	%rax, %rax
	js	LBB0_8
## %bb.6:
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_setgroups
	testq	%rax, %rax
	js	LBB0_8
## %bb.7:
	movl	8(%rbx), %edi
	callq	_setegid
	testq	%rax, %rax
	jns	LBB0_9
LBB0_8:
	movq	_PAM_SYSTEM_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RETURNC
LBB0_9:
	movl	(%r14), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_pam_set_data
	movl	(%r15), %edi
	callq	_RETURNC
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAM_SAVED_CRED,4,2             ## @PAM_SAVED_CRED
	.comm	_PAM_SUCCESS,4,2                ## @PAM_SUCCESS
	.comm	_PAM_SYSTEM_ERR,4,2             ## @PAM_SYSTEM_ERR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openpam_restore_cred           ; -- Begin function openpam_restore_cred
	.p2align	2
_openpam_restore_cred:                  ; @openpam_restore_cred
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	bl	_ENTER
Lloh0:
	adrp	x20, _PAM_SAVED_CRED@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PAM_SAVED_CRED@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #8
	mov	x0, x19
	bl	_pam_get_data
Lloh2:
	adrp	x21, _PAM_SUCCESS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PAM_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_2
; %bb.1:
	bl	_RETURNC
LBB0_2:
	ldr	x22, [sp, #8]
	cbnz	x22, LBB0_4
; %bb.3:
Lloh4:
	adrp	x8, _PAM_SYSTEM_ERR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PAM_SYSTEM_ERR@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_RETURNC
	ldr	x22, [sp, #8]
LBB0_4:
	ldr	x23, [x22]
	bl	_geteuid
	cmp	x23, x0
	b.eq	LBB0_9
; %bb.5:
	ldr	x0, [x22]
	bl	_seteuid
	tbnz	x0, #63, LBB0_8
; %bb.6:
	ldp	w1, w0, [x22, #12]
	bl	_setgroups
	tbnz	x0, #63, LBB0_8
; %bb.7:
	ldr	w0, [x22, #8]
	bl	_setegid
	tbz	x0, #63, LBB0_9
LBB0_8:
Lloh7:
	adrp	x8, _PAM_SYSTEM_ERR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PAM_SYSTEM_ERR@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_RETURNC
LBB0_9:
	ldr	w1, [x20]
	mov	x0, x19
	mov	x2, #0
	mov	x3, #0
	bl	_pam_set_data
	ldr	w0, [x21]
	bl	_RETURNC
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PAM_SAVED_CRED,4,2             ; @PAM_SAVED_CRED
	.comm	_PAM_SUCCESS,4,2                ; @PAM_SUCCESS
	.comm	_PAM_SYSTEM_ERR,4,2             ; @PAM_SYSTEM_ERR
.subsections_via_symbols
