	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function http_connect
_http_connect:                          ## @http_connect
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_AF_INET@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movl	$118, %edi
	callq	_CHECK_FLAG
	movl	%eax, %r15d
	movl	$52, %edi
	callq	_CHECK_FLAG
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r12), %ebx
LBB0_2:
	testq	%r13, %r13
	movq	%r14, %rax
	cmovneq	%r13, %rax
	movl	4(%rax), %esi
	movl	8(%rax), %edi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	callq	_fetch_connect
	testq	%rax, %rax
	je	LBB0_20
## %bb.3:
	movq	%rax, %r12
	leaq	-44(%rbp), %rdi
	callq	_init_http_headerbuf
	movl	(%r14), %edi
	movq	_SCHEME_HTTPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strcmp
	testq	%r13, %r13
	je	LBB0_12
## %bb.4:
	testq	%rax, %rax
	jne	LBB0_12
## %bb.5:
	movl	4(%r14), %ecx
	movl	8(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_http_cmd
	movl	4(%r14), %ecx
	movl	8(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_http_cmd
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_http_cmd
	movq	%r12, %rdi
	callq	_http_get_reply
	movq	_HTTP_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.7:
	movq	%r12, %rdi
	callq	_fetch_getln
	testq	%rax, %rax
	js	LBB0_15
## %bb.8:
	leaq	-44(%rbp), %r13
	leaq	-56(%rbp), %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_http_next_header
	cmpq	$129, %rax
	je	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$128, %rax
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_hdr_end@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_9
LBB0_12:
	movl	(%r14), %edi
	movq	_SCHEME_HTTPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_16
## %bb.13:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_fetch_ssl
	cmpl	$-1, %eax
	je	LBB0_14
LBB0_16:
	movl	$1, -48(%rbp)
	movl	(%r12), %edi
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TCP_NOPUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movl	$4, %r8d
	callq	_setsockopt
	leaq	-44(%rbp), %rdi
	callq	_clean_http_headerbuf
	jmp	LBB0_21
LBB0_6:
	movl	4(%r12), %edi
LBB0_18:
	callq	_http_seterr
	jmp	LBB0_19
LBB0_14:
	movq	_EAUTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_15:
	xorl	%eax, %eax
	callq	_fetch_syserr
LBB0_19:
	movq	_errno@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	leaq	-44(%rbp), %rdi
	callq	_clean_http_headerbuf
	movq	%r12, %rdi
	callq	_fetch_close
	movl	%ebx, (%r14)
LBB0_20:
	xorl	%r12d, %r12d
LBB0_21:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_HTTP_PROTOCOL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_SCHEME_HTTPS,4,2               ## @SCHEME_HTTPS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CONNECT %s:%d HTTP/1.1"

L_.str.1:                               ## @.str.1
	.asciz	"Host: %s:%d"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_HTTP_OK,8,3                    ## @HTTP_OK
	.comm	_HTTP_PROTOCOL_ERROR,4,2        ## @HTTP_PROTOCOL_ERROR
	.comm	_hdr_end,8,3                    ## @hdr_end
	.comm	_EAUTH,4,2                      ## @EAUTH
	.comm	_errno,4,2                      ## @errno
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.comm	_TCP_NOPUSH,4,2                 ## @TCP_NOPUSH
	.comm	_AF_INET6,4,2                   ## @AF_INET6
	.comm	_AF_UNSPEC,4,2                  ## @AF_UNSPEC
	.no_dead_strip	_http_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function http_connect
_http_connect:                          ; @http_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x19, _AF_INET@GOTPAGE
Lloh1:
	ldr	x19, [x19, _AF_INET@GOTPAGEOFF]
	ldr	w23, [x19]
	mov	w0, #118
	bl	_CHECK_FLAG
	mov	x21, x0
	mov	w0, #52
	bl	_CHECK_FLAG
	ldr	w8, [x19]
	cmp	w0, #0
	csel	w2, w23, w8, eq
	cmp	x22, #0
	csel	x8, x22, x20, ne
	ldp	w1, w0, [x8, #4]
	mov	x3, x21
	bl	_fetch_connect
	mov	x19, x0
	cbz	x0, LBB0_17
; %bb.1:
	add	x0, sp, #44
	bl	_init_http_headerbuf
	ldr	w0, [x20]
Lloh2:
	adrp	x23, _SCHEME_HTTPS@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SCHEME_HTTPS@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_strcmp
	cbz	x22, LBB0_9
; %bb.2:
	cbnz	x0, LBB0_9
; %bb.3:
	ldp	w9, w8, [x20, #4]
	stp	x8, x9, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_http_cmd
	ldp	w9, w8, [x20, #4]
	stp	x8, x9, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_http_cmd
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_http_cmd
	mov	x0, x19
	bl	_http_get_reply
Lloh10:
	adrp	x8, _HTTP_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HTTP_OK@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.4:
	mov	x0, x19
	bl	_fetch_getln
	tbnz	x0, #63, LBB0_15
; %bb.5:
Lloh13:
	adrp	x22, _hdr_end@GOTPAGE
Lloh14:
	ldr	x22, [x22, _hdr_end@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #44
	add	x2, sp, #32
	mov	x0, x19
	bl	_http_next_header
	cmp	x0, #129
	b.eq	LBB0_18
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	x0, #128
	b.eq	LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22]
	cmp	x0, x8
	b.gt	LBB0_6
LBB0_9:
	ldr	w0, [x20]
	ldr	w1, [x23]
	bl	_strcmp
	cbnz	x0, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_fetch_ssl
	cmn	w0, #1
	b.eq	LBB0_14
LBB0_11:
	mov	w8, #1
	str	w8, [sp, #28]
	ldr	w0, [x19]
Lloh15:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _TCP_NOPUSH@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TCP_NOPUSH@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	add	x3, sp, #28
	mov	w4, #4
	bl	_setsockopt
	add	x0, sp, #44
	bl	_clean_http_headerbuf
	b	LBB0_17
LBB0_12:
	ldr	w0, [x19, #4]
LBB0_13:
	bl	_http_seterr
	b	LBB0_16
LBB0_14:
Lloh21:
	adrp	x8, _EAUTH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EAUTH@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _errno@GOTPAGE
Lloh25:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh26:
	str	w8, [x9]
LBB0_15:
	bl	_fetch_syserr
LBB0_16:
Lloh27:
	adrp	x20, _errno@GOTPAGE
Lloh28:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w21, [x20]
	add	x0, sp, #44
	bl	_clean_http_headerbuf
	mov	x0, x19
	bl	_fetch_close
	mov	x19, #0
	str	w21, [x20]
LBB0_17:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
Lloh29:
	adrp	x8, _HTTP_PROTOCOL_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _HTTP_PROTOCOL_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_SCHEME_HTTPS,4,2               ; @SCHEME_HTTPS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CONNECT %s:%d HTTP/1.1"

l_.str.1:                               ; @.str.1
	.asciz	"Host: %s:%d"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_HTTP_OK,8,3                    ; @HTTP_OK
	.comm	_HTTP_PROTOCOL_ERROR,4,2        ; @HTTP_PROTOCOL_ERROR
	.comm	_hdr_end,8,3                    ; @hdr_end
	.comm	_EAUTH,4,2                      ; @EAUTH
	.comm	_errno,4,2                      ; @errno
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.comm	_TCP_NOPUSH,4,2                 ; @TCP_NOPUSH
	.comm	_AF_INET6,4,2                   ; @AF_INET6
	.comm	_AF_UNSPEC,4,2                  ; @AF_UNSPEC
	.no_dead_strip	_http_connect
.subsections_via_symbols
