// File: /workspace/github_c_makefile_star2_O1/rb-de0[P]hashverifier-for-monacoin/main.c
// Function: print_hash
void print_hash(char* algorithm, char* input, char* output) {

    char input_lyra2re2[80];
    size_t input_length = strlen(input);

    if (strcmp(algorithm, "lyra2rev2") == 0) {

         for (size_t count = 0; count < sizeof(input_lyra2re2) / sizeof(*input_lyra2re2); count++) {
            if (count * 2 >= input_length) {
                input_lyra2re2[count] = 0x00;
            } 
        }

        lyra2re2_hash(input_lyra2re2, output);

    } else if (strcmp(algorithm, "blake") == 0) {
        blake256(input, output);
    } else if (strcmp(algorithm, "cubehash") == 0) {
        cubehash256(input, output);
    } else if (strcmp(algorithm, "keccak") == 0) {
        keccak256(input, output);
    } else if (strcmp(algorithm, "skein") == 0) {
        skein256(input, output);
    } else if (strcmp(algorithm, "bmw") == 0) {
        bmw256(input, output);
    } else if (strcmp(algorithm, "lyra2") == 0) {
        LYRA2(output, 32, input, 32, input, 32, 1, 4, 4);
    } else {
        printf("Algorithum not found\n");
        exit(1);
    }

    printf("%s result : ", algorithm);

    for(int i = 0; i < 32; i++) {
        printf("%02x", (unsigned char)output[i]);
    }

    printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1060
movq %rax, %r12
leaq 0x20c14(%rip), %rsi     # 0x22004
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x14bb
leaq 0x20c0d(%rip), %rsi     # 0x22014
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x14e7
leaq 0x20bfc(%rip), %rsi     # 0x2201a
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x14f4
leaq 0x20bf8(%rip), %rsi     # 0x2202d
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x1501
leaq 0x20bd7(%rip), %rsi     # 0x22023
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x150e
leaq 0x20bc6(%rip), %rsi     # 0x22029
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x151b
leaq 0x20b94(%rip), %rsi     # 0x2200e
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
jne 0x1570
subq $0x8, %rsp
movl $0x4, %eax
movl $0x20, %esi
movl $0x20, %ecx
movl $0x20, %r9d
movq %rbx, %rdi
movq %r15, %rdx
movq %r15, %r8
pushq %rax
pushq %rax
pushq $0x1
callq 0x18e8
addq $0x20, %rsp
jmp 0x1526
leaq -0x70(%rbp), %rax
xorl %ecx, %ecx
cmpq %r12, %rcx
jb 0x14c9
movb $0x0, (%rax)
addq $0x2, %rcx
incq %rax
cmpq $0xa0, %rcx
jne 0x14c1
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x177f
jmp 0x1526
movq %r15, %rdi
movq %rbx, %rsi
callq 0x123e
jmp 0x1526
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11dc
jmp 0x1526
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12a0
jmp 0x1526
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1302
jmp 0x1526
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1364
leaq 0x20b07(%rip), %rdi     # 0x22034
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0x20b03(%rip), %r14     # 0x22041
xorl %r15d, %r15d
movzbl (%rbx,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
incq %r15
cmpq $0x20, %r15
jne 0x1541
movl $0xa, %edi
callq 0x1040
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20ad5(%rip), %rdi     # 0x2204c
callq 0x1050
movl $0x1, %edi
callq 0x10d0