	.file	"extr_sym_hipd.c_sym_prepare_nego.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"sync msgout"
.LC1:
	.string	"wide msgout"
.LC2:
	.string	"ppr msgout"
	.text
	.p2align 4
	.type	sym_prepare_nego, @function
sym_prepare_nego:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR [rsi]
	lea	rdx, [rax+rax*8]
	mov	rax, QWORD PTR [rdi]
	lea	rbx, [rax+rdx*8]
	mov	rsi, QWORD PTR 64[rbx]
	lea	rdx, 8[rbx]
	call	sym_check_goals@PLT
	mov	eax, DWORD PTR 8[rbx]
	mov	rdx, QWORD PTR 48[rbx]
	cmp	eax, 130
	je	.L2
	test	rdx, rdx
	jne	.L34
.L3:
	mov	rsi, QWORD PTR 40[rbx]
	cmp	eax, 128
	je	.L7
	test	rsi, rsi
	jne	.L7
	cmp	eax, 129
	je	.L8
	test	rdx, rdx
	jne	.L8
	mov	QWORD PTR 56[rbx], 0
	xor	r14d, r14d
	mov	DWORD PTR 8[rbp], 0
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	cmp	QWORD PTR 32[rbx], 0
	mov	rsi, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR 16[rbx]
	mov	r9d, DWORD PTR 12[rbx]
	je	.L35
.L4:
	mov	r8d, DWORD PTR PPR_OPT_IU[rip]
.L5:
	test	rsi, rsi
	je	.L11
	or	r8d, DWORD PTR PPR_OPT_DT[rip]
.L11:
	test	rcx, rcx
	je	.L6
	or	r8d, DWORD PTR PPR_OPT_QAS[rip]
.L6:
	mov	rcx, QWORD PTR 40[rbx]
	mov	esi, r9d
	mov	rdi, r13
	call	spi_populate_ppr_msg@PLT
	mov	DWORD PTR 8[rbp], 130
	lea	rdx, .LC2[rip]
	mov	r14d, eax
	mov	QWORD PTR [rbx], rbp
	mov	eax, DWORD PTR DEBUG_FLAGS[rip]
	test	DWORD PTR DEBUG_NEGO[rip], eax
	jne	.L10
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	rdi, r13
	call	spi_populate_width_msg@PLT
	mov	DWORD PTR 8[rbp], 128
	mov	r14d, eax
	mov	QWORD PTR [rbx], rbp
	mov	eax, DWORD PTR DEBUG_NEGO[rip]
	test	DWORD PTR DEBUG_FLAGS[rip], eax
	je	.L1
	lea	rdx, .LC1[rip]
.L10:
	mov	rsi, QWORD PTR 0[rbp]
	mov	rcx, r13
	mov	rdi, r12
	call	sym_print_nego_msg@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	xor	r8d, r8d
	cmp	QWORD PTR 32[rbx], 0
	mov	rsi, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR 16[rbx]
	mov	r9d, DWORD PTR 12[rbx]
	je	.L5
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rdi, rsi
	or	rdi, rcx
	jne	.L12
	cmp	r9d, 9
	jg	.L3
	xor	r8d, r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, DWORD PTR 12[rbx]
	mov	rdi, r13
	call	spi_populate_sync_msg@PLT
	mov	DWORD PTR 8[rbp], 129
	mov	r14d, eax
	mov	QWORD PTR [rbx], rbp
	mov	eax, DWORD PTR DEBUG_FLAGS[rip]
	test	DWORD PTR DEBUG_NEGO[rip], eax
	je	.L1
	lea	rdx, .LC0[rip]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	xor	r8d, r8d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	sym_prepare_nego, .-sym_prepare_nego
	.comm	PPR_OPT_QAS,4,4
	.comm	PPR_OPT_IU,4,4
	.comm	PPR_OPT_DT,4,4
	.comm	DEBUG_NEGO,4,4
	.comm	DEBUG_FLAGS,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_sym_hipd.c_sym_prepare_nego.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"wide msgout\000"
	.align	2
.LC1:
	.ascii	"sync msgout\000"
	.align	2
.LC2:
	.ascii	"ppr msgout\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sym_prepare_nego, %function
