#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 decrypt_byte(unsigned int *);
int /*<<< orphan*/ init_keys(char const *, unsigned int *,
                             unsigned int const *);
int rand();
int /*<<< orphan*/ srand(unsigned int);
unsigned long time(int /*<<< orphan*/ *);
int /*<<< orphan*/ update_keys(unsigned int *, unsigned int const *, int);
int crypthead(const char *passwd, unsigned char *buf, int bufSize,
              unsigned int *pkeys, const unsigned int *pcrc_32_tab,
              unsigned int crcForCrypting) {
  int n;
  int t;
  int c;
  unsigned char header[12 - 2];
  static unsigned calls = 0;
  if (bufSize < 12)
    return 0;
  if (++calls == 1) {
    srand((unsigned)(time(NULL) ^ 3141592654UL));
  }
  init_keys(passwd, pkeys, pcrc_32_tab);
  for (n = 0; n < 12 - 2; n++) {
    c = (rand() >> 7) & 0xff;
    header[n] = (unsigned char)(t = decrypt_byte(pkeys),
                                update_keys(pkeys, pcrc_32_tab, c), t ^ (c));
  }
  init_keys(passwd, pkeys, pcrc_32_tab);
  for (n = 0; n < 12 - 2; n++) {
    buf[n] = (unsigned char)(t = decrypt_byte(pkeys),
                             update_keys(pkeys, pcrc_32_tab, header[n]),
                             t ^ (header[n]));
  }
  buf[n++] = (unsigned char)(t = decrypt_byte(pkeys),
                             update_keys(pkeys, pcrc_32_tab,
                                         (int)(crcForCrypting >> 16) & 0xff),
                             t ^ ((int)(crcForCrypting >> 16) & 0xff));
  buf[n++] = (unsigned char)(t = decrypt_byte(pkeys),
                             update_keys(pkeys, pcrc_32_tab,
                                         (int)(crcForCrypting >> 24) & 0xff),
                             t ^ ((int)(crcForCrypting >> 24) & 0xff));
  return n;
}


