	.file	"824831.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"usage: pipe_lat <message-size> <roundtrip-count>"
.LC1:
	.string	"malloc"
.LC2:
	.string	"message size: %i octets\n"
.LC3:
	.string	"roundtrip count: %lli\n"
.LC4:
	.string	"pipe"
.LC5:
	.string	"read"
.LC6:
	.string	"write"
.LC7:
	.string	"average latency: %lli us\n"
	.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
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -116[rbp], 3
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L17
.L2:
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -100[rbp], eax
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atol@PLT
	mov	QWORD PTR -88[rbp], rax
	mov	eax, DWORD PTR -100[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -80[rbp], rax
	cmp	QWORD PTR -80[rbp], 0
	jne	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L4:
	mov	eax, DWORD PTR -100[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -88[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -24[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	pipe@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L5:
	lea	rax, -16[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	pipe@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L6:
	call	fork@PLT
	test	eax, eax
	jne	.L7
	mov	QWORD PTR -96[rbp], 0
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, DWORD PTR -100[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	cmp	DWORD PTR -100[rbp], eax
	je	.L9
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L9:
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, DWORD PTR -100[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	cmp	DWORD PTR -100[rbp], eax
	je	.L10
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L10:
	add	QWORD PTR -96[rbp], 1
.L8:
	mov	rax, QWORD PTR -96[rbp]
	cmp	rax, QWORD PTR -88[rbp]
	jl	.L11
	jmp	.L12
.L7:
	lea	rax, -64[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	gettimeofday@PLT
	mov	QWORD PTR -96[rbp], 0
	jmp	.L13
.L16:
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, DWORD PTR -100[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	cmp	DWORD PTR -100[rbp], eax
	je	.L14
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L14:
	mov	eax, DWORD PTR -24[rbp]
	mov	edx, DWORD PTR -100[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	cmp	DWORD PTR -100[rbp], eax
	je	.L15
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L17
.L15:
	add	QWORD PTR -96[rbp], 1
.L13:
	mov	rax, QWORD PTR -96[rbp]
	cmp	rax, QWORD PTR -88[rbp]
	jl	.L16
	lea	rax, -48[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	sub	rax, rdx
	imul	rdx, rax, 1000000
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -56[rbp]
	sub	rax, rdx
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	lea	rcx, [rax+rax]
	mov	rax, QWORD PTR -72[rbp]
	cqo
	idiv	rcx
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L12:
	mov	eax, 0
.L17:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	"824831.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: pipe_lat <message-size> <roundtrip-count>\000"
	.align	2
.LC1:
	.ascii	"malloc\000"
	.align	2
.LC2:
	.ascii	"message size: %i octets\012\000"
	.align	2
.LC3:
	.ascii	"roundtrip count: %lli\012\000"
	.align	2
.LC4:
	.ascii	"pipe\000"
	.align	2
.LC5:
	.ascii	"read\000"
	.align	2
.LC6:
	.ascii	"write\000"
	.global	__aeabi_ldivmod
	.align	2
.LC7:
	.ascii	"average latency: %lli us\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #104
	str	r0, [fp, #-104]
	str	r1, [fp, #-108]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	ldr	r3, [fp, #-104]
	cmp	r3, #3
	beq	.L2
	ldr	r0, .L19+4
	bl	puts
	mov	r3, #1
	b	.L17
.L2:
	ldr	r3, [fp, #-108]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-108]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atol
	mov	r3, r0
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-84]
	str	r3, [fp, #-80]
	ldr	r3, [fp, #-100]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L19+8
	bl	perror
	mov	r3, #1
	b	.L17
.L4:
	ldr	r1, [fp, #-100]
	ldr	r0, .L19+12
	bl	printf
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	ldr	r0, .L19+16
	bl	printf
	sub	r3, fp, #48
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L19+20
	bl	perror
	mov	r3, #1
	b	.L17
.L5:
	sub	r3, fp, #40
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L19+20
	bl	perror
	mov	r3, #1
	b	.L17
.L6:
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-92]
	str	r3, [fp, #-88]
	b	.L8
.L11:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-100]
	ldr	r1, [fp, #-96]
	mov	r0, r3
	bl	read
	mov	r2, r0
	ldr	r3, [fp, #-100]
	cmp	r3, r2
	beq	.L9
	ldr	r0, .L19+24
	bl	perror
	mov	r3, #1
	b	.L17
.L9:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-100]
	ldr	r1, [fp, #-96]
	mov	r0, r3
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-100]
	cmp	r3, r2
	beq	.L10
	ldr	r0, .L19+28
	bl	perror
	mov	r3, #1
	b	.L17
.L10:
	sub	r3, fp, #92
	ldmia	r3, {r2-r3}
	adds	r4, r2, #1
	adc	r5, r3, #0
	str	r4, [fp, #-92]
	str	r5, [fp, #-88]
.L8:
	sub	r1, fp, #92
	ldmia	r1, {r0-r1}
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	cmp	r0, r2
	sbcs	r3, r1, r3
	blt	.L11
	b	.L12
.L7:
	sub	r3, fp, #64
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-92]
	str	r3, [fp, #-88]
	b	.L13
.L16:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-100]
	ldr	r1, [fp, #-96]
	mov	r0, r3
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-100]
	cmp	r3, r2
	beq	.L14
	ldr	r0, .L19+28
	bl	perror
	mov	r3, #1
	b	.L17
.L14:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-100]
	ldr	r1, [fp, #-96]
	mov	r0, r3
	bl	read
	mov	r2, r0
	ldr	r3, [fp, #-100]
	cmp	r3, r2
	beq	.L15
	ldr	r0, .L19+24
	bl	perror
	mov	r3, #1
	b	.L17
.L15:
	sub	r3, fp, #92
	ldmia	r3, {r2-r3}
	adds	r1, r2, #1
	str	r1, [fp, #-116]
	adc	r3, r3, #0
	str	r3, [fp, #-112]
	sub	r4, fp, #116
	ldmia	r4, {r3-r4}
	str	r3, [fp, #-92]
	str	r4, [fp, #-88]
.L13:
	sub	r1, fp, #92
	ldmia	r1, {r0-r1}
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	cmp	r0, r2
	sbcs	r3, r1, r3
	blt	.L16
	sub	r3, fp, #56
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-64]
	sub	r3, r2, r3
	mov	r4, r3
	asr	r5, r4, #31
	mov	r2, r4
	mov	r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r2, r0
	mov	r3, r1
	subs	r2, r2, r4
	sbc	r3, r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #9
	orr	r1, r1, r2, lsr #23
	lsl	r0, r2, #9
	mov	r2, r0
	mov	r3, r1
	adds	r2, r2, r4
	adc	r3, r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #6
	orr	r1, r1, r2, lsr #26
	lsl	r0, r2, #6
	subs	r0, r0, r2
	sbc	r1, r1, r3
	adds	r8, r0, r4
	adc	r9, r1, r5
	ldr	r3, [fp, #-52]
	mov	r2, r3
	asr	r3, r2, #31
	adds	r6, r8, r2
	adc	r7, r9, r3
	ldr	r3, [fp, #-60]
	mov	r2, r3
	asr	r3, r2, #31
	subs	r1, r6, r2
	str	r1, [fp, #-124]
	sbc	r3, r7, r3
	str	r3, [fp, #-120]
	sub	r4, fp, #124
	ldmia	r4, {r3-r4}
	str	r3, [fp, #-76]
	str	r4, [fp, #-72]
	sub	r3, fp, #84
	ldmia	r3, {r2-r3}
	adds	r1, r2, r2
	str	r1, [fp, #-132]
	adc	r3, r3, r3
	str	r3, [fp, #-128]
	sub	r3, fp, #132
	ldmia	r3, {r2-r3}
	sub	r1, fp, #76
	ldmia	r1, {r0-r1}
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L19+32
	bl	printf
.L12:
	mov	r3, #0
.L17:
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
