// File: khedoros[P]khednes/cpu2.cpp
// Function: cpu::stat_string(cpu::statreg_t)
char * cpu::stat_string(statreg_t status) {
    if(util::is_active(ORIGIN)) {
        for(int i=0;i<9;++i) {
            st[i]=0;
        }
        strncat(st,((status.sign)?"N":"n"),1);
        strncat(st,((status.verflow)?"V":"v"),1);        
        strncat(st,((status.tru)?"T":"t"),1);        
        strncat(st,((status.brk)?"B":"b"),1);        
        strncat(st,((status.dec)?"D":"d"),1);        
        strncat(st,((status.inter)?"I":"i"),1);        
        strncat(st,((status.zero)?"Z":"z"),1);        
        strncat(st,((status.carry)?"C":"c"),1);        
    }
    return st;
}

// Assembly:
subq $0xa8, %rsp
movl %esi, 0xa4(%rsp)
movq %rdi, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movl $0x1, %edi
callq 0x20db0
testb $0x1, %al
jne 0x191f9
jmp 0x194f1
movl $0x0, 0x94(%rsp)
cmpl $0x9, 0x94(%rsp)
jge 0x19239
movq 0x88(%rsp), %rax
movslq 0x94(%rsp), %rcx
movb $0x0, 0x4c7(%rax,%rcx)
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x19204
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x80(%rsp)
movb 0xa4(%rsp), %al
shrb $0x7, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1926f
leaq 0x132f3(%rip), %rax     # 0x2c55b
movq %rax, 0x78(%rsp)
jmp 0x1927d
leaq 0x132e7(%rip), %rax     # 0x2c55d
movq %rax, 0x78(%rsp)
jmp 0x1927d
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x70(%rsp)
movb 0xa4(%rsp), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x192c9
leaq 0x13a46(%rip), %rax     # 0x2cd08
movq %rax, 0x68(%rsp)
jmp 0x192d7
leaq 0x1328f(%rip), %rax     # 0x2c55f
movq %rax, 0x68(%rsp)
jmp 0x192d7
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x60(%rsp)
movb 0xa4(%rsp), %al
shrb $0x5, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x19320
leaq 0x1396f(%rip), %rax     # 0x2cc88
movq %rax, 0x58(%rsp)
jmp 0x1932e
leaq 0x1256a(%rip), %rax     # 0x2b891
movq %rax, 0x58(%rsp)
jmp 0x1932e
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x50(%rsp)
movb 0xa4(%rsp), %al
shrb $0x4, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x19377
leaq 0x131f1(%rip), %rax     # 0x2c561
movq %rax, 0x48(%rsp)
jmp 0x19385
leaq 0x131e5(%rip), %rax     # 0x2c563
movq %rax, 0x48(%rsp)
jmp 0x19385
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x40(%rsp)
movb 0xa4(%rsp), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x193ce
leaq 0x13211(%rip), %rax     # 0x2c5d8
movq %rax, 0x38(%rsp)
jmp 0x193dc
leaq 0x11fba(%rip), %rax     # 0x2b38f
movq %rax, 0x38(%rsp)
jmp 0x193dc
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x30(%rsp)
movb 0xa4(%rsp), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x19425
leaq 0x138ae(%rip), %rax     # 0x2cccc
movq %rax, 0x28(%rsp)
jmp 0x19433
leaq 0x13139(%rip), %rax     # 0x2c565
movq %rax, 0x28(%rsp)
jmp 0x19433
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x20(%rsp)
movb 0xa4(%rsp), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1947b
leaq 0x130f3(%rip), %rax     # 0x2c567
movq %rax, 0x18(%rsp)
jmp 0x19489
leaq 0x130e7(%rip), %rax     # 0x2c569
movq %rax, 0x18(%rsp)
jmp 0x19489
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
movq %rax, 0x10(%rsp)
movb 0xa4(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x194cf
leaq 0x13868(%rip), %rax     # 0x2cd30
movq %rax, 0x8(%rsp)
jmp 0x194dd
leaq 0x13095(%rip), %rax     # 0x2c56b
movq %rax, 0x8(%rsp)
jmp 0x194dd
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl $0x1, %edx
callq 0x4290
movq 0x88(%rsp), %rax
addq $0x4c7, %rax            # imm = 0x4C7
addq $0xa8, %rsp
retq
nopw (%rax,%rax)