	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function files_read_raw_ref
_files_read_raw_ref:                    ## @files_read_raw_ref
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	_REF_STORE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_files_downcast
	movq	%rax, %rbx
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rax, -80(%rbp)
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	$0, (%r15)
	leaq	-80(%rbp), %r15
	movq	%r15, %rdi
	callq	_strbuf_reset
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdx
	callq	_files_ref_path
	movl	$-3, %r12d
	movq	-80(%rbp), %r14
	movq	_ENOENT@GOTPCREL(%rip), %rbx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_1:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r12d
	je	LBB0_31
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	leaq	-104(%rbp), %rsi
	callq	_lstat
	testq	%rax, %rax
	js	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-104(%rbp), %r15d
	movl	%r15d, %edi
	callq	_S_ISLNK
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	-48(%rbp), %r13
	movq	%r13, %rdi
	callq	_strbuf_reset
	movl	-100(%rbp), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_strbuf_readlink
	testq	%rax, %rax
	js	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_starts_with
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_check_refname_format
	testl	%eax, %eax
	je	LBB0_25
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %edi
	callq	_S_ISDIR
	testq	%rax, %rax
	jne	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	testl	%eax, %eax
	jns	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$-1, %r13d
	cmpl	(%rbx), %eax
	jne	LBB0_32
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %edi
	callq	_S_ISLNK
	testq	%rax, %rax
	je	LBB0_1
	jmp	LBB0_32
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	(%rbx), %eax
	je	LBB0_1
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_1
	jmp	LBB0_31
LBB0_13:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$-1, %r13d
	cmpl	(%rbx), %eax
	jne	LBB0_32
## %bb.14:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_refs_read_raw_ref
	testq	%rax, %rax
	je	LBB0_27
## %bb.15:
	movl	(%rbx), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_32
LBB0_16:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_refs_read_raw_ref
	testq	%rax, %rax
	je	LBB0_27
## %bb.17:
	movq	_EISDIR@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_18:
	movl	%eax, %r13d
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_strbuf_reset
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_strbuf_read
	testq	%rax, %rax
	js	LBB0_24
## %bb.19:
	movl	%r13d, %edi
	callq	_close
	leaq	-48(%rbp), %rdi
	callq	_strbuf_rtrim
	movq	-48(%rbp), %rbx
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_starts_with
	testq	%rax, %rax
	je	LBB0_28
## %bb.20:
	addq	$3, %rbx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movsbl	1(%rbx), %edi
	incq	%rbx
	callq	_isspace
	testq	%rax, %rax
	jne	LBB0_21
## %bb.22:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_strbuf_reset
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_strbuf_addstr
	jmp	LBB0_26
LBB0_24:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movl	%r13d, %edi
	callq	_close
	movl	%r14d, (%r15)
	jmp	LBB0_31
LBB0_25:
	leaq	-48(%rbp), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_strbuf_swap
LBB0_26:
	movq	_REF_ISSYMREF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orl	%eax, (%rcx)
LBB0_27:
	xorl	%r13d, %r13d
	jmp	LBB0_32
LBB0_28:
	leaq	-112(%rbp), %rdx
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_parse_oid_hex
	testq	%rax, %rax
	je	LBB0_33
LBB0_29:
	movq	_REF_ISBROKEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orl	%eax, (%rcx)
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_31:
	movl	$-1, %r13d
LBB0_32:
	movq	_errno@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	leaq	-80(%rbp), %rdi
	callq	_strbuf_release
	leaq	-48(%rbp), %rdi
	callq	_strbuf_release
	movl	%ebx, (%r14)
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_33:
	movq	-112(%rbp), %rax
	movb	(%rax), %al
	xorl	%r13d, %r13d
	testb	%al, %al
	je	LBB0_32
## %bb.34:
	movsbl	%al, %edi
	callq	_isspace
	testq	%rax, %rax
	jne	LBB0_32
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_REF_STORE_READ,4,2             ## @REF_STORE_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read_raw_ref"

	.comm	_STRBUF_INIT,8,3                ## @STRBUF_INIT
	.comm	_errno,4,2                      ## @errno
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"refs/"

	.comm	_REF_ISSYMREF,4,2               ## @REF_ISSYMREF
	.comm	_EISDIR,4,2                     ## @EISDIR
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.2:                               ## @.str.2
	.asciz	"ref:"

	.comm	_REF_ISBROKEN,4,2               ## @REF_ISBROKEN
	.no_dead_strip	_files_read_raw_ref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function files_read_raw_ref
