	.file	"extr_kern_sig.c_build_userspace_exit_reason.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"build_userspace_exit_reason: failed to allocate exit reason"
	.align 8
.LC1:
	.string	"build_userspace_exit_reason: illegal flags passed from userspace (some masked off) 0x%llx, ns: %u, code 0x%llx\n"
	.align 8
.LC2:
	.string	"build_userspace_exit_reason: exit reason with namespace %u, nonzero payload but zero length\n"
	.align 8
.LC3:
	.string	"build_userspace_exit_reason: failed to allocate signal reason buffer"
	.align 8
.LC4:
	.string	"build_userspace_exit_reason: failed to allocate space for reason string"
	.align 8
.LC5:
	.string	"build_userspace_exit_reason: failed to copy in payload data with error %d\n"
	.align 8
.LC6:
	.string	"build_userspace_exit_reason: failed to allocate space for payload data"
	.text
	.p2align 4
	.globl	build_userspace_exit_reason
	.type	build_userspace_exit_reason, @function
build_userspace_exit_reason:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, edi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r9d
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	QWORD PTR [rsp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	QWORD PTR 24[rsp], 0
	call	os_reason_create@PLT
	cmp	QWORD PTR OS_REASON_NULL[rip], rax
	mov	r12, rax
	je	.L44
	mov	edx, DWORD PTR OS_REASON_FLAG_MASK_ALLOWED_FROM_USER[rip]
	mov	eax, DWORD PTR OS_REASON_FLAG_FROM_USERSPACE[rip]
	and	edx, ebx
	or	eax, edx
	or	eax, DWORD PTR [r12]
	mov	DWORD PTR [r12], eax
	cmp	edx, ebx
	jne	.L45
	test	DWORD PTR OS_REASON_FLAG_NO_CRASH_REPORT[rip], eax
	je	.L46
.L5:
	mov	rax, QWORD PTR USER_ADDR_NULL[rip]
	cmp	rax, rbp
	je	.L6
	test	r13d, r13d
	je	.L47
	mov	edx, DWORD PTR EXIT_REASON_PAYLOAD_MAX_LEN[rip]
	cmp	edx, r13d
	jl	.L48
	cmp	rax, QWORD PTR [rsp]
	jne	.L9
.L42:
	mov	r8d, r13d
.L10:
	mov	esi, r8d
	mov	edi, 1
	mov	QWORD PTR 32[rsp], 0
	call	kcdata_estimate_required_buffer_size@PLT
	mov	rdi, r12
	mov	esi, eax
	call	os_reason_alloc_buffer@PLT
	test	eax, eax
	jne	.L49
	cmp	rbp, QWORD PTR USER_ADDR_NULL[rip]
	je	.L1
	xor	ebx, ebx
.L24:
	mov	esi, DWORD PTR EXIT_REASON_USER_PAYLOAD[rip]
	lea	rcx, 32[rsp]
	lea	rdi, 4[r12]
	mov	edx, r13d
	call	kcdata_get_memory_addr@PLT
	cmp	rax, QWORD PTR KERN_SUCCESS[rip]
	jne	.L20
	mov	rsi, QWORD PTR 32[rsp]
	mov	edx, r13d
	mov	rdi, rbp
	call	copyin@PLT
	test	eax, eax
	jne	.L50
	test	rbx, rbx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L51
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
.L47:
	.cfi_restore_state
	mov	esi, r15d
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	printf@PLT
	mov	eax, DWORD PTR OS_REASON_FLAG_BAD_PARAMS[rip]
	or	DWORD PTR [r12], eax
	mov	rbp, QWORD PTR USER_ADDR_NULL[rip]
.L6:
	cmp	QWORD PTR [rsp], rbp
	je	.L1
	mov	edi, DWORD PTR EXIT_REASON_USER_DESC_MAX_LEN[rip]
	call	kalloc@PLT
	mov	r15, rax
	test	rax, rax
	je	.L1
	xor	r14d, r14d
	xor	r8d, r8d
.L29:
	mov	edx, DWORD PTR EXIT_REASON_USER_DESC_MAX_LEN[rip]
	mov	rdi, QWORD PTR [rsp]
	mov	rsi, r15
	mov	rbx, r15
	lea	rcx, 24[rsp]
	mov	DWORD PTR 12[rsp], r8d
	call	copyinstr@PLT
	mov	r8d, DWORD PTR 12[rsp]
	test	eax, eax
	jne	.L11
	mov	esi, DWORD PTR 24[rsp]
	lea	edi, 1[r14]
	add	esi, r8d
.L12:
	mov	QWORD PTR 32[rsp], 0
	call	kcdata_estimate_required_buffer_size@PLT
	mov	rdi, r12
	mov	esi, eax
	call	os_reason_alloc_buffer@PLT
	test	eax, eax
	jne	.L52
	mov	rdx, QWORD PTR 24[rsp]
	test	rdx, rdx
	jne	.L53
.L18:
	cmp	QWORD PTR USER_ADDR_NULL[rip], rbp
	jne	.L24
.L23:
	mov	esi, DWORD PTR EXIT_REASON_USER_DESC_MAX_LEN[rip]
	mov	rdi, rbx
	call	kfree@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L46:
	or	eax, DWORD PTR OS_REASON_FLAG_GENERATE_CRASH_REPORT[rip]
	mov	DWORD PTR [r12], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L45:
	mov	ecx, r14d
	mov	edx, r15d
	mov	esi, ebx
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	printf@PLT
	mov	eax, DWORD PTR [r12]
	test	DWORD PTR OS_REASON_FLAG_NO_CRASH_REPORT[rip], eax
	jne	.L5
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L48:
	mov	ecx, DWORD PTR OS_REASON_FLAG_PAYLOAD_TRUNCATED[rip]
	mov	r13d, edx
	or	DWORD PTR [r12], ecx
	cmp	rax, QWORD PTR [rsp]
	je	.L42
.L9:
	mov	edi, DWORD PTR EXIT_REASON_USER_DESC_MAX_LEN[rip]
	call	kalloc@PLT
	mov	r15, rax
	test	rax, rax
	je	.L42
	mov	r8d, r13d
	mov	r14d, 1
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L44:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	cmp	DWORD PTR ENAMETOOLONG[rip], eax
	movsx	rsi, DWORD PTR EXIT_REASON_USER_DESC_MAX_LEN[rip]
	jne	.L13
	mov	BYTE PTR -1[r15+rsi], 0
	mov	esi, DWORD PTR 24[rsp]
	lea	edi, 1[r14]
	add	esi, r8d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L53:
	mov	esi, DWORD PTR EXIT_REASON_USER_DESC[rip]
	lea	r14, 4[r12]
	lea	rcx, 32[rsp]
	mov	rdi, r14
	call	kcdata_get_memory_addr@PLT
	cmp	rax, QWORD PTR KERN_SUCCESS[rip]
	jne	.L19
	mov	rcx, QWORD PTR 24[rsp]
	mov	rsi, QWORD PTR 32[rsp]
	mov	rdx, r15
	mov	rdi, r14
	call	kcdata_memcpy@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L22:
	test	rbx, rbx
	je	.L16
.L17:
	mov	esi, DWORD PTR EXIT_REASON_USER_DESC_MAX_LEN[rip]
	mov	rdi, rbx
	call	kfree@PLT
	mov	QWORD PTR 24[rsp], 0
.L16:
	mov	eax, DWORD PTR OS_REASON_FLAG_FAILED_DATA_COPYIN[rip]
	or	DWORD PTR [r12], eax
	xor	esi, esi
	mov	rdi, r12
	call	os_reason_alloc_buffer@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L49:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR OS_REASON_FLAG_FAILED_DATA_COPYIN[rip]
	or	DWORD PTR [r12], eax
	mov	rdi, r15
	mov	DWORD PTR [rsp], r8d
	call	kfree@PLT
	test	r14d, r14d
	mov	r8d, DWORD PTR [rsp]
	mov	QWORD PTR 24[rsp], 0
	jne	.L10
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L50:
	mov	esi, eax
	lea	rdi, .LC5[rip]
	xor	eax, eax
	call	printf@PLT
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L52:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	jmp	.L17
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	build_userspace_exit_reason, .-build_userspace_exit_reason
	.comm	USER_ADDR_NULL,8,8
	.comm	OS_REASON_NULL,8,8
	.comm	OS_REASON_FLAG_PAYLOAD_TRUNCATED,4,4
	.comm	OS_REASON_FLAG_NO_CRASH_REPORT,4,4
	.comm	OS_REASON_FLAG_MASK_ALLOWED_FROM_USER,4,4
	.comm	OS_REASON_FLAG_GENERATE_CRASH_REPORT,4,4
	.comm	OS_REASON_FLAG_FROM_USERSPACE,4,4
	.comm	OS_REASON_FLAG_FAILED_DATA_COPYIN,4,4
	.comm	OS_REASON_FLAG_BAD_PARAMS,4,4
	.comm	KERN_SUCCESS,8,8
	.comm	EXIT_REASON_USER_PAYLOAD,4,4
	.comm	EXIT_REASON_USER_DESC_MAX_LEN,4,4
	.comm	EXIT_REASON_USER_DESC,4,4
	.comm	EXIT_REASON_PAYLOAD_MAX_LEN,4,4
	.comm	ENAMETOOLONG,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_kern_sig.c_build_userspace_exit_reason.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"build_userspace_exit_reason: failed to allocate exi"
	.ascii	"t reason\000"
	.align	2
.LC1:
	.ascii	"build_userspace_exit_reason: illegal flags passed f"
	.ascii	"rom userspace (some masked off) 0x%llx, ns: %u, cod"
	.ascii	"e 0x%llx\012\000"
	.align	2
.LC2:
	.ascii	"build_userspace_exit_reason: exit reason with names"
	.ascii	"pace %u, nonzero payload but zero length\012\000"
	.align	2
.LC3:
	.ascii	"build_userspace_exit_reason: failed to allocate sig"
	.ascii	"nal reason buffer\000"
	.align	2
.LC4:
	.ascii	"build_userspace_exit_reason: failed to allocate spa"
	.ascii	"ce for reason string\000"
	.align	2
.LC5:
	.ascii	"build_userspace_exit_reason: failed to copy in payl"
	.ascii	"oad data with error %d\012\000"
	.align	2
.LC6:
	.ascii	"build_userspace_exit_reason: failed to allocate spa"
	.ascii	"ce for payload data\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	build_userspace_exit_reason
	.syntax unified
	.arm
	.fpu softvfp
	.type	build_userspace_exit_reason, %function
build_userspace_exit_reason:
	@ args = 8, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r3
	ldr	r3, .L56
	sub	sp, sp, #28
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r5, r2
	mov	r8, r0
	mov	r7, r1
	ldr	r10, [sp, #64]
	ldr	r9, [sp, #68]
	str	ip, [sp, #12]
	bl	os_reason_create
	ldr	r3, .L56+4
	mov	r4, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L47
	ldr	r2, .L56+8
	ldr	r3, .L56+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r0]
	and	r2, r2, r9
	orr	r3, r2, r3
	orr	r3, r3, r1
	cmp	r2, r9
	str	r3, [r0]
	bne	.L48
.L4:
	ldr	r2, .L56+16
	ldr	r7, .L56+20
	ldr	r2, [r2]
	tst	r3, r2
	ldreq	r2, .L56+24
	ldreq	r2, [r2]
	orreq	r3, r2, r3
	streq	r3, [r4]
	ldr	r3, [r7]
	cmp	r3, r5
	beq	.L6
	cmp	r6, #0
	beq	.L49
	ldr	r2, .L56+28
	ldr	r2, [r2]
	cmp	r2, r6
	blt	.L50
	cmp	r3, r10
	bne	.L9
.L44:
	mov	fp, r6
.L10:
	mov	r3, #0
	mov	r1, fp
	mov	r0, #1
	str	r3, [sp, #16]
	bl	kcdata_estimate_required_buffer_size
	mov	r1, r0
	mov	r0, r4
	bl	os_reason_alloc_buffer
	subs	r10, r0, #0
	bne	.L51
	ldr	r3, [r7]
	cmp	r5, r3
	beq	.L1
.L24:
	ldr	r2, .L56+32
	add	r3, sp, #16
	ldr	r1, [r2]
	add	r0, r4, #4
	mov	r2, r6
	bl	kcdata_get_memory_addr
	ldr	r3, .L56+36
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L20
	ldr	r1, [sp, #16]
	mov	r2, r6
	mov	r0, r5
	bl	copyin
	subs	r1, r0, #0
	bne	.L52
	cmp	r10, #0
	beq	.L1
	ldr	r9, .L56+40
.L23:
	mov	r0, r10
	ldr	r1, [r9]
	bl	kfree
.L1:
	ldr	r3, .L56
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L53
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L49:
	mov	r1, r8
	ldr	r0, .L56+44
	bl	printf
	ldr	r2, .L56+48
	ldr	r3, [r4]
	ldr	r2, [r2]
	ldr	r5, [r7]
	orr	r3, r3, r2
	str	r3, [r4]
.L6:
	cmp	r10, r5
	beq	.L1
	ldr	r9, .L56+40
	ldr	r0, [r9]
	bl	kalloc
	subs	r8, r0, #0
	beq	.L1
	mov	r3, #0
	mov	fp, r3
	str	r3, [sp, #4]
.L29:
	mov	r0, r10
	mov	r1, r8
	ldr	r2, [r9]
	add	r3, sp, #12
	bl	copyinstr
	cmp	r0, #0
	mov	r10, r8
	beq	.L45
	ldr	r3, .L56+52
	ldr	r1, [r9]
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L13
	mov	r3, #0
	add	r1, r8, r1
	strb	r3, [r1, #-1]
.L45:
	ldr	r3, [sp, #4]
	ldr	r1, [sp, #12]
	add	r0, r3, #1
	mov	r3, #0
	add	r1, fp, r1
	str	r3, [sp, #16]
	bl	kcdata_estimate_required_buffer_size
	mov	r1, r0
	mov	r0, r4
	bl	os_reason_alloc_buffer
	cmp	r0, #0
	bne	.L54
	ldr	r2, [sp, #12]
	cmp	r2, #0
	bne	.L55
.L18:
	ldr	r3, [r7]
	cmp	r3, r5
	beq	.L23
	b	.L24
.L48:
	mov	r3, r7
	mov	r1, r9
	mov	r2, r8
	ldr	r0, .L56+56
	bl	printf
	ldr	r3, [r4]
	b	.L4
.L50:
	ldr	r1, .L56+60
	mov	r6, r2
	ldr	r1, [r1]
	ldr	r2, [r4]
	cmp	r3, r10
	orr	r2, r2, r1
	str	r2, [r4]
	beq	.L44
.L9:
	ldr	r9, .L56+40
	ldr	r0, [r9]
	bl	kalloc
	subs	r8, r0, #0
	beq	.L44
	mov	r3, #1
	mov	fp, r6
	str	r3, [sp, #4]
	b	.L29
.L47:
	ldr	r0, .L56+64
	bl	puts
	b	.L1
.L55:
	ldr	r3, .L56+68
	add	fp, r4, #4
	ldr	r1, [r3]
	mov	r0, fp
	add	r3, sp, #16
	bl	kcdata_get_memory_addr
	ldr	r3, .L56+36
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L19
	mov	r2, r8
	mov	r0, fp
	ldr	r3, [sp, #12]
	ldr	r1, [sp, #16]
	bl	kcdata_memcpy
	b	.L18
.L20:
	ldr	r0, .L56+72
	bl	puts
.L22:
	cmp	r10, #0
	beq	.L16
	ldr	r9, .L56+40
.L17:
	mov	r0, r10
	ldr	r1, [r9]
	bl	kfree
	mov	r3, #0
	str	r3, [sp, #12]
.L16:
	ldr	r2, .L56+76
	ldr	r3, [r4]
	ldr	r2, [r2]
	mov	r1, #0
	orr	r3, r3, r2
	mov	r0, r4
	str	r3, [r4]
	bl	os_reason_alloc_buffer
	b	.L1
.L51:
	ldr	r0, .L56+80
	bl	puts
	b	.L16
.L13:
	ldr	r2, .L56+76
	ldr	r3, [r4]
	ldr	r2, [r2]
	mov	r0, r8
	orr	r3, r3, r2
	str	r3, [r4]
	bl	kfree
	mov	r3, #0
	ldr	r2, [sp, #4]
	str	r3, [sp, #12]
	cmp	r2, r3
	bne	.L10
	b	.L1
.L19:
	ldr	r0, .L56+84
	bl	puts
	b	.L17
.L52:
	ldr	r0, .L56+88
	bl	printf
	b	.L22
.L54:
	ldr	r0, .L56+80
	bl	puts
	b	.L17
.L53:
	bl	__stack_chk_fail
.L57:
	.align	2
.L56:
	.word	.LC7
	.word	OS_REASON_NULL
	.word	OS_REASON_FLAG_MASK_ALLOWED_FROM_USER
	.word	OS_REASON_FLAG_FROM_USERSPACE
	.word	OS_REASON_FLAG_NO_CRASH_REPORT
	.word	USER_ADDR_NULL
	.word	OS_REASON_FLAG_GENERATE_CRASH_REPORT
	.word	EXIT_REASON_PAYLOAD_MAX_LEN
	.word	EXIT_REASON_USER_PAYLOAD
	.word	KERN_SUCCESS
	.word	EXIT_REASON_USER_DESC_MAX_LEN
	.word	.LC2
	.word	OS_REASON_FLAG_BAD_PARAMS
	.word	ENAMETOOLONG
	.word	.LC1
	.word	OS_REASON_FLAG_PAYLOAD_TRUNCATED
	.word	.LC0
	.word	EXIT_REASON_USER_DESC
	.word	.LC6
	.word	OS_REASON_FLAG_FAILED_DATA_COPYIN
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	build_userspace_exit_reason, .-build_userspace_exit_reason
	.comm	USER_ADDR_NULL,4,4
	.comm	OS_REASON_NULL,4,4
	.comm	OS_REASON_FLAG_PAYLOAD_TRUNCATED,4,4
	.comm	OS_REASON_FLAG_NO_CRASH_REPORT,4,4
	.comm	OS_REASON_FLAG_MASK_ALLOWED_FROM_USER,4,4
	.comm	OS_REASON_FLAG_GENERATE_CRASH_REPORT,4,4
	.comm	OS_REASON_FLAG_FROM_USERSPACE,4,4
	.comm	OS_REASON_FLAG_FAILED_DATA_COPYIN,4,4
	.comm	OS_REASON_FLAG_BAD_PARAMS,4,4
	.comm	KERN_SUCCESS,4,4
	.comm	EXIT_REASON_USER_PAYLOAD,4,4
	.comm	EXIT_REASON_USER_DESC_MAX_LEN,4,4
	.comm	EXIT_REASON_USER_DESC,4,4
	.comm	EXIT_REASON_PAYLOAD_MAX_LEN,4,4
	.comm	ENAMETOOLONG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
