	.file	"extr_machine_routines.c_platform_syscall.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	platform_syscall
	.type	platform_syscall, @function
platform_syscall:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	esi, 3
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	get_saved_state_reg@PLT
	cmp	eax, 2
	je	.L2
	jg	.L3
	test	eax, eax
	je	.L4
	cmp	eax, 1
	jne	.L6
	mov	esi, 1
	mov	rdi, rbp
	call	get_saved_state_reg@PLT
	xor	esi, esi
	mov	rdi, rbp
	mov	r12, rax
	call	get_saved_state_reg@PLT
	mov	rsi, r12
	mov	rdi, rax
	call	dcache_flush_trap@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	xor	eax, eax
	call	thread_exception_return@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	cmp	eax, 3
	jne	.L6
	xor	eax, eax
	call	thread_get_cthread_self@PLT
	xor	esi, esi
	mov	rdi, rbp
	mov	edx, eax
	call	set_saved_state_reg@PLT
	jmp	.L6
.L2:
	mov	rdi, rbp
	xor	esi, esi
	call	get_saved_state_reg@PLT
	mov	rdi, rax
	call	thread_set_cthread_self@PLT
	jmp	.L6
.L4:
	mov	rdi, rbp
	mov	esi, 1
	call	get_saved_state_reg@PLT
	xor	esi, esi
	mov	rdi, rbp
	mov	r12, rax
	call	get_saved_state_reg@PLT
	mov	rsi, r12
	mov	rdi, rax
	call	icache_invalidate_trap@PLT
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	platform_syscall, .-platform_syscall
	.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_machine_routines.c_platform_syscall.c"
	.text
	.align	2
	.global	platform_syscall
	.syntax unified
	.arm
	.fpu softvfp
	.type	platform_syscall, %function
platform_syscall:
	@ Volatile: function does not return.
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	mov	r1, #3
	mov	r4, r0
	bl	get_saved_state_reg
	cmp	r0, #3
	ldrls	pc, [pc, r0, asl #2]
	b	.L2
.L4:
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L7:
	mov	r1, #0
	mov	r0, r4
	bl	get_saved_state_reg
	mov	r1, #1
	mov	r5, r0
	mov	r0, r4
	bl	get_saved_state_reg
	mov	r1, r0
	mov	r0, r5
	bl	icache_invalidate_trap
.L2:
	bl	thread_exception_return
.L3:
	bl	thread_get_cthread_self
	mov	r1, #0
	mov	r2, r0
	mov	r0, r4
	bl	set_saved_state_reg
	b	.L2
.L6:
	mov	r1, #0
	mov	r0, r4
	bl	get_saved_state_reg
	mov	r1, #1
	mov	r5, r0
	mov	r0, r4
	bl	get_saved_state_reg
	mov	r1, r0
	mov	r0, r5
	bl	dcache_flush_trap
	b	.L2
.L5:
	mov	r1, #0
	mov	r0, r4
	bl	get_saved_state_reg
	bl	thread_set_cthread_self
	b	.L2
	.size	platform_syscall, .-platform_syscall
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
