// File: /workspace/github_c_makefile_star2_O0/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
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1040
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x59be5(%rip), %rsi     # 0x5b004
callq 0x1070
cmpl $0x0, %eax
jne 0x1470
movq $0x0, -0x80(%rbp)
cmpq $0x50, -0x80(%rbp)
jae 0x145e
movq -0x80(%rbp), %rax
shlq %rax
cmpq -0x78(%rbp), %rax
jb 0x144e
movq -0x80(%rbp), %rax
movb $0x0, -0x70(%rbp,%rax)
jmp 0x1450
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1431
leaq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x18e0
jmp 0x15a2
movq -0x8(%rbp), %rdi
leaq 0x59b99(%rip), %rsi     # 0x5b014
callq 0x1070
cmpl $0x0, %eax
jne 0x1497
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1230
jmp 0x15a0
movq -0x8(%rbp), %rdi
leaq 0x59b78(%rip), %rsi     # 0x5b01a
callq 0x1070
cmpl $0x0, %eax
jne 0x14be
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11c0
jmp 0x159e
movq -0x8(%rbp), %rdi
leaq 0x59b64(%rip), %rsi     # 0x5b02d
callq 0x1070
cmpl $0x0, %eax
jne 0x14e5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12a0
jmp 0x159c
movq -0x8(%rbp), %rdi
leaq 0x59b33(%rip), %rsi     # 0x5b023
callq 0x1070
cmpl $0x0, %eax
jne 0x150c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1310
jmp 0x159a
movq -0x8(%rbp), %rdi
leaq 0x59b12(%rip), %rsi     # 0x5b029
callq 0x1070
cmpl $0x0, %eax
jne 0x1530
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1380
jmp 0x1598
movq -0x8(%rbp), %rdi
leaq 0x59ad3(%rip), %rsi     # 0x5b00e
callq 0x1070
cmpl $0x0, %eax
jne 0x157e
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %r8
movl $0x20, %r9d
movq %r9, %rsi
movq %r9, %rcx
movq $0x1, (%rsp)
movq $0x4, 0x8(%rsp)
movq $0x4, 0x10(%rsp)
callq 0x1ac0
jmp 0x1596
leaq 0x59aaf(%rip), %rdi     # 0x5b034
movb $0x0, %al
callq 0x1050
movl $0x1, %edi
callq 0x10b0
jmp 0x1598
jmp 0x159a
jmp 0x159c
jmp 0x159e
jmp 0x15a0
jmp 0x15a2
movq -0x8(%rbp), %rsi
leaq 0x59a9d(%rip), %rdi     # 0x5b04a
movb $0x0, %al
callq 0x1050
movl $0x0, -0x84(%rbp)
cmpl $0x20, -0x84(%rbp)
jge 0x15f5
movq -0x18(%rbp), %rax
movslq -0x84(%rbp), %rcx
movzbl (%rax,%rcx), %esi
leaq 0x59a7a(%rip), %rdi     # 0x5b057
movb $0x0, %al
callq 0x1050
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x15be
leaq 0x59a4c(%rip), %rdi     # 0x5b048
movb $0x0, %al
callq 0x1050
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)