#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 */
typedef unsigned char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int /*<<< orphan*/ sha256_loc(unsigned char const *, unsigned int *,
                              unsigned int *);
void data_pkg(const uint8_t *data, uint8_t *out) {
  uint8_t work[44];
  uint8_t *t;
  unsigned int per_a[3];
  unsigned int per_b[3];
  sha256_loc(data, per_a, per_b);
  memcpy(work, data, 32);
  memcpy(work + 32, data + 52, 12);
  t = out + 12;
  memcpy(t, work + 32, 12);
  memcpy(t + 12 + 0, (unsigned char *)&per_a[1], 4);
  memcpy(t + 12 + 4, (unsigned char *)&per_a[0], 4);
  memcpy(t + 12 + 8, (unsigned char *)&per_b[2], 4);
  memcpy(t + 12 + 12, (unsigned char *)&per_b[1], 4);
  memcpy(t + 12 + 16, (unsigned char *)&per_b[0], 4);
  memcpy(t + 12 + 20, work, 32);
  memcpy(t + 12 + 52, (unsigned char *)&per_a[2], 4);
  out[0] = 0x11;
  out[1] = 0x11;
  out[2] = 0x11;
  out[3] = 0x11;
  out[4] = 0x1;
  out[5] = 0x0;
  out[6] = 0x0;
  out[7] = 0x0;
  out[8] = 0x0;
  out[9] = 0x0;
  out[10] = 0x0;
  out[11] = 0x0;
  out[80] = 0x0;
  out[81] = 0x0;
  out[82] = 0x0;
  out[83] = 0x0;
  out[84] = 0xaa;
  out[85] = 0xaa;
  out[86] = 0xaa;
  out[87] = 0xaa;
}


