	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function extract_referer_site
_extract_referer_site:                  ## @extract_referer_site
	.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
	movl	$1, %ebx
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	cmpb	$0, (%rdi)
	je	LBB0_7
## %bb.2:
	movq	%rsi, %r14
	callq	_strdup
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_strstr
	movl	$1, %ebx
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %r12
	addq	$2, %r12
	movq	%r12, %rdi
	callq	_strlen
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	$47, %esi
	callq	_strchr
	movl	%eax, %ecx
	subl	%r12d, %ecx
	testq	%rax, %rax
	cmovel	%r13d, %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.5:
	movq	_REF_SITE_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%ebx, %ecx
	cmovll	%ecx, %ebx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movslq	%ebx, %rax
	movb	$0, (%r14,%rax)
	xorl	%ebx, %ebx
LBB0_6:
	movq	%r15, %rdi
	callq	_free
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"//"

	.comm	_REF_SITE_LEN,4,2               ## @REF_SITE_LEN
	.no_dead_strip	_extract_referer_site
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function extract_referer_site
_extract_referer_site:                  ; @extract_referer_site
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_6
; %bb.1:
	ldrb	w8, [x0]
	cbz	w8, LBB0_6
; %bb.2:
	mov	x20, x1
	bl	_strdup
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_7
; %bb.3:
	add	x21, x0, #2
	mov	x0, x21
	bl	_strlen
	cbz	w0, LBB0_7
; %bb.4:
	mov	x22, x0
	mov	x0, x21
	mov	w1, #47
	bl	_strchr
	sub	w8, w0, w21
	cmp	x0, #0
	csel	w8, w22, w8, eq
	cbz	w8, LBB0_7
; %bb.5:
Lloh2:
	adrp	x9, _REF_SITE_LEN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _REF_SITE_LEN@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w22, w8, w9, lt
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_memcpy
	mov	w21, #0
	strb	wzr, [x20, w22, sxtw]
	b	LBB0_8
LBB0_6:
	mov	w21, #1
	b	LBB0_9
LBB0_7:
	mov	w21, #1
LBB0_8:
	mov	x0, x19
	bl	_free
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"//"

	.comm	_REF_SITE_LEN,4,2               ; @REF_SITE_LEN
	.no_dead_strip	_extract_referer_site
.subsections_via_symbols
