	.file	"31387644.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	">> Thread creation failed: %d\n"
.LC1:
	.string	">> Canceling thread"
.LC2:
	.string	">> Thread cancel failed: %d\n"
	.align 8
.LC3:
	.string	">> Waiting for thread to finish..."
.LC4:
	.string	">> Thread join failed: %d\n"
	.align 8
.LC5:
	.string	">> Thread joined, result is: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, thread_function[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L2
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	edi, 3
	call	sleep@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_cancel@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L3
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L4
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC6:
	.string	">> Thread cancel state change failed: %d\n"
	.align 8
.LC7:
	.string	">> Thread cancel type change failed: %d\n"
.LC8:
	.string	">> Thread is running"
	.align 8
.LC9:
	.string	">> Thread is still running (%d) ... \n, i"
.LC10:
	.string	"0"
	.text
	.globl	thread_function
	.type	thread_function, @function
thread_function:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	esi, 0
	mov	edi, 0
	call	pthread_setcancelstate@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L8
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	esi, 0
	mov	edi, 1
	call	pthread_setcanceltype@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L9
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L10
.L11:
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
	add	DWORD PTR -8[rbp], 1
.L10:
	cmp	DWORD PTR -8[rbp], 9
	jle	.L11
	lea	rdi, .LC10[rip]
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.size	thread_function, .-thread_function
	.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	"31387644.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	">> Thread creation failed: %d\012\000"
	.align	2
.LC1:
	.ascii	">> Canceling thread\000"
	.align	2
.LC2:
	.ascii	">> Thread cancel failed: %d\012\000"
	.align	2
.LC3:
	.ascii	">> Waiting for thread to finish...\000"
	.align	2
.LC4:
	.ascii	">> Thread join failed: %d\012\000"
	.align	2
.LC5:
	.ascii	">> Thread joined, result is: %s\012\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 = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #20
	mov	r3, #0
	ldr	r2, .L7+4
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L2
	ldr	r1, [fp, #-12]
	ldr	r0, .L7+8
	bl	printf
	mov	r0, #1
	bl	exit
.L2:
	mov	r0, #3
	bl	sleep
	ldr	r0, .L7+12
	bl	puts
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	pthread_cancel
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L3
	ldr	r1, [fp, #-12]
	ldr	r0, .L7+16
	bl	printf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r0, .L7+20
	bl	puts
	ldr	r3, [fp, #-20]
	sub	r2, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L4
	ldr	r1, [fp, #-12]
	ldr	r0, .L7+24
	bl	printf
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L7+28
	bl	printf
	mov	r3, #0
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC6
	.word	thread_function
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC7:
	.ascii	">> Thread cancel state change failed: %d\012\000"
	.align	2
.LC8:
	.ascii	">> Thread cancel type change failed: %d\012\000"
	.align	2
.LC9:
	.ascii	">> Thread is running\000"
	.align	2
.LC10:
	.ascii	">> Thread is still running (%d) ... \012, i\000"
	.align	2
.LC11:
	.ascii	"0\000"
	.text
	.align	2
	.global	thread_function
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_function, %function
thread_function:
	@ 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]
	mov	r1, #0
	mov	r0, #0
	bl	pthread_setcancelstate
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L10
	ldr	r1, [fp, #-8]
	ldr	r0, .L14
	bl	printf
	mov	r0, #1
	bl	exit
.L10:
	mov	r1, #0
	mov	r0, #1
	bl	pthread_setcanceltype
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L11
	ldr	r1, [fp, #-8]
	ldr	r0, .L14+4
	bl	printf
	mov	r0, #1
	bl	exit
.L11:
	ldr	r0, .L14+8
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L12
.L13:
	ldr	r0, .L14+12
	bl	printf
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L12:
	ldr	r3, [fp, #-12]
	cmp	r3, #9
	ble	.L13
	ldr	r0, .L14+16
	bl	pthread_exit
.L15:
	.align	2
.L14:
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	thread_function, .-thread_function
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