sym_prepare_nego:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, [r1]
	ldr	r9, [r0]
	add	ip, ip, ip, lsl #2
	add	r4, r9, ip, lsl #3
	mov	r7, r1
	mov	r10, r2
	ldr	r1, [r4, #36]
	sub	sp, sp, #12
	add	r2, r4, #4
	mov	r8, r0
	lsl	r6, ip, #3
	bl	sym_check_goals
	ldr	r0, [r4, #4]
	cmp	r0, #130
	beq	.L2
	ldr	r2, [r4, #28]
	ldr	r5, [r4, #24]
	cmp	r2, #0
	bne	.L33
.L3:
	cmp	r0, #128
	beq	.L7
	cmp	r5, #0
	bne	.L7
	subs	r3, r2, #0
	movne	r3, #1
	cmp	r0, #129
	movne	r0, r3
	orreq	r0, r3, #1
	cmp	r0, #0
	streq	r5, [r4, #32]
	streq	r5, [r7, #4]
	beq	.L1
	ldr	r1, [r4, #8]
	mov	r0, r10
	bl	spi_populate_sync_msg
	mov	r3, #129
	ldr	r1, .L36
	ldr	r2, .L36+4
	ldr	r1, [r1]
	ldr	r2, [r2]
	str	r3, [r7, #4]
	tst	r1, r2
	mov	r5, r0
	str	r7, [r9, r6]
	beq	.L1
	ldr	r1, [r7]
	ldr	r2, .L36+8
.L14:
	mov	r3, r10
	mov	r0, r8
	bl	sym_print_nego_msg
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L33:
	ldr	r3, [r4, #20]
	ldr	lr, [r4, #16]
	cmp	r3, #0
	ldr	r1, [r4, #8]
	ldr	ip, [r4, #12]
	beq	.L34
.L4:
	ldr	r3, .L36+12
	ldr	r3, [r3]
.L5:
	cmp	lr, #0
	ldrne	r0, .L36+16
	ldrne	r0, [r0]
	orrne	r3, r3, r0
	cmp	ip, #0
	ldrne	r0, .L36+20
	ldrne	r0, [r0]
	orrne	r3, r3, r0
.L6:
	str	r3, [sp]
	mov	r0, r10
	mov	r3, r5
	bl	spi_populate_ppr_msg
	mov	r3, #130
	ldr	r1, .L36+4
	ldr	r2, .L36
	ldr	r1, [r1]
	ldr	r2, [r2]
	str	r3, [r7, #4]
	tst	r1, r2
	mov	r5, r0
	str	r7, [r9, r6]
	bne	.L35
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r1, r5
	mov	r0, r10
	bl	spi_populate_width_msg
	mov	r3, #128
	ldr	r1, .L36+4
	ldr	r2, .L36
	ldr	r1, [r1]
	ldr	r2, [r2]
	str	r3, [r7, #4]
	tst	r1, r2
	mov	r5, r0
	str	r7, [r9, r6]
	beq	.L1
	ldr	r1, [r7]
	ldr	r2, .L36+24
	b	.L14
.L2:
	ldr	r3, [r4, #20]
	ldr	r1, [r4, #8]
	cmp	r3, #0
	ldr	r2, [r4, #28]
	ldr	r5, [r4, #24]
	ldr	lr, [r4, #16]
	ldr	ip, [r4, #12]
	beq	.L5
	b	.L4
.L34:
	orrs	fp, lr, ip
	bne	.L5
	cmp	r1, #9
	ble	.L6
	b	.L3
.L35:
	ldr	r1, [r7]
	ldr	r2, .L36+28
	b	.L14
.L37:
	.align	2
.L36:
	.word	DEBUG_FLAGS
	.word	DEBUG_NEGO
	.word	.LC1
	.word	PPR_OPT_IU
	.word	PPR_OPT_DT
	.word	PPR_OPT_QAS
	.word	.LC0
	.word	.LC2
	.size	sym_prepare_nego, .-sym_prepare_nego
	.comm	PPR_OPT_QAS,4,4
	.comm	PPR_OPT_IU,4,4
	.comm	PPR_OPT_DT,4,4
	.comm	DEBUG_NEGO,4,4
	.comm	DEBUG_FLAGS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
