#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ EVP_sha1();
int /*<<< orphan*/ EVP_sha224();
int /*<<< orphan*/ EVP_sha256();
int /*<<< orphan*/ EVP_sha384();
int /*<<< orphan*/ EVP_sha512();
int /*<<< orphan*/ emit_length_test(char *, int /*<<< orphan*/, int);
int main(void) {
  emit_length_test("SHA1", EVP_sha1(), 1024);
  emit_length_test("SHA224", EVP_sha224(), 1024);
  emit_length_test("SHA256", EVP_sha256(), 1024);
  emit_length_test("SHA384", EVP_sha384(), 1024);
  emit_length_test("SHA512", EVP_sha512(), 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <EVP_sha1@plt>
mov    %eax,%esi
lea    0xe81(%rip),%rdi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
mov    $0x0,%al
call   1030 <EVP_sha224@plt>
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
mov    $0x0,%al
call   1080 <EVP_sha256@plt>
mov    %eax,%esi
lea    0xe59(%rip),%rdi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
mov    $0x0,%al
call   1070 <EVP_sha384@plt>
mov    %eax,%esi
lea    0xe46(%rip),%rdi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
mov    $0x0,%al
call   1040 <EVP_sha512@plt>
mov    %eax,%esi
lea    0xe33(%rip),%rdi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <EVP_sha1@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
xor    %eax,%eax
call   1030 <EVP_sha224@plt>
lea    0xe7c(%rip),%rdi
mov    %eax,%esi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
xor    %eax,%eax
call   1080 <EVP_sha256@plt>
lea    0xe69(%rip),%rdi
mov    %eax,%esi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
xor    %eax,%eax
call   1070 <EVP_sha384@plt>
lea    0xe56(%rip),%rdi
mov    %eax,%esi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
xor    %eax,%eax
call   1040 <EVP_sha512@plt>
lea    0xe43(%rip),%rdi
mov    %eax,%esi
mov    $0x400,%edx
call   1060 <emit_length_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"SHA1\00"
@.str.1 = [7 x i8] c"SHA224\00"
@.str.2 = [7 x i8] c"SHA256\00"
@.str.3 = [7 x i8] c"SHA384\00"
@.str.4 = [7 x i8] c"SHA512\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @EVP_sha1()
%3 = call i32 @emit_length_test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1024)
%4 = call i32 (...) @EVP_sha224()
%5 = call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 1024)
%6 = call i32 (...) @EVP_sha256()
%7 = call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 1024)
%8 = call i32 (...) @EVP_sha384()
%9 = call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 1024)
%10 = call i32 (...) @EVP_sha512()
%11 = call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 1024)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"SHA1\00"
@.str.1 = [7 x i8] c"SHA224\00"
@.str.2 = [7 x i8] c"SHA256\00"
@.str.3 = [7 x i8] c"SHA384\00"
@.str.4 = [7 x i8] c"SHA512\00"
define i32 @main() {
%1 = tail call i32 (...) @EVP_sha1()
%2 = tail call i32 @emit_length_test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i32 1024)
%3 = tail call i32 (...) @EVP_sha224()
%4 = tail call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 1024)
%5 = tail call i32 (...) @EVP_sha256()
%6 = tail call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 1024)
%7 = tail call i32 (...) @EVP_sha384()
%8 = tail call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 1024)
%9 = tail call i32 (...) @EVP_sha512()
%10 = tail call i32 @emit_length_test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 1024)
ret i32 0
}