#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*/ SHA256(char *, int /*<<< orphan*/, char *);
int SHA256_DIGEST_LENGTH;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main() {
  char *message = "136934373096c70ab05a922178e0668ba5402160d7";
  char buff[SHA256_DIGEST_LENGTH];
  SHA256(message, strlen(message), buff);
  write(0, buff, SHA256_DIGEST_LENGTH);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    %eax,%esi
call   1030 <SHA256@plt>
mov    -0x28(%rbp),%rsi
mov    0x2e3f(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1040 <write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2e9f(%rip),%r15
mov    (%r15),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea4(%rip),%r14
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <SHA256@plt>
mov    (%r15),%edx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <write@plt>
xor    %eax,%eax
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"136934373096c70ab05a922178e0668ba5402160d7\00"
@SHA256_DIGEST_LENGTH = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i32, i32* @SHA256_DIGEST_LENGTH
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @SHA256(i8* %9, i32 %11, i8* %8)
%13 = load i32, i32* @SHA256_DIGEST_LENGTH
%14 = call i32 @write(i32 0, i8* %8, i32 %13)
store i32 0, i32* %1
%15 = load i8*, i8** %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [43 x i8] c"136934373096c70ab05a922178e0668ba5402160d7\00"
@SHA256_DIGEST_LENGTH = global i32 0
define i32 @main() {
%1 = load i32, i32* @SHA256_DIGEST_LENGTH
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @SHA256(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %3)
%6 = load i32, i32* @SHA256_DIGEST_LENGTH
%7 = call i32 @write(i32 0, i8* %3, i32 %6)
ret i32 0
}