	.file	"28995.c"
	.intel_syntax noprefix
	.text
	.globl	err
	.bss
	.align 4
	.type	err, @object
	.size	err, 4
err:
	.zero	4
	.globl	th_arg
	.section	.rodata
	.align 4
	.type	th_arg, @object
	.size	th_arg, 4
th_arg:
	.long	1234
	.globl	key
	.bss
	.align 4
	.type	key, @object
	.size	key, 4
key:
	.zero	4
	.globl	on_exit_thread_called
	.align 4
	.type	on_exit_thread_called, @object
	.size	on_exit_thread_called, 4
on_exit_thread_called:
	.zero	4
	.globl	detached_thread_fn_sleep
	.align 4
	.type	detached_thread_fn_sleep, @object
	.size	detached_thread_fn_sleep, 4
detached_thread_fn_sleep:
	.zero	4
	.section	.rodata
.LC0:
	.string	"the_stack_data/28995.c"
.LC1:
	.string	"*((int *)arg) == th_arg"
.LC2:
	.string	"th != NULL"
	.text
	.globl	thread_fn
	.type	thread_fn, @function
thread_fn:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 1234
	cmp	eax, edx
	je	.L2
	lea	rcx, __PRETTY_FUNCTION__.3[rip]
	mov	edx, 22
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L2:
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L3
	lea	rcx, __PRETTY_FUNCTION__.3[rip]
	mov	edx, 25
	lea	rsi, .LC0[rip]
	lea	rdi, .LC2[rip]
	call	__assert_fail@PLT
.L3:
	call	pthread_self@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_exit@PLT
	.cfi_endproc
.LFE6:
	.size	thread_fn, .-thread_fn
	.section	.rodata
.LC3:
	.string	"fail: thread specific key"
	.text
	.globl	detached_thread_fn
	.type	detached_thread_fn, @function
detached_thread_fn:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 1234
	cmp	eax, edx
	je	.L5
	lea	rcx, __PRETTY_FUNCTION__.2[rip]
	mov	edx, 33
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L5:
	mov	eax, DWORD PTR key[rip]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	pthread_setspecific@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L6
	lea	rdi, .LC3[rip]
	call	perror@PLT
	call	abort@PLT
.L6:
	mov	DWORD PTR detached_thread_fn_sleep[rip], 1
	mov	edi, 2147483647
	call	sleep@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	detached_thread_fn, .-detached_thread_fn
	.globl	on_exit_thread
	.type	on_exit_thread, @function
on_exit_thread:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 1234
	cmp	eax, edx
	je	.L9
	lea	rcx, __PRETTY_FUNCTION__.1[rip]
	mov	edx, 48
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L9:
	mov	DWORD PTR on_exit_thread_called[rip], 1
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	on_exit_thread, .-on_exit_thread
	.section	.rodata
.LC4:
	.string	"fail: create attributes"
.LC5:
	.string	"fail: create thread"
.LC6:
	.string	"fail: join thread"
.LC7:
	.string	"pthread_equal(*th_res, th)"
.LC8:
	.string	"fail: set key pthread"
.LC9:
	.string	"fail: set attr detached"
.LC10:
	.string	"fail: create detached thread"
.LC11:
	.string	"fail: cancel detached thread"
	.text
	.globl	main
	.type	main, @function
main:
.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, 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L11
	lea	rdi, .LC4[rip]
	call	perror@PLT
	call	abort@PLT
.L11:
	lea	rsi, -64[rbp]
	lea	rax, -80[rbp]
	lea	rcx, th_arg[rip]
	lea	rdx, thread_fn[rip]
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L12
	lea	rdi, .LC5[rip]
	call	perror@PLT
	call	abort@PLT
