	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_http_fetch_ref                 ## -- Begin function http_fetch_ref
	.p2align	4, 0x90
_http_fetch_ref:                        ## @http_fetch_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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	$1, -56(%rbp)
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movups	(%rax), %xmm0
	movaps	%xmm0, -48(%rbp)
	movl	8(%rsi), %esi
	callq	_quote_ref_url
	movq	%rax, %r14
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	movq	%rax, %rdi
	callq	_http_get_strbuf
	movq	_HTTP_OK@GOTPCREL(%rip), %rcx
	movl	$-1, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	leaq	-48(%rbp), %rdi
	callq	_strbuf_rtrim
	movq	_the_hash_algo@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx
	movq	-40(%rbp), %rdi
	cmpq	(%rax), %rcx
	jne	LBB0_3
## %bb.2:
	addq	$4, %r15
	movq	%r15, %rsi
	callq	_get_oid_hex
	movl	%eax, %ebx
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str(%rip), %rsi
	callq	_starts_with
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	-40(%rbp), %rdi
	addq	$5, %rdi
	callq	_xstrdup
	movl	%eax, (%r15)
	xorl	%ebx, %ebx
LBB0_5:
	leaq	-48(%rbp), %rdi
	callq	_strbuf_release
	movq	%r14, %rdi
	callq	_free
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STRBUF_INIT,16,3               ## @STRBUF_INIT
	.comm	_HTTP_OK,8,3                    ## @HTTP_OK
	.comm	_the_hash_algo,8,3              ## @the_hash_algo
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ref: "

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_http_fetch_ref                 ; -- Begin function http_fetch_ref
	.p2align	2
_http_fetch_ref:                        ; @http_fetch_ref
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	w8, #1
	str	x8, [sp, #24]
Lloh0:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh2:
	ldr	q0, [x8]
	str	q0, [sp]
	ldr	w1, [x1, #8]
	bl	_quote_ref_url
	mov	x19, x0
	mov	x1, sp
	add	x2, sp, #24
	bl	_http_get_strbuf
Lloh3:
	adrp	x8, _HTTP_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HTTP_OK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.1:
	mov	x0, sp
	bl	_strbuf_rtrim
Lloh6:
	adrp	x8, _the_hash_algo@GOTPAGE
Lloh7:
	ldr	x8, [x8, _the_hash_algo@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldp	x9, x0, [sp]
	cmp	x9, x8
	b.ne	LBB0_3
; %bb.2:
	add	x1, x20, #4
	bl	_get_oid_hex
	mov	x21, x0
	b	LBB0_6
LBB0_3:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_starts_with
	cbz	x0, LBB0_5
; %bb.4:
	ldr	x8, [sp, #8]
	add	x0, x8, #5
	bl	_xstrdup
	mov	w21, #0
	str	w0, [x20]
	b	LBB0_6
LBB0_5:
	mov	w21, #-1
LBB0_6:
	mov	x0, sp
	bl	_strbuf_release
	mov	x0, x19
	bl	_free
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_STRBUF_INIT,16,3               ; @STRBUF_INIT
	.comm	_HTTP_OK,8,3                    ; @HTTP_OK
	.comm	_the_hash_algo,8,3              ; @the_hash_algo
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ref: "

.subsections_via_symbols
