	.file	"705875.c"
	.intel_syntax noprefix
	.text
	.globl	wait_cond
	.bss
	.align 32
	.type	wait_cond, @object
	.size	wait_cond, 48
wait_cond:
	.zero	48
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.globl	in_there
	.align 4
	.type	in_there, @object
	.size	in_there, 4
in_there:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"%c wants to enter the critical section\n"
	.align 8
.LC1:
	.string	"%c is in the critical section\n"
	.align 8
.LC2:
	.string	"%c has left the critical section\n"
	.text
	.globl	thread
	.type	thread, @function
thread:
.LFB0:
	.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	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	jmp	.L2
.L3:
	lea	rsi, mutex[rip]
	lea	rdi, wait_cond[rip]
	call	pthread_cond_wait@PLT
.L2:
	mov	eax, DWORD PTR in_there[rip]
	cmp	eax, 2
	jg	.L3
	mov	eax, DWORD PTR in_there[rip]
	add	eax, 1
	mov	DWORD PTR in_there[rip], eax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR in_there[rip]
	sub	eax, 1
	mov	DWORD PTR in_there[rip], eax
	lea	rdi, wait_cond[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	thread, .-thread
	.section	.rodata
.LC3:
	.string	"abcdefgh"
.LC4:
	.string	"Everything finished..."
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC3[rip]
	mov	QWORD PTR -88[rbp], rax
	mov	DWORD PTR -92[rbp], 0
	jmp	.L6
.L8:
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	lea	rcx, -80[rbp]
	mov	eax, DWORD PTR -92[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	cmp	DWORD PTR -92[rbp], 4
	jne	.L7
	mov	edi, 4
	call	sleep@PLT
.L7:
	add	DWORD PTR -92[rbp], 1
.L6:
	cmp	DWORD PTR -92[rbp], 7
	jle	.L8
	mov	DWORD PTR -92[rbp], 0
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -92[rbp]
	cdqe
	mov	rax, QWORD PTR -80[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -92[rbp], 1
.L9:
	cmp	DWORD PTR -92[rbp], 7
	jle	.L10
	lea	rdi, .LC4[rip]
	call	puts@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
.LFE1:
	.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	"705875.c"
	.text
	.comm	wait_cond,48,8
	.comm	mutex,24,4
	.global	in_there
	.bss
	.align	2
	.type	in_there, %object
	.size	in_there, 4
in_there:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%c wants to enter the critical section\012\000"
	.align	2
.LC1:
	.ascii	"%c is in the critical section\012\000"
	.align	2
.LC2:
	.ascii	"%c has left the critical section\012\000"
	.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
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L5
	bl	printf
	ldr	r0, .L5+4
	bl	pthread_mutex_lock
	b	.L2
.L3:
	ldr	r1, .L5+4
	ldr	r0, .L5+8
	bl	pthread_cond_wait
.L2:
	ldr	r3, .L5+12
	ldr	r3, [r3]
	cmp	r3, #2
	bgt	.L3
	ldr	r3, .L5+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L5+12
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L5+16
	bl	printf
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L5+20
	bl	printf
	ldr	r3, .L5+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L5+12
	str	r3, [r2]
	ldr	r0, .L5+8
	bl	pthread_cond_signal
	ldr	r0, .L5+4
	bl	pthread_mutex_unlock
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	mutex
	.word	wait_cond
	.word	in_there
	.word	.LC1
	.word	.LC2
	.size	thread, .-thread
	.section	.rodata
	.align	2
.LC3:
	.ascii	"abcdefgh\000"
	.align	2
.LC4:
	.ascii	"Everything finished...\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L15+4
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L8
.L10:
	sub	r2, fp, #40
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r2, .L15+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	bne	.L9
	mov	r0, #4
	bl	sleep
.L9:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L8:
	ldr	r3, [fp, #-48]
	cmp	r3, #7
	ble	.L10
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L11
.L12:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L11:
	ldr	r3, [fp, #-48]
	cmp	r3, #7
	ble	.L12
	ldr	r0, .L15+12
	bl	puts
	mov	r3, #0
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC5
	.word	.LC3
	.word	thread
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
