	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_debugnet_arp_gw                ## -- Begin function debugnet_arp_gw
	.p2align	4, 0x90
_debugnet_arp_gw:                       ## @debugnet_arp_gw
	.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	%rdi, %rbx
	leaq	16(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_debugnet_npolls@GOTPCREL(%rip), %r12
	movq	_DN_STATE_HAVE_GW_MAC@GOTPCREL(%rip), %r15
	movq	%rdi, %rax
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##       Child Loop BB0_6 Depth 3
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_debugnet_arp_nretries@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_6 Depth 3
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_debugnet_send_arp
	testl	%eax, %eax
	jne	LBB0_17
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	cmpl	$0, (%r12)
	jle	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_1 Depth=1
                                        ##     Parent Loop BB0_3 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	8(%rbx), %rax
	cmpq	(%r15), %rax
	jge	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=3
	movq	%rbx, %rdi
	callq	_debugnet_network_poll
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_DELAY
	incl	%r14d
	cmpl	(%r12), %r14d
	jl	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=2
	movq	8(%rbx), %rax
	cmpq	(%r15), %rax
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=2
	leaq	L_.str(%rip), %rdi
	callq	_printf
	incl	%r13d
	movq	_debugnet_arp_nretries@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jl	LBB0_3
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rax
	cmpq	(%r15), %rax
	jge	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	(%rbx), %rax
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_printf
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rax
	movq	_INADDR_ANY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_str.6(%rip), %rdi
	callq	_puts
	movq	%r14, %rax
	jmp	LBB0_1
LBB0_11:
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_13:
	leaq	L_str(%rip), %rdi
	jmp	LBB0_16
LBB0_15:
	leaq	L_str.5(%rip), %rdi
LBB0_16:
	callq	_puts
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debugnet_arp_nretries,4,2      ## @debugnet_arp_nretries
	.comm	_debugnet_npolls,4,2            ## @debugnet_npolls
	.comm	_DN_STATE_HAVE_GW_MAC,8,3       ## @DN_STATE_HAVE_GW_MAC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(ARP retry)"

L_.str.1:                               ## @.str.1
	.asciz	"\nFailed to ARP server"

	.comm	_INADDR_ANY,8,3                 ## @INADDR_ANY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_str:                                  ## @str
	.asciz	"\nFailed to ARP gateway."

L_str.5:                                ## @str.5
	.asciz	"."

L_str.6:                                ## @str.6
	.asciz	", trying to reach gateway..."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_debugnet_arp_gw                ; -- Begin function debugnet_arp_gw
	.p2align	2
_debugnet_arp_gw:                       ; @debugnet_arp_gw
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x25, _debugnet_arp_nretries@GOTPAGE
Lloh1:
	ldr	x25, [x25, _debugnet_arp_nretries@GOTPAGEOFF]
Lloh2:
	adrp	x26, _debugnet_npolls@GOTPAGE
Lloh3:
	ldr	x26, [x26, _debugnet_npolls@GOTPAGEOFF]
Lloh4:
	adrp	x27, _DN_STATE_HAVE_GW_MAC@GOTPAGE
Lloh5:
	ldr	x27, [x27, _DN_STATE_HAVE_GW_MAC@GOTPAGEOFF]
Lloh6:
	adrp	x21, l_.str@PAGE
Lloh7:
	add	x21, x21, l_.str@PAGEOFF
	add	x20, x0, #16
	mov	x8, x0
Lloh8:
	adrp	x23, l_str.6@PAGE
Lloh9:
	add	x23, x23, l_str.6@PAGEOFF
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
                                        ;       Child Loop BB0_6 Depth 3
	ldr	x24, [x8]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w28, #0
LBB0_3:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_6 Depth 3
	mov	x0, x19
	mov	x1, x24
	bl	_debugnet_send_arp
	cbnz	w0, LBB0_18
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	mov	w22, #0
LBB0_6:                                 ;   Parent Loop BB0_1 Depth=1
                                        ;     Parent Loop BB0_3 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x19, #8]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=3
	mov	x0, x19
	bl	_debugnet_network_poll
	mov	w0, #500
	bl	_DELAY
	add	w22, w22, #1
	ldr	w8, [x26]
	cmp	w22, w8
	b.lt	LBB0_6
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=2
	ldr	x8, [x19, #8]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=2
	mov	x0, x21
	bl	_printf
	add	w28, w28, #1
	ldr	w8, [x25]
	cmp	w28, w8
	b.lt	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ge	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19]
	cmp	x24, x8
	b.ne	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_1 Depth=1
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	ldr	x8, [x20]
Lloh12:
	adrp	x9, _INADDR_ANY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _INADDR_ANY@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x23
	bl	_puts
	mov	x8, x20
	b	LBB0_1
LBB0_14:
	mov	w0, #0
	b	LBB0_18
LBB0_15:
Lloh15:
	adrp	x0, l_str@PAGE
Lloh16:
	add	x0, x0, l_str@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh17:
	adrp	x0, l_str.5@PAGE
Lloh18:
	add	x0, x0, l_str.5@PAGEOFF
LBB0_17:
	bl	_puts
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
LBB0_18:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_debugnet_arp_nretries,4,2      ; @debugnet_arp_nretries
	.comm	_debugnet_npolls,4,2            ; @debugnet_npolls
	.comm	_DN_STATE_HAVE_GW_MAC,8,3       ; @DN_STATE_HAVE_GW_MAC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(ARP retry)"

l_.str.1:                               ; @.str.1
	.asciz	"\nFailed to ARP server"

	.comm	_INADDR_ANY,8,3                 ; @INADDR_ANY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_str:                                  ; @str
	.asciz	"\nFailed to ARP gateway."

l_str.5:                                ; @str.5
	.asciz	"."

l_str.6:                                ; @str.6
	.asciz	", trying to reach gateway..."

.subsections_via_symbols
