	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_validate_headref               ## -- Begin function validate_headref
	.p2align	4, 0x90
_validate_headref:                      ## @validate_headref
	.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	%rbx
	subq	$296, %rsp                      ## imm = 0x128
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leaq	-304(%rbp), %rsi
	callq	_lstat
	movl	$-1, %r14d
	testq	%rax, %rax
	js	LBB0_13
## %bb.1:
	movl	-304(%rbp), %edi
	callq	_S_ISLNK
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	leaq	-288(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$255, %edx
	callq	_readlink
	cmpl	$5, %eax
	jl	LBB0_13
## %bb.3:
	leaq	L_.str(%rip), %rdi
	leaq	-288(%rbp), %rsi
	movl	$5, %edx
	callq	_memcmp
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_5:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_13
## %bb.6:
	movl	%eax, %ebx
	leaq	-288(%rbp), %rsi
	movl	%eax, %edi
	movl	$255, %edx
	callq	_read_in_full
	movl	%eax, %r15d
	movl	%ebx, %edi
	callq	_close
	testl	%r15d, %r15d
	js	LBB0_13
## %bb.7:
	movl	%r15d, %eax
	movb	$0, -288(%rbp,%rax)
	leaq	L_.str.1(%rip), %rsi
	leaq	-288(%rbp), %rdi
	leaq	-296(%rbp), %rdx
	callq	_skip_prefix
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	movq	-296(%rbp), %rax
	movsbl	(%rax), %edi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	callq	_isspace
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	movq	-296(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, -296(%rbp)
	movsbl	1(%rax), %edi
	jmp	LBB0_10
LBB0_11:
	movq	-296(%rbp), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_starts_with
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_13
LBB0_12:
	leaq	-288(%rbp), %rdi
	leaq	-312(%rbp), %rsi
	callq	_get_oid_hex
	xorl	%r14d, %r14d
	negl	%eax
	sbbl	%r14d, %r14d
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r14d, %eax
	addq	$296, %rsp                      ## imm = 0x128
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"refs/"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.1:                               ## @.str.1
	.asciz	"ref:"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_validate_headref               ; -- Begin function validate_headref
	.p2align	2
_validate_headref:                      ; @validate_headref
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #336
	.cfi_def_cfa_offset 336
	stp	x22, x21, [sp, #288]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #304]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #320]            ; 16-byte Folded Spill
	add	x29, sp, #320
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	add	x1, sp, #16
	bl	_lstat
	tbnz	x0, #63, LBB0_11
; %bb.1:
	ldr	w0, [sp, #16]
	bl	_S_ISLNK
	cbz	x0, LBB0_4
; %bb.2:
	add	x1, sp, #24
	mov	x0, x19
	mov	w2, #255
	bl	_readlink
	cmp	w0, #5
	b.lt	LBB0_11
; %bb.3:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	add	x1, sp, #24
	mov	w2, #5
	bl	_memcmp
	cbnz	w0, LBB0_11
	b	LBB0_12
LBB0_4:
Lloh5:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_open
	tbnz	w0, #31, LBB0_11
; %bb.5:
	mov	x19, x0
	add	x21, sp, #24
	add	x1, sp, #24
	mov	w2, #255
	bl	_read_in_full
	mov	x20, x0
	mov	x0, x19
	bl	_close
	tbnz	w20, #31, LBB0_11
; %bb.6:
	strb	wzr, [x21, w20, uxtw]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #24
	add	x2, sp, #8
	bl	_skip_prefix
	cbz	x0, LBB0_14
; %bb.7:
	ldr	x8, [sp, #8]
	ldrsb	w0, [x8]
	bl	_isspace
	cbz	x0, LBB0_9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #8]
	add	x9, x8, #1
	str	x9, [sp, #8]
	ldrsb	w0, [x8, #1]
	bl	_isspace
	cbnz	x0, LBB0_8
LBB0_9:
	ldr	x0, [sp, #8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_starts_with
	cbz	x0, LBB0_14
; %bb.10:
	mov	w0, #0
	b	LBB0_12
LBB0_11:
	mov	w0, #-1
LBB0_12:
	ldur	x8, [x29, #-40]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.13:
	ldp	x29, x30, [sp, #320]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #304]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #336
	ret
LBB0_14:
	add	x0, sp, #24
	mov	x1, sp
	bl	_get_oid_hex
	cmp	w0, #0
	csetm	w0, ne
	b	LBB0_12
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"refs/"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.1:                               ; @.str.1
	.asciz	"ref:"

.subsections_via_symbols
