	.file	"170452080.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"usage:algorithm_b_bubble_sort <in.dat >out.dat"
	.align 8
.LC1:
	.string	"Implements Algorithm B (Bubble sort), 5.2.2 Sorting by Exchanging, The Art of Computer Programming Volume 3, Sorting and Searching by Donald Knuth"
	.align 8
.LC2:
	.string	"reads 64-bit values as binary data to sort, outputs sorted 64-bit values as binary data"
	.align 8
.LC3:
	.string	"first uint64_t is number of values to sort"
	.align 8
.LC4:
	.string	"next that many int64_t is data to sort"
.LC5:
	.string	""
.LC6:
	.string	"binary input data format"
.LC7:
	.string	"uint64_t N"
.LC8:
	.string	"int64_t[N] data"
.LC9:
	.string	"binary output data format"
.LC10:
	.string	"int64_t[N] sorted data"
.LC11:
	.string	"examples:"
	.align 8
.LC12:
	.string	"algorithm_b_bubble_sort <data/algorithm_b_bubble_sort/in.0.le.dat | od -An -td8 -w8 -v"
	.text
	.type	usage, @function
usage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	lea	rdi, .LC12[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	usage, .-usage
	.globl	Sort
	.type	Sort, @function
Sort:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -32[rbp], rax
.L9:
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -16[rbp], 1
	jmp	.L3
.L6:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 1
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	cmp	rdx, rax
	jle	.L11
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -16[rbp]
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -24[rbp], rax
	jmp	.L5
.L11:
	nop
.L5:
	add	QWORD PTR -16[rbp], 1
.L3:
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, 1
	cmp	QWORD PTR -16[rbp], rax
	jbe	.L6
	cmp	QWORD PTR -24[rbp], 0
	je	.L12
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L9
.L12:
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Sort, .-Sort
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	cmp	DWORD PTR -84[rbp], 1
	jle	.L14
	mov	eax, 0
	call	usage
	mov	edi, 0
	call	exit@PLT
.L14:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -80[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 8
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 1
	mov	rdx, rax
	sub	rdx, 1
	mov	QWORD PTR -72[rbp], rdx
	mov	r14, rax
	mov	r15d, 0
	mov	r12, rax
	mov	r13d, 0
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L15:
	cmp	rsp, rdx
	je	.L16
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L15
.L16:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L17
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L17:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -64[rbp], rax
	mov	rdx, QWORD PTR stdin[rip]
	mov	rax, QWORD PTR -80[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	lea	rdi, 8[rcx]
	mov	rcx, rdx
	mov	rdx, rax
	mov	esi, 8
	call	fread@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	Sort
	mov	rdx, QWORD PTR stdout[rip]
	lea	rax, -80[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 8
	mov	rdi, rax
	call	fwrite@PLT
	mov	rdx, QWORD PTR stdout[rip]
	mov	rax, QWORD PTR -80[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	lea	rdi, 8[rcx]
	mov	rcx, rdx
	mov	rdx, rax
	mov	esi, 8
	call	fwrite@PLT
	mov	eax, 0
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"170452080.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage:algorithm_b_bubble_sort <in.dat >out.dat\000"
	.align	2
.LC1:
	.ascii	"Implements Algorithm B (Bubble sort), 5.2.2 Sorting"
	.ascii	" by Exchanging, The Art of Computer Programming Vol"
	.ascii	"ume 3, Sorting and Searching by Donald Knuth\000"
	.align	2
.LC2:
	.ascii	"reads 64-bit values as binary data to sort, outputs"
	.ascii	" sorted 64-bit values as binary data\000"
	.align	2
.LC3:
	.ascii	"first uint64_t is number of values to sort\000"
	.align	2
.LC4:
	.ascii	"next that many int64_t is data to sort\000"
	.align	2
.LC5:
	.ascii	"\000"
	.align	2
.LC6:
	.ascii	"binary input data format\000"
	.align	2
.LC7:
	.ascii	"uint64_t N\000"
	.align	2
.LC8:
	.ascii	"int64_t[N] data\000"
	.align	2
.LC9:
	.ascii	"binary output data format\000"
	.align	2
.LC10:
	.ascii	"int64_t[N] sorted data\000"
	.align	2
.LC11:
	.ascii	"examples:\000"
	.align	2
.LC12:
	.ascii	"algorithm_b_bubble_sort <data/algorithm_b_bubble_so"
	.ascii	"rt/in.0.le.dat | od -An -td8 -w8 -v\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	puts
	ldr	r0, .L2+4
	bl	puts
	ldr	r0, .L2+8
	bl	puts
	ldr	r0, .L2+12
	bl	puts
	ldr	r0, .L2+16
	bl	puts
	ldr	r0, .L2+20
	bl	puts
	ldr	r0, .L2+24
	bl	puts
	ldr	r0, .L2+28
	bl	puts
	ldr	r0, .L2+32
	bl	puts
	ldr	r0, .L2+20
	bl	puts
	ldr	r0, .L2+36
	bl	puts
	ldr	r0, .L2+28
	bl	puts
	ldr	r0, .L2+40
	bl	puts
	ldr	r0, .L2+20
	bl	puts
	ldr	r0, .L2+44
	bl	puts
	ldr	r0, .L2+48
	bl	puts
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	usage, .-usage
	.align	2
	.global	Sort
	.syntax unified
	.arm
	.fpu softvfp
	.type	Sort, %function
Sort:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	push	{r4, r5, r6, r7, fp}
	add	fp, sp, #16
	sub	sp, sp, #52
	str	r0, [fp, #-60]
	str	r1, [fp, #-56]
	str	r2, [fp, #-64]
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
.L11:
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	mov	r2, #1
	mov	r3, #0
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	b	.L5
.L8:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-64]
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-36]
	add	r1, r1, #1
	lsl	r1, r1, #3
	ldr	r0, [fp, #-64]
	add	r1, r0, r1
	ldmia	r1, {r0-r1}
	cmp	r0, r2
	sbcs	r3, r1, r3
	bge	.L13
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-64]
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	lsl	r3, r3, #3
	ldr	r2, [fp, #-64]
	add	r3, r2, r3
	ldr	r2, [fp, #-36]
	lsl	r2, r2, #3
	ldr	r1, [fp, #-64]
	add	r1, r1, r2
	ldmia	r3, {r2-r3}
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	lsl	r3, r3, #3
	ldr	r2, [fp, #-64]
	add	r1, r2, r3
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	stm	r1, {r2-r3}
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	b	.L7
.L13:
	nop
.L7:
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	adds	r6, r2, #1
	adc	r7, r3, #0
	str	r6, [fp, #-36]
	str	r7, [fp, #-32]
.L5:
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	subs	r4, r2, #1
	sbc	r5, r3, #0
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	cmp	r3, r5
	cmpeq	r2, r4
	bls	.L8
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	orrs	r3, r2, r3
	beq	.L14
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	b	.L11
.L14:
	nop
	nop
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, fp}
	bx	lr
	.size	Sort, .-Sort
	.section	.rodata
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #36
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	mov	r3, sp
	mov	r6, r3
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	ble	.L16
	bl	usage
	mov	r0, #0
	bl	exit
.L16:
	ldr	r3, .L19+4
	ldr	r3, [r3]
	sub	r0, fp, #36
	mov	r2, #1
	mov	r1, #8
	bl	fread
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	adds	r4, r2, #1
	adc	r5, r3, #0
	mov	r3, r4
	sub	r3, r3, #1
	str	r3, [fp, #-44]
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, r4
	lsl	r3, r3, #3
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	add	r0, r3, #8
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	ldr	r3, .L19+4
	ldr	r3, [r3]
	mov	r1, #8
	bl	fread
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	ldr	r2, [fp, #-40]
	bl	Sort
	ldr	r3, .L19+8
	ldr	r3, [r3]
	sub	r0, fp, #36
	mov	r2, #1
	mov	r1, #8
	bl	fwrite
	ldr	r3, [fp, #-40]
	add	r0, r3, #8
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	ldr	r3, .L19+8
	ldr	r3, [r3]
	mov	r1, #8
	bl	fwrite
	mov	r3, #0
	mov	sp, r6
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-24]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC13
	.word	stdin
	.word	stdout
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
