	.file	"242331608.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"sem_init"
	.text
	.globl	s_init
	.type	s_init, @function
s_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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	ftok@PLT
	mov	edx, 896
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	test	eax, eax
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR -12[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	s_init, .-s_init
	.section	.rodata
.LC1:
	.string	"sem_wait"
	.text
	.globl	s_wait
	.type	s_wait, @function
s_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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -14[rbp], 0
	mov	WORD PTR -12[rbp], -1
	mov	WORD PTR -10[rbp], 0
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L7
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	s_wait, .-s_wait
	.section	.rodata
.LC2:
	.string	"sem_post"
	.text
	.globl	s_post
	.type	s_post, @function
s_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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -14[rbp], 0
	mov	WORD PTR -12[rbp], 1
	mov	WORD PTR -10[rbp], 0
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L11
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	s_post, .-s_post
	.local	flag
	.comm	flag,4,4
	.globl	do_printing
	.type	do_printing, @function
do_printing:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, esi
	mov	BYTE PTR -24[rbp], al
	mov	eax, DWORD PTR flag[rip]
	test	eax, eax
	je	.L13
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	s_wait
.L13:
	mov	DWORD PTR -4[rbp], 0
	jmp	.L14
.L15:
	movsx	eax, BYTE PTR -24[rbp]
	mov	edi, eax
	call	putchar@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	edi, 1
	call	sleep@PLT
	add	DWORD PTR -4[rbp], 1
.L14:
	cmp	DWORD PTR -4[rbp], 4
	jle	.L15
	mov	edi, 3
	call	sleep@PLT
	mov	eax, DWORD PTR flag[rip]
	test	eax, eax
	je	.L16
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	s_post
.L16:
	mov	edi, 1
	call	sleep@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	do_printing, .-do_printing
	.section	.rodata
.LC3:
	.string	"semprint"
	.text
	.globl	main
	.type	main, @function
main:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 1
	jle	.L18
	mov	DWORD PTR flag[rip], 1
.L18:
	mov	esi, 2
	lea	rdi, .LC3[rip]
	call	s_init
	mov	DWORD PTR -4[rbp], eax
	call	fork@PLT
	test	eax, eax
	jne	.L19
.L20:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, 49
	mov	edi, eax
	call	do_printing
	jmp	.L20
.L19:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, 50
	mov	edi, eax
	call	do_printing
	jmp	.L19
	.cfi_endproc
.LFE10:
	.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	"242331608.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sem_init\000"
	.text
	.align	2
	.global	s_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	s_init, %function
s_init:
	@ 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]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	ftok
	mov	r3, r0
	mov	r2, #896
	mov	r1, #1
	mov	r0, r3
	bl	semget
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	semctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.size	s_init, .-s_init
	.section	.rodata
	.align	2
.LC1:
	.ascii	"sem_wait\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	s_wait
	.syntax unified
	.arm
	.fpu softvfp
	.type	s_wait, %function
s_wait:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mvn	r3, #0
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	sub	r3, fp, #16
	mov	r2, #2
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L10+4
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	nop
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC2
	.word	.LC1
	.size	s_wait, .-s_wait
	.section	.rodata
	.align	2
.LC3:
	.ascii	"sem_post\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	s_post
	.syntax unified
	.arm
	.fpu softvfp
	.type	s_post, %function
s_post:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	sub	r3, fp, #16
	mov	r2, #2
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L16+4
	bl	perror
	mov	r0, #1
	bl	exit
.L15:
	nop
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC4
	.word	.LC3
	.size	s_post, .-s_post
	.local	flag
	.comm	flag,4,4
	.align	2
	.global	do_printing
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_printing, %function
do_printing:
	@ 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, r1
	strb	r3, [fp, #-17]
	ldr	r3, .L23
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L19
	ldr	r0, [fp, #-16]
	bl	s_wait
.L19:
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L20
.L21:
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, .L23+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L20:
	ldr	r3, [fp, #-8]
	cmp	r3, #4
	ble	.L21
	mov	r0, #3
	bl	sleep
	ldr	r3, .L23
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L22
	ldr	r0, [fp, #-16]
	bl	s_post
.L22:
	mov	r0, #1
	bl	sleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	flag
	.word	stdout
	.size	do_printing, .-do_printing
	.section	.rodata
	.align	2
.LC5:
	.ascii	"semprint\000"
	.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, [fp, #-16]
	cmp	r3, #1
	ble	.L26
	ldr	r3, .L29
	mov	r2, #1
	str	r2, [r3]
.L26:
	mov	r1, #2
	ldr	r0, .L29+4
	bl	s_init
	str	r0, [fp, #-8]
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
.L28:
	mov	r1, #49
	ldr	r0, [fp, #-8]
	bl	do_printing
	b	.L28
.L27:
	mov	r1, #50
	ldr	r0, [fp, #-8]
	bl	do_printing
	b	.L27
.L30:
	.align	2
.L29:
	.word	flag
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
