	.file	"200370.c"
	.intel_syntax noprefix
	.text
	.globl	mutex
	.bss
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.section	.rodata
	.align 8
.LC0:
	.string	"in child thread, lock the mutex"
	.text
	.globl	another
	.type	another, @function
another:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	edi, 5
	call	sleep@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	another, .-another
	.globl	prepare
	.type	prepare, @function
prepare:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	prepare, .-prepare
	.globl	infork
	.type	infork, @function
infork:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	infork, .-infork
	.section	.rodata
	.align 8
.LC1:
	.string	"I anm in the child, want to get the lock"
.LC2:
	.string	"I can not run to here, oop..."
	.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	pthread_mutex_init@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, another[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	edi, 1
	call	sleep@PLT
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L5
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_destroy@PLT
	mov	eax, 1
	jmp	.L8
.L5:
	cmp	DWORD PTR -20[rbp], 0
	jne	.L7
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	edi, 0
	call	exit@PLT
.L7:
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	edi, 0
	call	wait@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_destroy@PLT
	mov	eax, 0
.L8:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"200370.c"
	.text
	.comm	mutex,24,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"in child thread, lock the mutex\000"
	.text
	.align	2
	.global	another
	.syntax unified
	.arm
	.fpu softvfp
	.type	another, %function
another:
	@ 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	r0, .L2
	bl	puts
	ldr	r0, .L2+4
	bl	pthread_mutex_lock
	mov	r0, #5
	bl	sleep
	ldr	r0, .L2+4
	bl	pthread_mutex_unlock
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	mutex
	.size	another, .-another
	.align	2
	.global	prepare
	.syntax unified
	.arm
	.fpu softvfp
	.type	prepare, %function
prepare:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L5
	bl	pthread_mutex_lock
	nop
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	mutex
	.size	prepare, .-prepare
	.align	2
	.global	infork
	.syntax unified
	.arm
	.fpu softvfp
	.type	infork, %function
infork:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L8
	bl	pthread_mutex_unlock
	nop
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	mutex
	.size	infork, .-infork
	.section	.rodata
	.align	2
.LC1:
	.ascii	"I anm in the child, want to get the lock\000"
	.align	2
.LC2:
	.ascii	"I can not run to here, oop...\000"
	.align	2
.LC3:
	.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, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L16+4
	bl	pthread_mutex_init
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L16+8
	mov	r1, #0
	bl	pthread_create
	mov	r0, #1
	bl	sleep
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L11
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L16+4
	bl	pthread_mutex_destroy
	mov	r3, #1
	b	.L14
.L11:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L13
	ldr	r0, .L16+12
	bl	puts
	ldr	r0, .L16+4
	bl	pthread_mutex_lock
	ldr	r0, .L16+16
	bl	puts
	ldr	r0, .L16+4
	bl	pthread_mutex_unlock
	mov	r0, #0
	bl	exit
.L13:
	ldr	r0, .L16+4
	bl	pthread_mutex_unlock
	mov	r0, #0
	bl	wait
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L16+4
	bl	pthread_mutex_destroy
	mov	r3, #0
.L14:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC3
	.word	mutex
	.word	another
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
