	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smb_ctx_resolve                ## -- Begin function smb_ctx_resolve
	.p2align	4, 0x90
_smb_ctx_resolve:                       ## @smb_ctx_resolve
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SMBCF_RESOLVED@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	notl	%eax
	andl	%eax, (%rdi)
	movq	56(%rdi), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_1
## %bb.3:
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	_SMBL_SHARE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jl	LBB0_6
## %bb.4:
	movq	48(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
LBB0_6:
	movq	24(%r14), %rdi
	callq	_nb_ctx_resolve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
## %bb.7:
	movq	64(%r14), %rsi
	cmpq	$0, (%rsi)
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	callq	_strcpy
	movq	64(%r14), %rsi
LBB0_9:
	movq	_nls_lower@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rdi
	callq	_smb_addiconvtbl
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
## %bb.10:
	movq	64(%r14), %rsi
	movq	_nls_upper@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rdi
	callq	_smb_addiconvtbl
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
## %bb.11:
	movq	72(%r14), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_13
## %bb.12:
	movq	64(%r14), %rsi
	callq	_kiconv_add_xlat16_cspairs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
LBB0_13:
	movq	40(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	movl	32(%r14), %edx
	leaq	-64(%rbp), %rsi
	callq	_nb_resolvehost_in
	jmp	LBB0_16
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_smb_error
	jmp	LBB0_2
LBB0_5:
	movl	112(%r14), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_smb_error
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_33:
	movl	%ebx, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	24(%r14), %rsi
	movq	56(%r14), %rdi
	leaq	-64(%rbp), %rdx
	callq	_nbns_resolvename
LBB0_16:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_19
## %bb.17:
	leaq	L_.str.5(%rip), %rdi
LBB0_18:
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_smb_error
	jmp	LBB0_33
LBB0_19:
	movq	24(%r14), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_NBT_SERVER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	56(%r14), %rdi
	callq	_strlen
	movq	_NB_NAMELEN@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	jle	LBB0_21
## %bb.20:
	movq	_NBERR_NAMETOOLONG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_NBERROR
	movl	%eax, %ebx
	jmp	LBB0_33
LBB0_21:
	movq	56(%r14), %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	-64(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	callq	_nb_sockaddr
	movl	%eax, %ebx
	movq	-64(%rbp), %rdi
	callq	_nb_snbfree
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.22:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_18
LBB0_23:
	movq	-56(%rbp), %rax
	movq	%rax, 104(%r14)
	movq	16(%r14), %rsi
	cmpq	$0, (%rsi)
	je	LBB0_24
LBB0_27:
	movl	-40(%rbp), %edi
	movl	(%r12), %edx
	callq	_strlcpy
	movq	_NBT_WKSTA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	24(%r14), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	xorl	%edi, %edi
	callq	_nb_sockaddr
	testl	%eax, %eax
	je	LBB0_29
## %bb.28:
	movl	%eax, %ebx
	movq	-56(%rbp), %rdi
	callq	_nb_snbfree
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_18
LBB0_24:
	movq	%rsi, %rdi
	callq	_nb_getlocalname
	testl	%eax, %eax
	je	LBB0_26
## %bb.25:
	movl	%eax, %ebx
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_18
LBB0_29:
	movq	-72(%rbp), %rax
	movq	%rax, 96(%r14)
	movl	(%rax), %eax
	movl	%eax, 92(%r14)
	movq	-56(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, 88(%r14)
	movq	80(%r14), %rax
	cmpq	$0, (%rax)
	jne	LBB0_32
## %bb.30:
	movq	_SMBCF_NOPWD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	jne	LBB0_32
## %bb.31:
	leaq	L_.str.9(%rip), %rdi
	callq	_getpass
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_smb_ctx_setpassword
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
LBB0_32:
	movl	(%r15), %eax
	orl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_33
LBB0_26:
	movq	16(%r14), %rdi
	movq	%rdi, %rsi
	callq	_nls_str_upper
	movq	16(%r14), %rsi
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_SMBCF_RESOLVED,4,2             ## @SMBCF_RESOLVED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no server name specified"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SMBL_SHARE,8,3                 ## @SMBL_SHARE
L_.str.1:                               ## @.str.1
	.asciz	"no share name specified for %s@%s"

L_.str.2:                               ## @.str.2
	.asciz	"ISO8859-1"

L_.str.3:                               ## @.str.3
	.asciz	"tolower"

	.comm	_nls_lower,4,2                  ## @nls_lower
L_.str.4:                               ## @.str.4
	.asciz	"toupper"

	.comm	_nls_upper,4,2                  ## @nls_upper
L_.str.5:                               ## @.str.5
	.asciz	"can't get server address"

	.comm	_NBT_SERVER,4,2                 ## @NBT_SERVER
	.comm	_NB_NAMELEN,4,2                 ## @NB_NAMELEN
	.comm	_NBERR_NAMETOOLONG,4,2          ## @NBERR_NAMETOOLONG
L_.str.6:                               ## @.str.6
	.asciz	"can't allocate server address"

L_.str.7:                               ## @.str.7
	.asciz	"can't get local name"

	.comm	_NBT_WKSTA,4,2                  ## @NBT_WKSTA
L_.str.8:                               ## @.str.8
	.asciz	"can't allocate local address"

	.comm	_SMBCF_NOPWD,4,2                ## @SMBCF_NOPWD
L_.str.9:                               ## @.str.9
	.asciz	"Password:"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smb_ctx_resolve                ; -- Begin function smb_ctx_resolve
	.p2align	2
_smb_ctx_resolve:                       ; @smb_ctx_resolve
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x21, _SMBCF_RESOLVED@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SMBCF_RESOLVED@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	w9, [x0]
	bic	w8, w9, w8
	str	w8, [x0]
	ldr	x8, [x0, #56]
	ldr	x9, [x8]
	cbz	x9, LBB0_12
; %bb.1:
	mov	x19, x0
	ldr	x9, [x0, #8]
Lloh2:
	adrp	x10, _SMBL_SHARE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _SMBL_SHARE@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x9, x10
	b.lt	LBB0_3
; %bb.2:
	ldr	x9, [x19, #48]
	ldr	x9, [x9]
	cbz	x9, LBB0_13
LBB0_3:
	ldr	x0, [x19, #24]
	bl	_nb_ctx_resolve
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.4:
	ldr	x1, [x19, #64]
	ldr	x8, [x1]
	cbnz	x8, LBB0_6
; %bb.5:
Lloh5:
	adrp	x8, l_.str.2@PAGE
Lloh6:
	add	x8, x8, l_.str.2@PAGEOFF
	mov	x0, x1
	mov	x1, x8
	bl	_strcpy
	ldr	x1, [x19, #64]
LBB0_6:
Lloh7:
	adrp	x8, _nls_lower@GOTPAGE
Lloh8:
	ldr	x8, [x8, _nls_lower@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_smb_addiconvtbl
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.7:
	ldr	x1, [x19, #64]
Lloh12:
	adrp	x8, _nls_upper@GOTPAGE
Lloh13:
	ldr	x8, [x8, _nls_upper@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_smb_addiconvtbl
	mov	x20, x0
	cbnz	w0, LBB0_15
; %bb.8:
	ldr	x0, [x19, #72]
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	x1, [x19, #64]
	bl	_kiconv_add_xlat16_cspairs
	mov	x20, x0
	cbnz	w0, LBB0_15
LBB0_10:
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_16
; %bb.11:
	ldr	w2, [x19, #32]
	add	x1, sp, #40
	bl	_nb_resolvehost_in
	b	LBB0_17
LBB0_12:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_13:
	ldr	w9, [x19, #112]
	stp	x9, x8, [sp]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_14:
	mov	w1, #0
	bl	_smb_error
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w20, [x8]
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	ldr	x0, [x19, #56]
	ldr	x1, [x19, #24]
	add	x2, sp, #40
	bl	_nbns_resolvename
LBB0_17:
	mov	x20, x0
	cbz	w0, LBB0_20
; %bb.18:
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_19:
	mov	x1, x20
	bl	_smb_error
	b	LBB0_15
LBB0_20:
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _NBT_SERVER@GOTPAGE
Lloh27:
	ldr	x9, [x9, _NBT_SERVER@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #48]
	ldr	x0, [x19, #56]
	bl	_strlen
Lloh29:
	adrp	x22, _NB_NAMELEN@GOTPAGE
Lloh30:
	ldr	x22, [x22, _NB_NAMELEN@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w0, w8
	b.le	LBB0_22
; %bb.21:
Lloh31:
	adrp	x8, _NBERR_NAMETOOLONG@GOTPAGE
Lloh32:
	ldr	x8, [x8, _NBERR_NAMETOOLONG@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_NBERROR
	mov	x20, x0
	b	LBB0_15
LBB0_22:
	ldr	x1, [x19, #56]
	mov	w2, #4
	bl	_strlcpy
	ldr	x0, [sp, #40]
	add	x1, sp, #48
	add	x2, sp, #24
	bl	_nb_sockaddr
	mov	x20, x0
	ldr	x0, [sp, #40]
	bl	_nb_snbfree
	cbz	w20, LBB0_24
; %bb.23:
Lloh34:
	adrp	x0, l_.str.6@PAGE
Lloh35:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_19
LBB0_24:
	ldr	x8, [sp, #24]
	str	x8, [x19, #104]
	ldr	x1, [x19, #16]
	ldr	x8, [x1]
	cbz	x8, LBB0_27
LBB0_25:
	ldr	w0, [sp, #56]
	ldr	w2, [x22]
	bl	_strlcpy
Lloh36:
	adrp	x8, _NBT_WKSTA@GOTPAGE
Lloh37:
	ldr	x8, [x8, _NBT_WKSTA@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	str	w8, [sp, #52]
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	str	w8, [sp, #48]
	add	x1, sp, #48
	add	x2, sp, #32
	mov	x0, #0
	bl	_nb_sockaddr
	cbz	w0, LBB0_29
; %bb.26:
	mov	x20, x0
	ldr	x0, [sp, #24]
	bl	_nb_snbfree
Lloh39:
	adrp	x0, l_.str.8@PAGE
Lloh40:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_19
LBB0_27:
	mov	x0, x1
	bl	_nb_getlocalname
	cbz	w0, LBB0_33
; %bb.28:
	mov	x20, x0
Lloh41:
	adrp	x0, l_.str.7@PAGE
Lloh42:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_19
LBB0_29:
	ldr	x8, [sp, #32]
	str	x8, [x19, #96]
	ldr	w8, [x8]
	str	w8, [x19, #92]
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	str	w8, [x19, #88]
	ldr	x8, [x19, #80]
	ldr	x8, [x8]
	cbnz	x8, LBB0_32
; %bb.30:
	ldr	w8, [x19]
Lloh43:
	adrp	x9, _SMBCF_NOPWD@GOTPAGE
Lloh44:
	ldr	x9, [x9, _SMBCF_NOPWD@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_32
; %bb.31:
Lloh46:
	adrp	x0, l_.str.9@PAGE
Lloh47:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_getpass
	mov	x1, x0
	mov	x0, x19
	bl	_smb_ctx_setpassword
	mov	x20, x0
	cbnz	w0, LBB0_15
LBB0_32:
	mov	w20, #0
	ldr	w8, [x21]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_15
LBB0_33:
	ldr	x0, [x19, #16]
	mov	x1, x0
	bl	_nls_str_upper
	ldr	x1, [x19, #16]
	b	LBB0_25
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_SMBCF_RESOLVED,4,2             ; @SMBCF_RESOLVED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no server name specified"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SMBL_SHARE,8,3                 ; @SMBL_SHARE
l_.str.1:                               ; @.str.1
	.asciz	"no share name specified for %s@%s"

l_.str.2:                               ; @.str.2
	.asciz	"ISO8859-1"

l_.str.3:                               ; @.str.3
	.asciz	"tolower"

	.comm	_nls_lower,4,2                  ; @nls_lower
l_.str.4:                               ; @.str.4
	.asciz	"toupper"

	.comm	_nls_upper,4,2                  ; @nls_upper
l_.str.5:                               ; @.str.5
	.asciz	"can't get server address"

	.comm	_NBT_SERVER,4,2                 ; @NBT_SERVER
	.comm	_NB_NAMELEN,4,2                 ; @NB_NAMELEN
	.comm	_NBERR_NAMETOOLONG,4,2          ; @NBERR_NAMETOOLONG
l_.str.6:                               ; @.str.6
	.asciz	"can't allocate server address"

l_.str.7:                               ; @.str.7
	.asciz	"can't get local name"

	.comm	_NBT_WKSTA,4,2                  ; @NBT_WKSTA
l_.str.8:                               ; @.str.8
	.asciz	"can't allocate local address"

	.comm	_SMBCF_NOPWD,4,2                ; @SMBCF_NOPWD
l_.str.9:                               ; @.str.9
	.asciz	"Password:"

.subsections_via_symbols
