	.file	"798766.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 4
	.type	EXIT_CODE_OK, @object
	.size	EXIT_CODE_OK, 4
EXIT_CODE_OK:
	.zero	4
	.align 4
	.type	EXIT_CODE_UNKNOWN_ERROR, @object
	.size	EXIT_CODE_UNKNOWN_ERROR, 4
EXIT_CODE_UNKNOWN_ERROR:
	.long	1
	.align 4
	.type	EXIT_CODE_FORK_FAILURE, @object
	.size	EXIT_CODE_FORK_FAILURE, 4
EXIT_CODE_FORK_FAILURE:
	.long	2
	.align 4
	.type	EXIT_CODE_EXEC_FAILURE, @object
	.size	EXIT_CODE_EXEC_FAILURE, 4
EXIT_CODE_EXEC_FAILURE:
	.long	3
	.align 4
	.type	EXIT_CODE_WAIT_FAILURE, @object
	.size	EXIT_CODE_WAIT_FAILURE, 4
EXIT_CODE_WAIT_FAILURE:
	.long	4
	.align 4
	.type	EXIT_CODE_INCORRECT_USAGE, @object
	.size	EXIT_CODE_INCORRECT_USAGE, 4
EXIT_CODE_INCORRECT_USAGE:
	.long	5
	.align 4
	.type	EXIT_CODE_CHILD_LOST, @object
	.size	EXIT_CODE_CHILD_LOST, 4
EXIT_CODE_CHILD_LOST:
	.long	6
	.align 8
.LC0:
	.string	"Unable to fork; errno=%d (%s)\n"
	.align 8
.LC1:
	.string	"Unable to exec; errno=%d (%s)\n"
.LC2:
	.string	"Child is pid=%ld\n"
.LC3:
	.string	"Child exited (ret=%d)\n"
.LC4:
	.string	"Child died to signal %d\n"
.LC5:
	.string	"Child is stopped\n"
	.align 8
.LC6:
	.string	"Child exited for an unknown reason\n"
	.align 8
.LC7:
	.string	"Oops, lost track of the child process!\n"
	.text
	.type	spawnAndAwaitTermination, @function
spawnAndAwaitTermination:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -40[rbp], 1
	call	fork@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L2
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rbx
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -40[rbp], 2
	jmp	.L3
