	.file	"1254380.c"
	.intel_syntax noprefix
	.text
	.globl	peterson
	.type	peterson, @function
peterson:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	QWORD PTR -56[rbp], rdx
	mov	QWORD PTR -64[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -19[rbp], 1
	movzx	eax, BYTE PTR -19[rbp]
	movzx	edx, al
	mov	eax, DWORD PTR -44[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	xchg	dl, BYTE PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	xchg	edx, DWORD PTR [rax]
	nop
.L3:
	mov	eax, 1
	sub	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -18[rbp], al
	movzx	eax, BYTE PTR -18[rbp]
	test	al, al
	je	.L2
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -44[rbp], eax
	je	.L3
.L2:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	rdx
	mov	BYTE PTR -17[rbp], 0
	movzx	eax, BYTE PTR -17[rbp]
	movzx	edx, al
	mov	eax, DWORD PTR -44[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	xchg	dl, BYTE PTR [rax]
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	peterson, .-peterson
	.section	.rodata
.LC0:
	.string	"hello from %d\n"
	.text
	.globl	print
	.type	print, @function
print:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -32[rbp], 1
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	thrd_sleep@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print, .-print
	.globl	thread
	.type	thread, @function
thread:
.LFB2:
	.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
.L8:
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rcx, rdx
	lea	rdx, print[rip]
	mov	rdi, rax
	call	peterson
	jmp	.L8
	.cfi_endproc
.LFE2:
	.size	thread, .-thread
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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, -48[rbp]
	mov	edx, 32
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -72[rbp]
	mov	edx, 8
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	QWORD PTR -80[rbp], 0
	jmp	.L10
.L11:
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 4
	add	rax, rbp
	lea	rdx, -48[rax]
	lea	rax, -72[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 4
	add	rax, rbp
	sub	rax, 40
	mov	DWORD PTR [rax], edx
	lea	rdx, -48[rbp]
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 4
	add	rdx, rax
	lea	rcx, -64[rbp]
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 3
	add	rax, rcx
	lea	rsi, thread[rip]
	mov	rdi, rax
	call	thrd_create@PLT
	add	QWORD PTR -80[rbp], 1
.L10:
	cmp	QWORD PTR -80[rbp], 1
	jbe	.L11
	mov	QWORD PTR -80[rbp], 0
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR -64[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	thrd_join@PLT
	add	QWORD PTR -80[rbp], 1
.L12:
	cmp	QWORD PTR -80[rbp], 1
	jbe	.L13
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"1254380.c"
	.text
	.global	__sync_synchronize
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	peterson
	.syntax unified
	.arm
	.fpu softvfp
	.type	peterson, %function
peterson:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	str	r3, [fp, #-44]
	ldr	r3, .L5
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #1
	strb	r3, [fp, #-27]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-36]
	add	r4, r2, r3
	ldrb	r3, [fp, #-27]	@ zero_extendqisi2
	mov	r5, r3
	bl	__sync_synchronize
	mov	r3, r5
	strb	r3, [r4]
	bl	__sync_synchronize
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-32]
	add	r4, r3, #4
	ldr	r3, [fp, #-24]
	mov	r5, r3
	bl	__sync_synchronize
	str	r5, [r4]
	bl	__sync_synchronize
	nop
.L3:
	ldr	r3, [fp, #-36]
	rsb	r3, r3, #1
	ldr	r2, [fp, #-32]
	add	r4, r2, r3
	bl	__sync_synchronize
	ldrb	r4, [r4]
	bl	__sync_synchronize
	and	r3, r4, #255
	strb	r3, [fp, #-26]
	ldrb	r3, [fp, #-26]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-32]
	add	r4, r3, #4
	bl	__sync_synchronize
	ldr	r4, [r4]
	bl	__sync_synchronize
	mov	r3, r4
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	beq	.L3
.L2:
	ldr	r3, [fp, #-40]
	ldr	r0, [fp, #-44]
	blx	r3
	mov	r3, #0
	strb	r3, [fp, #-25]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-36]
	add	r4, r2, r3
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	mov	r5, r3
	bl	__sync_synchronize
	mov	r3, r5
	strb	r3, [r4]
	bl	__sync_synchronize
	nop
	ldr	r3, .L5
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L4
	bl	__stack_chk_fail
.L4:
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.size	peterson, .-peterson
	.section	.rodata
	.align	2
.LC1:
	.ascii	"hello from %d\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	print
	.syntax unified
	.arm
	.fpu softvfp
	.type	print, %function
print:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, .L9+4
	bl	printf
	ldr	r3, .L9+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	sub	r3, fp, #16
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	mov	r3, #1
	str	r3, [fp, #-16]
	sub	r3, fp, #16
	mov	r1, #0
	mov	r0, r3
	bl	thrd_sleep
	nop
	ldr	r3, .L9
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC2
	.word	.LC1
	.word	stdout
	.size	print, .-print
	.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]
.L12:
	ldr	r3, [fp, #-8]
	ldr	r0, [r3]
	ldr	r3, [fp, #-8]
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r2, .L13
	bl	peterson
	b	.L12
.L14:
	.align	2
.L13:
	.word	print
	.size	thread, .-thread
	.section	.rodata
	.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 = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #32
	mov	r2, #8
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L16
.L17:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r2, fp, #32
	str	r2, [r3, #-20]
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-16]
	sub	r2, fp, #40
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r2, fp, #24
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L22+4
	bl	thrd_create
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L16:
	ldr	r3, [fp, #-44]
	cmp	r3, #1
	bls	.L17
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L18
.L19:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	mov	r1, #0
	mov	r0, r3
	bl	thrd_join
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L18:
	ldr	r3, [fp, #-44]
	cmp	r3, #1
	bls	.L19
	mov	r3, #0
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC3
	.word	thread
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
