	.file	"extr_slru.c_SlruPhysicalWritePage.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	SlruPhysicalWritePage, @function
SlruPhysicalWritePage:
.LFB0:
	.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	mov	r14, rcx
	push	r13
	push	r12
	push	rbx
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 56
	mov	DWORD PTR -68[rbp], edx
	mov	rcx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	mov	QWORD PTR -80[rbp], rax
	mov	eax, esi
	cdq
	idiv	DWORD PTR SLRU_PAGES_PER_SEGMENT[rip]
	imul	edx, DWORD PTR BLCKSZ[rip]
	mov	r12d, edx
	mov	r15d, eax
	movsx	rax, DWORD PTR MAXPGPATH[rip]
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L44:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L44
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L45
.L4:
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -88[rbp], rsp
	mov	r9, QWORD PTR [rax]
	test	r9, r9
	je	.L6
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -68[rbp]
	imul	eax, edx
	lea	esi, 1[rax]
	cdqe
	mov	r13, QWORD PTR [r9+rax*8]
	cmp	edx, 1
	jle	.L7
	sub	edx, 2
	movsx	rsi, esi
	add	rax, rdx
	lea	rdi, [r9+rsi*8]
	lea	rdx, 16[r9+rax*8]
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR [rdi]
	cmp	r13, rax
	cmovl	r13, rax
	add	rdi, 8
	cmp	rdx, rdi
	jne	.L8
.L7:
	mov	rdi, r13
	call	XLogRecPtrIsInvalid@PLT
	test	eax, eax
	je	.L46
.L6:
	test	r14, r14
	je	.L10
.L50:
	mov	edx, DWORD PTR [r14]
	test	edx, edx
	jle	.L11
	sub	edx, 1
	mov	rax, QWORD PTR 8[r14]
	xor	edi, edi
	lea	rdx, 4[0+rdx*4]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	add	rdi, 4
	cmp	rdx, rdi
	je	.L11
.L14:
	cmp	DWORD PTR [rax+rdi], r15d
	jne	.L12
	mov	rax, QWORD PTR 16[r14]
	mov	r13d, DWORD PTR [rax+rdi]
	test	r13d, r13d
	js	.L11
.L13:
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	esi, r12d
	mov	edi, r13d
	call	lseek@PLT
	test	rax, rax
	jns	.L23
	mov	eax, DWORD PTR SLRU_SEEK_FAILED[rip]
	xor	r12d, r12d
	mov	DWORD PTR slru_errcause[rip], eax
	mov	rax, QWORD PTR errno[rip]
	mov	QWORD PTR slru_errno[rip], rax
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L47
	lea	rsp, -40[rbp]
	mov	eax, r12d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	r13, QWORD PTR -88[rbp]
	mov	edx, r15d
	mov	rdi, rbx
	mov	rsi, r13
	call	SlruFileName@PLT
	mov	esi, DWORD PTR O_RDWR[rip]
	mov	rdi, r13
	or	esi, DWORD PTR O_CREAT[rip]
	or	esi, DWORD PTR PG_BINARY[rip]
	call	OpenTransientFile@PLT
	mov	r13d, eax
	test	eax, eax
	js	.L25
	movsx	rax, DWORD PTR [r14]
	cmp	eax, DWORD PTR MAX_FLUSH_BUFFERS[rip]
	jl	.L48
.L16:
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	esi, r12d
	mov	edi, r13d
	xor	r14d, r14d
	call	lseek@PLT
	test	rax, rax
	js	.L49
.L23:
	mov	edi, DWORD PTR WAIT_EVENT_SLRU_WRITE[rip]
	mov	QWORD PTR errno[rip], 0
	call	pgstat_report_wait_start@PLT
	mov	rax, QWORD PTR -80[rbp]
	movsx	rdx, DWORD PTR -68[rbp]
	mov	edi, r13d
	mov	rax, QWORD PTR 16[rax]
	mov	esi, DWORD PTR [rax+rdx*4]
	mov	edx, DWORD PTR BLCKSZ[rip]
	call	write@PLT
	cmp	eax, DWORD PTR BLCKSZ[rip]
	mov	eax, 0
	je	.L17
	call	pgstat_report_wait_end@PLT
	mov	rax, QWORD PTR errno[rip]
	test	rax, rax
	jne	.L18
	mov	rax, QWORD PTR ENOSPC[rip]
	mov	QWORD PTR errno[rip], rax
