	.file	"extr_kull_m_patch.c_kull_m_patch.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	kull_m_patch
	.type	kull_m_patch, @function
kull_m_patch:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	xmm0, xmm0
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, r8d
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	mov	rdi, rsi
	mov	esi, edx
	mov	rdx, rbx
	sub	rsp, 120
	.cfi_def_cfa_offset 176
	mov	r14d, DWORD PTR TRUE[rip]
	mov	r13d, DWORD PTR FALSE[rip]
	mov	rax, QWORD PTR 192[rsp]
	mov	QWORD PTR 8[rsp], rcx
	mov	QWORD PTR [rsp], r9
	mov	r12, QWORD PTR 176[rsp]
	mov	QWORD PTR 16[rsp], rax
	mov	rax, QWORD PTR 200[rsp]
	mov	QWORD PTR 24[rsp], rax
	mov	rax, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rcx
	xor	ecx, ecx
	test	r12, r12
	movaps	XMMWORD PTR 48[rsp], xmm0
	mov	ecx, r14d
	mov	QWORD PTR 56[rsp], rax
	lea	rax, KULL_M_MEMORY_GLOBAL_OWN_HANDLE[rip]
	sete	r15b
	movaps	XMMWORD PTR 80[rsp], xmm0
	mov	QWORD PTR 64[rsp], 0
	mov	QWORD PTR 96[rsp], 0
	mov	QWORD PTR 88[rsp], rax
	mov	DWORD PTR 44[rsp], 0
	call	kull_m_memory_search@PLT
	test	rax, rax
	je	.L1
	mov	rax, QWORD PTR [rsp]
	add	rax, QWORD PTR [rbx]
	movzx	r15d, r15b
	mov	QWORD PTR 48[rsp], rax
	test	r12, r12
	je	.L3
	mov	edi, DWORD PTR LPTR[rip]
	mov	esi, ebp
	call	LocalAlloc@PLT
	mov	QWORD PTR 80[rsp], rax
	test	rax, rax
	jne	.L52
.L3:
	test	r15d, r15d
	jne	.L53
