	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_ssl
_setup_ssl:                             ## @setup_ssl
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movl	%esi, %r14d
	callq	_SSL_new
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_ssl_err
LBB0_4:
	movq	%rbx, %rdi
	callq	_SSL_set_connect_state
	movq	_SSL_MODE_AUTO_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_SSL_set_mode
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_SSL_set_fd
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_ssl_err
LBB0_6:
	xorl	%eax, %eax
	callq	_ERR_clear_error
	movq	%rbx, %rdi
	callq	_SSL_do_handshake
	cmpl	$1, %eax
	jne	LBB0_7
LBB0_12:
	movq	%rbx, %rdi
	callq	_SSL_get_verify_result
	movq	_X509_V_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.3(%rip), %rdi
	callq	_ssl_err
LBB0_14:
	movq	%rbx, %rdi
	callq	_SSL_get_peer_certificate
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:
	leaq	L_.str.4(%rip), %rdi
	callq	_ssl_err
LBB0_16:
	movq	%r14, %rdi
	callq	_X509_free
	jmp	LBB0_17
LBB0_1:
	xorl	%ebx, %ebx
LBB0_17:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_SSL_ERROR_WANT_READ@GOTPCREL(%rip), %r15
	movq	_SSL_ERROR_WANT_WRITE@GOTPCREL(%rip), %r12
	leaq	L_.str.2(%rip), %r14
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
	callq	_ERR_clear_error
	movq	%rbx, %rdi
	callq	_SSL_do_handshake
	cmpl	$1, %eax
	je	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_SSL_get_error
	cmpl	(%r15), %eax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	(%r12), %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	callq	_ssl_err
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not SSL_new"

	.comm	_SSL_MODE_AUTO_RETRY,4,2        ## @SSL_MODE_AUTO_RETRY
L_.str.1:                               ## @.str.1
	.asciz	"could not SSL_set_fd"

	.comm	_SSL_ERROR_WANT_READ,4,2        ## @SSL_ERROR_WANT_READ
	.comm	_SSL_ERROR_WANT_WRITE,4,2       ## @SSL_ERROR_WANT_WRITE
L_.str.2:                               ## @.str.2
	.asciz	"SSL handshake failed"

	.comm	_X509_V_OK,8,3                  ## @X509_V_OK
L_.str.3:                               ## @.str.3
	.asciz	"SSL verification failed"

L_.str.4:                               ## @.str.4
	.asciz	"Server presented no peer certificate"

	.no_dead_strip	_setup_ssl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_ssl
_setup_ssl:                             ; @setup_ssl
	.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_11
; %bb.1:
	mov	x20, x1
	bl	_SSL_new
	mov	x19, x0
	cbnz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ssl_err
LBB0_3:
	mov	x0, x19
	bl	_SSL_set_connect_state
Lloh2:
	adrp	x8, _SSL_MODE_AUTO_RETRY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SSL_MODE_AUTO_RETRY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_SSL_set_mode
	mov	x0, x19
	mov	x1, x20
	bl	_SSL_set_fd
	cbnz	w0, LBB0_5
; %bb.4:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ssl_err
LBB0_5:
	bl	_ERR_clear_error
	mov	x0, x19
	bl	_SSL_do_handshake
	cmp	w0, #1
	b.ne	LBB0_13
LBB0_6:
	mov	x0, x19
	bl	_SSL_get_verify_result
Lloh7:
	adrp	x8, _X509_V_OK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _X509_V_OK@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_8
; %bb.7:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ssl_err
LBB0_8:
	mov	x0, x19
	bl	_SSL_get_peer_certificate
	mov	x20, x0
	cbnz	x0, LBB0_10
; %bb.9:
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_ssl_err
LBB0_10:
	mov	x0, x20
	bl	_X509_free
	b	LBB0_12
LBB0_11:
	mov	x19, #0
LBB0_12:
	mov	x0, x19
	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
LBB0_13:
	mov	x1, x0
Lloh14:
	adrp	x21, _SSL_ERROR_WANT_READ@GOTPAGE
Lloh15:
	ldr	x21, [x21, _SSL_ERROR_WANT_READ@GOTPAGEOFF]
Lloh16:
	adrp	x22, _SSL_ERROR_WANT_WRITE@GOTPAGE
Lloh17:
	ldr	x22, [x22, _SSL_ERROR_WANT_WRITE@GOTPAGEOFF]
Lloh18:
	adrp	x20, l_.str.2@PAGE
Lloh19:
	add	x20, x20, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	bl	_ERR_clear_error
	mov	x0, x19
	bl	_SSL_do_handshake
	mov	x1, x0
	cmp	w0, #1
	b.eq	LBB0_6
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_SSL_get_error
	ldr	w8, [x21]
	ldr	w9, [x22]
	cmp	w0, w8
	ccmp	w0, w9, #4, ne
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x20
	bl	_ssl_err
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not SSL_new"

	.comm	_SSL_MODE_AUTO_RETRY,4,2        ; @SSL_MODE_AUTO_RETRY
l_.str.1:                               ; @.str.1
	.asciz	"could not SSL_set_fd"

	.comm	_SSL_ERROR_WANT_READ,4,2        ; @SSL_ERROR_WANT_READ
	.comm	_SSL_ERROR_WANT_WRITE,4,2       ; @SSL_ERROR_WANT_WRITE
l_.str.2:                               ; @.str.2
	.asciz	"SSL handshake failed"

	.comm	_X509_V_OK,8,3                  ; @X509_V_OK
l_.str.3:                               ; @.str.3
	.asciz	"SSL verification failed"

l_.str.4:                               ; @.str.4
	.asciz	"Server presented no peer certificate"

	.no_dead_strip	_setup_ssl
.subsections_via_symbols
