	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_serf__handle_basic_auth        ## -- Begin function serf__handle_basic_auth
	.p2align	4, 0x90
_serf__handle_basic_auth:               ## @serf__handle_basic_auth
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %r12
	movq	8(%r12), %r15
	cmpl	$0, 16(%r15)
	je	LBB0_1
## %bb.2:
	movq	%r8, %r13
	movq	%rsi, %r14
	cmpl	$401, %edi                      ## imm = 0x191
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_serf__get_authn_info_for_server
	jmp	LBB0_5
LBB0_1:
	movq	_SERF_ERROR_AUTHN_FAILED@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_4:
	movq	%r15, %rax
LBB0_5:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	$61, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	$5, %edx
	callq	_strncasecmp
	testq	%rax, %rax
	je	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
	movq	16(%rbp), %r13
	jmp	LBB0_16
LBB0_8:
	incq	%rbx
	movq	16(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_apr_pstrdup
	movq	%rax, %r13
	cmpb	$34, (%rax)
	jne	LBB0_9
## %bb.10:
	movq	%r13, %rdi
	callq	_strlen
	cltq
	cmpb	$34, -1(%rax,%r13)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	jne	LBB0_12
## %bb.11:
	movb	$0, -1(%r13,%rax)
	incq	%r13
LBB0_12:
	cmpl	$401, %ecx                      ## imm = 0x191
	jne	LBB0_13
LBB0_14:
	movq	_HOST@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_9:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$401, %ecx                      ## imm = 0x191
	je	LBB0_14
LBB0_13:
	movq	_PROXY@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %edi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movq	16(%rbp), %r13
	movq	%r13, %rcx
	callq	_serf__construct_realm
	movq	%rax, %rbx
LBB0_16:
	leaq	-56(%rbp), %rdi
	movq	%r13, %rsi
	callq	_apr_pool_create
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	(%r13), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	leaq	-96(%rbp), %rsi
	leaq	-88(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rcx
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %r9d
	pushq	-56(%rbp)
	pushq	%rbx
	pushq	%rax
	callq	_serf__provide_credentials
	addq	$32, %rsp
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi
	callq	_apr_pool_destroy
	jmp	LBB0_20
LBB0_18:
	movl	(%r12), %edi
	movq	-96(%rbp), %rsi
	movq	-88(%rbp), %rcx
	leaq	L_.str.1(%rip), %rdx
	xorl	%r8d, %r8d
	callq	_apr_pstrcat
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_strlen
	movl	%eax, %r14d
	movq	-56(%rbp), %rdi
	callq	_apr_pool_destroy
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	leaq	8(%rbx), %rdi
	movq	(%r13), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	movq	16(%rbp), %r8
	callq	_serf__encode_auth_header
	cmpl	$401, %r15d                     ## imm = 0x191
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, (%rbx)
	movq	_APR_SUCCESS@GOTPCREL(%rip), %rax
LBB0_19:
	movq	(%rax), %rbx
LBB0_20:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SERF_ERROR_AUTHN_FAILED,8,3    ## @SERF_ERROR_AUTHN_FAILED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"realm"

	.comm	_SERF_ERROR_AUTHN_MISSING_ATTRIBUTE,8,3 ## @SERF_ERROR_AUTHN_MISSING_ATTRIBUTE
	.comm	_HOST,4,2                       ## @HOST
	.comm	_PROXY,4,2                      ## @PROXY
L_.str.1:                               ## @.str.1
	.asciz	":"

L_.str.2:                               ## @.str.2
	.asciz	"Authorization"

L_.str.3:                               ## @.str.3
	.asciz	"Proxy-Authorization"

	.comm	_APR_SUCCESS,8,3                ## @APR_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_serf__handle_basic_auth        ; -- Begin function serf__handle_basic_auth
	.p2align	2
_serf__handle_basic_auth:               ; @serf__handle_basic_auth
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	ldr	x22, [x1]
	ldr	x25, [x22, #8]
	ldr	w8, [x25, #16]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x20, x6
	mov	x23, x5
	mov	x26, x4
	mov	x24, x1
	mov	x19, x0
	cmp	w0, #401
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_serf__get_authn_info_for_server
	mov	x21, x0
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _SERF_ERROR_AUTHN_FAILED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SERF_ERROR_AUTHN_FAILED@GOTPAGEOFF]
	b	LBB0_15
LBB0_4:
	mov	x21, x25
LBB0_5:
	ldr	x28, [x21, #8]
	mov	x0, x26
	mov	w1, #61
	bl	_strchr
	cbz	x0, LBB0_7
; %bb.6:
	mov	x27, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x26
	mov	w2, #5
	bl	_strncasecmp
	cbz	x0, LBB0_8
LBB0_7:
	mov	x26, #0
	b	LBB0_12
LBB0_8:
	add	x1, x27, #1
	mov	x0, x20
	bl	_apr_pstrdup
	mov	x26, x0
	ldrb	w8, [x0]
	cmp	w8, #34
	b.ne	LBB0_11
; %bb.9:
	mov	x0, x26
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	sub	x8, x8, #1
	ldrb	w9, [x26, x8]
	cmp	w9, #34
	b.ne	LBB0_11
; %bb.10:
	strb	wzr, [x26, x8]
	add	x26, x26, #1
LBB0_11:
Lloh4:
	adrp	x8, _HOST@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HOST@GOTPAGEOFF]
Lloh6:
	adrp	x9, _PROXY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PROXY@GOTPAGEOFF]
	cmp	w19, #401
	csel	x8, x8, x9, eq
	ldr	w0, [x8]
	mov	x1, x22
	mov	x2, x26
	mov	x3, x20
	bl	_serf__construct_realm
	mov	x26, x0
LBB0_12:
	add	x0, sp, #24
	mov	x1, x20
	bl	_apr_pool_create
	ldr	x8, [x21]
	ldr	w6, [x8]
	ldr	x8, [sp, #24]
	str	x8, [sp]
	add	x1, sp, #16
	add	x2, sp, #8
	mov	x0, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x19
	mov	x7, x26
	bl	_serf__provide_credentials
	cbz	x0, LBB0_14
; %bb.13:
	mov	x23, x0
	ldr	x0, [sp, #24]
	bl	_apr_pool_destroy
	b	LBB0_16
LBB0_14:
	ldr	w0, [x22]
	ldp	x3, x1, [sp, #8]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x4, #0
	bl	_apr_pstrcat
	mov	x22, x0
	bl	_strlen
	mov	x23, x0
	ldr	x0, [sp, #24]
	bl	_apr_pool_destroy
	add	x0, x28, #8
	ldr	x8, [x21]
	ldr	w1, [x8]
	mov	x2, x22
	mov	x3, x23
	mov	x4, x20
	bl	_serf__encode_auth_header
Lloh10:
	adrp	x8, l_.str.3@PAGE
Lloh11:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh12:
	adrp	x9, l_.str.2@PAGE
Lloh13:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w19, #401
	csel	x8, x9, x8, eq
	str	x8, [x28]
Lloh14:
	adrp	x8, _APR_SUCCESS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _APR_SUCCESS@GOTPAGEOFF]
LBB0_15:
	ldr	x23, [x8]
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SERF_ERROR_AUTHN_FAILED,8,3    ; @SERF_ERROR_AUTHN_FAILED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"realm"

	.comm	_SERF_ERROR_AUTHN_MISSING_ATTRIBUTE,8,3 ; @SERF_ERROR_AUTHN_MISSING_ATTRIBUTE
	.comm	_HOST,4,2                       ; @HOST
	.comm	_PROXY,4,2                      ; @PROXY
l_.str.1:                               ; @.str.1
	.asciz	":"

l_.str.2:                               ; @.str.2
	.asciz	"Authorization"

l_.str.3:                               ; @.str.3
	.asciz	"Proxy-Authorization"

	.comm	_APR_SUCCESS,8,3                ; @APR_SUCCESS
.subsections_via_symbols
