	.file	"626498.c"
	.intel_syntax noprefix
	.text
	.globl	bridgeStatus
	.bss
	.align 32
	.type	bridgeStatus, @object
	.size	bridgeStatus, 32
bridgeStatus:
	.zero	32
	.globl	DirectionOutput
	.section	.rodata
.LC0:
	.string	"North"
.LC1:
	.string	"South"
	.section	.data.rel.local,"aw"
	.align 16
	.type	DirectionOutput, @object
	.size	DirectionOutput, 16
DirectionOutput:
	.quad	.LC0
	.quad	.LC1
	.section	.rodata
	.align 8
.LC2:
	.string	"Missing two numeric inputs. Please try again."
	.align 8
.LC3:
	.string	"* We have %i farmers from the north and %i from south *\n"
.LC4:
	.string	"* All farmers passed *"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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, 120
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -116[rbp], 1
	jg	.L2
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L20
.L2:
	add	QWORD PTR -128[rbp], 8
	mov	DWORD PTR -100[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -100[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -128[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	edx, DWORD PTR -100[rbp]
	movsx	rdx, edx
	mov	DWORD PTR -64[rbp+rdx*4], eax
	add	DWORD PTR -100[rbp], 1
.L4:
	mov	eax, DWORD PTR -116[rbp]
	sub	eax, 1
	cmp	DWORD PTR -100[rbp], eax
	jl	.L5
	mov	edx, DWORD PTR -64[rbp]
	mov	eax, DWORD PTR -60[rbp]
	add	eax, edx
	mov	rdx, rsp
	mov	rbx, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -96[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -144[rbp], rdx
	mov	QWORD PTR -136[rbp], 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	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L6:
	cmp	rsp, rdx
	je	.L7
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L6
.L7:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L8
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L8:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -88[rbp], rax
	mov	DWORD PTR -108[rbp], 0
	mov	DWORD PTR -100[rbp], 0
	jmp	.L9
.L12:
	mov	DWORD PTR -104[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -108[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -108[rbp], edx
	mov	rdx, QWORD PTR -88[rbp]
	movsx	rcx, eax
	mov	esi, DWORD PTR -104[rbp]
	mov	DWORD PTR [rdx+rcx*8], esi
	mov	rdx, QWORD PTR -88[rbp]
	cdqe
	mov	ecx, DWORD PTR -100[rbp]
	mov	DWORD PTR 4[rdx+rax*8], ecx
	add	DWORD PTR -104[rbp], 1
.L10:
	mov	eax, DWORD PTR -100[rbp]
	cdqe
	mov	eax, DWORD PTR -64[rbp+rax*4]
	cmp	DWORD PTR -104[rbp], eax
	jl	.L11
	add	DWORD PTR -100[rbp], 1
.L9:
	cmp	DWORD PTR -100[rbp], 1
	jle	.L12
	mov	edx, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 1
	mov	esi, 0
	lea	rdi, bridgeStatus[rip]
	call	sem_init@PLT
	mov	eax, DWORD PTR -108[rbp]
	mov	rdx, rsp
	mov	r12, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -80[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], 0
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L13:
	cmp	rsp, rdx
	je	.L14
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L13
.L14:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L15
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L15:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -72[rbp], rax
	mov	eax, DWORD PTR -108[rbp]
	mov	DWORD PTR -112[rbp], eax
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, crossTheBridge[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
.L16:
	mov	eax, DWORD PTR -112[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -112[rbp], edx
	test	eax, eax
	jne	.L17
	mov	eax, DWORD PTR -108[rbp]
	mov	DWORD PTR -112[rbp], eax
	jmp	.L18
.L19:
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	rdx, edx
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
.L18:
	mov	eax, DWORD PTR -112[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -112[rbp], edx
	test	eax, eax
	jne	.L19
	lea	rdi, bridgeStatus[rip]
	call	sem_destroy@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rsp, r12
	mov	rsp, rbx
.L20:
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC5:
	.string	"M1: %s farmer #%i is about to enter the bridge (%s)\n"
	.align 8
.LC6:
	.string	"M5: %s farmer #%i has left the bridge (%s)\n"
	.text
	.globl	crossTheBridge
	.type	crossTheBridge, @function
crossTheBridge:
.LFB7:
	.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]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rcx, QWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rsi, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rax, QWORD PTR [rsi+rax]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	enterBridge
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	exitBridge
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rcx, QWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rsi, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rax, QWORD PTR [rsi+rax]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.size	crossTheBridge, .-crossTheBridge
	.section	.rodata
	.align 8
.LC7:
	.string	"M2: %s farmer #%i has entered the bridge (%s)\n"
	.align 8
.LC8:
	.string	" M3: %s farmer #%i will pass the bridge in %i seconds \n"
	.text
	.globl	enterBridge
	.type	enterBridge, @function
enterBridge:
.LFB8:
	.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
	lea	rdi, bridgeStatus[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rcx, QWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rsi, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rax, QWORD PTR [rsi+rax]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -4[rbp], edx
	mov	ecx, DWORD PTR -4[rbp]
	mov	edx, ecx
	sal	edx, 2
	add	edx, ecx
	sub	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -4[rbp]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	sleep@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enterBridge, .-enterBridge
	.section	.rodata
	.align 8
.LC9:
	.string	" M4: %s farmer #%i has finished passing the bridge\n"
	.text
	.globl	exitBridge
	.type	exitBridge, @function
exitBridge:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, DirectionOutput[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, bridgeStatus[rip]
	call	sem_post@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	exitBridge, .-exitBridge
	.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	"626498.c"
	.text
	.comm	bridgeStatus,16,4
	.global	DirectionOutput
	.section	.rodata
	.align	2
.LC0:
	.ascii	"North\000"
	.align	2
.LC1:
	.ascii	"South\000"
	.data
	.align	2
	.type	DirectionOutput, %object
	.size	DirectionOutput, 8
DirectionOutput:
	.word	.LC0
	.word	.LC1
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Missing two numeric inputs. Please try again.\000"
	.align	2
.LC3:
	.ascii	"* We have %i farmers from the north and %i from sou"
	.ascii	"th *\012\000"
	.align	2
.LC4:
	.ascii	"* All farmers passed *\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 = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #64
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-72]
	cmp	r3, #1
	bgt	.L2
	ldr	r0, .L16+4
	bl	puts
	mov	r3, #0
	b	.L14
.L2:
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	str	r3, [fp, #-76]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L4
.L5:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-76]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r2, r0
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r2, [r3, #-12]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L4:
	ldr	r3, [fp, #-72]
	sub	r3, r3, #1
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L5
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	ip, r2, r3
	mov	r3, sp
	mov	r4, r3
	sub	r3, ip, #1
	str	r3, [fp, #-48]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, ip
	lsl	r3, r3, #3
	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, #-44]
	mov	r3, #0
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L6
.L9:
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L7
.L8:
	ldr	r3, [fp, #-60]
	add	r2, r3, #1
	str	r2, [fp, #-60]
	ldr	r2, [fp, #-44]
	ldr	r1, [fp, #-56]
	str	r1, [r2, r3, lsl #3]
	ldr	r2, [fp, #-44]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [fp, #-52]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L7:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-12]
	ldr	r2, [fp, #-56]
	cmp	r2, r3
	blt	.L8
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L6:
	ldr	r3, [fp, #-52]
	cmp	r3, #1
	ble	.L9
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-20]
	mov	r1, r3
	ldr	r0, .L16+8
	bl	printf
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L16+12
	bl	sem_init
	ldr	ip, [fp, #-60]
	mov	r3, sp
	mov	r5, r3
	sub	r3, ip, #1
	str	r3, [fp, #-40]
	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, #-36]
	ldr	r3, [fp, #-60]
	str	r3, [fp, #-64]
	b	.L10
.L11:
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r0, r2, r3
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r2, .L16+16
	mov	r1, #0
	bl	pthread_create
.L10:
	ldr	r3, [fp, #-64]
	sub	r2, r3, #1
	str	r2, [fp, #-64]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-60]
	str	r3, [fp, #-64]
	b	.L12
.L13:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-64]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
.L12:
	ldr	r3, [fp, #-64]
	sub	r2, r3, #1
	str	r2, [fp, #-64]
	cmp	r3, #0
	bne	.L13
	ldr	r0, .L16+12
	bl	sem_destroy
	ldr	r0, .L16+20
	bl	puts
	mov	r3, #0
	mov	sp, r5
	mov	sp, r4
.L14:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC5
	.word	.LC2
	.word	.LC3
	.word	bridgeStatus
	.word	crossTheBridge
	.word	.LC4
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"M1: %s farmer #%i is about to enter the bridge (%s)"
	.ascii	"\012\000"
	.align	2
.LC7:
	.ascii	"M5: %s farmer #%i has left the bridge (%s)\012\000"
	.text
	.align	2
	.global	crossTheBridge
	.syntax unified
	.arm
	.fpu softvfp
	.type	crossTheBridge, %function
crossTheBridge:
	@ 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]
	ldr	r3, [r3, #4]
	ldr	r2, .L19
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r0, .L19
	ldr	r3, [r0, r3, lsl #2]
	ldr	r0, .L19+4
	bl	printf
	ldr	r0, [fp, #-8]
	bl	enterBridge
	ldr	r0, [fp, #-8]
	bl	exitBridge
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r2, .L19
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r0, .L19
	ldr	r3, [r0, r3, lsl #2]
	ldr	r0, .L19+8
	bl	printf
	mov	r0, #0
	bl	pthread_exit
.L20:
	.align	2
.L19:
	.word	DirectionOutput
	.word	.LC6
	.word	.LC7
	.size	crossTheBridge, .-crossTheBridge
	.section	.rodata
	.align	2
.LC8:
	.ascii	"M2: %s farmer #%i has entered the bridge (%s)\012\000"
	.align	2
.LC9:
	.ascii	" M3: %s farmer #%i will pass the bridge in %i secon"
	.ascii	"ds \012\000"
	.text
	.align	2
	.global	enterBridge
	.syntax unified
	.arm
	.fpu softvfp
	.type	enterBridge, %function
enterBridge:
	@ 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, .L22
	bl	sem_wait
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, .L22+4
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r0, .L22+4
	ldr	r3, [r0, r3, lsl #2]
	ldr	r0, .L22+8
	bl	printf
	bl	rand
	mov	r2, r0
	ldr	r3, .L22+12
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r2, .L22+4
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r0, .L22+16
	bl	printf
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	bridgeStatus
	.word	DirectionOutput
	.word	.LC8
	.word	1717986919
	.word	.LC9
	.size	enterBridge, .-enterBridge
	.section	.rodata
	.align	2
.LC10:
	.ascii	" M4: %s farmer #%i has finished passing the bridge\012"
	.ascii	"\000"
	.text
	.align	2
	.global	exitBridge
	.syntax unified
	.arm
	.fpu softvfp
	.type	exitBridge, %function
exitBridge:
	@ 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]
	ldr	r3, [r3, #4]
	ldr	r2, .L25
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L25+4
	bl	printf
	ldr	r0, .L25+8
	bl	sem_post
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	DirectionOutput
	.word	.LC10
	.word	bridgeStatus
	.size	exitBridge, .-exitBridge
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
