	.file	"extr_rxe_resp.c_prepare_ack_packet.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	prepare_ack_packet, @function
prepare_ack_packet:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, r8d
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, r9d
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, r15d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	neg	r13d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, ecx
	and	r13d, 3
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	edi, DWORD PTR 16[rdi]
	mov	rax, QWORD PTR 120[rsp]
	mov	QWORD PTR 8[rsp], rsi
	mov	DWORD PTR 28[rsp], r8d
	mov	QWORD PTR 16[rsp], rax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	to_rdev@PLT
	mov	rdx, QWORD PTR rxe_opcode[rip]
	mov	rcx, r12
	lea	rsi, 12[rbx]
	mov	rdi, rax
	movsx	rax, ebp
	mov	DWORD PTR 36[rsp], 0
	add	r15d, DWORD PTR [rdx+rax*8]
	lea	r8, 0[0+rax*8]
	mov	edx, r15d
	mov	QWORD PTR [rsp], r8
	add	edx, r13d
	add	edx, DWORD PTR RXE_ICRC_SIZE[rip]
	mov	DWORD PTR 24[rsp], edx
	call	rxe_init_packet@PLT
	mov	r15, rax
	test	rax, rax
	je	.L1
	mov	r8, QWORD PTR [rsp]
	mov	rax, QWORD PTR rxe_opcode[rip]
	mov	QWORD PTR 32[r12], rbx
	mov	r11, QWORD PTR 8[rsp]
	mov	edx, DWORD PTR 24[rsp]
	mov	DWORD PTR [r12], ebp
	mov	eax, DWORD PTR 4[rax+r8]
	mov	edi, DWORD PTR 24[r12]
	mov	esi, DWORD PTR 24[r11]
	mov	DWORD PTR 4[r12], eax
	mov	rax, QWORD PTR 16[r11]
	mov	DWORD PTR 8[r12], edx
	mov	rdx, QWORD PTR RXE_BTH_BYTES[rip]
	mov	QWORD PTR 16[r12], rax
	add	rdx, QWORD PTR 16[r11]
	call	memcpy@PLT
	mov	esi, ebp
	mov	rdi, r12
	call	bth_set_opcode@PLT
	mov	esi, DWORD PTR 8[rbx]
	mov	rdi, r12
	call	bth_set_qpn@PLT
	mov	esi, r13d
	mov	rdi, r12
	call	bth_set_pad@PLT
	xor	esi, esi
	mov	rdi, r12
	call	bth_set_se@PLT
	mov	esi, r14d
	mov	rdi, r12
	call	bth_set_psn@PLT
	xor	esi, esi
	mov	rdi, r12
	call	bth_set_ack@PLT
	mov	DWORD PTR 12[r12], r14d
	mov	eax, DWORD PTR 4[r12]
	test	DWORD PTR RXE_AETH_MASK[rip], eax
	jne	.L19
	test	DWORD PTR RXE_ATMACK_MASK[rip], eax
	jne	.L20
.L4:
	lea	rdx, 36[rsp]
	mov	rsi, r15
	mov	rdi, r12
	call	rxe_prepare@PLT
	test	eax, eax
	jne	.L21
	mov	rcx, QWORD PTR 16[rsp]
	test	rcx, rcx
	je	.L6
	mov	eax, DWORD PTR 36[rsp]
	mov	DWORD PTR [rcx], eax
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L22
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r15
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	esi, DWORD PTR 112[rsp]
	mov	rdi, r12
	call	aeth_set_syn@PLT
	mov	esi, DWORD PTR 4[rbx]
	mov	rdi, r12
	call	aeth_set_msn@PLT
	mov	eax, DWORD PTR 4[r12]
	test	DWORD PTR RXE_ATMACK_MASK[rip], eax
	je	.L4
.L20:
	mov	esi, DWORD PTR [rbx]
	mov	rdi, r12
	call	atmack_set_orig@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, r12
	call	payload_addr@PLT
	mov	rdi, r12
	mov	rbx, rax
	call	bth_pad@PLT
	movsx	r12, DWORD PTR 28[rsp]
	cdqe
	add	r12, rax
	mov	eax, DWORD PTR 36[rsp]
	not	eax
	mov	DWORD PTR [rbx+r12*4], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, r15
	xor	r15d, r15d
	call	kfree_skb@PLT
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	prepare_ack_packet, .-prepare_ack_packet
	.comm	rxe_opcode,8,8
	.comm	RXE_ICRC_SIZE,4,4
	.comm	RXE_BTH_BYTES,8,8
	.comm	RXE_ATMACK_MASK,4,4
	.comm	RXE_AETH_MASK,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_rxe_resp.c_prepare_ack_packet.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	prepare_ack_packet, %function
