	.file	"639926.c"
	.intel_syntax noprefix
	.text
	.globl	p
	.data
	.align 2
	.type	p, @object
	.size	p, 6
p:
	.value	0
	.value	-1
	.value	4096
	.globl	v
	.align 2
	.type	v, @object
	.size	v, 6
v:
	.value	0
	.value	1
	.value	4096
	.section	.rodata
.LC0:
	.string	"semget"
.LC1:
	.string	"semctl"
.LC2:
	.string	"fork"
.LC3:
	.string	"abcdefgh"
.LC4:
	.string	"semop p"
.LC5:
	.string	"ABCDEFGH"
	.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
	sub	rsp, 48
	mov	edx, 950
	mov	esi, 1
	mov	edi, 4369
	call	semget@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 11
	call	exit@PLT
.L2:
	mov	DWORD PTR -24[rbp], 1
	mov	rdx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -40[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 12
	call	exit@PLT
.L3:
	call	fork@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	srand@PLT
	cmp	DWORD PTR -36[rbp], 0
	jns	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	cmp	DWORD PTR -36[rbp], 0
	je	.L5
	lea	rax, .LC3[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	DWORD PTR -48[rbp], 0
	jmp	.L6
.L9:
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, 1
	lea	rsi, p[rip]
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L7
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 13
	call	exit@PLT
.L7:
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, 1
	lea	rsi, v[rip]
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L8
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 14
	call	exit@PLT
.L8:
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -48[rbp], 1
.L6:
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L9
	jmp	.L10
.L5:
	lea	rax, .LC5[rip]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -32[rbp], eax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L11
.L14:
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, 1
	lea	rsi, p[rip]
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L12
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 15
	call	exit@PLT
.L12:
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, 1
	lea	rsi, v[rip]
	mov	edi, eax
	call	semop@PLT
	test	eax, eax
	jns	.L13
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 16
	call	exit@PLT
.L13:
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -44[rbp], 1
.L11:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jl	.L14
.L10:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"639926.c"
	.text
	.global	p
	.data
	.align	2
	.type	p, %object
	.size	p, 6
p:
	.short	0
	.short	-1
	.short	4096
	.global	v
	.align	2
	.type	v, %object
	.size	v, 6
v:
	.short	0
	.short	1
	.short	4096
	.section	.rodata
	.align	2
.LC0:
	.ascii	"semget\000"
	.align	2
.LC1:
	.ascii	"semctl\000"
	.align	2
.LC2:
	.ascii	"fork\000"
	.align	2
.LC3:
	.ascii	"abcdefgh\000"
	.align	2
.LC4:
	.ascii	"semop p\000"
	.align	2
.LC5:
	.ascii	"ABCDEFGH\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r2, .L16
	mov	r1, #1
	ldr	r0, .L16+4
	bl	semget
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L16+8
	bl	perror
	mov	r0, #11
	bl	exit
.L2:
	mov	r3, #1
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	semctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L16+12
	bl	perror
	mov	r0, #12
	bl	exit
.L3:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	srand
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L16+16
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L5
	ldr	r3, .L16+20
	str	r3, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L6
.L9:
	mov	r2, #1
	ldr	r1, .L16+24
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L16+28
	bl	perror
	mov	r0, #13
	bl	exit
.L7:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, .L16+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, .L16+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r2, #1
	ldr	r1, .L16+36
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L16+28
	bl	perror
	mov	r0, #14
	bl	exit
.L8:
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L6:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L9
	b	.L10
.L5:
	ldr	r3, .L16+40
	str	r3, [fp, #-20]
	ldr	r0, [fp, #-20]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L11
.L14:
	mov	r2, #1
	ldr	r1, .L16+24
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L16+28
	bl	perror
	mov	r0, #15
	bl	exit
.L12:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, .L16+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, .L16+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r2, #1
	ldr	r1, .L16+36
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmp	r3, #0
	bge	.L13
	ldr	r0, .L16+28
	bl	perror
	mov	r0, #16
	bl	exit
.L13:
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L11:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L14
.L10:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	950
	.word	4369
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	p
	.word	.LC4
	.word	stdout
	.word	v
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
