# 1 "build/bootblock/bootblock.S"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "./build/config.h" 1
# 1 "<command-line>" 2
# 1 "build/bootblock/bootblock.S"
# 1 "build/config.h" 1
# 2 "build/bootblock/bootblock.S" 2
# 1 "./src/arch/x86/init/prologue.inc" 1
# 20 "./src/arch/x86/init/prologue.inc"
# 1 "src/include/cpu/x86/post_code.h" 1

# 1 "src/include/console/post_codes.h" 1
# 3 "src/include/cpu/x86/post_code.h" 2
# 21 "./src/arch/x86/init/prologue.inc" 2
# 1 "src/include/cpu/x86/stack.h" 1
# 22 "./src/arch/x86/init/prologue.inc" 2

.section ".rom.data", "a", @progbits
.section ".rom.text", "ax", @progbits



 movb $0x01, %al; outb %al, $0x80
# 3 "build/bootblock/bootblock.S" 2
# 1 "./src/cpu/x86/16bit/entry16.inc" 1
# 29 "./src/cpu/x86/16bit/entry16.inc"
# 1 "src/arch/x86/include/arch/rom_segs.h" 1
# 30 "./src/cpu/x86/16bit/entry16.inc" 2
.code16
.globl _start
.type _start, @function

_start:
 cli

 movl %eax, %ebp







 xorl %eax, %eax
 movl %eax, %cr3
# 94 "./src/cpu/x86/16bit/entry16.inc"
 movw %cs, %ax
 shlw $4, %ax
 movw $gdtptr16_offset, %bx
 subw %ax, %bx
 data32 lgdt %cs:(%bx)

 movl %cr0, %eax
 andl $0x7FFAFFD1, %eax
 orl $0x60000001, %eax
 movl %eax, %cr0


 movl %ebp, %eax


 data32 ljmp $0x08, $__protected_start





.align 4
.globl gdtptr16
gdtptr16:
 .word gdt_end - gdt -1
 .long gdt

.globl _estart
_estart:
 .code32
# 4 "build/bootblock/bootblock.S" 2
# 1 "./src/cpu/x86/16bit/reset16.inc" 1
 .section ".reset"
 .code16
.globl reset_vector
reset_vector:
 .byte 0xe9
 .int _start - ( . + 2 )






 . = 0x8;
 .code32
 jmp protected_start
 .previous
# 5 "build/bootblock/bootblock.S" 2
# 1 "./src/cpu/x86/32bit/entry32.inc" 1



# 1 "src/include/cpu/x86/post_code.h" 1
# 5 "./src/cpu/x86/32bit/entry32.inc" 2

 .code32







 .align 4
.globl gdtptr
gdt:
gdtptr:
 .word gdt_end - gdt -1
 .long gdt
 .word 0


 .word 0xffff, 0x0000
 .byte 0x00, 0x9b, 0xcf, 0x00


 .word 0xffff, 0x0000
 .byte 0x00, 0x93, 0xcf, 0x00

gdt_end:
# 44 "./src/cpu/x86/32bit/entry32.inc"
 .align 4
.globl protected_start
protected_start:

 lgdt %cs:gdtptr
 ljmp $0x08, $__protected_start

__protected_start:

 movl %eax, %ebp

 movb $0x10, %al; outb %al, $0x80

 movw $0x10, %ax
 movw %ax, %ds
 movw %ax, %es
 movw %ax, %ss
 movw %ax, %fs
 movw %ax, %gs


 movl %ebp, %eax
# 6 "build/bootblock/bootblock.S" 2
# 1 "./src/arch/x86/lib/id.inc" 1
 .section ".id", "a", @progbits

 .globl __id_start
__id_start:
vendor:
 .asciz "AMD"
part:
 .asciz "Persimmon"
.long __id_end + 0x10 - vendor
.long __id_end + 0x10 - part
.long 0x400000
 .globl __id_end

__id_end:
.previous
# 7 "build/bootblock/bootblock.S" 2
# 1 "./build/mainboard/amd/persimmon/bootblock.inc" 1
.section ".rom.data"
.balign 16
L1:
.int 0xff, 0, 0, 0
L2:
.int 0xffff, 0, 0, 0
.section ".rom.text"

L1001:
L1002:

.section ".rom.data"
.balign 1
L1003:
.byte 0x66
.byte 0x61
.byte 0x6c
.byte 0x6c
.byte 0x62
.byte 0x61
.byte 0x63
.byte 0x6b
.byte 0x2f
.byte 0x72
.byte 0x6f
.byte 0x6d
.byte 0x73
.byte 0x74
.byte 0x61
.byte 0x67
.byte 0x65
.byte 0x00
.section ".rom.text"


