	.file	"127495.c"
	.intel_syntax noprefix
	.text
	.local	mem
	.comm	mem,8,8
	.data
	.align 8
	.type	sz, @object
	.size	sz, 8
sz:
	.quad	34359738368
	.align 8
	.type	lpg_sz, @object
	.size	lpg_sz, 8
lpg_sz:
	.quad	2097152
	.align 8
	.type	pg_sz, @object
	.size	pg_sz, 8
pg_sz:
	.quad	65536
	.align 4
	.type	nr_procs, @object
	.size	nr_procs, 4
nr_procs:
	.long	1
	.text
	.type	set_cpu, @function
set_cpu:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 176
	mov	DWORD PTR -164[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -144[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 16
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	eax, DWORD PTR -164[rbp]
	cdqe
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -152[rbp], 1023
	ja	.L3
	mov	rax, QWORD PTR -152[rbp]
	shr	rax, 6
	lea	rdx, 0[0+rax*8]
	lea	rcx, -144[rbp]
	add	rdx, rcx
	mov	rsi, QWORD PTR [rdx]
	mov	rdx, QWORD PTR -152[rbp]
	and	edx, 63
	mov	edi, 1
	mov	ecx, edx
	sal	rdi, cl
	mov	rdx, rdi
	lea	rcx, 0[0+rax*8]
	lea	rax, -144[rbp]
	add	rax, rcx
	or	rdx, rsi
	mov	QWORD PTR [rax], rdx
.L3:
	lea	rax, -144[rbp]
	mov	rdx, rax
	mov	esi, 128
	mov	edi, 0
	call	sched_setaffinity@PLT
	cmp	eax, -1
	jne	.L4
	mov	eax, -1
	jmp	.L6
.L4:
	mov	eax, 0
.L6:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set_cpu, .-set_cpu
	.type	set_random_cpu, @function
set_random_cpu:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	nop
.L9:
	call	random@PLT
	mov	edx, DWORD PTR nr_procs[rip]
	movsx	rcx, edx
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	edi, eax
	call	set_cpu
	cmp	eax, -1
	je	.L9
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	set_random_cpu, .-set_random_cpu
	.type	mem_walker_fn, @function
mem_walker_fn:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
.L13:
	call	set_random_cpu
	mov	QWORD PTR -8[rbp], 0
	jmp	.L11
.L12:
	mov	rdx, QWORD PTR mem[rip]
	mov	rax, QWORD PTR lpg_sz[rip]
	imul	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	add	QWORD PTR -8[rbp], 1
.L11:
	mov	rax, QWORD PTR sz[rip]
	mov	rcx, QWORD PTR lpg_sz[rip]
	mov	edx, 0
	div	rcx
	cmp	QWORD PTR -8[rbp], rax
	jb	.L12
	jmp	.L13
	.cfi_endproc
.LFE8:
	.size	mem_walker_fn, .-mem_walker_fn
	.section	.rodata
.LC0:
	.string	"mprotect"
	.text
	.type	madvise_fn, @function
madvise_fn:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
.L17:
	mov	edi, 1000
	call	usleep@PLT
	call	set_random_cpu
	call	random@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR sz[rip]
	mov	rsi, QWORD PTR lpg_sz[rip]
	mov	edx, 0
	div	rsi
	mov	rsi, rax
	mov	rax, rcx
	mov	edx, 0
	div	rsi
	mov	QWORD PTR -8[rbp], rdx
	mov	rax, QWORD PTR lpg_sz[rip]
	mov	rcx, QWORD PTR mem[rip]
	mov	rdx, QWORD PTR lpg_sz[rip]
	imul	rdx, QWORD PTR -8[rbp]
	add	rcx, rdx
	mov	edx, 0
	mov	rsi, rax
	mov	rdi, rcx
	call	mprotect@PLT
	test	eax, eax
	je	.L15
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	edi, 1000
	call	usleep@PLT
	mov	rax, QWORD PTR lpg_sz[rip]
	mov	rcx, QWORD PTR mem[rip]
	mov	rdx, QWORD PTR lpg_sz[rip]
	imul	rdx, QWORD PTR -8[rbp]
	add	rcx, rdx
	mov	edx, 3
	mov	rsi, rax
	mov	rdi, rcx
	call	mprotect@PLT
	test	eax, eax
	je	.L17
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.size	madvise_fn, .-madvise_fn
	.type	SIGSEGV_handler, @function
SIGSEGV_handler:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	edi, 1000
	call	usleep@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	SIGSEGV_handler, .-SIGSEGV_handler
	.section	.rodata
.LC1:
	.string	"sigaction"
.LC2:
	.string	"madvise"
.LC3:
	.string	"pthread_create"
.LC4:
	.string	"pthread_join"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 448
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	get_nprocs_conf@PLT
	mov	DWORD PTR nr_procs[rip], eax
	lea	rax, -432[rbp]
	mov	edx, 152
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, SIGSEGV_handler[rip]
	mov	QWORD PTR -432[rbp], rax
	lea	rax, -432[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 11
	call	sigaction@PLT
	test	eax, eax
	je	.L20
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	mov	rdx, QWORD PTR sz[rip]
	mov	rax, QWORD PTR lpg_sz[rip]
	mov	rsi, rax
	lea	rdi, mem[rip]
	call	posix_memalign@PLT
	mov	rdx, QWORD PTR sz[rip]
	mov	rax, QWORD PTR mem[rip]
	mov	esi, 255
	mov	rdi, rax
	call	memset@PLT
	mov	rcx, QWORD PTR sz[rip]
	mov	rax, QWORD PTR mem[rip]
	mov	edx, 14
	mov	rsi, rcx
	mov	rdi, rax
	call	madvise@PLT
	test	eax, eax
	je	.L21
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	mov	DWORD PTR -436[rbp], 0
	jmp	.L22
.L24:
	lea	rdx, -272[rbp]
	mov	eax, DWORD PTR -436[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, mem_walker_fn[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L23
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	add	DWORD PTR -436[rbp], 1
.L22:
	cmp	DWORD PTR -436[rbp], 30
	jle	.L24
	lea	rdx, -272[rbp]
	mov	eax, DWORD PTR -436[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, madvise_fn[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L25
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	DWORD PTR -436[rbp], 0
	jmp	.L26
.L28:
	mov	eax, DWORD PTR -436[rbp]
	cdqe
	mov	rax, QWORD PTR -272[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L27
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L27:
	add	DWORD PTR -436[rbp], 1
.L26:
	cmp	DWORD PTR -436[rbp], 31
	jle	.L28
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"127495.c"
	.text
	.local	mem
	.comm	mem,4,4
	.local	sz
	.comm	sz,4,4
	.data
	.align	2
	.type	lpg_sz, %object
	.size	lpg_sz, 4
lpg_sz:
	.word	2097152
	.align	2
	.type	pg_sz, %object
	.size	pg_sz, 4
pg_sz:
	.word	65536
	.align	2
	.type	nr_procs, %object
	.size	nr_procs, 4
nr_procs:
	.word	1
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_cpu, %function
set_cpu:
	@ args = 0, pretend = 0, frame = 144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #144
	str	r0, [fp, #-144]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #136
	mov	r0, r3
	mov	r3, #128
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, [fp, #-144]
	str	r3, [fp, #-140]
	ldr	r3, [fp, #-140]
	cmp	r3, #1024
	bcs	.L3
	ldr	r3, [fp, #-140]
	lsr	r3, r3, #5
	lsl	r2, r3, #2
	sub	r1, fp, #136
	add	r2, r1, r2
	ldr	r1, [r2]
	ldr	r2, [fp, #-140]
	and	r2, r2, #31
	mov	r0, #1
	lsl	r2, r0, r2
	lsl	r3, r3, #2
	sub	r0, fp, #136
	add	r3, r0, r3
	orr	r2, r1, r2
	str	r2, [r3]
.L3:
	sub	r3, fp, #136
	mov	r2, r3
	mov	r1, #128
	mov	r0, #0
	bl	sched_setaffinity
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	mvn	r3, #0
	b	.L6
.L4:
	mov	r3, #0
.L6:
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC0
	.size	set_cpu, .-set_cpu
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_random_cpu, %function
set_random_cpu:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	nop
.L11:
	bl	random
	mov	r2, r0
	ldr	r3, .L12
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r0, r3
	bl	set_cpu
	mov	r3, r0
	cmn	r3, #1
	beq	.L11
	nop
	nop
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	nr_procs
	.size	set_random_cpu, .-set_random_cpu
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mem_walker_fn, %function
mem_walker_fn:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
.L17:
	bl	set_random_cpu
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L15
.L16:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, .L18+4
	ldr	r3, [r3]
	ldr	r1, [fp, #-8]
	mul	r3, r1, r3
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L15:
	ldr	r3, .L18+8
	ldr	r3, [r3]
	ldr	r2, .L18+4
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_uidiv
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	bcc	.L16
	b	.L17
.L19:
	.align	2
.L18:
	.word	mem
	.word	lpg_sz
	.word	sz
	.size	mem_walker_fn, .-mem_walker_fn
	.global	__aeabi_uidivmod
	.section	.rodata
	.align	2
.LC1:
	.ascii	"mprotect\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	madvise_fn, %function
madvise_fn:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
.L23:
	mov	r0, #1000
	bl	usleep
	bl	set_random_cpu
	bl	random
	mov	r3, r0
	mov	r4, r3
	ldr	r3, .L24
	ldr	r3, [r3]
	ldr	r2, .L24+4
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_uidiv
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	__aeabi_uidivmod
	mov	r3, r1
	str	r3, [fp, #-16]
	ldr	r3, .L24+8
	ldr	r2, [r3]
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r1, [fp, #-16]
	mul	r3, r1, r3
	add	r3, r2, r3
	ldr	r2, .L24+4
	ldr	r1, [r2]
	mov	r2, #0
	mov	r0, r3
	bl	mprotect
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	ldr	r0, .L24+12
	bl	perror
	mov	r0, #1
	bl	exit
.L21:
	mov	r0, #1000
	bl	usleep
	ldr	r3, .L24+8
	ldr	r2, [r3]
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r1, [fp, #-16]
	mul	r3, r1, r3
	add	r3, r2, r3
	ldr	r2, .L24+4
	ldr	r1, [r2]
	mov	r2, #3
	mov	r0, r3
	bl	mprotect
	mov	r3, r0
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L24+12
	bl	perror
	mov	r0, #1
	bl	exit
.L25:
	.align	2
.L24:
	.word	sz
	.word	lpg_sz
	.word	mem
	.word	.LC1
	.size	madvise_fn, .-madvise_fn
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	SIGSEGV_handler, %function
SIGSEGV_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	mov	r0, #1000
	bl	usleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	SIGSEGV_handler, .-SIGSEGV_handler
	.section	.rodata
	.align	2
.LC2:
	.ascii	"sigaction\000"
	.align	2
.LC3:
	.ascii	"madvise\000"
	.align	2
.LC4:
	.ascii	"pthread_create\000"
	.align	2
.LC5:
	.ascii	"pthread_join\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #280
	ldr	r3, .L38
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	get_nprocs_conf
	mov	r3, r0
	ldr	r2, .L38+4
	str	r3, [r2]
	sub	r3, fp, #148
	mov	r2, #140
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L38+8
	str	r3, [fp, #-148]
	sub	r3, fp, #148
	mov	r2, #0
	mov	r1, r3
	mov	r0, #11
	bl	sigaction
	mov	r3, r0
	cmp	r3, #0
	beq	.L28
	ldr	r0, .L38+12
	bl	perror
	mov	r0, #1
	bl	exit
.L28:
	ldr	r3, .L38+16
	ldr	r3, [r3]
	ldr	r2, .L38+20
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L38+24
	bl	posix_memalign
	ldr	r3, .L38+24
	ldr	r3, [r3]
	ldr	r2, .L38+20
	ldr	r2, [r2]
	mov	r1, #255
	mov	r0, r3
	bl	memset
	ldr	r3, .L38+24
	ldr	r3, [r3]
	ldr	r2, .L38+20
	ldr	r1, [r2]
	mov	r2, #14
	mov	r0, r3
	bl	madvise
	mov	r3, r0
	cmp	r3, #0
	beq	.L29
	ldr	r0, .L38+28
	bl	perror
	mov	r0, #1
	bl	exit
.L29:
	mov	r3, #0
	str	r3, [fp, #-280]
	b	.L30
.L32:
	sub	r2, fp, #276
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L38+32
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L31
	ldr	r0, .L38+36
	bl	perror
	mov	r0, #1
	bl	exit
.L31:
	ldr	r3, [fp, #-280]
	add	r3, r3, #1
	str	r3, [fp, #-280]
.L30:
	ldr	r3, [fp, #-280]
	cmp	r3, #30
	ble	.L32
	sub	r2, fp, #276
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L38+40
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L33
	ldr	r0, .L38+36
	bl	perror
	mov	r0, #1
	bl	exit
.L33:
	mov	r3, #0
	str	r3, [fp, #-280]
	b	.L34
.L36:
	ldr	r3, [fp, #-280]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-272]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L35
	ldr	r0, .L38+44
	bl	perror
	mov	r0, #1
	bl	exit
.L35:
	ldr	r3, [fp, #-280]
	add	r3, r3, #1
	str	r3, [fp, #-280]
.L34:
	ldr	r3, [fp, #-280]
	cmp	r3, #31
	ble	.L36
	mov	r0, #0
	bl	exit
.L39:
	.align	2
.L38:
	.word	.LC6
	.word	nr_procs
	.word	SIGSEGV_handler
	.word	.LC2
	.word	lpg_sz
	.word	sz
	.word	mem
	.word	.LC3
	.word	mem_walker_fn
	.word	.LC4
	.word	madvise_fn
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