.L12:
	mov	rax, QWORD PTR -80[rbp]
	lea	rdx, -72[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L13
	lea	rdi, .LC6[rip]
	call	perror@PLT
	call	abort@PLT
.L13:
	mov	rdx, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_equal@PLT
	test	eax, eax
	jne	.L14
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 65
	lea	rsi, .LC0[rip]
	lea	rdi, .LC7[rip]
	call	__assert_fail@PLT
.L14:
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rsi, on_exit_thread[rip]
	lea	rdi, key[rip]
	call	pthread_key_create@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L15
	lea	rdi, .LC8[rip]
	call	perror@PLT
	call	abort@PLT
.L15:
	lea	rax, -64[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	pthread_attr_setdetachstate@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L16
	lea	rdi, .LC9[rip]
	call	perror@PLT
	call	abort@PLT
.L16:
	lea	rsi, -64[rbp]
	lea	rax, -80[rbp]
	lea	rcx, th_arg[rip]
	lea	rdx, detached_thread_fn[rip]
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L17
	lea	rdi, .LC10[rip]
	call	perror@PLT
	call	abort@PLT
.L17:
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_attr_destroy@PLT
	nop
.L18:
	mov	eax, DWORD PTR detached_thread_fn_sleep[rip]
	test	eax, eax
	je	.L18
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	pthread_cancel@PLT
	mov	DWORD PTR err[rip], eax
	mov	eax, DWORD PTR err[rip]
	test	eax, eax
	je	.L23
	lea	rdi, .LC11[rip]
	call	perror@PLT
	call	abort@PLT
.L23:
	nop
.L20:
	mov	eax, DWORD PTR on_exit_thread_called[rip]
	test	eax, eax
	je	.L20
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__PRETTY_FUNCTION__.3, @object
	.size	__PRETTY_FUNCTION__.3, 10
__PRETTY_FUNCTION__.3:
	.string	"thread_fn"
	.align 16
	.type	__PRETTY_FUNCTION__.2, @object
	.size	__PRETTY_FUNCTION__.2, 19
__PRETTY_FUNCTION__.2:
	.string	"detached_thread_fn"
	.align 8
	.type	__PRETTY_FUNCTION__.1, @object
	.size	__PRETTY_FUNCTION__.1, 15
__PRETTY_FUNCTION__.1:
	.string	"on_exit_thread"
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 5
__PRETTY_FUNCTION__.0:
	.string	"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	"28995.c"
	.text
	.global	err
	.bss
	.align	2
	.type	err, %object
	.size	err, 4
err:
	.space	4
	.global	th_arg
	.section	.rodata
	.align	2
	.type	th_arg, %object
	.size	th_arg, 4
th_arg:
	.word	1234
	.comm	key,4,4
	.global	on_exit_thread_called
	.bss
	.align	2
	.type	on_exit_thread_called, %object
	.size	on_exit_thread_called, 4
on_exit_thread_called:
	.space	4
	.global	detached_thread_fn_sleep
	.align	2
	.type	detached_thread_fn_sleep, %object
	.size	detached_thread_fn_sleep, 4
detached_thread_fn_sleep:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"the_stack_data/28995.c\000"
	.align	2
.LC1:
	.ascii	"*((int *)arg) == th_arg\000"
	.align	2
.LC2:
	.ascii	"th != NULL\000"
	.text
	.align	2
	.global	thread_fn
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_fn, %function
thread_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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r2, .L4
	cmp	r3, r2
	beq	.L2
	ldr	r3, .L4+4
	mov	r2, #22
	ldr	r1, .L4+8
	ldr	r0, .L4+12
	bl	__assert_fail
.L2:
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L4+4
	mov	r2, #25
	ldr	r1, .L4+8
	ldr	r0, .L4+16
	bl	__assert_fail
.L3:
	bl	pthread_self
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r0, [fp, #-8]
	bl	pthread_exit
.L5:
	.align	2
.L4:
	.word	1234
	.word	__PRETTY_FUNCTION__.6268
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	thread_fn, .-thread_fn
	.section	.rodata
	.align	2
.LC3:
	.ascii	"fail: thread specific key\000"
	.text
	.align	2
	.global	detached_thread_fn
	.syntax unified
	.arm
	.fpu softvfp
	.type	detached_thread_fn, %function
detached_thread_fn:
	@ 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]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, .L10
	cmp	r3, r2
	beq	.L7
	ldr	r3, .L10+4
	mov	r2, #33
	ldr	r1, .L10+8
	ldr	r0, .L10+12
	bl	__assert_fail
.L7:
	ldr	r3, .L10+16
	ldr	r3, [r3]
	ldr	r1, [fp, #-8]
	mov	r0, r3
	bl	pthread_setspecific
	mov	r3, r0
	ldr	r2, .L10+20
	str	r3, [r2]
	ldr	r3, .L10+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L8
	ldr	r0, .L10+24
	bl	perror
	bl	abort
.L8:
	ldr	r3, .L10+28
	mov	r2, #1
	str	r2, [r3]
	mvn	r0, #-2147483648
	bl	sleep
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	1234
	.word	__PRETTY_FUNCTION__.6273
	.word	.LC0
	.word	.LC1
	.word	key
	.word	err
	.word	.LC3
	.word	detached_thread_fn_sleep
	.size	detached_thread_fn, .-detached_thread_fn
	.align	2
	.global	on_exit_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	on_exit_thread, %function
on_exit_thread:
	@ 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]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, .L14
	cmp	r3, r2
	beq	.L13
	ldr	r3, .L14+4
	mov	r2, #48
	ldr	r1, .L14+8
	ldr	r0, .L14+12
	bl	__assert_fail
.L13:
	ldr	r3, .L14+16
	mov	r2, #1
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	1234
	.word	__PRETTY_FUNCTION__.6277
	.word	.LC0
	.word	.LC1
	.word	on_exit_thread_called
	.size	on_exit_thread, .-on_exit_thread
	.section	.rodata
	.align	2
.LC4:
	.ascii	"fail: create attributes\000"
	.align	2
.LC5:
	.ascii	"fail: create thread\000"
	.align	2
.LC6:
	.ascii	"fail: join thread\000"
	.align	2
.LC7:
	.ascii	"pthread_equal(*th_res, th)\000"
	.align	2
.LC8:
	.ascii	"fail: set key pthread\000"
	.align	2
.LC9:
	.ascii	"fail: set attr detached\000"
	.align	2
.LC10:
	.ascii	"fail: create detached thread\000"
	.align	2
.LC11:
	.ascii	"fail: cancel detached thread\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L30
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #44
	mov	r0, r3
	bl	pthread_attr_init
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L17
	ldr	r0, .L30+8
	bl	perror
	bl	abort
.L17:
	sub	r1, fp, #44
	sub	r0, fp, #52
	ldr	r3, .L30+12
	ldr	r2, .L30+16
	bl	pthread_create
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L18
	ldr	r0, .L30+20
	bl	perror
	bl	abort
.L18:
	ldr	r3, [fp, #-52]
	sub	r2, fp, #48
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L19
	ldr	r0, .L30+24
	bl	perror
	bl	abort
.L19:
	ldr	r3, [fp, #-48]
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	mov	r1, r2
	mov	r0, r3
	bl	pthread_equal
	mov	r3, r0
	cmp	r3, #0
	bne	.L20
	ldr	r3, .L30+28
	mov	r2, #65
	ldr	r1, .L30+32
	ldr	r0, .L30+36
	bl	__assert_fail
.L20:
	ldr	r3, [fp, #-48]
	mov	r0, r3
	bl	free
	ldr	r1, .L30+40
	ldr	r0, .L30+44
	bl	pthread_key_create
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L21
	ldr	r0, .L30+48
	bl	perror
	bl	abort
.L21:
	sub	r3, fp, #44
	mov	r1, #1
	mov	r0, r3
	bl	pthread_attr_setdetachstate
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L22
	ldr	r0, .L30+52
	bl	perror
	bl	abort
.L22:
	sub	r1, fp, #44
	sub	r0, fp, #52
	ldr	r3, .L30+12
	ldr	r2, .L30+56
	bl	pthread_create
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L30+60
	bl	perror
	bl	abort
.L23:
	sub	r3, fp, #44
	mov	r0, r3
	bl	pthread_attr_destroy
	nop
.L24:
	ldr	r3, .L30+64
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-52]
	mov	r0, r3
	bl	pthread_cancel
	mov	r3, r0
	ldr	r2, .L30+4
	str	r3, [r2]
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L29
	ldr	r0, .L30+68
	bl	perror
	bl	abort
.L29:
	nop
.L26:
	ldr	r3, .L30+72
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L26
	mov	r3, #0
	ldr	r2, .L30
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	.LC12
	.word	err
	.word	.LC4
	.word	th_arg
	.word	thread_fn
	.word	.LC5
	.word	.LC6
	.word	__PRETTY_FUNCTION__.6283
	.word	.LC0
	.word	.LC7
	.word	on_exit_thread
	.word	key
	.word	.LC8
	.word	.LC9
	.word	detached_thread_fn
	.word	.LC10
	.word	detached_thread_fn_sleep
	.word	.LC11
	.word	on_exit_thread_called
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.6268, %object
	.size	__PRETTY_FUNCTION__.6268, 10
__PRETTY_FUNCTION__.6268:
	.ascii	"thread_fn\000"
	.align	2
	.type	__PRETTY_FUNCTION__.6273, %object
	.size	__PRETTY_FUNCTION__.6273, 19
__PRETTY_FUNCTION__.6273:
	.ascii	"detached_thread_fn\000"
	.align	2
	.type	__PRETTY_FUNCTION__.6277, %object
	.size	__PRETTY_FUNCTION__.6277, 15
__PRETTY_FUNCTION__.6277:
	.ascii	"on_exit_thread\000"
	.align	2
	.type	__PRETTY_FUNCTION__.6283, %object
	.size	__PRETTY_FUNCTION__.6283, 5
__PRETTY_FUNCTION__.6283:
	.ascii	"main\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