x86 assembly (clang, -O0):
<data_pkg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1040 <sha256_loc@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
add    $0x20,%rdi
mov    -0x8(%rbp),%rsi
add    $0x34,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
lea    -0x40(%rbp),%rsi
add    $0x20,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
lea    -0x54(%rbp),%rsi
add    $0x4,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
add    $0x4,%rdi
lea    -0x54(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
add    $0x8,%rdi
lea    -0x60(%rbp),%rsi
add    $0x8,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
add    $0xc,%rdi
lea    -0x60(%rbp),%rsi
add    $0x4,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
add    $0x10,%rdi
lea    -0x60(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
add    $0x14,%rdi
lea    -0x40(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    -0x48(%rbp),%rdi
add    $0xc,%rdi
add    $0x34,%rdi
lea    -0x54(%rbp),%rsi
add    $0x8,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movb   $0x11,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x11,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x11,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x11,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x5(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x6(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x7(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x9(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0xa(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0xb(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x50(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x51(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x52(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x53(%rax)
mov    -0x10(%rbp),%rax
movb   $0xaa,0x54(%rax)
mov    -0x10(%rbp),%rax
movb   $0xaa,0x55(%rax)
mov    -0x10(%rbp),%rax
movb   $0xaa,0x56(%rax)
mov    -0x10(%rbp),%rax
movb   $0xaa,0x57(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_pkg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0x14(%rsp),%r12
lea    0x8(%rsp),%r14
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <sha256_loc@plt>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x40(%rsp),%rbp
add    $0x34,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
lea    0xc(%r13),%rdi
mov    %rbp,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
lea    0x18(%r13),%rdi
lea    0x18(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x1c(%r13),%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x20(%r13),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x24(%r13),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x28(%r13),%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x2c(%r13),%rdi
mov    %r15,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x4c(%r13),%rdi
lea    0x1c(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movl   $0x11111111,0x0(%r13)
11
movb   $0x1,0x4(%r13)
movl   $0x0,0x5(%r13)
movl   $0x0,0x8(%r13)
movabs $0xaaaaaaaa00000000,%rax
aa aa aa
mov    %rax,0x50(%r13)
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @data_pkg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [44 x i8]
%6 = alloca i8*
%7 = alloca [3 x i32]
%8 = alloca [3 x i32]
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%12 = call i32 @sha256_loc(i8* %9, i32* %10, i32* %11)
%13 = getelementptr inbounds [44 x i8], [44 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %3
%15 = call i32 @memcpy(i8* %13, i8* %14, i32 32)
%16 = getelementptr inbounds [44 x i8], [44 x i8]* %5, i64 0, i64 0
%17 = getelementptr inbounds i8, i8* %16, i64 32
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 52
%20 = call i32 @memcpy(i8* %17, i8* %19, i32 12)
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 12
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = getelementptr inbounds [44 x i8], [44 x i8]* %5, i64 0, i64 0
%25 = getelementptr inbounds i8, i8* %24, i64 32
%26 = call i32 @memcpy(i8* %23, i8* %25, i32 12)
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i64 12
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
%31 = bitcast i32* %30 to i8*
%32 = call i32 @memcpy(i8* %29, i8* %31, i32 4)
%33 = load i8*, i8** %6
%34 = getelementptr inbounds i8, i8* %33, i64 12
%35 = getelementptr inbounds i8, i8* %34, i64 4
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%37 = bitcast i32* %36 to i8*
%38 = call i32 @memcpy(i8* %35, i8* %37, i32 4)
%39 = load i8*, i8** %6
%40 = getelementptr inbounds i8, i8* %39, i64 12
%41 = getelementptr inbounds i8, i8* %40, i64 8
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 2
%43 = bitcast i32* %42 to i8*
%44 = call i32 @memcpy(i8* %41, i8* %43, i32 4)
%45 = load i8*, i8** %6
%46 = getelementptr inbounds i8, i8* %45, i64 12
%47 = getelementptr inbounds i8, i8* %46, i64 12
%48 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
%49 = bitcast i32* %48 to i8*
%50 = call i32 @memcpy(i8* %47, i8* %49, i32 4)
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i64 12
%53 = getelementptr inbounds i8, i8* %52, i64 16
%54 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%55 = bitcast i32* %54 to i8*
%56 = call i32 @memcpy(i8* %53, i8* %55, i32 4)
%57 = load i8*, i8** %6
%58 = getelementptr inbounds i8, i8* %57, i64 12
%59 = getelementptr inbounds i8, i8* %58, i64 20
%60 = getelementptr inbounds [44 x i8], [44 x i8]* %5, i64 0, i64 0
%61 = call i32 @memcpy(i8* %59, i8* %60, i32 32)
%62 = load i8*, i8** %6
%63 = getelementptr inbounds i8, i8* %62, i64 12
%64 = getelementptr inbounds i8, i8* %63, i64 52
%65 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
%66 = bitcast i32* %65 to i8*
%67 = call i32 @memcpy(i8* %64, i8* %66, i32 4)
%68 = load i8*, i8** %4
%69 = getelementptr inbounds i8, i8* %68, i64 0
store i8 17, i8* %69
%70 = load i8*, i8** %4
%71 = getelementptr inbounds i8, i8* %70, i64 1
store i8 17, i8* %71
%72 = load i8*, i8** %4
%73 = getelementptr inbounds i8, i8* %72, i64 2
store i8 17, i8* %73
%74 = load i8*, i8** %4
%75 = getelementptr inbounds i8, i8* %74, i64 3
store i8 17, i8* %75
%76 = load i8*, i8** %4
%77 = getelementptr inbounds i8, i8* %76, i64 4
store i8 1, i8* %77
%78 = load i8*, i8** %4
%79 = getelementptr inbounds i8, i8* %78, i64 5
store i8 0, i8* %79
%80 = load i8*, i8** %4
%81 = getelementptr inbounds i8, i8* %80, i64 6
store i8 0, i8* %81
%82 = load i8*, i8** %4
%83 = getelementptr inbounds i8, i8* %82, i64 7
store i8 0, i8* %83
%84 = load i8*, i8** %4
%85 = getelementptr inbounds i8, i8* %84, i64 8
store i8 0, i8* %85
%86 = load i8*, i8** %4
%87 = getelementptr inbounds i8, i8* %86, i64 9
store i8 0, i8* %87
%88 = load i8*, i8** %4
%89 = getelementptr inbounds i8, i8* %88, i64 10
store i8 0, i8* %89
%90 = load i8*, i8** %4
%91 = getelementptr inbounds i8, i8* %90, i64 11
store i8 0, i8* %91
%92 = load i8*, i8** %4
%93 = getelementptr inbounds i8, i8* %92, i64 80
store i8 0, i8* %93
%94 = load i8*, i8** %4
%95 = getelementptr inbounds i8, i8* %94, i64 81
store i8 0, i8* %95
%96 = load i8*, i8** %4
%97 = getelementptr inbounds i8, i8* %96, i64 82
store i8 0, i8* %97
%98 = load i8*, i8** %4
%99 = getelementptr inbounds i8, i8* %98, i64 83
store i8 0, i8* %99
%100 = load i8*, i8** %4
%101 = getelementptr inbounds i8, i8* %100, i64 84
store i8 -86, i8* %101
%102 = load i8*, i8** %4
%103 = getelementptr inbounds i8, i8* %102, i64 85
store i8 -86, i8* %103
%104 = load i8*, i8** %4
%105 = getelementptr inbounds i8, i8* %104, i64 86
store i8 -86, i8* %105
%106 = load i8*, i8** %4
%107 = getelementptr inbounds i8, i8* %106, i64 87
store i8 -86, i8* %107
ret void
}

LLVM IR (-O2):
define void @data_pkg(i8* %0, i8* %1) {
%3 = alloca [44 x i8]
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = getelementptr inbounds [44 x i8], [44 x i8]* %3, i64 0, i64 0
%7 = bitcast [3 x i32]* %4 to i8*
%8 = bitcast [3 x i32]* %5 to i8*
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%11 = call i32 @sha256_loc(i8* %0, i32* %9, i32* %10)
%12 = call i32 @memcpy(i8* %6, i8* %0, i32 32)
%13 = getelementptr inbounds [44 x i8], [44 x i8]* %3, i64 0, i64 32
%14 = getelementptr inbounds i8, i8* %0, i64 52
%15 = call i32 @memcpy(i8* %13, i8* %14, i32 12)
%16 = getelementptr inbounds i8, i8* %1, i64 12
%17 = call i32 @memcpy(i8* %16, i8* %13, i32 12)
%18 = getelementptr inbounds i8, i8* %1, i64 24
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%20 = bitcast i32* %19 to i8*
%21 = call i32 @memcpy(i8* %18, i8* %20, i32 4)
%22 = getelementptr inbounds i8, i8* %1, i64 28
%23 = call i32 @memcpy(i8* %22, i8* %7, i32 4)
%24 = getelementptr inbounds i8, i8* %1, i64 32
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%26 = bitcast i32* %25 to i8*
%27 = call i32 @memcpy(i8* %24, i8* %26, i32 4)
%28 = getelementptr inbounds i8, i8* %1, i64 36
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%30 = bitcast i32* %29 to i8*
%31 = call i32 @memcpy(i8* %28, i8* %30, i32 4)
%32 = getelementptr inbounds i8, i8* %1, i64 40
%33 = call i32 @memcpy(i8* %32, i8* %8, i32 4)
%34 = getelementptr inbounds i8, i8* %1, i64 44
%35 = call i32 @memcpy(i8* %34, i8* %6, i32 32)
%36 = getelementptr inbounds i8, i8* %1, i64 76
%37 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%38 = bitcast i32* %37 to i8*
%39 = call i32 @memcpy(i8* %36, i8* %38, i32 4)
%40 = getelementptr inbounds i8, i8* %1, i64 4
%41 = bitcast i8* %1 to i32*
store i32 286331153, i32* %41
store i8 1, i8* %40
%42 = getelementptr inbounds i8, i8* %1, i64 5
%43 = getelementptr inbounds i8, i8* %1, i64 80
%44 = getelementptr inbounds i8, i8* %1, i64 84
%45 = bitcast i8* %43 to i32*
store i32 0, i32* %45
%46 = bitcast i8* %44 to i32*
store i32 -1431655766, i32* %46
ret void
}