x86 assembly (clang, -O0):
<crypthead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
cmpl   $0xc,-0x1c(%rbp)
jge    1195 <crypthead+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1345 <crypthead+0x1e5>
mov    0x2eb9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eb0(%rip)
cmp    $0x1,%eax
jne    11ca <crypthead+0x6a>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
movabs $0xbb40e64e,%rcx
xor    %rcx,%rax
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1050 <init_keys@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1238 <crypthead+0xd8>
mov    $0x0,%al
call   1080 <rand@plt>
sar    $0x7,%eax
and    $0xff,%eax
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x40(%rbp),%edx
call   1030 <update_keys@plt>
mov    -0x3c(%rbp),%eax
xor    -0x40(%rbp),%eax
mov    %al,%cl
movslq -0x38(%rbp),%rax
mov    %cl,-0x4a(%rbp,%rax,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11e2 <crypthead+0x82>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1050 <init_keys@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    12a5 <crypthead+0x145>
mov    -0x28(%rbp),%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movslq -0x38(%rbp),%rax
movzbl -0x4a(%rbp,%rax,1),%edx
call   1030 <update_keys@plt>
mov    -0x3c(%rbp),%eax
movslq -0x38(%rbp),%rcx
movzbl -0x4a(%rbp,%rcx,1),%ecx
xor    %ecx,%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1250 <crypthead+0xf0>
mov    -0x28(%rbp),%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
shr    $0x10,%edx
and    $0xff,%edx
call   1030 <update_keys@plt>
mov    -0x3c(%rbp),%eax
mov    -0x34(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
xor    %ecx,%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x38(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
shr    $0x18,%edx
and    $0xff,%edx
call   1030 <update_keys@plt>
mov    -0x3c(%rbp),%eax
mov    -0x34(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
xor    %ecx,%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x38(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypthead>:
xor    %eax,%eax
cmp    $0xc,%edx
jl     1552 <crypthead+0x3f2>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%r12
mov    %rcx,%r15
mov    %rdi,%rbx
mov    %rsi,0x30(%rsp)
mov    %r9d,0x24(%rsp)
mov    0x2ec2(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2eb9(%rip)
test   %eax,%eax
jne    11b2 <crypthead+0x52>
xor    %edi,%edi
call   1060 <time@plt>
xor    $0xbb40e64e,%eax
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rbx,0x28(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <init_keys@plt>
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x20(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x1c(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x18(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x14(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x10(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0xc(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x8(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,0x4(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r13d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shr    $0x7,%ebp
movzbl %bpl,%r14d
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %ebx,%r14d
mov    0x28(%rsp),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <init_keys@plt>
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x20(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    0x30(%rsp),%r13
mov    %bpl,0x0(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x1c(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x1(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x18(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x2(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x14(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x3(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x10(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x4(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x5(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x6(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    0x4(%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x7(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
mov    (%rsp),%ebx
movzbl %bl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %ebx,%ebp
mov    %bpl,0x8(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
movzbl %r14b,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %r14d,%ebp
mov    %bpl,0x9(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%r14d
mov    0x24(%rsp),%ebx
mov    %ebx,%ebp
shr    $0x10,%ebp
movzbl %bpl,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <update_keys@plt>
xor    %r14d,%ebp
mov    %bpl,0xa(%r13)
mov    %r15,%rdi
call   1070 <decrypt_byte@plt>
mov    %eax,%ebp
shr    $0x18,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1030 <update_keys@plt>
xor    %ebp,%ebx
mov    %bl,0xb(%r13)
mov    $0xc,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@crypthead.calls = internal global i32 0
define i32 @crypthead(i8* %0, i8* %1, i32 %2, i32* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [10 x i8]
store i8* %0, i8** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32 %5, i32* %13
%18 = load i32, i32* %10
%19 = icmp slt i32 %18, 12
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 0, i32* %7
br label %132
21: ; preds = %6
%22 = load i32, i32* @crypthead.calls
%23 = add i32 %22, 1
store i32 %23, i32* @crypthead.calls
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = call i64 @time(i32* null)
%27 = xor i64 %26, 3141592654
%28 = trunc i64 %27 to i32
%29 = call i32 @srand(i32 %28)
br label %30
30: ; preds = %25, %21
%31 = load i8*, i8** %8
%32 = load i32*, i32** %11
%33 = load i32*, i32** %12
%34 = call i32 @init_keys(i8* %31, i32* %32, i32* %33)
store i32 0, i32* %14
br label %35
35: ; preds = %55, %30
%36 = load i32, i32* %14
%37 = icmp slt i32 %36, 10
br i1 %37, label %38, label %58
38: ; preds = %35
%39 = call i32 (...) @rand()
%40 = ashr i32 %39, 7
%41 = and i32 %40, 255
store i32 %41, i32* %16
%42 = load i32*, i32** %11
%43 = call i32 @decrypt_byte(i32* %42)
store i32 %43, i32* %15
%44 = load i32*, i32** %11
%45 = load i32*, i32** %12
%46 = load i32, i32* %16
%47 = call i32 @update_keys(i32* %44, i32* %45, i32 %46)
%48 = load i32, i32* %15
%49 = load i32, i32* %16
%50 = xor i32 %48, %49
%51 = trunc i32 %50 to i8
%52 = load i32, i32* %14
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [10 x i8], [10 x i8]* %17, i64 0, i64 %53
store i8 %51, i8* %54
br label %55
55: ; preds = %38
%56 = load i32, i32* %14
%57 = add nsw i32 %56, 1
store i32 %57, i32* %14
br label %35
58: ; preds = %35
%59 = load i8*, i8** %8
%60 = load i32*, i32** %11
%61 = load i32*, i32** %12
%62 = call i32 @init_keys(i8* %59, i32* %60, i32* %61)
store i32 0, i32* %14
br label %63
63: ; preds = %89, %58
%64 = load i32, i32* %14
%65 = icmp slt i32 %64, 10
br i1 %65, label %66, label %92
66: ; preds = %63
%67 = load i32*, i32** %11
%68 = call i32 @decrypt_byte(i32* %67)
store i32 %68, i32* %15
%69 = load i32*, i32** %11
%70 = load i32*, i32** %12
%71 = load i32, i32* %14
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [10 x i8], [10 x i8]* %17, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = call i32 @update_keys(i32* %69, i32* %70, i32 %75)
%77 = load i32, i32* %15
%78 = load i32, i32* %14
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %17, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = xor i32 %77, %82
%84 = trunc i32 %83 to i8
%85 = load i8*, i8** %9
%86 = load i32, i32* %14
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
store i8 %84, i8* %88
br label %89
89: ; preds = %66
%90 = load i32, i32* %14
%91 = add nsw i32 %90, 1
store i32 %91, i32* %14
br label %63
92: ; preds = %63
%93 = load i32*, i32** %11
%94 = call i32 @decrypt_byte(i32* %93)
store i32 %94, i32* %15
%95 = load i32*, i32** %11
%96 = load i32*, i32** %12
%97 = load i32, i32* %13
%98 = lshr i32 %97, 16
%99 = and i32 %98, 255
%100 = call i32 @update_keys(i32* %95, i32* %96, i32 %99)
%101 = load i32, i32* %15
%102 = load i32, i32* %13
%103 = lshr i32 %102, 16
%104 = and i32 %103, 255
%105 = xor i32 %101, %104
%106 = trunc i32 %105 to i8
%107 = load i8*, i8** %9
%108 = load i32, i32* %14
%109 = add nsw i32 %108, 1
store i32 %109, i32* %14
%110 = sext i32 %108 to i64
%111 = getelementptr inbounds i8, i8* %107, i64 %110
store i8 %106, i8* %111
%112 = load i32*, i32** %11
%113 = call i32 @decrypt_byte(i32* %112)
store i32 %113, i32* %15
%114 = load i32*, i32** %11
%115 = load i32*, i32** %12
%116 = load i32, i32* %13
%117 = lshr i32 %116, 24
%118 = and i32 %117, 255
%119 = call i32 @update_keys(i32* %114, i32* %115, i32 %118)
%120 = load i32, i32* %15
%121 = load i32, i32* %13
%122 = lshr i32 %121, 24
%123 = and i32 %122, 255
%124 = xor i32 %120, %123
%125 = trunc i32 %124 to i8
%126 = load i8*, i8** %9
%127 = load i32, i32* %14
%128 = add nsw i32 %127, 1
store i32 %128, i32* %14
%129 = sext i32 %127 to i64
%130 = getelementptr inbounds i8, i8* %126, i64 %129
store i8 %125, i8* %130
%131 = load i32, i32* %14
store i32 %131, i32* %7
br label %132
132: ; preds = %92, %20
%133 = load i32, i32* %7
ret i32 %133
}

LLVM IR (-O2):
@crypthead.calls = internal unnamed_addr global i32 0
define i32 @crypthead(i8* %0, i8* nocapture writeonly %1, i32 %2, i32* %3, i32* %4, i32 %5) {
%7 = icmp slt i32 %2, 12
br i1 %7, label %152, label %8
8: ; preds = %6
%9 = load i32, i32* @crypthead.calls
%10 = add i32 %9, 1
store i32 %10, i32* @crypthead.calls
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = tail call i64 @time(i32* null)
%14 = trunc i64 %13 to i32
%15 = xor i32 %14, -1153374642
%16 = tail call i32 @srand(i32 %15)
br label %17
17: ; preds = %12, %8
%18 = tail call i32 @init_keys(i8* %0, i32* %3, i32* %4)
%19 = tail call i32 (...) @rand()
%20 = lshr i32 %19, 7
%21 = and i32 %20, 255
%22 = tail call i32 @decrypt_byte(i32* %3)
%23 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %21)
%24 = xor i32 %22, %20
%25 = tail call i32 (...) @rand()
%26 = lshr i32 %25, 7
%27 = and i32 %26, 255
%28 = tail call i32 @decrypt_byte(i32* %3)
%29 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %27)
%30 = xor i32 %28, %26
%31 = tail call i32 (...) @rand()
%32 = lshr i32 %31, 7
%33 = and i32 %32, 255
%34 = tail call i32 @decrypt_byte(i32* %3)
%35 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %33)
%36 = xor i32 %34, %32
%37 = tail call i32 (...) @rand()
%38 = lshr i32 %37, 7
%39 = and i32 %38, 255
%40 = tail call i32 @decrypt_byte(i32* %3)
%41 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %39)
%42 = xor i32 %40, %38
%43 = tail call i32 (...) @rand()
%44 = lshr i32 %43, 7
%45 = and i32 %44, 255
%46 = tail call i32 @decrypt_byte(i32* %3)
%47 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %45)
%48 = xor i32 %46, %44
%49 = tail call i32 (...) @rand()
%50 = lshr i32 %49, 7
%51 = and i32 %50, 255
%52 = tail call i32 @decrypt_byte(i32* %3)
%53 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %51)
%54 = xor i32 %52, %50
%55 = tail call i32 (...) @rand()
%56 = lshr i32 %55, 7
%57 = and i32 %56, 255
%58 = tail call i32 @decrypt_byte(i32* %3)
%59 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %57)
%60 = xor i32 %58, %56
%61 = tail call i32 (...) @rand()
%62 = lshr i32 %61, 7
%63 = and i32 %62, 255
%64 = tail call i32 @decrypt_byte(i32* %3)
%65 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %63)
%66 = xor i32 %64, %62
%67 = tail call i32 (...) @rand()
%68 = lshr i32 %67, 7
%69 = and i32 %68, 255
%70 = tail call i32 @decrypt_byte(i32* %3)
%71 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %69)
%72 = xor i32 %70, %68
%73 = tail call i32 (...) @rand()
%74 = lshr i32 %73, 7
%75 = and i32 %74, 255
%76 = tail call i32 @decrypt_byte(i32* %3)
%77 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %75)
%78 = xor i32 %76, %74
%79 = tail call i32 @init_keys(i8* %0, i32* %3, i32* %4)
%80 = tail call i32 @decrypt_byte(i32* %3)
%81 = and i32 %24, 255
%82 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %81)
%83 = xor i32 %24, %80
%84 = trunc i32 %83 to i8
store i8 %84, i8* %1
%85 = tail call i32 @decrypt_byte(i32* %3)
%86 = and i32 %30, 255
%87 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %86)
%88 = xor i32 %30, %85
%89 = trunc i32 %88 to i8
%90 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %89, i8* %90
%91 = tail call i32 @decrypt_byte(i32* %3)
%92 = and i32 %36, 255
%93 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %92)
%94 = xor i32 %36, %91
%95 = trunc i32 %94 to i8
%96 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %95, i8* %96
%97 = tail call i32 @decrypt_byte(i32* %3)
%98 = and i32 %42, 255
%99 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %98)
%100 = xor i32 %42, %97
%101 = trunc i32 %100 to i8
%102 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %101, i8* %102
%103 = tail call i32 @decrypt_byte(i32* %3)
%104 = and i32 %48, 255
%105 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %104)
%106 = xor i32 %48, %103
%107 = trunc i32 %106 to i8
%108 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %107, i8* %108
%109 = tail call i32 @decrypt_byte(i32* %3)
%110 = and i32 %54, 255
%111 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %110)
%112 = xor i32 %54, %109
%113 = trunc i32 %112 to i8
%114 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %113, i8* %114
%115 = tail call i32 @decrypt_byte(i32* %3)
%116 = and i32 %60, 255
%117 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %116)
%118 = xor i32 %60, %115
%119 = trunc i32 %118 to i8
%120 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %119, i8* %120
%121 = tail call i32 @decrypt_byte(i32* %3)
%122 = and i32 %66, 255
%123 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %122)
%124 = xor i32 %66, %121
%125 = trunc i32 %124 to i8
%126 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %125, i8* %126
%127 = tail call i32 @decrypt_byte(i32* %3)
%128 = and i32 %72, 255
%129 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %128)
%130 = xor i32 %72, %127
%131 = trunc i32 %130 to i8
%132 = getelementptr inbounds i8, i8* %1, i64 8
store i8 %131, i8* %132
%133 = tail call i32 @decrypt_byte(i32* %3)
%134 = and i32 %78, 255
%135 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %134)
%136 = xor i32 %78, %133
%137 = trunc i32 %136 to i8
%138 = getelementptr inbounds i8, i8* %1, i64 9
store i8 %137, i8* %138
%139 = tail call i32 @decrypt_byte(i32* %3)
%140 = lshr i32 %5, 16
%141 = and i32 %140, 255
%142 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %141)
%143 = xor i32 %139, %140
%144 = trunc i32 %143 to i8
%145 = getelementptr inbounds i8, i8* %1, i64 10
store i8 %144, i8* %145
%146 = tail call i32 @decrypt_byte(i32* %3)
%147 = lshr i32 %5, 24
%148 = tail call i32 @update_keys(i32* %3, i32* %4, i32 %147)
%149 = xor i32 %146, %147
%150 = trunc i32 %149 to i8
%151 = getelementptr inbounds i8, i8* %1, i64 11
store i8 %150, i8* %151
br label %152
152: ; preds = %6, %17
%153 = phi i32 [ 12, %17 ], [ 0, %6 ]
ret i32 %153
}