	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgx_lmac_internal_loopback     ## -- Begin function bgx_lmac_internal_loopback
	.p2align	4, 0x90
_bgx_lmac_internal_loopback:            ## @bgx_lmac_internal_loopback
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r14d
	callq	_get_bgx
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movslq	%r14d, %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_3
## %bb.2:
	movq	_BGX_GMP_PCS_MRX_CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_read
	movq	_PCS_MRX_CTL_LOOPBACK1@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_BGX_SPUX_CONTROL1@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_read
	movq	_SPU_CTL_LOOPBACK@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	orl	%eax, %edx
	notl	%ecx
	andl	%eax, %ecx
	testl	%r15d, %r15d
	cmovnel	%edx, %ecx
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bgx_reg_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_GMP_PCS_MRX_CTL,4,2        ## @BGX_GMP_PCS_MRX_CTL
	.comm	_PCS_MRX_CTL_LOOPBACK1,4,2      ## @PCS_MRX_CTL_LOOPBACK1
	.comm	_BGX_SPUX_CONTROL1,4,2          ## @BGX_SPUX_CONTROL1
	.comm	_SPU_CTL_LOOPBACK,4,2           ## @SPU_CTL_LOOPBACK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgx_lmac_internal_loopback     ; -- Begin function bgx_lmac_internal_loopback
	.p2align	2
_bgx_lmac_internal_loopback:            ; @bgx_lmac_internal_loopback
	.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	x21, x3
	mov	x19, x2
	bl	_get_bgx
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x8, [x8, w19, sxtw #3]
	cbz	x8, LBB0_4
; %bb.2:
Lloh0:
	adrp	x22, _BGX_GMP_PCS_MRX_CTL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BGX_GMP_PCS_MRX_CTL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_read
Lloh2:
	adrp	x8, _PCS_MRX_CTL_LOOPBACK1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCS_MRX_CTL_LOOPBACK1@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	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
LBB0_4:
Lloh4:
	adrp	x22, _BGX_SPUX_CONTROL1@GOTPAGE
Lloh5:
	ldr	x22, [x22, _BGX_SPUX_CONTROL1@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_read
Lloh6:
	adrp	x8, _SPU_CTL_LOOPBACK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SPU_CTL_LOOPBACK@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	orr	w9, w8, w0
	bic	w8, w0, w8
	cmp	w21, #0
	csel	w3, w8, w9, eq
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, 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
	b	_bgx_reg_write
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_GMP_PCS_MRX_CTL,4,2        ; @BGX_GMP_PCS_MRX_CTL
	.comm	_PCS_MRX_CTL_LOOPBACK1,4,2      ; @PCS_MRX_CTL_LOOPBACK1
	.comm	_BGX_SPUX_CONTROL1,4,2          ; @BGX_SPUX_CONTROL1
	.comm	_SPU_CTL_LOOPBACK,4,2           ; @SPU_CTL_LOOPBACK
.subsections_via_symbols
