	.file	"extr_ucode.c_copyin_update.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	copyin_update, @function
copyin_update:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	edx, 4
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	lea	rsi, 12[rsp]
	call	copyin@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	r13d, DWORD PTR 12[rsp]
	cmp	r13d, 1048575
	jg	.L9
	test	r13d, r13d
	mov	eax, 2048
	lea	rsi, 16[rsp]
	mov	ecx, DWORD PTR VM_KERN_MEMORY_OSFMK[rip]
	cmove	r13d, eax
	mov	edi, DWORD PTR kernel_map[rip]
	mov	edx, r13d
	call	kmem_alloc_kobject@PLT
	cmp	QWORD PTR KERN_SUCCESS[rip], rax
	je	.L5
.L9:
	mov	r12d, DWORD PTR ENOMEM[rip]
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L11
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rsi, QWORD PTR 16[rsp]
	mov	edx, r13d
	mov	edi, ebx
	call	copyin@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L12
	mov	rax, QWORD PTR 16[rsp]
	mov	QWORD PTR global_update[rip], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	esi, DWORD PTR 16[rsp]
	mov	edi, DWORD PTR kernel_map[rip]
	mov	edx, r13d
	call	kmem_free@PLT
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	copyin_update, .-copyin_update
	.comm	kernel_map,4,4
	.comm	global_update,8,8
	.comm	VM_KERN_MEMORY_OSFMK,4,4
	.comm	KERN_SUCCESS,8,8
	.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_ucode.c_copyin_update.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	copyin_update, %function
copyin_update:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r2, #4
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L13
	sub	sp, sp, #20
	add	r1, sp, r2
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r6, r0
	bl	copyin
	subs	r4, r0, #0
	bne	.L1
	ldr	r5, [sp, #4]
	cmp	r5, #1048576
	bge	.L9
	cmp	r5, #0
	moveq	r5, #2048
	ldr	r3, .L13+4
	ldr	r7, .L13+8
	ldr	r3, [r3]
	mov	r2, r5
	ldr	r0, [r7]
	add	r1, sp, #8
	bl	kmem_alloc_kobject
	ldr	r3, .L13+12
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L5
.L9:
	ldr	r3, .L13+16
	ldr	r4, [r3]
.L1:
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L5:
	mov	r0, r6
	mov	r2, r5
	ldr	r1, [sp, #8]
	bl	copyin
	subs	r4, r0, #0
	ldreq	r3, .L13+20
	ldreq	r2, [sp, #8]
	streq	r2, [r3]
	beq	.L1
.L12:
	mov	r2, r5
	ldr	r0, [r7]
	ldr	r1, [sp, #8]
	bl	kmem_free
	b	.L1
.L11:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	VM_KERN_MEMORY_OSFMK
	.word	kernel_map
	.word	KERN_SUCCESS
	.word	ENOMEM
	.word	global_update
	.size	copyin_update, .-copyin_update
	.comm	kernel_map,4,4
	.comm	global_update,4,4
	.comm	VM_KERN_MEMORY_OSFMK,4,4
	.comm	KERN_SUCCESS,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
