	.file	"339961.c"
	.intel_syntax noprefix
	.text
	.globl	mut
	.bss
	.align 32
	.type	mut, @object
	.size	mut, 40
mut:
	.zero	40
	.globl	water
	.align 4
	.type	water, @object
	.size	water, 4
water:
	.zero	4
	.section	.rodata
.LC0:
	.string	"The ship is dry, captain!"
	.align 8
.LC1:
	.string	"Sailor %ld removed 50 liters from the ship\n"
	.text
	.globl	sailorRemovesWater
	.type	sailorRemovesWater, @function
sailorRemovesWater:
.LFB6:
	.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	DWORD PTR -4[rbp], 0
	jmp	.L2
.L6:
	nop
.L3:
	lea	rdi, mut[rip]
	call	pthread_mutex_trylock@PLT
	test	eax, eax
	jne	.L3
	mov	eax, DWORD PTR water[rip]
	test	eax, eax
	jg	.L4
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L5
.L4:
	mov	eax, DWORD PTR water[rip]
	sub	eax, 50
	mov	DWORD PTR water[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 1
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L5:
	lea	rdi, mut[rip]
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -4[rbp], 1
.L2:
	cmp	DWORD PTR -4[rbp], 19
	jle	.L6
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE6:
	.size	sailorRemovesWater, .-sailorRemovesWater
	.section	.rodata
	.align 8
.LC2:
	.string	"Pirate %ld spilled 50 liters on the ship\n"
	.text
	.globl	pirateDoes
	.type	pirateDoes, @function
pirateDoes:
.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	DWORD PTR -4[rbp], 0
	jmp	.L8
.L10:
	nop
.L9:
	lea	rdi, mut[rip]
	call	pthread_mutex_trylock@PLT
	test	eax, eax
	jne	.L9
	mov	eax, DWORD PTR water[rip]
	add	eax, 50
	mov	DWORD PTR water[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 1
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mut[rip]
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -4[rbp], 1
.L8:
	cmp	DWORD PTR -4[rbp], 19
	jle	.L10
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.size	pirateDoes, .-pirateDoes
	.section	.rodata
.LC3:
	.string	"Water: %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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, 152
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -148[rbp], edi
	mov	QWORD PTR -160[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	QWORD PTR -96[rbp], 1
	mov	QWORD PTR -104[rbp], 1
	cmp	DWORD PTR -148[rbp], 1
	jle	.L12
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	cdqe
	mov	QWORD PTR -104[rbp], rax
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	cdqe
	mov	QWORD PTR -96[rbp], rax
.L12:
	mov	rax, QWORD PTR -104[rbp]
	lea	rdx, -1[rax]
	mov	QWORD PTR -88[rbp], rdx
	mov	rdx, rax
	mov	QWORD PTR -176[rbp], rdx
	mov	QWORD PTR -168[rbp], 0
	mov	rdx, rax
	mov	QWORD PTR -192[rbp], rdx
	mov	QWORD PTR -184[rbp], 0
	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 -80[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	lea	rdx, -1[rax]
	mov	QWORD PTR -72[rbp], rdx
	mov	rdx, rax
	mov	r14, rdx
	mov	r15d, 0
	mov	rdx, rax
	mov	r12, rdx
	mov	r13d, 0
	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
.L16:
	cmp	rsp, rdx
	je	.L17
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L16
.L17:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L18
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L18:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -64[rbp], rax
	mov	esi, 0
	lea	rdi, mut[rip]
	call	pthread_mutex_init@PLT
	mov	QWORD PTR -112[rbp], 0
	jmp	.L19
.L20:
	mov	rax, QWORD PTR -112[rbp]
	mov	rdx, QWORD PTR -112[rbp]
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -80[rbp]
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, pirateDoes[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	QWORD PTR -112[rbp], 1
.L19:
	mov	rax, QWORD PTR -112[rbp]
	cmp	rax, QWORD PTR -104[rbp]
	jl	.L20
	mov	QWORD PTR -120[rbp], 0
	jmp	.L21
.L22:
	mov	rax, QWORD PTR -120[rbp]
	mov	rdx, QWORD PTR -120[rbp]
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, sailorRemovesWater[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	QWORD PTR -120[rbp], 1
.L21:
	mov	rax, QWORD PTR -120[rbp]
	cmp	rax, QWORD PTR -96[rbp]
	jl	.L22
	mov	QWORD PTR -128[rbp], 0
	jmp	.L23
.L24:
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -128[rbp], 1
.L23:
	mov	rax, QWORD PTR -128[rbp]
	cmp	rax, QWORD PTR -104[rbp]
	jl	.L24
	mov	QWORD PTR -136[rbp], 0
	jmp	.L25
.L26:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -136[rbp], 1
.L25:
	mov	rax, QWORD PTR -136[rbp]
	cmp	rax, QWORD PTR -96[rbp]
	jl	.L26
	mov	eax, DWORD PTR water[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mut[rip]
	call	pthread_mutex_destroy@PLT
	mov	eax, 0
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"339961.c"
	.text
	.comm	mut,24,4
	.global	water
	.bss
	.align	2
	.type	water, %object
	.size	water, 4
water:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"The ship is dry, captain!\000"
	.align	2
.LC1:
	.ascii	"Sailor %ld removed 50 liters from the ship\012\000"
	.text
	.align	2
	.global	sailorRemovesWater
	.syntax unified
	.arm
	.fpu softvfp
	.type	sailorRemovesWater, %function
sailorRemovesWater:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L6:
	nop
.L3:
	ldr	r0, .L7
	bl	pthread_mutex_trylock
	mov	r3, r0
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L7+4
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L4
	ldr	r0, .L7+8
	bl	puts
	b	.L5
.L4:
	ldr	r3, .L7+4
	ldr	r3, [r3]
	sub	r3, r3, #50
	ldr	r2, .L7+4
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L7+12
	bl	printf
.L5:
	ldr	r0, .L7
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #19
	ble	.L6
	mov	r0, #0
	bl	pthread_exit
.L8:
	.align	2
.L7:
	.word	mut
	.word	water
	.word	.LC0
	.word	.LC1
	.size	sailorRemovesWater, .-sailorRemovesWater
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Pirate %ld spilled 50 liters on the ship\012\000"
	.text
	.align	2
	.global	pirateDoes
	.syntax unified
	.arm
	.fpu softvfp
	.type	pirateDoes, %function
pirateDoes:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L10
.L12:
	nop
.L11:
	ldr	r0, .L13
	bl	pthread_mutex_trylock
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	ldr	r3, .L13+4
	ldr	r3, [r3]
	add	r3, r3, #50
	ldr	r2, .L13+4
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L13+8
	bl	printf
	ldr	r0, .L13
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L10:
	ldr	r3, [fp, #-8]
	cmp	r3, #19
	ble	.L12
	mov	r0, #0
	bl	pthread_exit
.L14:
	.align	2
.L13:
	.word	mut
	.word	water
	.word	.LC2
	.size	pirateDoes, .-pirateDoes
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Water: %d\012\000"
	.align	2
.LC4:
	.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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #60
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r3, #1
	str	r3, [fp, #-36]
	mov	r3, #1
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-64]
	cmp	r3, #1
	ble	.L16
	ldr	r3, [fp, #-68]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-68]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-36]
.L16:
	ldr	ip, [fp, #-40]
	sub	r3, ip, #1
	str	r3, [fp, #-32]
	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, #-28]
	ldr	ip, [fp, #-36]
	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, .L27+4
	bl	pthread_mutex_init
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L17
.L18:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r0, r2, r3
	ldr	r3, [fp, #-44]
	ldr	r2, .L27+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L17:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L18
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L19
.L20:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r0, r2, r3
	ldr	r3, [fp, #-48]
	ldr	r2, .L27+12
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L19:
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	blt	.L20
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L21
.L22:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-52]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L21:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L22
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L23
.L24:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-56]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L23:
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	blt	.L24
	ldr	r3, .L27+16
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L27+20
	bl	printf
	ldr	r0, .L27+4
	bl	pthread_mutex_destroy
	mov	r3, #0
	mov	sp, r4
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L26
	bl	__stack_chk_fail
.L26:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC4
	.word	mut
	.word	pirateDoes
	.word	sailorRemovesWater
	.word	water
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
