	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function generate_random_port
_generate_random_port:                  ## @generate_random_port
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_printf
	movq	_portrange_first@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jne	LBB0_2
## %bb.1:
	movq	_PORTRANGE_FIRST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_int_via_sysctlbyname
	movl	%eax, (%r14)
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
LBB0_2:
	movq	_portrange_last@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jne	LBB0_4
## %bb.3:
	movq	_PORTRANGE_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_int_via_sysctlbyname
	movl	%eax, (%r15)
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
LBB0_4:
	movl	%ebx, %edi
	callq	_srand
	xorl	%eax, %eax
	callq	_rand
	movl	(%r15), %ecx
	movl	(%r14), %ebx
	subl	%ebx, %ecx
	cltd
	idivl	%ecx
	addl	%edx, %ebx
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	callq	_printf
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Generating a random port with seed=%d\n"

	.comm	_portrange_first,4,2            ## @portrange_first
	.comm	_PORTRANGE_FIRST,4,2            ## @PORTRANGE_FIRST
L_.str.1:                               ## @.str.1
	.asciz	"Port range lower bound: %d\n"

	.comm	_portrange_last,4,2             ## @portrange_last
	.comm	_PORTRANGE_LAST,4,2             ## @PORTRANGE_LAST
L_.str.2:                               ## @.str.2
	.asciz	"Port range upper bound: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Random port generated: %d\n"

	.no_dead_strip	_generate_random_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function generate_random_port
_generate_random_port:                  ; @generate_random_port
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_printf
Lloh2:
	adrp	x20, _portrange_first@GOTPAGE
Lloh3:
	ldr	x20, [x20, _portrange_first@GOTPAGEOFF]
	ldr	w8, [x20]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _PORTRANGE_FIRST@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PORTRANGE_FIRST@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_get_int_via_sysctlbyname
	mov	x1, x0
	str	w0, [x20]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
LBB0_2:
Lloh9:
	adrp	x21, _portrange_last@GOTPAGE
Lloh10:
	ldr	x21, [x21, _portrange_last@GOTPAGEOFF]
	ldr	w8, [x21]
	cbnz	w8, LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _PORTRANGE_LAST@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PORTRANGE_LAST@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_get_int_via_sysctlbyname
	mov	x1, x0
	str	w0, [x21]
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
LBB0_4:
	mov	x0, x19
	bl	_srand
	bl	_rand
	ldr	w8, [x21]
	ldr	w9, [x20]
	sub	w8, w8, w9
	sdiv	w10, w0, w8
	msub	w8, w10, w8, w0
	add	w19, w8, w9
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_printf
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Generating a random port with seed=%d\n"

	.comm	_portrange_first,4,2            ; @portrange_first
	.comm	_PORTRANGE_FIRST,4,2            ; @PORTRANGE_FIRST
l_.str.1:                               ; @.str.1
	.asciz	"Port range lower bound: %d\n"

	.comm	_portrange_last,4,2             ; @portrange_last
	.comm	_PORTRANGE_LAST,4,2             ; @PORTRANGE_LAST
l_.str.2:                               ; @.str.2
	.asciz	"Port range upper bound: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Random port generated: %d\n"

	.no_dead_strip	_generate_random_port
.subsections_via_symbols
