	.file	"126703562.c"
	.intel_syntax noprefix
	.text
	.globl	hydrogen
	.bss
	.align 4
	.type	hydrogen, @object
	.size	hydrogen, 4
hydrogen:
	.zero	4
	.globl	oxygen
	.align 4
	.type	oxygen, @object
	.size	oxygen, 4
oxygen:
	.zero	4
	.globl	bcount
	.align 4
	.type	bcount, @object
	.size	bcount, 4
bcount:
	.zero	4
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 32
mutex:
	.zero	32
	.globl	hydroqueue
	.align 32
	.type	hydroqueue, @object
	.size	hydroqueue, 32
hydroqueue:
	.zero	32
	.globl	oxyqueue
	.align 32
	.type	oxyqueue, @object
	.size	oxyqueue, 32
oxyqueue:
	.zero	32
	.globl	b_mutex
	.align 32
	.type	b_mutex, @object
	.size	b_mutex, 32
b_mutex:
	.zero	32
	.globl	sbarrier
	.align 32
	.type	sbarrier, @object
	.size	sbarrier, 32
sbarrier:
	.zero	32
	.globl	o_thread
	.align 8
	.type	o_thread, @object
	.size	o_thread, 8
o_thread:
	.zero	8
	.globl	h_thread1
	.align 8
	.type	h_thread1, @object
	.size	h_thread1, 8
h_thread1:
	.zero	8
	.globl	h_thread_2
	.align 8
	.type	h_thread_2, @object
	.size	h_thread_2, 8
h_thread_2:
	.zero	8
	.section	.rodata
.LC0:
	.string	" Water mol # %d created\n "
	.text
	.globl	bond
	.type	bond, @function
bond:
.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 i.0[rip]
	add	eax, 1
	mov	DWORD PTR i.0[rip], eax
	mov	edx, DWORD PTR i.0[rip]
	movsx	rax, edx
	imul	rax, rax, 1431655766
	shr	rax, 32
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	add	ecx, ecx
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	test	eax, eax
	jne	.L2
	mov	eax, DWORD PTR i.0[rip]
	movsx	rdx, eax
	imul	rdx, rdx, 1431655766
	shr	rdx, 32
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L2:
	mov	edi, 2
	call	sleep@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bond, .-bond
	.section	.rodata
.LC1:
	.string	" one Oxygen is ready"
	.text
	.globl	o_fn
	.type	o_fn, @function
