	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_net_open                    ## -- Begin function hb_net_open
	.p2align	4, 0x90
_hb_net_open:                           ## @hb_net_open
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	$4, %edi
	movl	$1, %esi
	callq	_calloc
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_gethostbyname
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movl	(%rbx), %eax
	movl	%eax, -40(%rbp)
	movl	%r14d, %edi
	callq	_htons
	movl	%eax, -44(%rbp)
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	movq	%r12, %rdi
	callq	_memcpy
	movl	(%rbx), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, (%r15)
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	leaq	-48(%rbp), %rsi
	movl	%eax, %edi
	movl	$12, %edx
	callq	_connect
	testq	%rax, %rax
	jns	LBB0_8
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_hb_log
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
LBB0_6:
	xorl	%eax, %eax
	callq	_hb_log
LBB0_7:
	movq	%r15, %rdi
	callq	_free
	xorl	%r15d, %r15d
LBB0_8:
	movq	%r15, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gethostbyname failed (%s)"

	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.1:                               ## @.str.1
	.asciz	"socket failed"

L_.str.2:                               ## @.str.2
	.asciz	"connect failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_net_open                    ; -- Begin function hb_net_open
	.p2align	2
_hb_net_open:                           ; @hb_net_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x22, x0
	mov	w0, #4
	mov	w1, #1
	bl	_calloc
	mov	x19, x0
	mov	x0, x22
	bl	_gethostbyname
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #12
	bl	_memset
	ldr	w8, [x21]
	str	w8, [sp, #24]
	mov	x0, x20
	bl	_htons
	str	w0, [sp, #20]
	ldp	w2, w1, [x21, #4]
	add	x0, sp, #16
	bl	_memcpy
	ldr	w0, [x21]
Lloh0:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	str	w0, [x19]
	tbnz	w0, #31, LBB0_5
; %bb.2:
	add	x1, sp, #16
	mov	w2, #12
	bl	_connect
	tbz	x0, #63, LBB0_7
; %bb.3:
Lloh3:
	adrp	x0, l_.str.2@PAGE
Lloh4:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
	str	x22, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_hb_log
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gethostbyname failed (%s)"

	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.1:                               ; @.str.1
	.asciz	"socket failed"

l_.str.2:                               ; @.str.2
	.asciz	"connect failed"

.subsections_via_symbols
