	.file	"extr_dasd_eer.c_dasd_eer_start_record.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dasd_eer_start_record, @function
dasd_eer_start_record:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movsx	rax, esi
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	add	rax, 4
	sub	rsp, 40
	.cfi_def_cfa_offset 64
	movsx	rdx, DWORD PTR [rdi]
	mov	DWORD PTR 12[rsp], esi
	mov	rbx, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rbx
	xor	ebx, ebx
	lea	rbx, 20[rsp]
	cmp	rax, rdx
	jbe	.L6
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR 4[rbp]
	test	eax, eax
	jle	.L4
	add	eax, DWORD PTR 8[rbp]
	mov	ecx, DWORD PTR 0[rbp]
	mov	DWORD PTR 4[rbp], -1
	mov	edx, eax
	sub	edx, ecx
	cmp	eax, ecx
	cmovge	eax, edx
	mov	DWORD PTR 8[rbp], eax
.L4:
	mov	edx, 4
	mov	rsi, rbx
	mov	rdi, rbp
	call	dasd_eer_read_buffer@PLT
	mov	ecx, DWORD PTR 0[rbp]
	mov	eax, DWORD PTR 20[rsp]
	add	eax, DWORD PTR 8[rbp]
	mov	edx, eax
	sub	edx, ecx
	cmp	eax, ecx
	cmovge	eax, edx
	mov	DWORD PTR 8[rbp], eax
.L6:
	mov	rdi, rbp
	call	dasd_eer_get_free_bytes@PLT
	movsx	rdx, DWORD PTR 12[rsp]
	cdqe
	add	rdx, 4
	cmp	rax, rdx
	jb	.L7
	lea	rsi, 12[rsp]
	mov	edx, 4
	mov	rdi, rbp
	call	dasd_eer_write_buffer@PLT
	xor	eax, eax
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L15
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	dasd_eer_start_record, .-dasd_eer_start_record
	.comm	ENOMEM,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_dasd_eer.c_dasd_eer_start_record.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dasd_eer_start_record, %function
dasd_eer_start_record:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, lr}
	ldr	r2, [r0]
	add	r3, r1, #4
	sub	sp, sp, #20
	cmp	r3, r2
	ldr	r3, .L15
	str	r1, [sp, #4]
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bhi	.L11
	mov	r4, r0
	mvn	r5, #0
	b	.L6
.L7:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	ble	.L4
	ldr	r1, [r4, #8]
	ldr	r2, [r4]
	add	r3, r3, r1
	cmp	r3, r2
	str	r3, [r4, #8]
	subge	r3, r3, r2
	strge	r3, [r4, #8]
	str	r5, [r4, #4]
.L4:
	mov	r2, #4
	add	r1, sp, #8
	mov	r0, r4
	bl	dasd_eer_read_buffer
	ldr	r3, [r4, #8]
	ldr	r1, [sp, #8]
	ldr	r2, [r4]
	add	r3, r3, r1
	cmp	r3, r2
	str	r3, [r4, #8]
	subge	r3, r3, r2
	strge	r3, [r4, #8]
.L6:
	mov	r0, r4
	bl	dasd_eer_get_free_bytes
	ldr	r3, [sp, #4]
	add	r3, r3, #4
	cmp	r0, r3
	bcc	.L7
	mov	r2, #4
	mov	r0, r4
	add	r1, sp, r2
	bl	dasd_eer_write_buffer
	mov	r0, #0
.L1:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, pc}
.L11:
	ldr	r3, .L15+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	ENOMEM
	.size	dasd_eer_start_record, .-dasd_eer_start_record
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