o_fn:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
.L6:
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR oxygen[rip]
	add	eax, 1
	mov	DWORD PTR oxygen[rip], eax
	mov	eax, DWORD PTR hydrogen[rip]
	cmp	eax, 1
	jle	.L4
	lea	rdi, hydroqueue[rip]
	call	sem_post@PLT
	lea	rdi, hydroqueue[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR hydrogen[rip]
	sub	eax, 2
	mov	DWORD PTR hydrogen[rip], eax
	lea	rdi, oxyqueue[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR oxygen[rip]
	sub	eax, 1
	mov	DWORD PTR oxygen[rip], eax
	jmp	.L5
.L4:
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L5:
	lea	rdi, oxyqueue[rip]
	call	sem_wait@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 0
	call	bond
	lea	rdi, mutex[rip]
	call	sem_post@PLT
	jmp	.L6
	.cfi_endproc
.LFE7:
	.size	o_fn, .-o_fn
	.section	.rodata
.LC2:
	.string	" 1 Hydrogen molecule ready "
	.text
	.globl	h_fn
	.type	h_fn, @function
h_fn:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
.L10:
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR hydrogen[rip]
	add	eax, 1
	mov	DWORD PTR hydrogen[rip], eax
	mov	eax, DWORD PTR hydrogen[rip]
	cmp	eax, 1
	jle	.L8
	mov	eax, DWORD PTR oxygen[rip]
	test	eax, eax
	jle	.L8
	lea	rdi, hydroqueue[rip]
	call	sem_post@PLT
	lea	rdi, hydroqueue[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR hydrogen[rip]
	sub	eax, 2
	mov	DWORD PTR hydrogen[rip], eax
	lea	rdi, oxyqueue[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR oxygen[rip]
	sub	eax, 1
	mov	DWORD PTR oxygen[rip], eax
	jmp	.L9
.L8:
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L9:
	lea	rdi, hydroqueue[rip]
	call	sem_wait@PLT
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	bond
	jmp	.L10
	.cfi_endproc
.LFE8:
	.size	h_fn, .-h_fn
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edx, 1
	mov	esi, 0
	lea	rdi, b_mutex[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, sbarrier[rip]
	call	sem_init@PLT
	mov	edx, 1
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, oxyqueue[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, hydroqueue[rip]
	call	sem_init@PLT
	mov	ecx, 0
	lea	rdx, o_fn[rip]
	mov	esi, 0
	lea	rdi, o_thread[rip]
	call	pthread_create@PLT
	mov	ecx, 0
	lea	rdx, h_fn[rip]
	mov	esi, 0
	lea	rdi, h_thread1[rip]
	call	pthread_create@PLT
	mov	ecx, 0
	lea	rdx, h_fn[rip]
	mov	esi, 0
	lea	rdi, h_thread_2[rip]
	call	pthread_create@PLT
.L12:
	jmp	.L12
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.local	i.0
	.comm	i.0,4,4
	.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	"126703562.c"
	.text
	.global	hydrogen
	.bss
	.align	2
	.type	hydrogen, %object
	.size	hydrogen, 4
hydrogen:
	.space	4
	.global	oxygen
	.align	2
	.type	oxygen, %object
	.size	oxygen, 4
oxygen:
	.space	4
	.global	bcount
	.align	2
	.type	bcount, %object
	.size	bcount, 4
bcount:
	.space	4
	.comm	mutex,16,4
	.comm	hydroqueue,16,4
	.comm	oxyqueue,16,4
	.comm	b_mutex,16,4
	.comm	sbarrier,16,4
	.comm	o_thread,4,4
	.comm	h_thread1,4,4
	.comm	h_thread_2,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	" Water mol # %d created\012 \000"
	.text
	.align	2
	.global	bond
	.syntax unified
	.arm
	.fpu softvfp
	.type	bond, %function
bond:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L3
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L3
	str	r3, [r2]
	ldr	r3, .L3
	ldr	r1, [r3]
	ldr	r3, .L3+4
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L2
	ldr	r3, .L3
	ldr	r3, [r3]
	ldr	r2, .L3+4
	smull	r1, r2, r3, r2
	asr	r3, r3, #31
	sub	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L3+8
	bl	printf
.L2:
	mov	r0, #2
	bl	sleep
	nop
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	i.5926
	.word	1431655766
	.word	.LC0
	.size	bond, .-bond
	.section	.rodata
	.align	2
.LC1:
	.ascii	" one Oxygen is ready\000"
	.text
	.align	2
	.global	o_fn
	.syntax unified
	.arm
	.fpu softvfp
	.type	o_fn, %function
o_fn:
	@ 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]
.L8:
	ldr	r0, .L9
	bl	sem_wait
	ldr	r3, .L9+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+4
	str	r3, [r2]
	ldr	r3, .L9+8
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L6
	ldr	r0, .L9+12
	bl	sem_post
	ldr	r0, .L9+12
	bl	sem_post
	ldr	r3, .L9+8
	ldr	r3, [r3]
	sub	r3, r3, #2
	ldr	r2, .L9+8
	str	r3, [r2]
	ldr	r0, .L9+16
	bl	sem_post
	ldr	r3, .L9+4
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L9+4
	str	r3, [r2]
	b	.L7
.L6:
	ldr	r0, .L9
	bl	sem_post
.L7:
	ldr	r0, .L9+16
	bl	sem_wait
	ldr	r0, .L9+20
	bl	puts
	bl	bond
	ldr	r0, .L9
	bl	sem_post
	b	.L8
.L10:
	.align	2
.L9:
	.word	mutex
	.word	oxygen
	.word	hydrogen
	.word	hydroqueue
	.word	oxyqueue
	.word	.LC1
	.size	o_fn, .-o_fn
	.section	.rodata
	.align	2
.LC2:
	.ascii	" 1 Hydrogen molecule ready \000"
	.text
	.align	2
	.global	h_fn
	.syntax unified
	.arm
	.fpu softvfp
	.type	h_fn, %function
h_fn:
	@ 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]
.L14:
	ldr	r0, .L15
	bl	sem_wait
	ldr	r3, .L15+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+4
	str	r3, [r2]
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L12
	ldr	r3, .L15+8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L12
	ldr	r0, .L15+12
	bl	sem_post
	ldr	r0, .L15+12
	bl	sem_post
	ldr	r3, .L15+4
	ldr	r3, [r3]
	sub	r3, r3, #2
	ldr	r2, .L15+4
	str	r3, [r2]
	ldr	r0, .L15+16
	bl	sem_post
	ldr	r3, .L15+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L15+8
	str	r3, [r2]
	b	.L13
.L12:
	ldr	r0, .L15
	bl	sem_post
.L13:
	ldr	r0, .L15+12
	bl	sem_wait
	ldr	r0, .L15+20
	bl	printf
	bl	bond
	b	.L14
.L16:
	.align	2
.L15:
	.word	mutex
	.word	hydrogen
	.word	oxygen
	.word	hydroqueue
	.word	oxyqueue
	.word	.LC2
	.size	h_fn, .-h_fn
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L19
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L19+4
	bl	sem_init
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L19+8
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L19+12
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L19+16
	bl	sem_init
	mov	r3, #0
	ldr	r2, .L19+20
	mov	r1, #0
	ldr	r0, .L19+24
	bl	pthread_create
	mov	r3, #0
	ldr	r2, .L19+28
	mov	r1, #0
	ldr	r0, .L19+32
	bl	pthread_create
	mov	r3, #0
	ldr	r2, .L19+28
	mov	r1, #0
	ldr	r0, .L19+36
	bl	pthread_create
.L18:
	b	.L18
.L20:
	.align	2
.L19:
	.word	b_mutex
	.word	sbarrier
	.word	mutex
	.word	oxyqueue
	.word	hydroqueue
	.word	o_fn
	.word	o_thread
	.word	h_fn
	.word	h_thread1
	.word	h_thread_2
	.size	main, .-main
	.local	i.5926
	.comm	i.5926,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