#ASM

#NOT ASM

 mov %eax, %ebp







 mov $27 , %ecx
 rdmsr
# 58 "./build/mainboard/amd/persimmon/bootblock.inc"
 and $256 , %eax

 test %eax, %eax
 jz L1005
L1004:
# 78 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-2147441852 , %eax
 mov $3320 , %dx
 outl %eax, %dx
# 90 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $3324 , %dx
 inl %dx, %eax
# 112 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-2147441852 , %eax
 mov $3320 , %dx
 outl %eax, %dx
# 124 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-1 , %eax
 mov $3324 , %dx
 outl %eax, %dx
# 142 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-2147441848 , %eax
 mov $3320 , %dx
 outl %eax, %dx
# 154 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $3324 , %dx
 inl %dx, %eax





 or $2097235 , %eax
 mov %eax, %esp
# 178 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-2147441848 , %eax
 mov $3320 , %dx
 outl %eax, %dx
# 190 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $3324 , %dx
 mov %esp, %eax
 outl %eax, %dx
# 208 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-2147441812 , %eax
 mov $3320 , %dx
 outl %eax, %dx
# 220 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $3324 , %dx
 inw %dx, %ax
# 238 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $-2147441812 , %eax
 mov $3320 , %dx
 outl %eax, %dx
# 250 "./build/mainboard/amd/persimmon/bootblock.inc"
 mov $65472 , %ax
 mov $3324 , %dx
 outw %ax, %dx

L1005:






 mov $L1003+0 , %esi
#ASM
 mov $1f, %esp
 jmp walkcbfs_asm
 1:

#NOT ASM




 mov %eax, %esp




 add $4 , %esp




 movl (%esp), %esp

 test %esp, %esp
 jz L1007
L1006:




 mov %ebp, %eax
#ASM
 jmp *%esp

#NOT ASM

L1007:

#ASM
 1:
 hlt
 jmp 1b

#NOT ASM





#ASM

#NOT ASM
# 8 "build/bootblock/bootblock.S" 2
# 1 "./src/arch/x86/lib/walkcbfs.S" 1
# 24 "./src/arch/x86/lib/walkcbfs.S"
walkcbfs_asm:
 cld

 mov 0xfffffffc, %eax
 mov ((0 + 4) + 4)(%eax), %ecx
 bswap %ecx
 mov $0, %ebx
 sub %ecx, %ebx
 mov (((((0 + 4) + 4) + 4) + 4) + 4)(%eax), %ecx
 bswap %ecx
 add %ecx, %ebx


 mov $0, %eax
1:
 cmpb $0, (%eax,%esi)
 jz 2f
 add $1, %eax
 jmp 1b
2:
 add $1, %eax
walker:
 mov 0(%ebx), %edi
 cmp %edi, filemagic
 jne searchfile
 mov 4(%ebx), %edi
 cmp %edi, filemagic+4
 jne searchfile


 mov %ebx, %edi
 add $(((((0 + 8) + 4) + 4) + 4) + 4), %edi
 mov %eax, %ecx
 repe cmpsb

 jnz tryharder


 mov ((((0 + 8) + 4) + 4) + 4)(%ebx), %eax
 bswap %eax
 add %ebx, %eax
 jmp *%esp

tryharder:
 sub %ebx, %edi
 sub $(((((0 + 8) + 4) + 4) + 4) + 4), %edi
 sub %edi, %esi


 mov ((((0 + 8) + 4) + 4) + 4)(%ebx), %ecx
 bswap %ecx
 add %ebx, %ecx
 mov (0 + 8)(%ebx), %edi
 bswap %edi
 add %edi, %ecx
 mov 0xfffffffc, %edi
 mov ((((0 + 4) + 4) + 4) + 4)(%edi), %edi
 bswap %edi
 sub $1, %edi
 add %edi, %ecx
 not %edi
 and %edi, %ecx


 cmp %ebx, %ecx
 jbe out

 mov %ecx, %ebx

check_for_exit:

 mov 0xfffffffc, %ecx
 mov (((0 + 4) + 4) + 4)(%ecx), %ecx
 bswap %ecx
 not %ecx
 add $1, %ecx

 cmp %ecx, %ebx

 jbe walker

out:
 mov $0, %eax
 jmp *%esp


searchfile:

 mov 0xfffffffc, %edi
 mov ((((0 + 4) + 4) + 4) + 4)(%edi), %edi
 bswap %edi
 add %edi, %ebx
 jmp check_for_exit

filemagic:
 .ascii "LARCHIVE"
# 8 "build/bootblock/bootblock.S" 2
