	.file	"extr_common.c_tomoyo_write_profile.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"COMMENT"
.LC1:
	.string	"%u"
	.text
	.p2align 4
	.type	tomoyo_write_profile, @function
tomoyo_write_profile:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	esi, 45
	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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rbp, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	rdi, rbp
	call	strchr@PLT
	test	rax, rax
	je	.L2
	mov	BYTE PTR [rax], 0
	mov	rdi, rbp
	lea	rdx, 16[rsp]
	mov	esi, 10
	mov	rbx, rax
	lea	rbp, 1[rbx]
	call	strict_strtoul@PLT
	test	rax, rax
	jne	.L27
.L20:
	mov	rdi, QWORD PTR 16[rsp]
	call	tomoyo_find_or_assign_new_profile@PLT
	mov	r12, rax
	test	rax, rax
	je	.L27
	mov	esi, 61
	mov	rdi, rbp
	call	strchr@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L27
	mov	BYTE PTR [rax], 0
	lea	rsi, .LC0[rip]
	mov	rdi, rbp
	call	strcmp@PLT
	test	rax, rax
	je	.L30
	mov	eax, DWORD PTR TOMOYO_MAX_CONTROL_INDEX[rip]
	xor	r13d, r13d
	test	eax, eax
	je	.L27
.L10:
	mov	r14d, r13d
	mov	rax, QWORD PTR tomoyo_control_array[rip]
	mov	rdi, rbp
	mov	r15, r14
	sal	r15, 4
	mov	rsi, QWORD PTR [rax+r15]
	call	strcmp@PLT
	test	rax, rax
	jne	.L31
	add	rbx, 1
	lea	rdx, 12[rsp]
	lea	rsi, .LC1[rip]
	mov	rdi, rbx
	call	sscanf@PLT
	cmp	eax, 1
	je	.L11
	cmp	r13d, 128
	mov	r13, QWORD PTR tomoyo_mode_2[rip]
	cmovne	r13, QWORD PTR tomoyo_mode_4[rip]
	xor	ebp, ebp
.L15:
	mov	rsi, QWORD PTR 0[r13+rbp*8]
	mov	rdi, rbx
	call	strcmp@PLT
	test	rax, rax
	jne	.L32
.L17:
	mov	rax, QWORD PTR [r12]
	mov	DWORD PTR [rax+r14*4], ebp
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	add	rbp, 1
	cmp	rbp, 4
	jne	.L15
	.p2align 4,,10
	.p2align 3
.L27:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L33
	add	rsp, 40
	.cfi_remember_state
	.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
.L2:
	.cfi_restore_state
	lea	rdx, 16[rsp]
	mov	esi, 10
	mov	rdi, rbp
	call	strict_strtoul@PLT
	test	rax, rax
	je	.L20
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L31:
	add	r13d, 1
	cmp	DWORD PTR TOMOYO_MAX_CONTROL_INDEX[rip], r13d
	ja	.L10
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L30:
	lea	rdi, 1[rbx]
	call	tomoyo_save_name@PLT
	test	rax, rax
	je	.L34
	mov	QWORD PTR 8[r12], rax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR tomoyo_control_array[rip]
	mov	ebp, DWORD PTR 12[rsp]
	cmp	DWORD PTR 8[rax+r15], ebp
	cmovbe	ebp, DWORD PTR 8[rax+r15]
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L34:
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tomoyo_write_profile, .-tomoyo_write_profile
	.comm	tomoyo_mode_4,8,8
	.comm	tomoyo_mode_2,8,8
	.comm	tomoyo_control_array,8,8
	.comm	TOMOYO_MAX_CONTROL_INDEX,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_common.c_tomoyo_write_profile.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"COMMENT\000"
	.align	2
.LC1:
	.ascii	"%u\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tomoyo_write_profile, %function
tomoyo_write_profile:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, [r0]
	ldr	r3, .L34
	sub	sp, sp, #28
	mov	r1, #45
	mov	r0, r6
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	strchr
	subs	r4, r0, #0
	beq	.L2
	mov	r3, #0
	mov	r0, r6
	mov	r1, #10
	strb	r3, [r4]
	add	r2, sp, #16
	bl	strict_strtoul
	cmp	r0, #0
	addeq	r6, r4, #1
	bne	.L27
	ldr	r0, [sp, #16]
	bl	tomoyo_find_or_assign_new_profile
	subs	r8, r0, #0
	beq	.L27
.L5:
	mov	r1, #61
	mov	r0, r6
	bl	strchr
	subs	r7, r0, #0
	beq	.L27
	mov	r5, #0
	mov	r0, r6
	ldr	r1, .L34+4
	strb	r5, [r7]
	bl	strcmp
	subs	r4, r0, #0
	beq	.L31
	ldr	r3, .L34+8
	ldr	r9, [r3]
	cmp	r9, #0
	beq	.L27
	ldr	fp, .L34+12
	ldr	r10, [fp]
.L10:
	mov	r0, r6
	ldr	r1, [r10, r5, lsl #3]
	bl	strcmp
	subs	r4, r0, #0
	lsl	r3, r5, #3
	beq	.L9
	add	r5, r5, #1
	cmp	r9, r5
	bne	.L10
.L27:
	ldr	r3, .L34+16
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L1:
	ldr	r3, .L34
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L32
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r1, #10
	mov	r0, r6
	add	r2, sp, #16
	bl	strict_strtoul
	cmp	r0, #0
	bne	.L27
	ldr	r0, [sp, #16]
	bl	tomoyo_find_or_assign_new_profile
	subs	r8, r0, #0
	bne	.L5
	b	.L27
.L9:
	add	r7, r7, #1
	mov	r0, r7
	ldr	r1, .L34+20
	add	r2, sp, #12
	str	r3, [sp, #4]
	bl	sscanf
	cmp	r0, #1
	ldr	r3, [sp, #4]
	beq	.L12
	mov	r9, #0
	cmp	r5, #128
	ldreq	r3, .L34+24
	ldrne	r3, .L34+28
	ldr	r6, [r3]
	sub	r6, r6, #4
.L16:
	mov	r0, r7
	ldr	r1, [r6, #4]!
	bl	strcmp
	cmp	r0, #0
	mov	r3, r9
	bne	.L33
.L15:
	ldr	r2, [r8]
	str	r3, [r2, r5, lsl #2]
	b	.L1
.L12:
	ldr	r2, [fp]
	ldr	r1, [sp, #12]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	cmp	r3, r1
	movcs	r3, r1
	b	.L15
.L31:
	add	r0, r7, #1
	bl	tomoyo_save_name
	cmp	r0, #0
	ldreq	r3, .L34+32
	strne	r0, [r8, #4]
	ldreq	r4, [r3]
	rsbeq	r4, r4, #0
	b	.L1
.L33:
	add	r9, r9, #1
	cmp	r9, #4
	beq	.L27
	b	.L16
.L32:
	bl	__stack_chk_fail
.L35:
	.align	2
.L34:
	.word	.LC2
	.word	.LC0
	.word	TOMOYO_MAX_CONTROL_INDEX
	.word	tomoyo_control_array
	.word	EINVAL
	.word	.LC1
	.word	tomoyo_mode_2
	.word	tomoyo_mode_4
	.word	ENOMEM
	.size	tomoyo_write_profile, .-tomoyo_write_profile
	.comm	tomoyo_mode_4,4,4
	.comm	tomoyo_mode_2,4,4
	.comm	tomoyo_control_array,4,4
	.comm	TOMOYO_MAX_CONTROL_INDEX,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
