	.file	"730539.c"
	.intel_syntax noprefix
	.text
	.globl	csse332_sem_init
	.type	csse332_sem_init, @function
csse332_sem_init:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	csse332_sem_init, .-csse332_sem_init
	.globl	csse332_sem_wait
	.type	csse332_sem_wait, @function
csse332_sem_wait:
.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
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_cond_wait@PLT
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jle	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	csse332_sem_wait, .-csse332_sem_wait
	.globl	csse332_sem_post
	.type	csse332_sem_post, @function
csse332_sem_post:
.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
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	rdi, rax
	call	pthread_cond_signal@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	csse332_sem_post, .-csse332_sem_post
	.globl	csse332_sem_destroy
	.type	csse332_sem_destroy, @function
csse332_sem_destroy:
.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]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	rdi, rax
	call	pthread_cond_destroy@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	csse332_sem_destroy, .-csse332_sem_destroy
	.local	s
	.comm	s,96,32
	.section	.rodata
.LC0:
	.string	"Child"
.LC1:
	.string	"Child completed"
	.text
	.globl	child
	.type	child, @function
child:
.LFB10:
	.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
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 5
	call	sleep@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, s[rip]
	call	csse332_sem_post
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	child, .-child
	.section	.rodata
.LC2:
	.string	"Parent waiting for the child"
	.align 8
.LC3:
	.string	"Child completed, parent can exit!"
	.text
	.globl	main
	.type	main, @function
main:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, s[rip]
	call	csse332_sem_init
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, child[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, s[rip]
	call	csse332_sem_wait
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, s[rip]
	call	csse332_sem_destroy
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"730539.c"
	.text
	.align	2
	.global	csse332_sem_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	csse332_sem_init, %function
csse332_sem_init:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-8]
	add	r3, r3, #32
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	csse332_sem_init, .-csse332_sem_init
	.align	2
	.global	csse332_sem_wait
	.syntax unified
	.arm
	.fpu softvfp
	.type	csse332_sem_wait, %function
csse332_sem_wait:
	@ 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]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L3
.L4:
	ldr	r3, [fp, #-8]
	add	r2, r3, #32
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	pthread_cond_wait
.L3:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L4
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	csse332_sem_wait, .-csse332_sem_wait
	.align	2
	.global	csse332_sem_post
	.syntax unified
	.arm
	.fpu softvfp
	.type	csse332_sem_post, %function
csse332_sem_post:
	@ 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]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #32
	mov	r0, r3
	bl	pthread_cond_signal
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	csse332_sem_post, .-csse332_sem_post
	.align	2
	.global	csse332_sem_destroy
	.syntax unified
	.arm
	.fpu softvfp
	.type	csse332_sem_destroy, %function
csse332_sem_destroy:
	@ 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]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-8]
	add	r3, r3, #32
	mov	r0, r3
	bl	pthread_cond_destroy
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	csse332_sem_destroy, .-csse332_sem_destroy
	.local	s
	.comm	s,80,8
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Child\000"
	.align	2
.LC1:
	.ascii	"Child completed\000"
	.text
	.align	2
	.global	child
	.syntax unified
	.arm
	.fpu softvfp
	.type	child, %function
child:
	@ 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	r0, .L9
	bl	puts
	mov	r0, #5
	bl	sleep
	ldr	r0, .L9+4
	bl	puts
	ldr	r0, .L9+8
	bl	csse332_sem_post
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	.LC1
	.word	s
	.size	child, .-child
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Parent waiting for the child\000"
	.align	2
.LC3:
	.ascii	"Child completed, parent can exit!\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 = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L14+4
	bl	csse332_sem_init
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L14+8
	mov	r1, #0
	bl	pthread_create
	ldr	r0, .L14+12
	bl	puts
	ldr	r0, .L14+4
	bl	csse332_sem_wait
	ldr	r0, .L14+16
	bl	puts
	ldr	r0, .L14+4
	bl	csse332_sem_destroy
	mov	r3, #0
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC4
	.word	s
	.word	child
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