prepare_ack_packet:
	@ args = 16, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r3
	mov	fp, r2
	mov	r4, r0
	mov	r9, #0
	ldr	r3, .L23
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r10, .L23+4
	ldr	r3, [sp, #68]
	ldr	r0, [r0, #16]
	mov	r7, r1
	str	r3, [sp, #4]
	bl	to_rdev
	ldr	r2, [r10]
	ldr	r3, [sp, #56]
	ldr	r2, [r2, r5, lsl #3]
	ldr	r1, .L23+8
	rsb	r8, r3, #0
	ldr	r1, [r1]
	add	r2, r3, r2
	and	r8, r8, #3
	add	r2, r2, r8
	add	r2, r2, r1
	mov	r3, fp
	add	r1, r4, #12
	str	r2, [sp]
	str	r9, [sp, #8]
	bl	rxe_init_packet
	subs	r6, r0, #0
	beq	.L1
	ldr	r1, [r10]
	ldr	ip, [r7, #16]
	lsl	r0, r5, #3
	add	r1, r1, r0
	ldr	r0, .L23+12
	ldr	r1, [r1, #4]
	str	ip, [fp, #16]
	ldr	ip, [r7, #16]
	ldr	r0, [r0]
	ldr	r2, [sp]
	str	r1, [fp, #4]
	str	r2, [fp, #8]
	ldr	r1, [r7, #20]
	add	r2, ip, r0
	str	r4, [fp, #24]
	ldr	r0, [fp, #20]
	str	r5, [fp]
	bl	memcpy
	mov	r1, r5
	mov	r0, fp
	bl	bth_set_opcode
	ldr	r1, [r4, #8]
	mov	r0, fp
	bl	bth_set_qpn
	mov	r1, r8
	mov	r0, fp
	bl	bth_set_pad
	mov	r1, r9
	mov	r0, fp
	bl	bth_set_se
	ldr	r1, [sp, #60]
	mov	r0, fp
	bl	bth_set_psn
	mov	r1, r9
	mov	r0, fp
	bl	bth_set_ack
	ldr	r1, .L23+16
	ldr	r2, [fp, #4]
	ldr	r1, [r1]
	ldr	r3, [sp, #60]
	tst	r2, r1
	str	r3, [fp, #12]
	bne	.L19
	ldr	r1, .L23+20
	ldr	r1, [r1]
	tst	r2, r1
	bne	.L20
.L4:
	mov	r1, r6
	mov	r0, fp
	add	r2, sp, #8
	bl	rxe_prepare
	cmp	r0, #0
	bne	.L21
	ldr	r2, [sp, #4]
	cmp	r2, #0
	beq	.L6
	ldr	r3, [sp, #8]
	str	r3, [r2]
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L22
	mov	r0, r6
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	ldr	r1, [sp, #64]
	mov	r0, fp
	bl	aeth_set_syn
	ldr	r1, [r4, #4]
	mov	r0, fp
	bl	aeth_set_msn
	ldr	r1, .L23+20
	ldr	r2, [fp, #4]
	ldr	r1, [r1]
	tst	r2, r1
	beq	.L4
.L20:
	mov	r0, fp
	ldr	r1, [r4]
	bl	atmack_set_orig
	b	.L4
.L6:
	mov	r0, fp
	bl	payload_addr
	mov	r4, r0
	mov	r0, fp
	bl	bth_pad
	ldr	r3, [sp, #8]
	ldr	r2, [sp, #56]
	mvn	r3, r3
	add	r0, r0, r2
	str	r3, [r4, r0, lsl #2]
	b	.L1
.L21:
	mov	r0, r6
	bl	kfree_skb
	mov	r6, #0
	b	.L1
.L22:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	.LC0
	.word	rxe_opcode
	.word	RXE_ICRC_SIZE
	.word	RXE_BTH_BYTES
	.word	RXE_AETH_MASK
	.word	RXE_ATMACK_MASK
	.size	prepare_ack_packet, .-prepare_ack_packet
	.comm	rxe_opcode,4,4
	.comm	RXE_ICRC_SIZE,4,4
	.comm	RXE_BTH_BYTES,4,4
	.comm	RXE_ATMACK_MASK,4,4
	.comm	RXE_AETH_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