_files_read_raw_ref:                    ; @files_read_raw_ref
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x19, x4
	stp	x2, x3, [sp, #8]                ; 16-byte Folded Spill
	mov	x22, x1
Lloh0:
	adrp	x8, _REF_STORE_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REF_STORE_READ@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_files_downcast
	mov	x23, x0
Lloh5:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	stp	x8, x8, [sp, #48]
	str	x19, [sp, #24]                  ; 8-byte Folded Spill
	str	wzr, [x19]
	add	x0, sp, #48
	bl	_strbuf_reset
	add	x1, sp, #48
	mov	x0, x23
	mov	x2, x22
	bl	_files_ref_path
	mov	w20, #-3
	ldr	x24, [sp, #48]
Lloh8:
	adrp	x19, _O_RDONLY@GOTPAGE
Lloh9:
	ldr	x19, [x19, _O_RDONLY@GOTPAGEOFF]
Lloh10:
	adrp	x28, _errno@GOTPAGE
Lloh11:
	ldr	x28, [x28, _errno@GOTPAGEOFF]
Lloh12:
	adrp	x21, _ENOENT@GOTPAGE
Lloh13:
	ldr	x21, [x21, _ENOENT@GOTPAGEOFF]
Lloh14:
	adrp	x25, l_.str.1@PAGE
Lloh15:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x28]
	ldr	w9, [x21]
Lloh16:
	adrp	x10, _EINVAL@GOTPAGE
Lloh17:
	ldr	x10, [x10, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_29
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	adds	w20, w20, #1
	b.hs	LBB0_29
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #32
	mov	x0, x24
	bl	_lstat
	tbnz	x0, #63, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w26, [sp, #32]
	mov	x0, x26
	bl	_S_ISLNK
	cbz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #56
	bl	_strbuf_reset
	ldr	w2, [sp, #36]
	add	x0, sp, #56
	mov	x1, x24
	bl	_strbuf_readlink
	tbnz	x0, #63, LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp, #56]
	mov	x1, x25
	bl	_starts_with
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp, #56]
	mov	w1, #0
	bl	_check_refname_format
	cbz	w0, LBB0_23
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x26
	bl	_S_ISDIR
	cbnz	x0, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x19]
	mov	x0, x24
	bl	_open
	tbz	w0, #31, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x28]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_29
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x26
	bl	_S_ISLNK
	cbz	x0, LBB0_2
	b	LBB0_29
LBB0_12:
	ldr	w8, [x28]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_29
; %bb.13:
	ldr	w0, [x23]
	mov	x1, x22
	ldp	x2, x3, [sp, #8]                ; 16-byte Folded Reload
	ldr	x4, [sp, #24]                   ; 8-byte Folded Reload
	bl	_refs_read_raw_ref
	cbz	x0, LBB0_33
; %bb.14:
	ldr	w8, [x21]
	b	LBB0_28
LBB0_15:
	ldr	w0, [x23]
	mov	x1, x22
	ldp	x2, x3, [sp, #8]                ; 16-byte Folded Reload
	ldr	x4, [sp, #24]                   ; 8-byte Folded Reload
	bl	_refs_read_raw_ref
	cbz	x0, LBB0_33
; %bb.16:
Lloh19:
	adrp	x8, _EISDIR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EISDIR@GOTPAGEOFF]
	b	LBB0_27
LBB0_17:
	mov	x27, x0
	add	x0, sp, #56
	bl	_strbuf_reset
	add	x0, sp, #56
	mov	x1, x27
	mov	w2, #256
	bl	_strbuf_read
	tbnz	x0, #63, LBB0_22
; %bb.18:
	mov	x0, x27
	bl	_close
	add	x0, sp, #56
	bl	_strbuf_rtrim
	ldr	x22, [sp, #56]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_starts_with
	cbz	x0, LBB0_25
; %bb.19:
	add	x21, x22, #3
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldrsb	w0, [x21, #1]!
	bl	_isspace
	cbnz	x0, LBB0_20
; %bb.21:
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	mov	x0, x19
	bl	_strbuf_reset
	mov	x0, x19
	mov	x1, x21
	bl	_strbuf_addstr
	b	LBB0_24
LBB0_22:
	ldr	w19, [x28]
	mov	x0, x27
	bl	_close
	str	w19, [x28]
	b	LBB0_29
LBB0_23:
	add	x0, sp, #56
	ldr	x1, [sp, #16]                   ; 8-byte Folded Reload
	bl	_strbuf_swap
LBB0_24:
	mov	w20, #0
Lloh23:
	adrp	x8, _REF_ISSYMREF@GOTPAGE
Lloh24:
	ldr	x8, [x8, _REF_ISSYMREF@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	ldr	x10, [sp, #24]                  ; 8-byte Folded Reload
	ldr	w9, [x10]
	orr	w8, w9, w8
	str	w8, [x10]
	b	LBB0_30
LBB0_25:
	add	x2, sp, #40
	mov	x0, x22
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_parse_oid_hex
	cbz	x0, LBB0_31
LBB0_26:
Lloh26:
	adrp	x8, _REF_ISBROKEN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _REF_ISBROKEN@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldr	x10, [sp, #24]                  ; 8-byte Folded Reload
	ldr	w9, [x10]
	orr	w8, w9, w8
	str	w8, [x10]
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_27:
	ldr	w8, [x8]
LBB0_28:
	str	w8, [x28]
LBB0_29:
	mov	w20, #-1
LBB0_30:
	ldr	w19, [x28]
	add	x0, sp, #48
	bl	_strbuf_release
	add	x0, sp, #56
	bl	_strbuf_release
	str	w19, [x28]
	mov	x0, x20
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_31:
	ldr	x8, [sp, #40]
	ldrb	w8, [x8]
	cbz	w8, LBB0_33
; %bb.32:
	sxtb	w0, w8
	bl	_isspace
	cbz	x0, LBB0_26
LBB0_33:
	mov	w20, #0
	b	LBB0_30
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_REF_STORE_READ,4,2             ; @REF_STORE_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read_raw_ref"

	.comm	_STRBUF_INIT,8,3                ; @STRBUF_INIT
	.comm	_errno,4,2                      ; @errno
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"refs/"

	.comm	_REF_ISSYMREF,4,2               ; @REF_ISSYMREF
	.comm	_EISDIR,4,2                     ; @EISDIR
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.2:                               ; @.str.2
	.asciz	"ref:"

	.comm	_REF_ISBROKEN,4,2               ; @REF_ISBROKEN
	.no_dead_strip	_files_read_raw_ref
.subsections_via_symbols
