	.file	"extr_subr_log.c_log_setsize.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"log_setsize: unable to allocate memory"
	.align 8
.LC1:
	.string	"log_setsize(%d): old_logdata %p old_logsize %d old_bufr %d old_bufx %d\n"
	.align 8
.LC2:
	.string	"log_setsize(%d): new_logdata %p new_logsize %d new_bufr %d new_bufx %d\n"
	.align 8
.LC3:
	.string	"set system log size to %d bytes\n"
	.text
	.p2align 4
	.globl	log_setsize
	.type	log_setsize, @function
log_setsize:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	DWORD PTR MAX_MSG_BSIZE[rip], edi
	jl	.L21
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	eax, DWORD PTR EINVAL[rip]
	test	edi, edi
	jle	.L1
	call	kalloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L22
	mov	esi, ebp
	mov	rdi, rax
	call	bzero@PLT
	xor	eax, eax
	call	LOG_LOCK@PLT
	mov	rax, QWORD PTR msgbufp[rip]
	mov	esi, ebp
	lea	rdi, .LC1[rip]
	mov	ebx, DWORD PTR 20[rax]
	mov	r14d, DWORD PTR [rax]
	mov	r13, QWORD PTR 8[rax]
	mov	r15d, DWORD PTR 16[rax]
	mov	r9d, ebx
	mov	ecx, r14d
	mov	r8d, r15d
	mov	rdx, r13
	call	LOG_SETSIZE_DEBUG@PLT
	cmp	ebp, ebx
	jg	.L6
	movsx	rax, ebp
	movsx	rcx, ebx
	movsx	rdi, r14d
	sub	rcx, rax
	mov	eax, ebp
	add	rcx, r13
.L7:
	add	rdi, r13
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L10:
	cmp	rdi, rcx
	cmovbe	rcx, r13
	mov	rsi, rcx
	lea	rcx, 1[rcx]
	movzx	esi, BYTE PTR [rsi]
	mov	BYTE PTR [r12+rdx], sil
	add	rdx, 1
	cmp	eax, edx
	jg	.L10
	test	eax, eax
	mov	r9d, 1
	cmovg	r9d, eax
	cmp	r9d, ebp
	jl	.L11
.L8:
	xor	r9d, r9d
.L11:
	sub	ebx, r15d
	mov	r8d, r9d
	mov	rax, QWORD PTR msgbufp[rip]
	mov	ecx, ebp
	lea	edx, [rbx+r14]
	mov	esi, ebp
	lea	rdi, .LC2[rip]
	cmovs	ebx, edx
	mov	DWORD PTR 20[rax], r9d
	mov	DWORD PTR [rax], ebp
	sub	r8d, ebx
	mov	QWORD PTR 8[rax], r12
	lea	edx, [r8+rbp]
	cmovs	r8d, edx
	mov	rdx, r12
	mov	DWORD PTR 16[rax], r8d
	call	LOG_SETSIZE_DEBUG@PLT
	xor	eax, eax
	call	LOG_UNLOCK@PLT
	mov	esi, r14d
	mov	rdi, r13
	call	bzero@PLT
	cmp	QWORD PTR smsg_bufc[rip], r13
	je	.L14
	mov	esi, r14d
	mov	rdi, r13
	call	kfree@PLT
.L14:
	mov	esi, ebp
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	printf@PLT
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	mov	eax, DWORD PTR EINVAL[rip]
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_def_cfa_offset 64
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	mov	esi, r14d
	mov	edi, ebp
	call	MIN@PLT
	test	eax, eax
	jle	.L8
	mov	edx, eax
	movsx	rdi, r14d
	sub	edx, ebx
	mov	rcx, rdi
	movsx	rdx, edx
	sub	rcx, rdx
	add	rcx, r13
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	log_setsize, .-log_setsize
	.comm	smsg_bufc,8,8
	.comm	msgbufp,8,8
	.comm	MAX_MSG_BSIZE,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_subr_log.c_log_setsize.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"log_setsize: unable to allocate memory\000"
	.align	2
