	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_port_protocol_socktype
_get_port_protocol_socktype:            ## @get_port_protocol_socktype
	.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	%r8, %r13
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rdi, %r15
	movl	$0, (%r8)
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	%rsi, %r14
	movq	(%rsi), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.2:
	callq	_getprotobynumber
	testq	%rax, %rax
	je	LBB0_14
## %bb.3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rbx
	movl	8(%rax), %eax
	movq	%r12, %rcx
	movl	%eax, (%r12)
	jmp	LBB0_6
LBB0_4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_5:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
LBB0_6:
	movl	8(%r14), %eax
	movl	%eax, (%r13)
LBB0_7:
	movq	_SOCK_STREAM@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	jne	LBB0_10
## %bb.8:
	testq	%rbx, %rbx
	leaq	L_.str(%rip), %rsi
	cmovneq	%rbx, %rsi
	movq	%r15, %r14
	movq	%r15, %rdi
	callq	_getservbyname
	testq	%rbx, %rbx
	jne	LBB0_18
## %bb.15:
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_10:
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.11:
	testq	%rbx, %rbx
	leaq	L_.str.1(%rip), %rsi
	cmovneq	%rbx, %rsi
	movq	%r15, %r14
	movq	%r15, %rdi
	callq	_getservbyname
	testq	%rbx, %rbx
	jne	LBB0_18
## %bb.16:
	movq	_IPPROTO_UDP@GOTPCREL(%rip), %rcx
LBB0_17:
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
LBB0_18:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_21
LBB0_20:
	movl	(%rax), %eax
	movl	%eax, (%r15)
	jmp	LBB0_22
LBB0_13:
	testl	%eax, %eax
	je	LBB0_25
LBB0_14:
	movq	_EAI_SOCKTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_23
LBB0_25:
	testq	%rbx, %rbx
	je	LBB0_27
## %bb.26:
	movq	%r15, %r14
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_getservbyname
	jmp	LBB0_18
LBB0_27:
	movq	%rcx, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_getservbyname
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
	movl	(%r14), %ecx
	movq	%r15, %r14
	movl	%ecx, (%r13)
	testq	%rax, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_20
## %bb.28:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_getservbyname
	movq	_IPPROTO_UDP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
	movl	(%rbx), %ecx
	movl	%ecx, (%r13)
	testq	%rax, %rax
	jne	LBB0_20
LBB0_21:
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	movl	$10, %edx
	callq	_strtol
	movl	%eax, %edi
	callq	_htons
	movl	%eax, (%r15)
	cmpq	%r14, -56(%rbp)
	je	LBB0_24
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	_EAI_NONAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_EAI_SOCKTYPE,4,2               ## @EAI_SOCKTYPE
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp"

	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.comm	_SOCK_DGRAM,4,2                 ## @SOCK_DGRAM
L_.str.1:                               ## @.str.1
	.asciz	"udp"

	.comm	_IPPROTO_UDP,4,2                ## @IPPROTO_UDP
	.comm	_EAI_NONAME,4,2                 ## @EAI_NONAME
	.no_dead_strip	_get_port_protocol_socktype
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_port_protocol_socktype
_get_port_protocol_socktype:            ; @get_port_protocol_socktype
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x4
	mov	x21, x3
	mov	x19, x2
	mov	x20, x0
	str	wzr, [x4]
	cbz	x1, LBB0_4
; %bb.1:
	mov	x24, x1
	ldr	x0, [x1]
	cbz	x0, LBB0_5
; %bb.2:
	bl	_getprotobynumber
	cbz	x0, LBB0_19
; %bb.3:
	ldr	x23, [x0]
	ldr	w8, [x0, #8]
	str	w8, [x21]
	b	LBB0_6
LBB0_4:
	mov	w8, #0
	mov	x23, #0
	b	LBB0_7
LBB0_5:
	mov	x23, #0
LBB0_6:
	ldr	w8, [x24, #8]
	str	w8, [x22]
LBB0_7:
Lloh0:
	adrp	x25, _SOCK_STREAM@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SOCK_STREAM@GOTPAGEOFF]
	ldr	w9, [x25]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.8:
Lloh2:
	adrp	x8, l_.str@PAGE
Lloh3:
	add	x8, x8, l_.str@PAGEOFF
	cmp	x23, #0
	csel	x1, x8, x23, eq
	mov	x0, x20
	bl	_getservbyname
	cbnz	x23, LBB0_14
; %bb.9:
Lloh4:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh6:
	adrp	x24, _SOCK_DGRAM@GOTPAGE
Lloh7:
	ldr	x24, [x24, _SOCK_DGRAM@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w8, w9
	b.ne	LBB0_18
; %bb.11:
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
	cmp	x23, #0
	csel	x1, x8, x23, eq
	mov	x0, x20
	bl	_getservbyname
	cbnz	x23, LBB0_14
; %bb.12:
Lloh10:
	adrp	x8, _IPPROTO_UDP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IPPROTO_UDP@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_14:
	cbz	x0, LBB0_16
LBB0_15:
	ldr	w8, [x0]
	str	w8, [x19]
	b	LBB0_17
LBB0_16:
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #10
	bl	_strtol
	bl	_htons
	str	w0, [x19]
	ldr	x8, [sp, #8]
	cmp	x8, x20
	b.eq	LBB0_20
LBB0_17:
	mov	w0, #0
	b	LBB0_22
LBB0_18:
	cbz	w8, LBB0_23
LBB0_19:
Lloh12:
	adrp	x8, _EAI_SOCKTYPE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EAI_SOCKTYPE@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:
Lloh14:
	adrp	x8, _EAI_NONAME@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EAI_NONAME@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
LBB0_22:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_23:
	cbz	x23, LBB0_25
; %bb.24:
	mov	x0, x20
	mov	x1, x23
	bl	_getservbyname
	b	LBB0_14
LBB0_25:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_getservbyname
Lloh18:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x21]
	ldr	w8, [x25]
	str	w8, [x22]
	cbnz	x0, LBB0_15
; %bb.26:
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_getservbyname
Lloh23:
	adrp	x8, _IPPROTO_UDP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IPPROTO_UDP@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [x21]
	ldr	w8, [x24]
	str	w8, [x22]
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EAI_SOCKTYPE,4,2               ; @EAI_SOCKTYPE
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp"

	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.comm	_SOCK_DGRAM,4,2                 ; @SOCK_DGRAM
l_.str.1:                               ; @.str.1
	.asciz	"udp"

	.comm	_IPPROTO_UDP,4,2                ; @IPPROTO_UDP
	.comm	_EAI_NONAME,4,2                 ; @EAI_NONAME
	.no_dead_strip	_get_port_protocol_socktype
.subsections_via_symbols
