#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 int uint8_t;

/* Variables and functions */
int READ_ROUND_KEY_BYTE(int);
int /*<<< orphan*/ round_function(int *, int *, int);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i;
  round_function(block, roundKeys, 2);
  for (i = 1; i < 20; i++)
    round_function(block, roundKeys + 8 * i, 1);
  for (i = 0; i < 8; i++)
    block[i] ^= READ_ROUND_KEY_BYTE(roundKeys[i]) ^
                READ_ROUND_KEY_BYTE(roundKeys[160 + i]);
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1040 <round_function@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1182 <Decrypt+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1040 <round_function@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <Decrypt+0x29>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11df <Decrypt+0xbf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0xa0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    -0x18(%rbp),%edx
xor    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1189 <Decrypt+0x69>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x2,%edx
call   1040 <round_function@plt>
lea    0x20(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x40(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x60(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x80(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0xa0(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0xc0(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0xe0(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x100(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x120(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x140(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x160(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x180(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x1a0(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x1c0(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x1e0(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x200(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x220(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x240(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
lea    0x260(%rbx),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1040 <round_function@plt>
mov    (%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x280(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,(%r14)
mov    0x4(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x284(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0x4(%r14)
mov    0x8(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x288(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0x8(%r14)
mov    0xc(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x28c(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0xc(%r14)
mov    0x10(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x290(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0x10(%r14)
mov    0x14(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x294(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0x14(%r14)
mov    0x18(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x298(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0x18(%r14)
mov    0x1c(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%ebp
mov    0x29c(%rbx),%edi
call   1030 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
xor    %eax,0x1c(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @Decrypt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @round_function(i32* %6, i32* %7, i32 2)
store i32 1, i32* %5
br label %9
9: ; preds = %20, %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = mul nsw i32 8, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = call i32 @round_function(i32* %13, i32* %18, i32 1)
br label %20
20: ; preds = %12
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
store i32 0, i32* %5
br label %24
24: ; preds = %48, %23
%25 = load i32, i32* %5
%26 = icmp slt i32 %25, 8
br i1 %26, label %27, label %51
27: ; preds = %24
%28 = load i32*, i32** %4
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @READ_ROUND_KEY_BYTE(i32 %32)
%34 = load i32*, i32** %4
%35 = load i32, i32* %5
%36 = add nsw i32 160, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %34, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @READ_ROUND_KEY_BYTE(i32 %39)
%41 = xor i32 %33, %40
%42 = load i32*, i32** %3
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = load i32, i32* %45
%47 = xor i32 %46, %41
store i32 %47, i32* %45
br label %48
48: ; preds = %27
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %24
51: ; preds = %24
ret void
}

LLVM IR (-O2):
define void @Decrypt(i32* %0, i32* %1) {
%3 = tail call i32 @round_function(i32* %0, i32* %1, i32 2)
%4 = getelementptr inbounds i32, i32* %1, i64 8
%5 = tail call i32 @round_function(i32* %0, i32* %4, i32 1)
%6 = getelementptr inbounds i32, i32* %1, i64 16
%7 = tail call i32 @round_function(i32* %0, i32* %6, i32 1)
%8 = getelementptr inbounds i32, i32* %1, i64 24
%9 = tail call i32 @round_function(i32* %0, i32* %8, i32 1)
%10 = getelementptr inbounds i32, i32* %1, i64 32
%11 = tail call i32 @round_function(i32* %0, i32* %10, i32 1)
%12 = getelementptr inbounds i32, i32* %1, i64 40
%13 = tail call i32 @round_function(i32* %0, i32* %12, i32 1)
%14 = getelementptr inbounds i32, i32* %1, i64 48
%15 = tail call i32 @round_function(i32* %0, i32* %14, i32 1)
%16 = getelementptr inbounds i32, i32* %1, i64 56
%17 = tail call i32 @round_function(i32* %0, i32* %16, i32 1)
%18 = getelementptr inbounds i32, i32* %1, i64 64
%19 = tail call i32 @round_function(i32* %0, i32* %18, i32 1)
%20 = getelementptr inbounds i32, i32* %1, i64 72
%21 = tail call i32 @round_function(i32* %0, i32* %20, i32 1)
%22 = getelementptr inbounds i32, i32* %1, i64 80
%23 = tail call i32 @round_function(i32* %0, i32* %22, i32 1)
%24 = getelementptr inbounds i32, i32* %1, i64 88
%25 = tail call i32 @round_function(i32* %0, i32* %24, i32 1)
%26 = getelementptr inbounds i32, i32* %1, i64 96
%27 = tail call i32 @round_function(i32* %0, i32* %26, i32 1)
%28 = getelementptr inbounds i32, i32* %1, i64 104
%29 = tail call i32 @round_function(i32* %0, i32* %28, i32 1)
%30 = getelementptr inbounds i32, i32* %1, i64 112
%31 = tail call i32 @round_function(i32* %0, i32* %30, i32 1)
%32 = getelementptr inbounds i32, i32* %1, i64 120
%33 = tail call i32 @round_function(i32* %0, i32* %32, i32 1)
%34 = getelementptr inbounds i32, i32* %1, i64 128
%35 = tail call i32 @round_function(i32* %0, i32* %34, i32 1)
%36 = getelementptr inbounds i32, i32* %1, i64 136
%37 = tail call i32 @round_function(i32* %0, i32* %36, i32 1)
%38 = getelementptr inbounds i32, i32* %1, i64 144
%39 = tail call i32 @round_function(i32* %0, i32* %38, i32 1)
%40 = getelementptr inbounds i32, i32* %1, i64 152
%41 = tail call i32 @round_function(i32* %0, i32* %40, i32 1)
%42 = load i32, i32* %1
%43 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %42)
%44 = getelementptr inbounds i32, i32* %1, i64 160
%45 = load i32, i32* %44
%46 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %45)
%47 = xor i32 %46, %43
%48 = load i32, i32* %0
%49 = xor i32 %47, %48
store i32 %49, i32* %0
%50 = getelementptr inbounds i32, i32* %1, i64 1
%51 = load i32, i32* %50
%52 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %51)
%53 = getelementptr inbounds i32, i32* %1, i64 161
%54 = load i32, i32* %53
%55 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %54)
%56 = xor i32 %55, %52
%57 = getelementptr inbounds i32, i32* %0, i64 1
%58 = load i32, i32* %57
%59 = xor i32 %56, %58
store i32 %59, i32* %57
%60 = getelementptr inbounds i32, i32* %1, i64 2
%61 = load i32, i32* %60
%62 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %61)
%63 = getelementptr inbounds i32, i32* %1, i64 162
%64 = load i32, i32* %63
%65 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %64)
%66 = xor i32 %65, %62
%67 = getelementptr inbounds i32, i32* %0, i64 2
%68 = load i32, i32* %67
%69 = xor i32 %66, %68
store i32 %69, i32* %67
%70 = getelementptr inbounds i32, i32* %1, i64 3
%71 = load i32, i32* %70
%72 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %71)
%73 = getelementptr inbounds i32, i32* %1, i64 163
%74 = load i32, i32* %73
%75 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %74)
%76 = xor i32 %75, %72
%77 = getelementptr inbounds i32, i32* %0, i64 3
%78 = load i32, i32* %77
%79 = xor i32 %76, %78
store i32 %79, i32* %77
%80 = getelementptr inbounds i32, i32* %1, i64 4
%81 = load i32, i32* %80
%82 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %81)
%83 = getelementptr inbounds i32, i32* %1, i64 164
%84 = load i32, i32* %83
%85 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %84)
%86 = xor i32 %85, %82
%87 = getelementptr inbounds i32, i32* %0, i64 4
%88 = load i32, i32* %87
%89 = xor i32 %86, %88
store i32 %89, i32* %87
%90 = getelementptr inbounds i32, i32* %1, i64 5
%91 = load i32, i32* %90
%92 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %91)
%93 = getelementptr inbounds i32, i32* %1, i64 165
%94 = load i32, i32* %93
%95 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %94)
%96 = xor i32 %95, %92
%97 = getelementptr inbounds i32, i32* %0, i64 5
%98 = load i32, i32* %97
%99 = xor i32 %96, %98
store i32 %99, i32* %97
%100 = getelementptr inbounds i32, i32* %1, i64 6
%101 = load i32, i32* %100
%102 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %101)
%103 = getelementptr inbounds i32, i32* %1, i64 166
%104 = load i32, i32* %103
%105 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %104)
%106 = xor i32 %105, %102
%107 = getelementptr inbounds i32, i32* %0, i64 6
%108 = load i32, i32* %107
%109 = xor i32 %106, %108
store i32 %109, i32* %107
%110 = getelementptr inbounds i32, i32* %1, i64 7
%111 = load i32, i32* %110
%112 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %111)
%113 = getelementptr inbounds i32, i32* %1, i64 167
%114 = load i32, i32* %113
%115 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %114)
%116 = xor i32 %115, %112
%117 = getelementptr inbounds i32, i32* %0, i64 7
%118 = load i32, i32* %117
%119 = xor i32 %116, %118
store i32 %119, i32* %117
ret void
}