	.file	"54825563.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Thread Demo"
.LC1:
	.string	"PID:%d\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
	lea	rdi, .LC0[rip]
	call	puts@PLT
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	thread
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"Thread ID:%0x\n"
.LC3:
	.string	"Create thread error"
.LC4:
	.string	"Return thread ID is %0x\n"
	.text
	.globl	thread
	.type	thread, @function
thread:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	pthread_self@PLT
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, routineFun[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L4
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L8
.L4:
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -20[rbp], 5
	jmp	.L6
.L7:
	call	pthread_self@PLT
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
.L6:
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -20[rbp], edx
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	call	pthread_self@PLT
	mov	rdi, rax
	call	pthread_cancel@PLT
	mov	eax, 0
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	thread, .-thread
	.globl	routineFun
	.type	routineFun, @function
routineFun:
.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
	mov	DWORD PTR -4[rbp], 20
	jmp	.L11
.L12:
	call	pthread_self@PLT
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
.L11:
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -4[rbp], edx
	test	eax, eax
	jne	.L12
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE8:
	.size	routineFun, .-routineFun
	.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	"54825563.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Thread Demo\000"
	.align	2
.LC1:
	.ascii	"PID:%d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L3
	bl	puts
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L3+4
	bl	printf
	bl	thread
	mov	r3, r0
	mov	r0, r3
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Thread ID:%0x\012\000"
	.align	2
.LC3:
	.ascii	"Create thread error\000"
	.align	2
.LC4:
	.ascii	"Return thread ID is %0x\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread, %function
thread:
	@ 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, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	pthread_self
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+4
	bl	printf
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L12+8
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r0, .L12+12
	bl	puts
	mvn	r3, #0
	b	.L10
.L6:
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L12+16
	bl	printf
	mov	r3, #5
	str	r3, [fp, #-12]
	b	.L8
.L9:
	bl	pthread_self
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+4
	bl	printf
	mov	r0, #1
	bl	sleep
.L8:
	ldr	r3, [fp, #-12]
	sub	r2, r3, #1
	str	r2, [fp, #-12]
	cmp	r3, #0
	bne	.L9
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	bl	pthread_self
	mov	r3, r0
	mov	r0, r3
	bl	pthread_cancel
	mov	r3, #0
.L10:
	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	.LC5
	.word	.LC2
	.word	routineFun
	.word	.LC3
	.word	.LC4
	.size	thread, .-thread
	.align	2
	.global	routineFun
	.syntax unified
	.arm
	.fpu softvfp
	.type	routineFun, %function
routineFun:
	@ 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	r3, #20
	str	r3, [fp, #-8]
	b	.L15
.L16:
	bl	pthread_self
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L17
	bl	printf
	mov	r0, #1
	bl	sleep
.L15:
	ldr	r3, [fp, #-8]
	sub	r2, r3, #1
	str	r2, [fp, #-8]
	cmp	r3, #0
	bne	.L16
	mov	r0, #0
	bl	pthread_exit
.L18:
	.align	2
.L17:
	.word	.LC2
	.size	routineFun, .-routineFun
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
