	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_get_qlm_mode
_bgx_get_qlm_mode:                      ## @bgx_get_qlm_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rdi), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.1:
	movq	16(%r14), %r8
	cmpq	$1, %rcx
	jne	LBB0_3
## %bb.2:
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_3:
	movq	%rcx, %rsi
	andq	$-2, %rsi
	leaq	28(%r8), %rdi
	xorl	%edx, %edx
	movq	_BGX_MODE_INVALID@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdx, -28(%rdi)
	movl	(%rbx), %eax
	movl	%eax, -16(%rdi)
	movl	$0, -20(%rdi)
	leaq	1(%rdx), %rax
	movq	%rax, -12(%rdi)
	movl	(%rbx), %eax
	movl	%eax, (%rdi)
	movl	$0, -4(%rdi)
	addq	$2, %rdx
	addq	$32, %rdi
	cmpq	%rsi, %rdx
	jne	LBB0_4
LBB0_5:
	testb	$1, %cl
	je	LBB0_7
## %bb.6:
	movq	%rdx, %rax
	shlq	$4, %rax
	movq	%rdx, (%r8,%rax)
	movq	_BGX_MODE_INVALID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r8,%rax)
	movl	$0, 8(%r8,%rax)
LBB0_7:
	movq	_BGX_CMR_RX_LMACS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_bgx_reg_read
                                        ## kill: def $eax killed $eax def $rax
	andl	$7, %eax
	movl	%eax, 8(%r14)
	movq	(%r14), %rcx
	cmpq	%rax, %rcx
	jae	LBB0_9
## %bb.8:
	movl	%ecx, 8(%r14)
	movl	%ecx, %eax
LBB0_9:
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_bgx_set_lmac_config
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_bgx_print_qlm_mode
	incq	%rbx
	movslq	8(%r14), %rax
	cmpq	%rax, %rbx
	jb	LBB0_11
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_MODE_INVALID,4,2           ## @BGX_MODE_INVALID
	.comm	_BGX_CMR_RX_LMACS,4,2           ## @BGX_CMR_RX_LMACS
	.no_dead_strip	_bgx_get_qlm_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_get_qlm_mode
_bgx_get_qlm_mode:                      ; @bgx_get_qlm_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x9, #0
	ldr	x10, [x19, #16]
	add	x10, x10, #12
Lloh0:
	adrp	x11, _BGX_MODE_INVALID@GOTPAGE
Lloh1:
	ldr	x11, [x11, _BGX_MODE_INVALID@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	stur	x9, [x10, #-12]
	ldr	w12, [x11]
	stp	wzr, w12, [x10, #-4]
	add	x9, x9, #1
	add	x10, x10, #16
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_3:
Lloh2:
	adrp	x8, _BGX_CMR_RX_LMACS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BGX_CMR_RX_LMACS@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_bgx_reg_read
	and	w8, w0, #0x7
	str	w8, [x19, #8]
	ldr	x9, [x19]
	cmp	x9, x8
	b.hs	LBB0_5
; %bb.4:
	str	w9, [x19, #8]
	mov	x8, x9
LBB0_5:
	cbz	w8, LBB0_8
; %bb.6:
	mov	x20, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_set_lmac_config
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_print_qlm_mode
	add	x20, x20, #1
	ldrsw	x8, [x19, #8]
	cmp	x20, x8
	b.lo	LBB0_7
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_MODE_INVALID,4,2           ; @BGX_MODE_INVALID
	.comm	_BGX_CMR_RX_LMACS,4,2           ; @BGX_CMR_RX_LMACS
	.no_dead_strip	_bgx_get_qlm_mode
.subsections_via_symbols
