	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_altera_set_ir_pre              ## -- Begin function altera_set_ir_pre
	.p2align	4, 0x90
_altera_set_ir_pre:                     ## @altera_set_ir_pre
	.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	%rcx, %r13
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	cmpl	%esi, (%rdi)
	jge	LBB0_3
## %bb.1:
	movq	8(%r12), %rdi
	callq	_kfree
	leal	7(%r15), %edi
	sarl	$3, %edi
	callq	_alt_malloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movl	%r15d, (%r12)
	xorl	%eax, %eax
	testl	%eax, %eax
	jne	LBB0_13
LBB0_5:
	testl	%r15d, %r15d
	jle	LBB0_13
## %bb.6:
	xorl	%edx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%edx, %ecx
	andb	$7, %cl
	movl	$1, %esi
	shll	%cl, %esi
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%r12), %rcx
	movl	%edx, %edi
	shrl	$3, %edi
	orl	%esi, (%rcx,%rdi,4)
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%edx
	cmpl	%edx, %r15d
	je	LBB0_13
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r13, %r13
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	leal	(%r14,%rdx), %ecx
	movl	%ecx, %esi
	sarl	$3, %esi
	movslq	%esi, %rsi
	movl	(%r13,%rsi,4), %edi
	andb	$7, %cl
	movzbl	%cl, %ebx
	movl	%edx, %ecx
	andb	$7, %cl
	movl	$1, %esi
	shll	%cl, %esi
	btl	%ebx, %edi
	jb	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	notl	%esi
	movq	8(%r12), %rcx
	movl	%edx, %edi
	shrl	$3, %edi
	andl	%esi, (%rcx,%rdi,4)
	jmp	LBB0_12
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	testl	%eax, %eax
	je	LBB0_5
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_altera_set_ir_pre              ; -- Begin function altera_set_ir_pre
	.p2align	2
_altera_set_ir_pre:                     ; @altera_set_ir_pre
	.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, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	w8, [x0]
	cmp	w8, w1
	b.ge	LBB0_2
; %bb.1:
	ldr	x0, [x22, #8]
	bl	_kfree
	add	w8, w21, #7
	asr	w0, w8, #3
	bl	_alt_malloc
	str	x0, [x22, #8]
	cbz	x0, LBB0_11
LBB0_2:
	mov	w0, #0
	str	w21, [x22]
	cbnz	w0, LBB0_12
LBB0_3:
	cmp	w21, #1
	b.lt	LBB0_12
; %bb.4:
	mov	w8, #0
	mov	w9, #1
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
	and	w10, w8, #0x7
	lsl	w10, w9, w10
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x11, [x22, #8]
	lsr	w12, w8, #3
	lsl	x12, x12, #2
	ldr	w13, [x11, x12]
	orr	w10, w13, w10
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	str	w10, [x11, x12]
	add	w8, w8, #1
	cmp	w21, w8
	b.eq	LBB0_12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x19, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w10, w20, w8
	asr	w11, w10, #3
	ldr	w11, [x19, w11, sxtw #2]
	and	w12, w10, #0x7
	and	w10, w8, #0x7
	lsl	w10, w9, w10
	lsr	w11, w11, w12
	tbnz	w11, #0, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x11, [x22, #8]
	lsr	w12, w8, #3
	lsl	x12, x12, #2
	ldr	w13, [x11, x12]
	bic	w10, w13, w10
	b	LBB0_7
LBB0_11:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	cbz	w0, LBB0_3
LBB0_12:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
