	.file	"10823.c"
	.intel_syntax noprefix
	.text
	.globl	check_in_lock
	.bss
	.align 32
	.type	check_in_lock, @object
	.size	check_in_lock, 40
check_in_lock:
	.zero	40
	.globl	riding_lock
	.align 32
	.type	riding_lock, @object
	.size	riding_lock, 40
riding_lock:
	.zero	40
	.globl	board_queue
	.align 32
	.type	board_queue, @object
	.size	board_queue, 32
board_queue:
	.zero	32
	.globl	all_boarded
	.align 32
	.type	all_boarded, @object
	.size	all_boarded, 32
all_boarded:
	.zero	32
	.globl	unboard_queue
	.align 32
	.type	unboard_queue, @object
	.size	unboard_queue, 32
unboard_queue:
	.zero	32
	.globl	all_unboarded
	.align 32
	.type	all_unboarded, @object
	.size	all_unboarded, 32
all_unboarded:
	.zero	32
	.globl	boarded
	.align 4
	.type	boarded, @object
	.size	boarded, 4
boarded:
	.zero	4
	.globl	unboarded
	.align 4
	.type	unboarded, @object
	.size	unboarded, 4
unboarded:
	.zero	4
	.globl	current_ride
	.align 4
	.type	current_ride, @object
	.size	current_ride, 4
current_ride:
	.zero	4
	.globl	total_rides
	.align 4
	.type	total_rides, @object
	.size	total_rides, 4
total_rides:
	.zero	4
	.globl	passengers
	.align 4
	.type	passengers, @object
	.size	passengers, 4
passengers:
	.zero	4
	.globl	capacity
	.align 4
	.type	capacity, @object
	.size	capacity, 4
capacity:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"Ride #%d will begin, time to load!\n"
.LC1:
	.string	"This car's capacity is %d\n"
	.text
	.globl	load
	.type	load, @function
load:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR current_ride[rip]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR capacity[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 2
	call	sleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	load, .-load
	.section	.rodata
	.align 8
.LC2:
	.string	"The car is full, time to ride!"
	.align 8
.LC3:
	.string	"The car is now riding the roller coaster!"
	.text
	.globl	run
	.type	run, @function
run:
.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, .LC2[rip]
	call	puts@PLT
	mov	edi, 2
	call	sleep@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	edi, 5
	call	sleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.section	.rodata
	.align 8
.LC4:
	.string	"The ride is over, time to unload!"
	.text
	.globl	unload
	.type	unload, @function
unload:
.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, .LC4[rip]
	call	puts@PLT
	mov	edi, 2
	call	sleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	unload, .-unload
	.section	.rodata
	.align 8
.LC5:
	.string	"%d passengers have boarded the car...\n"
	.text
	.globl	board
	.type	board, @function
board:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR boarded[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	board, .-board
	.section	.rodata
	.align 8
.LC6:
	.string	"%d passengers have unboarded the car...\n"
	.text
	.globl	unboard
	.type	unboard, @function
unboard:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR unboarded[rip]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	unboard, .-unboard
	.section	.rodata
.LC7:
	.string	"The car is now empty!\n"
	.text
	.globl	carThread
	.type	carThread, @function
carThread:
.LFB11:
	.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
	jmp	.L7
.L12:
	mov	eax, 0
	call	load
	mov	DWORD PTR -4[rbp], 0
	jmp	.L8
.L9:
	lea	rdi, board_queue[rip]
	call	sem_post@PLT
	add	DWORD PTR -4[rbp], 1
.L8:
	mov	eax, DWORD PTR capacity[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L9
	lea	rdi, all_boarded[rip]
	call	sem_wait@PLT
	mov	eax, 0
	call	run
	mov	eax, 0
	call	unload
	mov	DWORD PTR -4[rbp], 0
	jmp	.L10
.L11:
	lea	rdi, unboard_queue[rip]
	call	sem_post@PLT
	add	DWORD PTR -4[rbp], 1
.L10:
	mov	eax, DWORD PTR capacity[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L11
	lea	rdi, all_unboarded[rip]
	call	sem_wait@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, DWORD PTR current_ride[rip]
	add	eax, 1
	mov	DWORD PTR current_ride[rip], eax
.L7:
	mov	edx, DWORD PTR current_ride[rip]
	mov	eax, DWORD PTR total_rides[rip]
	cmp	edx, eax
	jl	.L12
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	carThread, .-carThread
	.globl	passengerThread
	.type	passengerThread, @function
passengerThread:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
.L17:
	lea	rdi, board_queue[rip]
	call	sem_wait@PLT
	lea	rdi, check_in_lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR boarded[rip]
	add	eax, 1
	mov	DWORD PTR boarded[rip], eax
	mov	eax, 0
	call	board
	mov	edx, DWORD PTR boarded[rip]
	mov	eax, DWORD PTR capacity[rip]
	cmp	edx, eax
	jne	.L15
	lea	rdi, all_boarded[rip]
	call	sem_post@PLT
	mov	DWORD PTR boarded[rip], 0
.L15:
	lea	rdi, check_in_lock[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, unboard_queue[rip]
	call	sem_wait@PLT
	lea	rdi, riding_lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR unboarded[rip]
	add	eax, 1
	mov	DWORD PTR unboarded[rip], eax
	mov	eax, 0
	call	unboard
	mov	edx, DWORD PTR unboarded[rip]
	mov	eax, DWORD PTR capacity[rip]
	cmp	edx, eax
	jne	.L16
	lea	rdi, all_unboarded[rip]
	call	sem_post@PLT
	mov	DWORD PTR unboarded[rip], 0
.L16:
	lea	rdi, riding_lock[rip]
	call	pthread_mutex_unlock@PLT
	jmp	.L17
	.cfi_endproc
.LFE12:
	.size	passengerThread, .-passengerThread
	.section	.rodata
	.align 8
.LC8:
	.string	"Today the roller coaster will ride %d times!\n"
	.align 8
.LC9:
	.string	"There are %d passengers waiting in the roller coaster queue!\n\n"
	.align 8
.LC10:
	.string	"That's all rides for today, the roller coaster is shutting down."
	.text
	.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
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1374389535
	shr	rax, 32
	sar	eax, 3
	mov	esi, edx
	sar	esi, 31
	sub	eax, esi
	mov	ecx, eax
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	lea	ecx, 0[0+rax*4]
	add	eax, ecx
	mov	ecx, edx
	sub	ecx, eax
	lea	eax, 2[rcx]
	mov	DWORD PTR passengers[rip], eax
	call	rand@PLT
	mov	edx, DWORD PTR passengers[rip]
	lea	ecx, -1[rdx]
	cdq
	idiv	ecx
	mov	eax, edx
	add	eax, 1
	mov	DWORD PTR capacity[rip], eax
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, edx
	sar	esi, 31
	sub	eax, esi
	mov	ecx, eax
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	mov	ecx, edx
	sub	ecx, eax
	lea	eax, 1[rcx]
	mov	DWORD PTR total_rides[rip], eax
	mov	eax, DWORD PTR passengers[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -72[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L19:
	cmp	rsp, rdx
	je	.L20
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L19
.L20:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L21
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L21:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -64[rbp], rax
	mov	esi, 0
	lea	rdi, check_in_lock[rip]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, riding_lock[rip]
	call	pthread_mutex_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, board_queue[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, all_boarded[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, unboard_queue[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, all_unboarded[rip]
	call	sem_init@PLT
	mov	eax, DWORD PTR total_rides[rip]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR passengers[rip]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -80[rbp]
	mov	ecx, 0
	lea	rdx, carThread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -84[rbp], 0
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, passengerThread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -84[rbp], 1
.L22:
	mov	eax, DWORD PTR passengers[rip]
	cmp	DWORD PTR -84[rbp], eax
	jl	.L23
	mov	rax, QWORD PTR -80[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
	lea	rdi, check_in_lock[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, riding_lock[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, board_queue[rip]
	call	sem_destroy@PLT
	lea	rdi, all_boarded[rip]
	call	sem_destroy@PLT
	lea	rdi, unboard_queue[rip]
	call	sem_destroy@PLT
	lea	rdi, all_unboarded[rip]
	call	sem_destroy@PLT
	mov	eax, 0
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	"10823.c"
	.text
	.comm	check_in_lock,24,4
	.comm	riding_lock,24,4
	.comm	board_queue,16,4
	.comm	all_boarded,16,4
	.comm	unboard_queue,16,4
	.comm	all_unboarded,16,4
	.global	boarded
	.bss
	.align	2
	.type	boarded, %object
	.size	boarded, 4
boarded:
	.space	4
	.global	unboarded
	.align	2
	.type	unboarded, %object
	.size	unboarded, 4
unboarded:
	.space	4
	.global	current_ride
	.align	2
	.type	current_ride, %object
	.size	current_ride, 4
current_ride:
	.space	4
	.comm	total_rides,4,4
	.comm	passengers,4,4
	.comm	capacity,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Ride #%d will begin, time to load!\012\000"
	.align	2
.LC1:
	.ascii	"This car's capacity is %d\012\000"
	.text
	.align	2
	.global	load
	.syntax unified
	.arm
	.fpu softvfp
	.type	load, %function
load:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L2+4
	bl	printf
	ldr	r3, .L2+8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+12
	bl	printf
	mov	r0, #2
	bl	sleep
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	current_ride
	.word	.LC0
	.word	capacity
	.word	.LC1
	.size	load, .-load
	.section	.rodata
	.align	2
.LC2:
	.ascii	"The car is full, time to ride!\000"
	.align	2
.LC3:
	.ascii	"The car is now riding the roller coaster!\000"
	.text
	.align	2
	.global	run
	.syntax unified
	.arm
	.fpu softvfp
	.type	run, %function
run:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L5
	bl	puts
	mov	r0, #2
	bl	sleep
	ldr	r0, .L5+4
	bl	puts
	mov	r0, #5
	bl	sleep
	nop
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC2
	.word	.LC3
	.size	run, .-run
	.section	.rodata
	.align	2
.LC4:
	.ascii	"The ride is over, time to unload!\000"
	.text
	.align	2
	.global	unload
	.syntax unified
	.arm
	.fpu softvfp
	.type	unload, %function
unload:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L8
	bl	puts
	mov	r0, #2
	bl	sleep
	nop
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC4
	.size	unload, .-unload
	.section	.rodata
	.align	2
.LC5:
	.ascii	"%d passengers have boarded the car...\012\000"
	.text
	.align	2
	.global	board
	.syntax unified
	.arm
	.fpu softvfp
	.type	board, %function
board:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L11
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L11+4
	bl	printf
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	mov	r0, r3
	bl	sleep
	nop
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	boarded
	.word	.LC5
	.size	board, .-board
	.section	.rodata
	.align	2
.LC6:
	.ascii	"%d passengers have unboarded the car...\012\000"
	.text
	.align	2
	.global	unboard
	.syntax unified
	.arm
	.fpu softvfp
	.type	unboard, %function
unboard:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L14
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L14+4
	bl	printf
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	mov	r0, r3
	bl	sleep
	nop
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	unboarded
	.word	.LC6
	.size	unboard, .-unboard
	.section	.rodata
	.align	2
.LC7:
	.ascii	"The car is now empty!\012\000"
	.text
	.align	2
	.global	carThread
	.syntax unified
	.arm
	.fpu softvfp
	.type	carThread, %function
carThread:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	b	.L17
.L22:
	bl	load
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L18
.L19:
	ldr	r0, .L24
	bl	sem_post
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L18:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L19
	ldr	r0, .L24+8
	bl	sem_wait
	bl	run
	bl	unload
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L20
.L21:
	ldr	r0, .L24+12
	bl	sem_post
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L20:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L21
	ldr	r0, .L24+16
	bl	sem_wait
	ldr	r0, .L24+20
	bl	puts
	ldr	r3, .L24+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L24+24
	str	r3, [r2]
.L17:
	ldr	r3, .L24+24
	ldr	r2, [r3]
	ldr	r3, .L24+28
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L22
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	board_queue
	.word	capacity
	.word	all_boarded
	.word	unboard_queue
	.word	all_unboarded
	.word	.LC7
	.word	current_ride
	.word	total_rides
	.size	carThread, .-carThread
	.align	2
	.global	passengerThread
	.syntax unified
	.arm
	.fpu softvfp
	.type	passengerThread, %function
passengerThread:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
.L29:
	ldr	r0, .L30
	bl	sem_wait
	ldr	r0, .L30+4
	bl	pthread_mutex_lock
	ldr	r3, .L30+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L30+8
	str	r3, [r2]
	bl	board
	ldr	r3, .L30+8
	ldr	r2, [r3]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L27
	ldr	r0, .L30+16
	bl	sem_post
	ldr	r3, .L30+8
	mov	r2, #0
	str	r2, [r3]
.L27:
	ldr	r0, .L30+4
	bl	pthread_mutex_unlock
	ldr	r0, .L30+20
	bl	sem_wait
	ldr	r0, .L30+24
	bl	pthread_mutex_lock
	ldr	r3, .L30+28
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L30+28
	str	r3, [r2]
	bl	unboard
	ldr	r3, .L30+28
	ldr	r2, [r3]
	ldr	r3, .L30+12
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L28
	ldr	r0, .L30+32
	bl	sem_post
	ldr	r3, .L30+28
	mov	r2, #0
	str	r2, [r3]
.L28:
	ldr	r0, .L30+24
	bl	pthread_mutex_unlock
	b	.L29
.L31:
	.align	2
.L30:
	.word	board_queue
	.word	check_in_lock
	.word	boarded
	.word	capacity
	.word	all_boarded
	.word	unboard_queue
	.word	riding_lock
	.word	unboarded
	.word	all_unboarded
	.size	passengerThread, .-passengerThread
	.global	__aeabi_idivmod
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Today the roller coaster will ride %d times!\012\000"
	.align	2
.LC9:
	.ascii	"There are %d passengers waiting in the roller coast"
	.ascii	"er queue!\012\012\000"
	.align	2
.LC10:
	.ascii	"That's all rides for today, the roller coaster is s"
	.ascii	"hutting down.\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	bl	rand
	mov	r1, r0
	ldr	r3, .L37+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #3
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	add	r3, r2, #2
	ldr	r2, .L37+8
	str	r3, [r2]
	bl	rand
	mov	r2, r0
	ldr	r3, .L37+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_idivmod
	mov	r3, r1
	add	r3, r3, #1
	ldr	r2, .L37+12
	str	r3, [r2]
	bl	rand
	mov	r1, r0
	ldr	r3, .L37+16
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	add	r3, r2, #1
	ldr	r2, .L37+20
	str	r3, [r2]
	ldr	r3, .L37+8
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-24]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-20]
	mov	r1, #0
	ldr	r0, .L37+24
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L37+28
	bl	pthread_mutex_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L37+32
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L37+36
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L37+40
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L37+44
	bl	sem_init
	ldr	r3, .L37+20
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+48
	bl	printf
	ldr	r3, .L37+8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L37+52
	bl	printf
	sub	r0, fp, #32
	mov	r3, #0
	ldr	r2, .L37+56
	mov	r1, #0
	bl	pthread_create
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L33
.L34:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L37+60
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L33:
	ldr	r3, .L37+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L34
	ldr	r3, [fp, #-32]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L37+64
	bl	puts
	ldr	r0, .L37+24
	bl	pthread_mutex_destroy
	ldr	r0, .L37+28
	bl	pthread_mutex_destroy
	ldr	r0, .L37+32
	bl	sem_destroy
	ldr	r0, .L37+36
	bl	sem_destroy
	ldr	r0, .L37+40
	bl	sem_destroy
	ldr	r0, .L37+44
	bl	sem_destroy
	mov	r3, #0
	mov	sp, r4
	ldr	r2, .L37
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L36
	bl	__stack_chk_fail
.L36:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC11
	.word	1374389535
	.word	passengers
	.word	capacity
	.word	1717986919
	.word	total_rides
	.word	check_in_lock
	.word	riding_lock
	.word	board_queue
	.word	all_boarded
	.word	unboard_queue
	.word	all_unboarded
	.word	.LC8
	.word	.LC9
	.word	carThread
	.word	passengerThread
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
