
.intel_syntax noprefix

.global BackPatch

.extern OutputByte


.SECTION .text
	.ALIGN	16

BackPatch:
	push	rsi
	push	rdi
	push	rbx
	push	rbp
	mov	rbp, rsp
	sub	rsp, 40
	mov	rsi, rcx
	mov	rbx, qword ptr [rsi+0x70]
$_001:	test	rbx, rbx
	je	$_027
	cmp	byte ptr [rbx+0x19], 0
	je	$_026
	mov	rax, qword ptr [rsi+0x40]
	test	rax, rax
	je	$_026
	cmp	qword ptr [rbx+0x28], rax
	jne	$_026
	xor	edi, edi
	movzx	ecx, byte ptr [rbx+0x18]
	jmp	$_009

$_002:	cmp	byte ptr [rsi+0x1E], 130
	jnz	$_003
	cmp	byte ptr [rbx+0x19], 5
	jnz	$_003
	or	byte ptr [r14+0x370], 0x01
	inc	dword ptr [rsi+0x30]
	xor	ecx, ecx
	call	OutputByte@PLT
$_003:	jmp	$_026

$_004:	cmp	byte ptr [rbx+0x19], 6
	jnz	$_005
	inc	edi
$_005:	jmp	$_010

$_006:	mov	rcx, qword ptr [rbx+0x30]
	mov	eax, dword ptr [rbx+0x10]
	add	eax, dword ptr [rcx+0x30]
	sub	eax, dword ptr [rbx+0x14]
	sub	eax, 2
	cmp	eax, 127
	jg	$_007
	cmp	eax, -128
	jge	$_008
$_007:	inc	edi
$_008:	jmp	$_010

$_009:	cmp	ecx, 3
	jz	$_002
	cmp	ecx, 2
	jz	$_002
	cmp	ecx, 4
	jz	$_004
	cmp	ecx, 1
	jz	$_006
$_010:	test	edi, edi
	je	$_026
	xor	edi, edi
	jmp	$_025

$_011:	jmp	$_026

$_012:	inc	edi
$_013:	inc	edi
$_014:	or	byte ptr [r14+0x370], 0x01
	mov	rdx, qword ptr [rsi+0x40]
	mov	rdx, qword ptr [rdx+0x78]
	cmp	byte ptr [rdx+0x1D], 0
	jz	$_015
	add	edi, 2
$_015:	inc	edi
	mov	eax, dword ptr [rbx+0x14]
	mov	rcx, qword ptr [rdx+0x28]
$_016:	test	rcx, rcx
	jz	$_018
	test	byte ptr [rcx+0x1B], 0x02
	jz	$_017
	or	byte ptr [r14+0x370], 0x02
	jmp	$_026

$_017:	cmp	eax, dword ptr [rcx+0x14]
	jnc	$_018
	mov	rcx, qword ptr [rcx+0x8]
	jmp	$_016

$_018:	mov	rcx, qword ptr [rdx+0x20]
$_019:	test	rcx, rcx
	jz	$_020
	cmp	eax, dword ptr [rcx+0x30]
	jge	$_020
	add	dword ptr [rcx+0x30], edi
	mov	rcx, qword ptr [rcx+0x80]
	jmp	$_019

$_020:	mov	rcx, qword ptr [rdx+0x28]
$_021:	test	rcx, rcx
	jz	$_023
	cmp	rsi, qword ptr [rcx+0x30]
	jz	$_022
	cmp	eax, dword ptr [rcx+0x14]
	jnc	$_023
	add	dword ptr [rcx+0x14], edi
$_022:	mov	rcx, qword ptr [rcx+0x8]
	jmp	$_021

$_023:	test	edi, edi
	jz	$_024
	mov	ecx, 204
	call	OutputByte@PLT
	dec	edi
	jmp	$_023

$_024:	jmp	$_026

$_025:	cmp	byte ptr [rbx+0x19], 2
	je	$_011
	cmp	byte ptr [rbx+0x19], 3
	je	$_012
	cmp	byte ptr [rbx+0x19], 4
	je	$_013
	jmp	$_014

$_026:	mov	rbx, qword ptr [rbx]
	jmp	$_001

$_027:
	leave
	pop	rbx
	pop	rdi
	pop	rsi
	ret


.SECTION .data
	.ALIGN	16


.att_syntax prefix