.L18:
	mov	edx, DWORD PTR SLRU_WRITE_FAILED[rip]
	mov	QWORD PTR slru_errno[rip], rax
	xor	r12d, r12d
	mov	DWORD PTR slru_errcause[rip], edx
	test	r14, r14
	jne	.L1
	mov	edi, r13d
	call	CloseTransientFile@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	call	pgstat_report_wait_end@PLT
	test	r14, r14
	je	.L19
.L21:
	mov	r12d, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L46:
	call	START_CRIT_SECTION@PLT
	mov	rdi, r13
	call	XLogFlush@PLT
	xor	eax, eax
	call	END_CRIT_SECTION@PLT
	test	r14, r14
	jne	.L50
.L10:
	mov	r14, QWORD PTR -88[rbp]
	mov	edx, r15d
	mov	rdi, rbx
	mov	rsi, r14
	call	SlruFileName@PLT
	mov	esi, DWORD PTR O_RDWR[rip]
	mov	rdi, r14
	or	esi, DWORD PTR O_CREAT[rip]
	or	esi, DWORD PTR PG_BINARY[rip]
	call	OpenTransientFile@PLT
	mov	r13d, eax
	test	eax, eax
	jns	.L16
.L25:
	mov	eax, DWORD PTR SLRU_OPEN_FAILED[rip]
	xor	r12d, r12d
	mov	DWORD PTR slru_errcause[rip], eax
	mov	rax, QWORD PTR errno[rip]
	mov	QWORD PTR slru_errno[rip], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L45:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L48:
	mov	rdx, QWORD PTR 16[r14]
	mov	DWORD PTR [rdx+rax*4], r13d
	mov	rax, QWORD PTR 8[r14]
	movsx	rdx, DWORD PTR [r14]
	mov	DWORD PTR [rax+rdx*4], r15d
	add	DWORD PTR [r14], 1
	jmp	.L13
.L49:
	mov	eax, DWORD PTR SLRU_SEEK_FAILED[rip]
.L42:
	mov	DWORD PTR slru_errcause[rip], eax
	mov	rax, QWORD PTR errno[rip]
	mov	edi, r13d
	xor	r12d, r12d
	mov	QWORD PTR slru_errno[rip], rax
	call	CloseTransientFile@PLT
	jmp	.L1
.L19:
	mov	edi, DWORD PTR WAIT_EVENT_SLRU_SYNC[rip]
	call	pgstat_report_wait_start@PLT
	cmp	QWORD PTR [rbx], 0
	je	.L20
	mov	edi, r13d
	call	pg_fsync@PLT
	test	rax, rax
	jne	.L51
.L20:
	xor	eax, eax
	call	pgstat_report_wait_end@PLT
	mov	edi, r13d
	call	CloseTransientFile@PLT
	test	rax, rax
	je	.L21
	mov	eax, DWORD PTR SLRU_CLOSE_FAILED[rip]
	xor	r12d, r12d
	mov	DWORD PTR slru_errcause[rip], eax
	mov	rax, QWORD PTR errno[rip]
	mov	QWORD PTR slru_errno[rip], rax
	jmp	.L1
.L51:
	xor	eax, eax
	call	pgstat_report_wait_end@PLT
	mov	eax, DWORD PTR SLRU_FSYNC_FAILED[rip]
	jmp	.L42
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	SlruPhysicalWritePage, .-SlruPhysicalWritePage
	.comm	slru_errno,8,8
	.comm	slru_errcause,4,4
	.comm	errno,8,8
	.comm	WAIT_EVENT_SLRU_WRITE,4,4
	.comm	WAIT_EVENT_SLRU_SYNC,4,4
	.comm	SLRU_WRITE_FAILED,4,4
	.comm	SLRU_SEEK_FAILED,4,4
	.comm	SLRU_PAGES_PER_SEGMENT,4,4
	.comm	SLRU_OPEN_FAILED,4,4
	.comm	SLRU_FSYNC_FAILED,4,4
	.comm	SLRU_CLOSE_FAILED,4,4
	.comm	SEEK_SET,4,4
	.comm	PG_BINARY,4,4
	.comm	O_RDWR,4,4
	.comm	O_CREAT,4,4
	.comm	MAX_FLUSH_BUFFERS,4,4
	.comm	MAXPGPATH,4,4
	.comm	ENOSPC,8,8
	.comm	BLCKSZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_slru.c_SlruPhysicalWritePage.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	SlruPhysicalWritePage, %function