.L1:
	mov	rax, QWORD PTR 104[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L54
	add	rsp, 120
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L53:
	.cfi_restore_state
	lea	r15, 48[rsp]
	lea	rsi, 40[rsp]
	mov	rdi, r15
	call	kull_m_memory_query@PLT
	test	rax, rax
	je	.L4
	mov	eax, DWORD PTR 40[rsp]
	mov	ecx, eax
	and	ecx, 15
	je	.L5
	mov	edx, DWORD PTR PAGE_READWRITE[rip]
	cmp	ecx, edx
	jge	.L5
.L6:
	xor	al, al
	lea	rcx, 44[rsp]
	mov	esi, ebp
	mov	rdi, r15
	or	edx, eax
	call	kull_m_memory_protect@PLT
	mov	r14d, eax
.L7:
	test	r14d, r14d
	jne	.L55
.L4:
	mov	rdi, QWORD PTR 80[rsp]
	test	rdi, rdi
	je	.L1
	call	LocalFree@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L52:
	lea	rsi, 48[rsp]
	lea	rdi, 80[rsp]
	mov	edx, ebp
	call	kull_m_memory_copy@PLT
	mov	r15d, eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	mov	ecx, eax
	and	ecx, 240
	je	.L7
	mov	edx, DWORD PTR PAGE_EXECUTE_READWRITE[rip]
	cmp	ecx, edx
	jl	.L6
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L55:
	mov	rsi, QWORD PTR 8[rsp]
	mov	edx, ebp
	mov	rdi, r15
	call	kull_m_memory_copy@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L8
	test	r12, r12
	je	.L8
	mov	rsi, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR 184[rsp]
	call	r12
	mov	rdx, QWORD PTR 24[rsp]
	test	rdx, rdx
	je	.L9
	mov	DWORD PTR [rdx], eax
.L9:
	lea	rsi, 80[rsp]
	mov	edx, ebp
	mov	rdi, r15
	call	kull_m_memory_copy@PLT
	mov	r13d, eax
.L8:
	mov	edx, DWORD PTR 44[rsp]
	test	edx, edx
	je	.L4
	xor	ecx, ecx
	mov	esi, ebp
	mov	rdi, r15
	call	kull_m_memory_protect@PLT
	jmp	.L4
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	kull_m_patch, .-kull_m_patch
	.comm	TRUE,4,4
	.comm	PAGE_READWRITE,4,4
	.comm	PAGE_EXECUTE_READWRITE,4,4
	.comm	LPTR,4,4
	.comm	KULL_M_MEMORY_GLOBAL_OWN_HANDLE,4,4
	.comm	FALSE,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_kull_m_patch.c_kull_m_patch.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	kull_m_patch
	.syntax unified
	.arm
	.fpu softvfp
	.type	kull_m_patch, %function
kull_m_patch:
	@ args = 24, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	ip, #0
	mov	r6, r3
	ldr	r3, .L56
	ldr	r8, [r0, #4]
	ldr	r9, [r3]
	ldr	lr, .L56+4
	ldr	r10, .L56+8
	ldr	r5, .L56+12
	sub	sp, sp, #44
	mov	r0, r1
	mov	r3, r9
	mov	r1, r2
	mov	r2, r4
	ldr	r10, [r10]
	str	r10, [sp, #36]
	mov	r10,#0
	ldr	r7, [sp, #88]
	str	r8, [sp, #16]
	ldr	fp, [sp, #96]
	ldr	r8, [r5]
	ldr	r10, [sp, #100]
	str	ip, [sp, #12]
	str	ip, [sp, #24]
	str	ip, [sp, #8]
	str	ip, [sp, #20]
	str	ip, [sp, #32]
	str	lr, [sp, #28]
	bl	kull_m_memory_search
	cmp	r0, #0
	beq	.L1
	clz	r5, r7
	ldr	r3, [r4]
	ldr	r2, [sp, #84]
	cmp	r7, #0
	add	r3, r3, r2
	lsr	r5, r5, #5
	str	r3, [sp, #12]
	beq	.L3
	ldr	r3, .L56+16
	ldr	r1, [sp, #80]
	ldr	r0, [r3]
	bl	LocalAlloc
	cmp	r0, #0
	str	r0, [sp, #24]
	bne	.L52
.L3:
	cmp	r5, #0
	bne	.L53
.L1:
	ldr	r3, .L56+8
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L54
	mov	r0, r8
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L53:
	add	r1, sp, #4
	add	r0, sp, #12
	bl	kull_m_memory_query
	cmp	r0, #0
	beq	.L4
	ldr	r3, [sp, #4]
	ands	r1, r3, #15
	beq	.L5
	ldr	r2, .L56+20
	ldr	r2, [r2]
	cmp	r1, r2
	bge	.L5
.L6:
	bic	r3, r3, #255
	orr	r2, r3, r2
	ldr	r1, [sp, #80]
	add	r3, sp, #8
	add	r0, sp, #12
	bl	kull_m_memory_protect
	mov	r9, r0
.L7:
	cmp	r9, #0
	bne	.L55
.L4:
	ldr	r0, [sp, #24]
	cmp	r0, #0
	beq	.L1
	bl	LocalFree
	b	.L1
.L52:
	ldr	r2, [sp, #80]
	add	r1, sp, #12
	add	r0, sp, #24
	bl	kull_m_memory_copy
	mov	r5, r0
	b	.L3
.L5:
	ands	r1, r3, #240
	beq	.L7
	ldr	r2, .L56+24
	ldr	r2, [r2]
	cmp	r1, r2
	blt	.L6
	b	.L7
.L55:
	mov	r1, r6
	ldr	r2, [sp, #80]
	add	r0, sp, #12
	bl	kull_m_memory_copy
	subs	r8, r0, #0
	beq	.L8
	cmp	r7, #0
	beq	.L8
	mov	r1, fp
	ldr	r0, [sp, #92]
	blx	r7
	cmp	r10, #0
	strne	r0, [r10]
	ldr	r2, [sp, #80]
	add	r1, sp, #24
	add	r0, sp, #12
	bl	kull_m_memory_copy
	mov	r8, r0
.L8:
	ldr	r2, [sp, #8]
	cmp	r2, #0
	beq	.L4
	mov	r3, #0
	ldr	r1, [sp, #80]
	add	r0, sp, #12
	bl	kull_m_memory_protect
	b	.L4
.L54:
	bl	__stack_chk_fail
.L57:
	.align	2
.L56:
	.word	TRUE
	.word	KULL_M_MEMORY_GLOBAL_OWN_HANDLE
	.word	.LC0
	.word	FALSE
	.word	LPTR
	.word	PAGE_READWRITE
	.word	PAGE_EXECUTE_READWRITE
	.size	kull_m_patch, .-kull_m_patch
	.comm	TRUE,4,4
	.comm	PAGE_READWRITE,4,4
	.comm	PAGE_EXECUTE_READWRITE,4,4
	.comm	LPTR,4,4
	.comm	KULL_M_MEMORY_GLOBAL_OWN_HANDLE,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
