	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openpam_check_path_owner_perms ## -- Begin function openpam_check_path_owner_perms
	.p2align	4, 0x90
_openpam_check_path_owner_perms:        ## @openpam_check_path_owner_perms
	.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, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_geteuid
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_realpath
	testq	%rax, %rax
	je	LBB0_19
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_strlen
	testl	%eax, %eax
	jle	LBB0_20
## %bb.2:
	movl	%eax, %ebx
	xorl	%r12d, %r12d
	leaq	-72(%rbp), %rsi
	xorl	%r13d, %r13d
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
	movq	%r15, %rdi
	movq	%rsi, %r14
	callq	_stat
	testq	%rax, %rax
	jne	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	testb	$1, %r12b
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-72(%rbp), %edi
	callq	_S_ISREG
	testl	%eax, %eax
	je	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	jne	LBB0_16
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_S_IWOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_S_IWGRP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	testl	%eax, -72(%rbp)
	jne	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$2, %ebx
	jb	LBB0_20
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-1(%rbx), %eax
	cmpb	$47, (%r15,%rax)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movb	$0, (%r15,%rax)
	movl	%eax, %ebx
	cmpl	$1, %eax
	ja	LBB0_13
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%rbx), %eax
	movb	$1, %r12b
	cmpl	$1, %ebx
	movl	%eax, %ebx
	movq	%r14, %rsi
	jg	LBB0_3
	jmp	LBB0_20
LBB0_16:
	movq	_PAM_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdx
	callq	_openpam_log
	movq	_EPERM@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ENOENT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_19
## %bb.5:
	movq	_PAM_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	callq	_openpam_log
	jmp	LBB0_18
LBB0_8:
	movq	_PAM_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	callq	_openpam_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %ebx
LBB0_18:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
LBB0_19:
	movl	$-1, %r13d
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	movl	%r13d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.comm	_errno,4,2                      ## @errno
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PAM_LOG_ERROR,4,2              ## @PAM_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %m"

L_.str.1:                               ## @.str.1
	.asciz	"%s: not a regular file"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_S_IWGRP,4,2                    ## @S_IWGRP
	.comm	_S_IWOTH,4,2                    ## @S_IWOTH
L_.str.2:                               ## @.str.2
	.asciz	"%s: insecure ownership or permissions"

	.comm	_EPERM,4,2                      ## @EPERM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_openpam_check_path_owner_perms ; -- Begin function openpam_check_path_owner_perms
	.p2align	2
_openpam_check_path_owner_perms:        ; @openpam_check_path_owner_perms
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #32
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	bl	_geteuid
	mov	x20, x0
	mov	x0, x21
	mov	x1, x19
	bl	_realpath
	cbz	x0, LBB0_20
; %bb.1:
	mov	x0, x19
	bl	_strlen
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.2:
	mov	x21, x0
	mov	w24, #0
Lloh8:
	adrp	x22, _S_IWGRP@GOTPAGE
Lloh9:
	ldr	x22, [x22, _S_IWGRP@GOTPAGEOFF]
Lloh10:
	adrp	x23, _S_IWOTH@GOTPAGE
Lloh11:
	ldr	x23, [x23, _S_IWOTH@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	sub	x1, x29, #72
	mov	x0, x19
	bl	_stat
	cbnz	x0, LBB0_15
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w24, #0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	w0, [x29, #-72]
	bl	_S_ISREG
	cbz	w0, LBB0_17
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldur	x8, [x29, #-64]
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x8, x20
	b.ne	LBB0_14
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldur	w8, [x29, #-72]
	ldr	w9, [x22]
	ldr	w10, [x23]
	orr	w9, w10, w9
	tst	w9, w8
	b.ne	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w21, #2
	b.lo	LBB0_13
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w8, w21, #1
	ldrb	w9, [x19, x8]
	cmp	w9, #47
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	strb	wzr, [x19, x8]
	mov	x21, x8
	cmp	w8, #1
	b.hi	LBB0_10
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #0
	mov	w24, #1
	subs	w21, w21, #1
	b.gt	LBB0_3
	b	LBB0_21
LBB0_13:
	mov	w0, #0
	b	LBB0_21
LBB0_14:
Lloh12:
	adrp	x8, _PAM_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PAM_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_openpam_log
Lloh17:
	adrp	x8, _EPERM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_18
LBB0_15:
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	w20, [x8]
Lloh22:
	adrp	x8, _ENOENT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_20
; %bb.16:
Lloh25:
	adrp	x8, _PAM_LOG_ERROR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PAM_LOG_ERROR@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_openpam_log
	b	LBB0_19
LBB0_17:
Lloh30:
	adrp	x8, _PAM_LOG_ERROR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PAM_LOG_ERROR@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_openpam_log
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_18:
	ldr	w20, [x8]
LBB0_19:
Lloh37:
	adrp	x8, _errno@GOTPAGE
Lloh38:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh39:
	str	w20, [x8]
LBB0_20:
	mov	w0, #-1
LBB0_21:
	ldur	x8, [x29, #-56]
Lloh40:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh41:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.22:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.comm	_errno,4,2                      ; @errno
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PAM_LOG_ERROR,4,2              ; @PAM_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %m"

l_.str.1:                               ; @.str.1
	.asciz	"%s: not a regular file"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_S_IWGRP,4,2                    ; @S_IWGRP
	.comm	_S_IWOTH,4,2                    ; @S_IWOTH
l_.str.2:                               ; @.str.2
	.asciz	"%s: insecure ownership or permissions"

	.comm	_EPERM,4,2                      ; @EPERM
.subsections_via_symbols