.L2:
	cmp	DWORD PTR -36[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jns	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rbx
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -40[rbp], 3
.L5:
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -40[rbp], 4
.L13:
	lea	rcx, -44[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jne	.L6
	mov	eax, DWORD PTR -44[rbp]
	and	eax, 127
	test	eax, eax
	sete	al
	mov	BYTE PTR -47[rbp], al
	mov	eax, DWORD PTR -44[rbp]
	and	eax, 127
	add	eax, 1
	sar	al
	test	al, al
	setg	al
	mov	BYTE PTR -46[rbp], al
	mov	eax, DWORD PTR -44[rbp]
	movzx	eax, al
	cmp	eax, 127
	sete	al
	mov	BYTE PTR -45[rbp], al
	cmp	BYTE PTR -47[rbp], 0
	je	.L7
	mov	eax, DWORD PTR -44[rbp]
	sar	eax, 8
	movzx	edx, al
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L8
.L7:
	cmp	BYTE PTR -46[rbp], 0
	je	.L9
	mov	eax, DWORD PTR -44[rbp]
	and	eax, 127
	mov	edx, eax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L8
.L9:
	cmp	BYTE PTR -45[rbp], 0
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	jmp	.L8
.L10:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 35
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
.L8:
	mov	DWORD PTR -40[rbp], 0
	jmp	.L3
.L6:
	cmp	DWORD PTR -32[rbp], 0
	jns	.L13
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 10
	jne	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 39
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	DWORD PTR -40[rbp], 6
.L3:
	mov	eax, DWORD PTR -40[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	spawnAndAwaitTermination, .-spawnAndAwaitTermination
	.section	.rodata
	.align 8
.LC8:
	.string	"Usage: %s program [program_args...]\n"
	.align 8
.LC9:
	.string	"An unknown error happened, indicating a bug in this program (%s).\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -4[rbp], 1
	cmp	DWORD PTR -20[rbp], 1
	jle	.L17
.L18:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rdi, rax
	call	spawnAndAwaitTermination
	mov	DWORD PTR -4[rbp], eax
	mov	eax, 0
	cmp	DWORD PTR -4[rbp], eax
	je	.L18
	jmp	.L19
.L17:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -4[rbp], 5
.L19:
	mov	eax, 1
	cmp	DWORD PTR -4[rbp], eax
	jne	.L20
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L20:
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"798766.c"
	.text
	.section	.rodata
	.align	2
	.type	EXIT_CODE_OK, %object
	.size	EXIT_CODE_OK, 4
EXIT_CODE_OK:
	.space	4
	.align	2
	.type	EXIT_CODE_UNKNOWN_ERROR, %object
	.size	EXIT_CODE_UNKNOWN_ERROR, 4
EXIT_CODE_UNKNOWN_ERROR:
	.word	1
	.align	2
	.type	EXIT_CODE_FORK_FAILURE, %object
	.size	EXIT_CODE_FORK_FAILURE, 4
EXIT_CODE_FORK_FAILURE:
	.word	2
	.align	2
	.type	EXIT_CODE_EXEC_FAILURE, %object
	.size	EXIT_CODE_EXEC_FAILURE, 4
EXIT_CODE_EXEC_FAILURE:
	.word	3
	.align	2
	.type	EXIT_CODE_WAIT_FAILURE, %object
	.size	EXIT_CODE_WAIT_FAILURE, 4
EXIT_CODE_WAIT_FAILURE:
	.word	4
	.align	2
	.type	EXIT_CODE_INCORRECT_USAGE, %object
	.size	EXIT_CODE_INCORRECT_USAGE, 4
EXIT_CODE_INCORRECT_USAGE:
	.word	5
	.align	2
	.type	EXIT_CODE_CHILD_LOST, %object
	.size	EXIT_CODE_CHILD_LOST, 4
EXIT_CODE_CHILD_LOST:
	.word	6
	.align	2
.LC0:
	.ascii	"Unable to fork; errno=%d (%s)\012\000"
	.align	2
.LC1:
	.ascii	"Unable to exec; errno=%d (%s)\012\000"
	.align	2
.LC2:
	.ascii	"Child is pid=%ld\012\000"
	.align	2
.LC3:
	.ascii	"Child exited (ret=%d)\012\000"
	.align	2
.LC4:
	.ascii	"Child died to signal %d\012\000"
	.align	2
.LC5:
	.ascii	"Child is stopped\012\000"
	.align	2
.LC6:
	.ascii	"Child exited for an unknown reason\012\000"
	.align	2
.LC7:
	.ascii	"Oops, lost track of the child process!\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	spawnAndAwaitTermination, %function
spawnAndAwaitTermination:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #40
	str	r0, [fp, #-48]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-32]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L2
	ldr	r3, .L16+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L16+8
	mov	r0, r4
	bl	fprintf
	mov	r3, #2
	str	r3, [fp, #-32]
	b	.L3
.L2:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-48]
	ldr	r3, [r3]
	ldr	r1, [fp, #-48]
	mov	r0, r3
	bl	execvp
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L5
	ldr	r3, .L16+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L16+12
	mov	r0, r4
	bl	fprintf
	mov	r3, #3
	str	r3, [fp, #-32]
.L5:
	ldr	r0, [fp, #-32]
	bl	exit
.L4:
	ldr	r3, .L16+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	ldr	r1, .L16+16
	mov	r0, r3
	bl	fprintf
	mov	r3, #4
	str	r3, [fp, #-32]
.L13:
	sub	r3, fp, #36
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-28]
	bl	waitpid
	str	r0, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bne	.L6
	ldr	r3, [fp, #-36]
	and	r3, r3, #127
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	strb	r3, [fp, #-39]
	ldr	r3, [fp, #-36]
	and	r3, r3, #255
	and	r3, r3, #127
	and	r3, r3, #255
	add	r3, r3, #1
	and	r3, r3, #255
	lsl	r3, r3, #24
	asr	r3, r3, #24
	asr	r3, r3, #1
	lsl	r3, r3, #24
	asr	r3, r3, #24
	cmp	r3, #0
	movgt	r3, #1
	movle	r3, #0
	strb	r3, [fp, #-38]
	ldr	r3, [fp, #-36]
	and	r3, r3, #255
	cmp	r3, #127
	moveq	r3, #1
	movne	r3, #0
	strb	r3, [fp, #-37]
	ldrb	r3, [fp, #-39]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-36]
	asr	r3, r3, #8
	and	r3, r3, #255
	mov	r2, r3
	ldr	r1, .L16+20
	bl	fprintf
	b	.L8
.L7:
	ldrb	r3, [fp, #-38]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-36]
	and	r3, r3, #127
	mov	r2, r3
	ldr	r1, .L16+24
	bl	fprintf
	b	.L8
.L9:
	ldrb	r3, [fp, #-37]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L16+4
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L16+28
	bl	fwrite
	b	.L8
.L10:
	ldr	r3, .L16+4
	ldr	r3, [r3]
	mov	r2, #35
	mov	r1, #1
	ldr	r0, .L16+32
	bl	fwrite
.L8:
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L3
.L6:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L13
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #10
	bne	.L13
	ldr	r3, .L16+4
	ldr	r3, [r3]
	mov	r2, #39
	mov	r1, #1
	ldr	r0, .L16+36
	bl	fwrite
	mov	r3, #6
	str	r3, [fp, #-32]
.L3:
	ldr	r3, [fp, #-32]
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC8
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	spawnAndAwaitTermination, .-spawnAndAwaitTermination
	.section	.rodata
	.align	2
.LC9:
	.ascii	"Usage: %s program [program_args...]\012\000"
	.align	2
.LC10:
	.ascii	"An unknown error happened, indicating a bug in this"
	.ascii	" program (%s).\012\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]
	mov	r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	ble	.L19
.L20:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	mov	r0, r3
	bl	spawnAndAwaitTermination
	str	r0, [fp, #-8]
	mov	r2, #0
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	beq	.L20
	b	.L21
.L19:
	ldr	r3, .L24
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L24+4
	bl	fprintf
	mov	r3, #5
	str	r3, [fp, #-8]
.L21:
	mov	r2, #1
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	bne	.L22
	ldr	r3, .L24
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L24+8
	bl	fprintf
.L22:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	stderr
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
