	.file	"37636434.c"
	.intel_syntax noprefix
	.text
	.local	dummy
	.comm	dummy,8,8
	.section	.rodata
.LC0:
	.string	"sched_affinity"
	.text
	.globl	set_affinity
	.type	set_affinity, @function
set_affinity:
.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:
	call	getpid@PLT
	mov	ecx, eax
	lea	rax, -144[rbp]
	mov	rdx, rax
	mov	esi, 128
	mov	edi, ecx
	call	sched_setaffinity@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L6:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set_affinity, .-set_affinity
	.globl	timediff
	.type	timediff, @function
timediff:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	imul	rdx, rax, 1000000000
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, rdx
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	imul	rdx, rax, 1000000000
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR -16[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	timediff, .-timediff
	.globl	mean
	.type	mean, @function
mean:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -12[rbp], 0
	mov	QWORD PTR -8[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	QWORD PTR -8[rbp], rax
	add	DWORD PTR -12[rbp], 1
.L10:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L11
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 0
	div	rcx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mean, .-mean
	.section	.rodata
.LC1:
	.string	"time for 1MB movs is %lu\n"
	.text
	.globl	calculate_latency
	.type	calculate_latency, @function
calculate_latency:
.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
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -4[rbp], 1
.L14:
	cmp	DWORD PTR -4[rbp], 9
	jle	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	calculate_latency, .-calculate_latency
	.section	.rodata
.LC2:
	.string	"failed to allocate memory"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 184
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	r13d, 10
	mov	edi, 0
	call	set_affinity
	mov	edi, 30
	call	sysconf@PLT
	mov	rcx, rax
	lea	rax, -176[rbp]
	mov	edx, 1048576
	mov	rsi, rcx
	mov	rdi, rax
	call	posix_memalign@PLT
	mov	DWORD PTR -180[rbp], eax
	cmp	DWORD PTR -180[rbp], 0
	je	.L17
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	mov	rax, QWORD PTR -176[rbp]
	mov	QWORD PTR -168[rbp], rax
	mov	ebx, 64
	jmp	.L18
.L19:
	movsx	rcx, ebx
	movsx	rax, ebx
	lea	rdx, -64[rax]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -168[rbp]
	add	rdx, rcx
	mov	QWORD PTR [rax], rdx
	add	ebx, 64
.L18:
	cmp	ebx, 1048575
	jle	.L19
	movsx	rax, ebx
	lea	rdx, -64[rax]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	jmp	.L20
.L23:
	mov	edi, 1
	call	sleep@PLT
	mov	r12, QWORD PTR -168[rbp]
	lea	rax, -160[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	clock_gettime@PLT
	jmp	.L21
.L22:
	mov	r12, QWORD PTR [r12]
.L21:
	mov	rax, QWORD PTR [r12]
	test	rax, rax
	jne	.L22
	lea	rax, -144[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	clock_gettime@PLT
	mov	eax, 9
	sub	eax, r13d
	mov	ebx, eax
	lea	rdx, -144[rbp]
	lea	rax, -160[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	timediff
	movsx	rdx, ebx
	mov	QWORD PTR -128[rbp+rdx*8], rax
.L20:
	mov	eax, r13d
	lea	r13d, -1[rax]
	test	eax, eax
	jg	.L23
	mov	rax, QWORD PTR [r12]
	mov	QWORD PTR dummy[rip], rax
	mov	rax, QWORD PTR -176[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rax, -128[rbp]
	mov	esi, 10
	mov	rdi, rax
	call	calculate_latency
	mov	eax, 0
	mov	rcx, QWORD PTR -40[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	add	rsp, 184
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"37636434.c"
	.text
	.local	dummy
	.comm	dummy,8,8
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sched_affinity\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	set_affinity
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_affinity, %function
set_affinity:
	@ 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, .L7
	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:
	bl	getpid
	sub	r3, fp, #136
	mov	r2, r3
	mov	r1, #128
	bl	sched_setaffinity
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L7+4
	bl	perror
.L6:
	nop
	ldr	r3, .L7
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC1
	.word	.LC0
	.size	set_affinity, .-set_affinity
	.align	2
	.global	timediff
	.syntax unified
	.arm
	.fpu softvfp
	.type	timediff, %function
timediff:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	push	{r4, r5, fp}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, .L11
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	ldr	r2, [r2, #4]
	add	r3, r3, r2
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, .L11
	mul	r3, r2, r3
	ldr	r2, [fp, #-36]
	ldr	r2, [r2, #4]
	add	r3, r3, r2
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	subs	r4, r0, r2
	sbc	r5, r1, r3
	mov	r2, r4
	mov	r3, r5
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, r5, fp}
	bx	lr
.L12:
	.align	2
.L11:
	.word	1000000000
	.size	timediff, .-timediff
	.global	__aeabi_uldivmod
	.align	2
	.global	mean
	.syntax unified
	.arm
	.fpu softvfp
	.type	mean, %function
mean:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #24
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L14
.L15:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	adds	r4, r0, r2
	adc	r5, r1, r3
	str	r4, [fp, #-20]
	str	r5, [fp, #-16]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L14:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	blt	.L15
	ldr	r3, [fp, #-36]
	mov	r2, r3
	asr	r3, r2, #31
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	bl	__aeabi_uldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
	.size	mean, .-mean
	.section	.rodata
	.align	2
.LC2:
	.ascii	"time for 1MB movs is %lu\012\000"
	.text
	.align	2
	.global	calculate_latency
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculate_latency, %function
calculate_latency:
	@ 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]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L18
.L19:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	ldr	r0, .L20
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L18:
	ldr	r3, [fp, #-8]
	cmp	r3, #9
	ble	.L19
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC2
	.size	calculate_latency, .-calculate_latency
	.section	.rodata
	.align	2
.LC3:
	.ascii	"failed to allocate memory\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #132
	str	r0, [fp, #-144]
	str	r1, [fp, #-148]
	ldr	r3, .L32
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	mov	r6, #10
	mov	r0, #0
	bl	set_affinity
	mov	r0, #30
	bl	sysconf
	mov	r3, r0
	mov	r1, r3
	sub	r3, fp, #136
	mov	r2, #1048576
	mov	r0, r3
	bl	posix_memalign
	str	r0, [fp, #-132]
	ldr	r3, [fp, #-132]
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L32+4
	bl	perror
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, [fp, #-136]
	str	r3, [fp, #-128]
	mov	r5, #64
	b	.L24
.L25:
	mov	r1, r5
	mov	r3, r5
	sub	r3, r3, #64
	ldr	r2, [fp, #-128]
	add	r3, r2, r3
	ldr	r2, [fp, #-128]
	add	r2, r2, r1
	str	r2, [r3]
	add	r5, r5, #64
.L24:
	cmp	r5, #1048576
	blt	.L25
	mov	r3, r5
	sub	r3, r3, #64
	ldr	r2, [fp, #-128]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	b	.L26
.L29:
	mov	r0, #1
	bl	sleep
	ldr	r4, [fp, #-128]
	sub	r3, fp, #124
	mov	r1, r3
	mov	r0, #0
	bl	clock_gettime
	b	.L27
.L28:
	ldr	r4, [r4]
.L27:
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L28
	sub	r3, fp, #116
	mov	r1, r3
	mov	r0, #0
	bl	clock_gettime
	rsb	r5, r6, #9
	sub	r2, fp, #116
	sub	r3, fp, #124
	mov	r1, r2
	mov	r0, r3
	bl	timediff
	mov	r2, r0
	mov	r3, r1
	lsl	r1, r5, #3
	sub	r0, fp, #20
	add	r1, r0, r1
	sub	r1, r1, #88
	stm	r1, {r2-r3}
.L26:
	mov	r3, r6
	sub	r6, r3, #1
	cmp	r3, #0
	bgt	.L29
	ldr	r3, [r4]
	mov	r2, r3
	asr	r3, r2, #31
	ldr	r1, .L32+8
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-136]
	mov	r0, r3
	bl	free
	sub	r3, fp, #108
	mov	r1, #10
	mov	r0, r3
	bl	calculate_latency
	mov	r3, #0
	ldr	r2, .L32
	ldr	r1, [r2]
	ldr	r2, [fp, #-24]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L31
	bl	__stack_chk_fail
.L31:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L33:
	.align	2
.L32:
	.word	.LC4
	.word	.LC3
	.word	dummy
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
