	.file	"442102.c"
	.intel_syntax noprefix
	.text
	.type	threadproc, @function
threadproc:
.LFB6:
	.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 -8[rbp], rdi
.L2:
	jmp	.L2
	.cfi_endproc
.LFE6:
	.size	threadproc, .-threadproc
#APP
	.pushsection .text
	.code32
	test_ss:
	pushl $0
	popl %eax
	ret
	.code64
	.section	.rodata
	.align 8
.LC0:
	.string	"[WARN]\tsched_setaffinity failed"
.LC1:
	.string	"pthread_create"
.LC2:
	.string	"mmap"
	.align 8
.LC3:
	.string	"[RUN]\tSyscalls followed by SS validation"
.LC4:
	.string	"[OK]\tWe survived"
#NO_APP
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	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	QWORD PTR -160[rbp], 0
	cmp	QWORD PTR -160[rbp], 1023
	ja	.L5
	mov	rax, QWORD PTR -160[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 -160[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
.L5:
	lea	rax, -144[rbp]
	mov	rdx, rax
	mov	esi, 128
	mov	edi, 0
	call	sched_setaffinity@PLT
	test	eax, eax
	je	.L6
	lea	rdi, .LC0[rip]
	call	puts@PLT
.L6:
	lea	rax, -168[rbp]
	mov	ecx, 0
	lea	rdx, threadproc[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L7
	lea	rsi, .LC1[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L7:
	mov	r9d, 0
	mov	r8d, -1
	mov	ecx, 98
	mov	edx, 3
	mov	esi, 4096
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -152[rbp], -1
	jne	.L8
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L8:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -172[rbp], 0
	jmp	.L9
.L10:
	mov	edi, 2
	call	usleep@PLT
	mov	rax, QWORD PTR -152[rbp]
	lea	rdx, 4088[rax]
	mov	rax, QWORD PTR test_ss@GOTPCREL[rip]
	mov	rsi, rax
	mov	rdi, rdx
	call	call32_from_64@PLT
	add	DWORD PTR -172[rbp], 1
.L9:
	cmp	DWORD PTR -172[rbp], 999
	jle	.L10
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, 4096
	mov	rdi, rax
	call	munmap@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"442102.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadproc, %function
threadproc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
.L2:
	b	.L2
	.size	threadproc, .-threadproc
	.section	.rodata
	.align	2
.LC0:
	.ascii	"[WARN]\011sched_setaffinity failed\000"
	.align	2
.LC1:
	.ascii	"pthread_create\000"
	.align	2
.LC2:
	.ascii	"[RUN]\011Syscalls followed by SS validation\000"
	.align	2
.LC3:
	.ascii	"[OK]\011We survived\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 = 144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #144
	ldr	r3, .L12
	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
	mov	r3, #0
	str	r3, [fp, #-140]
	ldr	r3, [fp, #-140]
	cmp	r3, #1024
	bcs	.L5
	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]
.L5:
	sub	r3, fp, #136
	mov	r2, r3
	mov	r1, #128
	mov	r0, #0
	bl	sched_setaffinity
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r0, .L12+4
	bl	puts
.L6:
	sub	r0, fp, #148
	mov	r3, #0
	ldr	r2, .L12+8
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r1, .L12+12
	mov	r0, #1
	bl	err
.L7:
	ldr	r0, .L12+16
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-144]
	b	.L8
.L9:
	mov	r0, #2
	bl	usleep
	ldr	r3, [fp, #-144]
	add	r3, r3, #1
	str	r3, [fp, #-144]
.L8:
	ldr	r3, [fp, #-144]
	cmp	r3, #1000
	blt	.L9
	ldr	r0, .L12+20
	bl	puts
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC4
	.word	.LC0
	.word	threadproc
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