SlruPhysicalWritePage:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #20
	mov	r6, r0
	ldr	ip, .L49
	mov	r4, r3
	ldr	r3, .L49+4
	str	r2, [fp, #-48]
	mov	r0, r1
	ldr	r1, [ip]
	mov	r5, r2
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	__aeabi_idivmod
	ldr	r3, .L49+8
	ldr	r9, [r6, #4]
	ldr	ip, [r3]
	ldr	r10, .L49+12
	ldr	r3, [r9]
	add	ip, ip, #7
	ldr	r8, [r10]
	bic	ip, ip, #7
	sub	sp, sp, ip
	cmp	r3, #0
	mov	r2, r0
	mov	r7, sp
	mul	r8, r1, r8
	beq	.L3
	mov	lr, r5
	ldr	ip, [r9, #4]
	mul	lr, ip, lr
	cmp	ip, #1
	ldr	r5, [r3, lr, lsl #2]
	add	r0, lr, #1
	ble	.L4
	add	ip, ip, lr
	add	ip, r3, ip, lsl #2
	add	r3, r3, r0, lsl #2
.L5:
	ldr	r0, [r3], #4
	cmp	r5, r0
	movlt	r5, r0
	cmp	r3, ip
	bne	.L5
.L4:
	mov	r0, r5
	str	r2, [fp, #-52]
	bl	XLogRecPtrIsInvalid
	cmp	r0, #0
	ldr	r2, [fp, #-52]
	beq	.L42
.L3:
	cmp	r4, #0
	beq	.L7
.L44:
	ldr	lr, [r4]
	cmp	lr, #0
	ble	.L8
	ldr	r0, [r4, #4]
	mov	r3, #0
	sub	r0, r0, #4
	b	.L11
.L9:
	add	r3, r3, #1
	cmp	lr, r3
	beq	.L8
.L11:
	ldr	ip, [r0, #4]!
	lsl	r5, r3, #2
	cmp	ip, r2
	bne	.L9
	ldr	r3, [r4, #8]
	ldr	r5, [r3, r5]
	cmp	r5, #0
	blt	.L8
.L10:
	ldr	r3, .L49+16
	mov	r1, r8
	mov	r0, r5
	ldr	r2, [r3]
	bl	lseek
	cmp	r0, #0
	bge	.L20
	ldr	r2, .L49+20
.L39:
	ldr	r0, [r2]
	ldr	r3, .L49+24
	ldr	r1, .L49+28
	ldr	r2, [r3]
	str	r0, [r1]
	mov	r0, #0
	ldr	r3, .L49+32
	str	r2, [r3]
.L1:
	ldr	r3, .L49+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L43
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L42:
	bl	START_CRIT_SECTION
	mov	r0, r5
	bl	XLogFlush
	bl	END_CRIT_SECTION
	cmp	r4, #0
	ldr	r2, [fp, #-52]
	bne	.L44
.L7:
	mov	r1, r7
	mov	r0, r6
	bl	SlruFileName
	ldr	r3, .L49+36
	ldr	r0, .L49+40
	ldr	r2, .L49+44
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r0
	orr	r1, r3, r2
	mov	r0, r7
	bl	OpenTransientFile
	subs	r5, r0, #0
	bge	.L13
.L22:
	ldr	r2, .L49+48
	b	.L39
.L8:
	mov	r1, r7
	mov	r0, r6
	str	r2, [fp, #-52]
	bl	SlruFileName
	ldr	r3, .L49+36
	ldr	r0, .L49+40
	ldr	ip, .L49+44
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r1, [ip]
	orr	r3, r3, r0
	orr	r1, r3, r1
	mov	r0, r7
	bl	OpenTransientFile
	subs	r5, r0, #0
	ldr	r2, [fp, #-52]
	blt	.L22
	ldr	r1, .L49+52
	ldr	r3, [r4]
	ldr	r1, [r1]
	cmp	r3, r1
	blt	.L45
.L13:
	ldr	r3, .L49+16
	mov	r1, r8
	mov	r0, r5
	ldr	r2, [r3]
	bl	lseek
	cmp	r0, #0
	movge	r4, #0
	blt	.L46
.L20:
	mov	r3, #0
	ldr	r2, .L49+56
	ldr	r8, .L49+24
	ldr	r0, [r2]
	str	r3, [r8]
	bl	pgstat_report_wait_start
	ldr	r3, [r9, #8]
	ldr	r1, [fp, #-48]
	mov	r0, r5
	ldr	r1, [r3, r1, lsl #2]
	ldr	r2, [r10]
	bl	write
	ldr	r3, [r10]
	cmp	r0, r3
	beq	.L14
	bl	pgstat_report_wait_end
	ldr	r3, [r8]
	ldr	r2, .L49+60
	cmp	r3, #0
	ldreq	r3, .L49+64
	ldr	r0, [r2]
	ldreq	r3, [r3]
	ldr	r1, .L49+28
	ldr	r2, .L49+32
	streq	r3, [r8]
	cmp	r4, #0
	str	r0, [r1]
	str	r3, [r2]
	beq	.L47
.L40:
	mov	r0, #0
	b	.L1
.L14:
	bl	pgstat_report_wait_end
	cmp	r4, #0
	beq	.L16
.L18:
	mov	r0, #1
	b	.L1
.L45:
	ldr	r0, [r4, #8]
	ldr	r1, [r4, #4]
	str	r5, [r0, r3, lsl #2]
	ldr	r3, [r4]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [r4]
	add	r3, r3, #1
	str	r3, [r4]
	b	.L10
.L46:
	ldr	r2, .L49+20
	ldr	r3, .L49+24
	ldr	ip, [r2]
	ldr	r1, .L49+28
	ldr	r2, [r3]
	ldr	r3, .L49+32
	mov	r0, r5
	str	ip, [r1]
	str	r2, [r3]
	bl	CloseTransientFile
	b	.L40
.L47:
	mov	r0, r5
	bl	CloseTransientFile
	mov	r0, r4
	b	.L1
.L16:
	ldr	r3, .L49+68
	ldr	r0, [r3]
	bl	pgstat_report_wait_start
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L17
	mov	r0, r5
	bl	pg_fsync
	cmp	r0, #0
	bne	.L48
.L17:
	bl	pgstat_report_wait_end
	mov	r0, r5
	bl	CloseTransientFile
	cmp	r0, #0
	beq	.L18
	ldr	r3, .L49+72
	ldr	r0, [r8]
	ldr	r2, [r3]
	ldr	r1, .L49+32
	ldr	r3, .L49+28
	str	r0, [r1]
	mov	r0, #0
	str	r2, [r3]
	b	.L1
.L48:
	bl	pgstat_report_wait_end
	ldr	r3, .L49+76
	ldr	ip, [r8]
	ldr	r2, [r3]
	ldr	r1, .L49+32
	ldr	r3, .L49+28
	mov	r0, r5
	str	ip, [r1]
	str	r2, [r3]
	bl	CloseTransientFile
	mov	r0, r4
	b	.L1
.L43:
	bl	__stack_chk_fail
.L50:
	.align	2
.L49:
	.word	SLRU_PAGES_PER_SEGMENT
	.word	.LC0
	.word	MAXPGPATH
	.word	BLCKSZ
	.word	SEEK_SET
	.word	SLRU_SEEK_FAILED
	.word	errno
	.word	slru_errcause
	.word	slru_errno
	.word	O_RDWR
	.word	O_CREAT
	.word	PG_BINARY
	.word	SLRU_OPEN_FAILED
	.word	MAX_FLUSH_BUFFERS
	.word	WAIT_EVENT_SLRU_WRITE
	.word	SLRU_WRITE_FAILED
	.word	ENOSPC
	.word	WAIT_EVENT_SLRU_SYNC
	.word	SLRU_CLOSE_FAILED
	.word	SLRU_FSYNC_FAILED
	.size	SlruPhysicalWritePage, .-SlruPhysicalWritePage
	.comm	slru_errno,4,4
	.comm	slru_errcause,4,4
	.comm	errno,4,4
	.comm	WAIT_EVENT_SLRU_WRITE,4,4
	.comm	WAIT_EVENT_SLRU_SYNC,4,4
	.comm	SLRU_WRITE_FAILED,4,4
	.comm	SLRU_SEEK_FAILED,4,4
	.comm	SLRU_PAGES_PER_SEGMENT,4,4
	.comm	SLRU_OPEN_FAILED,4,4
	.comm	SLRU_FSYNC_FAILED,4,4
	.comm	SLRU_CLOSE_FAILED,4,4
	.comm	SEEK_SET,4,4
	.comm	PG_BINARY,4,4
	.comm	O_RDWR,4,4
	.comm	O_CREAT,4,4
	.comm	MAX_FLUSH_BUFFERS,4,4
	.comm	MAXPGPATH,4,4
	.comm	ENOSPC,4,4
	.comm	BLCKSZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