.LC1:
	.ascii	"log_setsize(%d): old_logdata %p old_logsize %d old_"
	.ascii	"bufr %d old_bufx %d\012\000"
	.align	2
.LC2:
	.ascii	"log_setsize(%d): new_logdata %p new_logsize %d new_"
	.ascii	"bufr %d new_bufx %d\012\000"
	.align	2
.LC3:
	.ascii	"set system log size to %d bytes\012\000"
	.text
	.align	2
	.global	log_setsize
	.syntax unified
	.arm
	.fpu softvfp
	.type	log_setsize, %function
log_setsize:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L23
	ldr	r3, [r3]
	cmp	r3, r0
	blt	.L21
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r0, #0
	mov	r4, r0
	sub	sp, sp, #8
	ble	.L4
	bl	kalloc
	subs	r5, r0, #0
	beq	.L22
	ldr	r10, .L23+4
	mov	r1, r4
	bl	bzero
	bl	LOG_LOCK
	ldr	r3, [r10]
	mov	r1, r4
	ldmib	r3, {r6, r9}
	ldr	r7, [r3, #12]
	ldr	r8, [r3]
	mov	r2, r6
	mov	r3, r8
	ldr	r0, .L23+8
	str	r7, [sp, #4]
	str	r9, [sp]
	bl	LOG_SETSIZE_DEBUG
	cmp	r4, r7
	bgt	.L6
	mov	r0, r4
	sub	r3, r7, r4
	add	r3, r6, r3
.L7:
	mov	r2, #0
	add	ip, r6, r8
.L10:
	cmp	ip, r3
	movls	r3, r6
	ldrb	r1, [r3], #1	@ zero_extendqisi2
	strb	r1, [r5, r2]
	add	r2, r2, #1
	cmp	r2, r0
	blt	.L10
	cmp	r0, #1
	movlt	r0, #1
	cmp	r0, r4
	blt	.L11
.L8:
	mov	r0, #0
.L11:
	subs	r7, r7, r9
	addmi	r7, r7, r8
	subs	r7, r0, r7
	ldr	r3, [r10]
	addmi	r7, r7, r4
	str	r0, [r3, #12]
	stm	r3, {r4, r5, r7}
	mov	r2, r5
	mov	r3, r4
	mov	r1, r4
	str	r0, [sp, #4]
	str	r7, [sp]
	ldr	r0, .L23+12
	bl	LOG_SETSIZE_DEBUG
	bl	LOG_UNLOCK
	mov	r1, r8
	mov	r0, r6
	bl	bzero
	ldr	r3, .L23+16
	ldr	r3, [r3]
	cmp	r3, r6
	beq	.L14
	mov	r1, r8
	mov	r0, r6
	bl	kfree
.L14:
	mov	r1, r4
	ldr	r0, .L23+20
	bl	printf
	mov	r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	ldr	r3, .L23+24
	ldr	r0, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L21:
	ldr	r3, .L23+24
	ldr	r0, [r3]
	bx	lr
.L6:
	mov	r1, r8
	mov	r0, r4
	bl	MIN
	cmp	r0, #0
	ble	.L8
	sub	r3, r0, r7
	sub	r3, r8, r3
	add	r3, r6, r3
	b	.L7
.L22:
	ldr	r0, .L23+28
	bl	puts
	ldr	r3, .L23+32
	ldr	r0, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L24:
	.align	2
.L23:
	.word	MAX_MSG_BSIZE
	.word	msgbufp
	.word	.LC1
	.word	.LC2
	.word	smsg_bufc
	.word	.LC3
	.word	EINVAL
	.word	.LC0
	.word	ENOMEM
	.size	log_setsize, .-log_setsize
	.comm	smsg_bufc,4,4
	.comm	msgbufp,4,4
	.comm	MAX_MSG_BSIZE,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
