	.file	"extr_altera-jtag.c_altera_set_ir_pre.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	altera_set_ir_pre
	.type	altera_set_ir_pre, @function
altera_set_ir_pre:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rcx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	cmp	DWORD PTR [rdi], esi
	jl	.L16
.L2:
	mov	DWORD PTR 0[r13], ebp
	xor	r8d, r8d
.L3:
	test	ebp, ebp
	jle	.L1
	mov	rdx, QWORD PTR 8[r13]
	xor	eax, eax
	mov	esi, 1
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	lea	ecx, [rax+r12]
	mov	r11d, ecx
	and	ecx, 7
	sar	r11d, 3
	movsx	r11, r11d
	mov	r11d, DWORD PTR [rbx+r11*4]
	sar	r11d, cl
	mov	ecx, r9d
	not	ecx
	and	ecx, edi
	or	edi, r9d
	and	r11d, 1
	cmove	edi, ecx
	add	eax, 1
	mov	DWORD PTR [r10], edi
	cmp	ebp, eax
	je	.L1
.L8:
	mov	ecx, eax
	mov	r9d, esi
	sar	ecx, 3
	movsx	rcx, ecx
	lea	r10, [rdx+rcx*4]
	mov	ecx, eax
	and	ecx, 7
	mov	edi, DWORD PTR [r10]
	sal	r9d, cl
	test	rbx, rbx
	jne	.L5
	or	edi, r9d
	add	eax, 1
	mov	DWORD PTR [r10], edi
	cmp	ebp, eax
	jne	.L8
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r8d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rdi]
	call	kfree@PLT
	lea	edi, 7[rbp]
	sar	edi, 3
	call	alt_malloc@PLT
	mov	QWORD PTR 8[r13], rax
	test	rax, rax
	jne	.L2
	mov	eax, DWORD PTR ENOMEM[rip]
	mov	r8d, eax
	neg	r8d
	test	eax, eax
	je	.L3
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	altera_set_ir_pre, .-altera_set_ir_pre
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_altera-jtag.c_altera_set_ir_pre.c"
	.text
	.align	2
	.global	altera_set_ir_pre
	.syntax unified
	.arm
	.fpu softvfp
	.type	altera_set_ir_pre, %function
altera_set_ir_pre:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r7, r1
	ldr	r1, [r0]
	mov	r4, r0
	cmp	r1, r7
	mov	r9, r2
	mov	r8, r3
	blt	.L18
.L2:
	mov	r0, #0
	str	r7, [r4]
.L3:
	cmp	r7, #0
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	ip, #0
	mov	r2, #1
	ldr	r3, [r4, #4]
.L8:
	asr	r1, ip, #3
	add	lr, ip, r9
	ldr	r10, [r3, r1, lsl #2]
	and	r5, ip, #7
	cmp	r8, #0
	asr	r4, lr, #3
	and	r6, lr, #7
	lsl	lr, r2, r5
	orreq	lr, r10, lr
	streq	lr, [r3, r1, lsl #2]
	beq	.L6
	ldr	r4, [r8, r4, lsl #2]
	orr	r5, r10, lr
	asr	r4, r4, r6
	tst	r4, #1
	biceq	lr, r10, lr
	strne	r5, [r3, r1, lsl #2]
	streq	lr, [r3, r1, lsl #2]
.L6:
	add	ip, ip, #1
	cmp	r7, ip
	bne	.L8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	ldr	r0, [r0, #4]
	bl	kfree
	add	r0, r7, #7
	asr	r0, r0, #3
	bl	alt_malloc
	cmp	r0, #0
	str	r0, [r4, #4]
	bne	.L2
	ldr	r3, .L19
	ldr	r0, [r3]
	cmp	r0, #0
	rsb	r0, r0, #0
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	b	.L3
.L20:
	.align	2
.L19:
	.word	ENOMEM
	.size	altera_set_ir_pre, .-altera_set_ir_pre
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
