	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ql_get_sem_registers
_ql_get_sem_registers:                  ## @ql_get_sem_registers
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MAX_SEMAPHORE_FUNCTIONS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_5
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %r13
	xorl	%ebx, %ebx
	movq	_SEM@GOTPCREL(%rip), %r12
	leaq	-44(%rbp), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, (%r14,%rbx,4)
	incq	%rbx
	movq	_MAX_SEMAPHORE_FUNCTIONS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MPI_NIC_FUNCTION_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%ebx, %eax
	shll	%cl, %eax
	movq	_MPI_NIC_REG_BLOCK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r12), %ecx
	leal	3(%rcx), %esi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %esi
	sarl	$2, %esi
	orl	%eax, %esi
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_ql_read_mpi_reg
	movl	$-559038737, %ecx               ## imm = 0xDEADBEEF
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %ecx
	jmp	LBB0_4
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SEMAPHORE_FUNCTIONS,4,2    ## @MAX_SEMAPHORE_FUNCTIONS
	.comm	_MPI_NIC_REG_BLOCK,4,2          ## @MPI_NIC_REG_BLOCK
	.comm	_MPI_NIC_FUNCTION_SHIFT,4,2     ## @MPI_NIC_FUNCTION_SHIFT
	.comm	_SEM,4,2                        ## @SEM
	.no_dead_strip	_ql_get_sem_registers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ql_get_sem_registers
_ql_get_sem_registers:                  ; @ql_get_sem_registers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
Lloh0:
	adrp	x21, _MAX_SEMAPHORE_FUNCTIONS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MAX_SEMAPHORE_FUNCTIONS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x22, #0
Lloh2:
	adrp	x23, _MPI_NIC_REG_BLOCK@GOTPAGE
Lloh3:
	ldr	x23, [x23, _MPI_NIC_REG_BLOCK@GOTPAGEOFF]
Lloh4:
	adrp	x24, _MPI_NIC_FUNCTION_SHIFT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _MPI_NIC_FUNCTION_SHIFT@GOTPAGEOFF]
	mov	w25, #48879
	movk	w25, #57005, lsl #16
Lloh6:
	adrp	x26, _SEM@GOTPAGE
Lloh7:
	ldr	x26, [x26, _SEM@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	ldr	w9, [x24]
	lsl	w9, w22, w9
	orr	w8, w9, w8
	ldr	w9, [x26]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	orr	w1, w8, w9, asr #2
	add	x2, sp, #12
	mov	x0, x20
	bl	_ql_read_mpi_reg
	ldr	w8, [sp, #12]
	cmp	w0, #0
	csel	w8, w25, w8, eq
	str	w8, [x19, x22, lsl #2]
	ldr	w8, [x21]
	add	x22, x22, #1
	cmp	w22, w8
	b.lt	LBB0_2
LBB0_3:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SEMAPHORE_FUNCTIONS,4,2    ; @MAX_SEMAPHORE_FUNCTIONS
	.comm	_MPI_NIC_REG_BLOCK,4,2          ; @MPI_NIC_REG_BLOCK
	.comm	_MPI_NIC_FUNCTION_SHIFT,4,2     ; @MPI_NIC_FUNCTION_SHIFT
	.comm	_SEM,4,2                        ; @SEM
	.no_dead_strip	_ql_get_sem_registers
.subsections_via_symbols
