	.file	"extr_funchook.c_rehook32.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rehook32, @function
rehook32:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movsx	rax, DWORD PTR JMP_32_SIZE[rip]
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rdi, QWORD PTR 16[rdi]
	mov	ebx, esi
	lea	esi, [rax+rax]
	sub	rdi, rax
	call	fix_permissions@PLT
	test	ebx, ebx
	jne	.L2
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jne	.L21
.L2:
	mov	rsi, QWORD PTR 16[rbp]
	movsx	r8, DWORD PTR JMP_32_SIZE[rip]
	mov	rbx, rsi
	lea	rax, 0[0+r8*8]
	sub	rbx, rax
	mov	r9, QWORD PTR 40[rbx]
	mov	rax, rbx
	mov	r10, rbx
	test	r8, r8
	je	.L4
	mov	rdi, QWORD PTR X86_NOP[rip]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L6:
	xor	ecx, ecx
	cmp	QWORD PTR [rax], rdi
	sete	cl
	add	rax, 8
	add	rdx, rcx
	cmp	rsi, rax
	jne	.L6
	cmp	r8, rdx
	je	.L4
.L7:
	cmp	QWORD PTR [r10], 233
	je	.L22
.L10:
	cmp	r9, 233
	je	.L23
.L11:
	mov	rax, QWORD PTR HOOKTYPE_FORWARD_OVERWRITE[rip]
	mov	rdx, rax
	cmp	QWORD PTR 8[rbp], rax
	je	.L9
	mov	QWORD PTR 8[rbp], rax
.L9:
	mov	DWORD PTR 0[rbp], 1
	cmp	rax, rdx
	je	.L24
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR HOOKTYPE_FORWARD_OVERWRITE[rip]
	cmp	rax, rdx
	jne	.L1
.L24:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, r12
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	hook_forward_overwrite@PLT
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	cmp	QWORD PTR X86_JMP_NEG_5[rip], r9
	jne	.L10
.L13:
	mov	rsi, r10
	mov	rdi, rbp
	call	hook_reverse_chain@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR HOOKTYPE_FORWARD_OVERWRITE[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	r9, 139
	jne	.L7
	cmp	QWORD PTR 48[r10], 255
	je	.L25
	cmp	QWORD PTR [r10], 233
	jne	.L11
	cmp	QWORD PTR X86_JMP_NEG_5[rip], 139
	jne	.L11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdx, r12
	mov	rsi, r10
	mov	rdi, rbp
	call	hook_forward_chain@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR HOOKTYPE_FORWARD_OVERWRITE[rip]
	jmp	.L9
.L25:
	mov	rsi, r10
	mov	rdi, rbp
	call	hook_reverse_new@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR HOOKTYPE_FORWARD_OVERWRITE[rip]
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	rehook32, .-rehook32
	.comm	X86_NOP,8,8
	.comm	X86_JMP_NEG_5,8,8
	.comm	JMP_32_SIZE,4,4
	.comm	HOOKTYPE_FORWARD_OVERWRITE,8,8
	.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_funchook.c_rehook32.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rehook32, %function
rehook32:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	ldr	r7, .L32
	mov	r4, r0
	ldr	r1, [r7]
	ldr	r0, [r0, #8]
	mov	r6, r2
	sub	r0, r0, r1
	lsl	r1, r1, #1
	bl	fix_permissions
	cmp	r5, #0
	bne	.L2
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L27
.L2:
	ldr	r2, [r7]
	ldr	r0, [r4, #8]
	cmp	r2, #0
	sub	r3, r0, r2, lsl #2
	mov	r1, r3
	ldr	r7, [r3, #20]
	beq	.L4
	mov	r5, #0
	ldr	ip, .L32+4
	ldr	lr, [ip]
.L6:
	ldr	ip, [r3]
	add	r3, r3, #4
	cmp	ip, lr
	addeq	r5, r5, #1
	cmp	r0, r3
	bne	.L6
	cmp	r2, r5
	beq	.L4
.L7:
	ldr	r3, [r1]
	cmp	r3, #233
	beq	.L28
.L10:
	cmp	r7, #233
	beq	.L29
.L11:
	ldr	r3, .L32+8
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	mov	r2, r3
	strne	r3, [r4, #4]
.L9:
	mov	r1, #1
	cmp	r3, r2
	str	r1, [r4]
	popne	{r4, r5, r6, r7, r8, pc}
.L30:
	mov	r1, r6
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	hook_forward_overwrite
.L27:
	ldr	r2, .L32+8
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	cmp	r3, r2
	popne	{r4, r5, r6, r7, r8, pc}
	b	.L30
.L28:
	ldr	r3, .L32+12
	ldr	r3, [r3]
	cmp	r3, r7
	bne	.L10
.L13:
	mov	r0, r4
	bl	hook_reverse_chain
	ldr	r2, .L32+8
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	b	.L9
.L4:
	cmp	r7, #139
	bne	.L7
	ldr	r3, [r1, #24]
	cmp	r3, #255
	beq	.L31
	ldr	r3, [r1]
	cmp	r3, #233
	bne	.L11
	ldr	r3, .L32+12
	ldr	r3, [r3]
	cmp	r3, #139
	bne	.L11
	b	.L13
.L29:
	mov	r2, r6
	mov	r0, r4
	bl	hook_forward_chain
	ldr	r2, .L32+8
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	b	.L9
.L31:
	mov	r0, r4
	bl	hook_reverse_new
	ldr	r2, .L32+8
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	b	.L9
.L33:
	.align	2
.L32:
	.word	JMP_32_SIZE
	.word	X86_NOP
	.word	HOOKTYPE_FORWARD_OVERWRITE
	.word	X86_JMP_NEG_5
	.size	rehook32, .-rehook32
	.comm	X86_NOP,4,4
	.comm	X86_JMP_NEG_5,4,4
	.comm	JMP_32_SIZE,4,4
	.comm	HOOKTYPE_FORWARD_OVERWRITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
