	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function nes_query_port
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_nes_query_port:                        ## @nes_query_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
	movq	%rdx, %rbx
	callq	_to_nesvnic
	movq	%rax, %r14
	movq	8(%rax), %r15
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$96, %edx
	callq	_memset
	movq	_IB_MTU_4096@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 88(%rbx)
	movl	(%r15), %ecx
	cmpl	$4095, %ecx                     ## imm = 0xFFF
	jg	LBB0_9
## %bb.1:
	cmpl	$2048, %ecx                     ## imm = 0x800
	jl	LBB0_3
## %bb.2:
	movq	_IB_MTU_2048@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_3:
	cmpl	$1024, %ecx                     ## imm = 0x400
	jl	LBB0_5
## %bb.4:
	movq	_IB_MTU_1024@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	cmpl	$512, %ecx                      ## imm = 0x200
	jl	LBB0_7
## %bb.6:
	movq	_IB_MTU_512@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_IB_MTU_256@GOTPCREL(%rip), %rax
LBB0_8:
	movq	(%rax), %rax
LBB0_9:
	movq	%rax, 80(%rbx)
	movl	$1, (%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rbx)
	movq	$0, 72(%rbx)
	movq	%r15, %rdi
	callq	_netif_queue_stopped
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	cmpq	$0, (%r14)
	jne	LBB0_11
LBB0_12:
	movq	_IB_PORT_DOWN@GOTPCREL(%rip), %rax
LBB0_13:
	movq	(%rax), %rax
	movq	%rax, 48(%rbx)
	movq	_IB_PORT_CM_SUP@GOTPCREL(%rip), %rax
	movq	_IB_PORT_REINIT_SUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_IB_PORT_VENDOR_CLASS_SUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_IB_PORT_BOOT_MGMT_SUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 4(%rbx)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 8(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
	movq	_IB_WIDTH_4X@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_IB_SPEED_SDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movl	$-2147483648, 16(%rbx)          ## imm = 0x80000000
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_MTU_4096,8,3                ## @IB_MTU_4096
	.comm	_IB_MTU_2048,8,3                ## @IB_MTU_2048
	.comm	_IB_MTU_1024,8,3                ## @IB_MTU_1024
	.comm	_IB_MTU_512,8,3                 ## @IB_MTU_512
	.comm	_IB_MTU_256,8,3                 ## @IB_MTU_256
	.comm	_IB_PORT_DOWN,8,3               ## @IB_PORT_DOWN
	.comm	_IB_PORT_ACTIVE,8,3             ## @IB_PORT_ACTIVE
	.comm	_IB_PORT_CM_SUP,4,2             ## @IB_PORT_CM_SUP
	.comm	_IB_PORT_REINIT_SUP,4,2         ## @IB_PORT_REINIT_SUP
	.comm	_IB_PORT_VENDOR_CLASS_SUP,4,2   ## @IB_PORT_VENDOR_CLASS_SUP
	.comm	_IB_PORT_BOOT_MGMT_SUP,4,2      ## @IB_PORT_BOOT_MGMT_SUP
	.comm	_IB_WIDTH_4X,4,2                ## @IB_WIDTH_4X
	.comm	_IB_SPEED_SDR,4,2               ## @IB_SPEED_SDR
	.no_dead_strip	_nes_query_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_query_port
_nes_query_port:                        ; @nes_query_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, x2
	bl	_to_nesvnic
	mov	x20, x0
	ldr	x21, [x0, #8]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #96
	bl	_memset
Lloh0:
	adrp	x8, _IB_MTU_4096@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_MTU_4096@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x19, #88]
	ldr	w9, [x21]
	cmp	w9, #4095
	b.gt	LBB0_9
; %bb.1:
	cmp	w9, #2048
	b.lt	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _IB_MTU_2048@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_MTU_2048@GOTPAGEOFF]
	b	LBB0_8
LBB0_3:
	cmp	w9, #1024
	b.lt	LBB0_5
; %bb.4:
Lloh5:
	adrp	x8, _IB_MTU_1024@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_MTU_1024@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	cmp	w9, #512
	b.lt	LBB0_7
; %bb.6:
Lloh7:
	adrp	x8, _IB_MTU_512@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IB_MTU_512@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh9:
	adrp	x8, _IB_MTU_256@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IB_MTU_256@GOTPAGEOFF]
LBB0_8:
	ldr	x8, [x8]
LBB0_9:
	mov	w9, #1
	str	w9, [x19]
	stp	xzr, x8, [x19, #72]
	stp	xzr, xzr, [x19, #56]
	mov	x0, x21
	bl	_netif_queue_stopped
Lloh11:
	adrp	x8, _IB_PORT_DOWN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IB_PORT_DOWN@GOTPAGEOFF]
	cbnz	x0, LBB0_11
; %bb.10:
	ldr	x9, [x20]
Lloh13:
	adrp	x10, _IB_PORT_ACTIVE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _IB_PORT_ACTIVE@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
LBB0_11:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _IB_PORT_CM_SUP@GOTPAGE
Lloh16:
	ldr	x9, [x9, _IB_PORT_CM_SUP@GOTPAGEOFF]
	str	x8, [x19, #48]
Lloh17:
	ldr	w8, [x9]
Lloh18:
	adrp	x9, _IB_PORT_REINIT_SUP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IB_PORT_REINIT_SUP@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh21:
	adrp	x9, _IB_PORT_VENDOR_CLASS_SUP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IB_PORT_VENDOR_CLASS_SUP@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh24:
	adrp	x9, _IB_PORT_BOOT_MGMT_SUP@GOTPAGE
Lloh25:
	ldr	x9, [x9, _IB_PORT_BOOT_MGMT_SUP@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #4]
	movi.2s	v0, #1
	str	d0, [x19, #8]
	stp	xzr, xzr, [x19, #32]
Lloh27:
	adrp	x8, _IB_WIDTH_4X@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IB_WIDTH_4X@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x8]
Lloh30:
	adrp	x9, _IB_SPEED_SDR@GOTPAGE
Lloh31:
	ldr	x9, [x9, _IB_SPEED_SDR@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x9]
	mov	w9, #-2147483648
	stp	w8, w10, [x19, #20]
	str	w9, [x19, #16]
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_MTU_4096,8,3                ; @IB_MTU_4096
	.comm	_IB_MTU_2048,8,3                ; @IB_MTU_2048
	.comm	_IB_MTU_1024,8,3                ; @IB_MTU_1024
	.comm	_IB_MTU_512,8,3                 ; @IB_MTU_512
	.comm	_IB_MTU_256,8,3                 ; @IB_MTU_256
	.comm	_IB_PORT_DOWN,8,3               ; @IB_PORT_DOWN
	.comm	_IB_PORT_ACTIVE,8,3             ; @IB_PORT_ACTIVE
	.comm	_IB_PORT_CM_SUP,4,2             ; @IB_PORT_CM_SUP
	.comm	_IB_PORT_REINIT_SUP,4,2         ; @IB_PORT_REINIT_SUP
	.comm	_IB_PORT_VENDOR_CLASS_SUP,4,2   ; @IB_PORT_VENDOR_CLASS_SUP
	.comm	_IB_PORT_BOOT_MGMT_SUP,4,2      ; @IB_PORT_BOOT_MGMT_SUP
	.comm	_IB_WIDTH_4X,4,2                ; @IB_WIDTH_4X
	.comm	_IB_SPEED_SDR,4,2               ; @IB_SPEED_SDR
	.no_dead_strip	_nes_query_port
.subsections_via_symbols
