	.file	"154827289.c"
	.intel_syntax noprefix
	.text
	.type	ticketlock_init, @function
ticketlock_init:
.LFB6:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -28[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -28[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ticketlock_init, .-ticketlock_init
	.type	get_next_ticket, @function
get_next_ticket:
.LFB7:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 1
	lock xadd	DWORD PTR [rax], edx
	mov	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_next_ticket, .-get_next_ticket
	.type	await_for_ticket, @function
await_for_ticket:
.LFB8:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	nop
.L6:
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -44[rbp]
	jne	.L6
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	await_for_ticket, .-await_for_ticket
	.type	ticketlock_acquire, @function
ticketlock_acquire:
.LFB9:
	.cfi_startproc
	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	rdi, rax
	call	get_next_ticket
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	await_for_ticket
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	ticketlock_acquire, .-ticketlock_acquire
	.type	ticketlock_release, @function
ticketlock_release:
.LFB11:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	mov	DWORD PTR -28[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 1
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ticketlock_release, .-ticketlock_release
	.globl	shared
	.bss
	.align 4
	.type	shared, @object
	.size	shared, 4
shared:
	.zero	4
	.globl	lock
	.align 8
	.type	lock, @object
	.size	lock, 8
lock:
	.zero	8
	.section	.rodata
.LC0:
	.string	"the_stack_data/154827289.c"
.LC1:
	.string	"r == index"
	.text
	.globl	thread_n
	.type	thread_n, @function
thread_n:
.LFB12:
	.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 lock[rip]
	mov	rdi, rax
	call	ticketlock_acquire
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR shared[rip], eax
	mov	eax, DWORD PTR shared[rip]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	cmp	QWORD PTR -8[rbp], rax
	je	.L12
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 74
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L12:
	mov	rax, QWORD PTR lock[rip]
	mov	rdi, rax
	call	ticketlock_release
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	thread_n, .-thread_n
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR lock[rip], rax
	mov	rax, QWORD PTR lock[rip]
	mov	rdi, rax
	call	ticketlock_init
	lea	rax, -56[rbp]
	mov	ecx, 0
	lea	rdx, thread_n[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -48[rbp]
	mov	ecx, 1
	lea	rdx, thread_n[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -40[rbp]
	mov	ecx, 2
	lea	rdx, thread_n[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -32[rbp]
	mov	ecx, 3
	lea	rdx, thread_n[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -24[rbp]
	mov	ecx, 4
	lea	rdx, thread_n[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -16[rbp]
	mov	ecx, 5
	lea	rdx, thread_n[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 9
__PRETTY_FUNCTION__.0:
	.string	"thread_n"
	.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	"154827289.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ticketlock_init, %function
ticketlock_init:
	@ 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, .L3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	mov	r2, r3
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	mov	r2, r3
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	nop
	ldr	r3, .L3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L2
	bl	__stack_chk_fail
.L2:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC0
	.size	ticketlock_init, .-ticketlock_init
	.global	__sync_fetch_and_add_4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_next_ticket, %function
get_next_ticket:
	@ 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	r3, [fp, #-8]
	mov	r1, #1
	mov	r0, r3
	bl	__sync_fetch_and_add_4
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	get_next_ticket, .-get_next_ticket
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	await_for_ticket, %function
await_for_ticket:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	nop
.L8:
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bne	.L8
	nop
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.size	await_for_ticket, .-await_for_ticket
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ticketlock_acquire, %function
ticketlock_acquire:
	@ 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	r0, [fp, #-16]
	bl	get_next_ticket
	str	r0, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	await_for_ticket
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	ticketlock_acquire, .-ticketlock_acquire
	.global	__sync_synchronize
	.section	.rodata
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ticketlock_release, %function
ticketlock_release:
	@ 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, #-40]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-40]
	add	r3, r3, #4
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	add	r3, r3, #4
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	mov	r5, r3
	ldr	r4, [fp, #-20]
	bl	__sync_synchronize
	str	r5, [r4]
	nop
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC2
	.size	ticketlock_release, .-ticketlock_release
	.comm	shared,4,4
	.comm	lock,4,4
	.section	.rodata
	.align	2
.LC3:
	.ascii	"the_stack_data/154827289.c\000"
	.align	2
.LC4:
	.ascii	"r == index\000"
	.text
	.align	2
	.global	thread_n
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_n, %function
thread_n:
	@ 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, #-12]
	ldr	r3, .L20
	ldr	r3, [r3]
	mov	r0, r3
	bl	ticketlock_acquire
	ldr	r2, .L20+4
	ldr	r3, [fp, #-12]
	str	r3, [r2]
	ldr	r3, .L20+4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	beq	.L18
	ldr	r3, .L20+8
	mov	r2, #74
	ldr	r1, .L20+12
	ldr	r0, .L20+16
	bl	__assert_fail
.L18:
	ldr	r3, .L20
	ldr	r3, [r3]
	mov	r0, r3
	bl	ticketlock_release
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	lock
	.word	shared
	.word	__PRETTY_FUNCTION__.5780
	.word	.LC3
	.word	.LC4
	.size	thread_n, .-thread_n
	.section	.rodata
	.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 = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L25+4
	str	r2, [r3]
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	ticketlock_init
	sub	r0, fp, #32
	mov	r3, #0
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #28
	mov	r3, #1
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #24
	mov	r3, #2
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #20
	mov	r3, #3
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #16
	mov	r3, #4
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #12
	mov	r3, #5
	ldr	r2, .L25+8
	mov	r1, #0
	bl	pthread_create
	mov	r3, #0
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC5
	.word	lock
	.word	thread_n
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.5780, %object
	.size	__PRETTY_FUNCTION__.5780, 9
__PRETTY_FUNCTION__.5780:
	.ascii	"thread_n\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
