#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 /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ arc4_crypt(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void arc4_enc128(uint32_t *out, const uint32_t *in) {
  uint8_t *o = (uint8_t *)out;
  const uint8_t *i = (const uint8_t *)in;
  for (int j = 0; j < 16; j++) {
    arc4_crypt(o, i);
    o++;
    i++;
  }
}


x86 assembly (clang, -O0):
<arc4_enc128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    1174 <arc4_enc128+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <arc4_crypt@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1137 <arc4_enc128+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc4_enc128>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <arc4_crypt@plt>
lea    0x4(%rbx),%rdi
lea    0x4(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x8(%rbx),%rdi
lea    0x8(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0xc(%rbx),%rdi
lea    0xc(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x10(%rbx),%rdi
lea    0x10(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x14(%rbx),%rdi
lea    0x14(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x18(%rbx),%rdi
lea    0x18(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x1c(%rbx),%rdi
lea    0x1c(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x20(%rbx),%rdi
lea    0x20(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x24(%rbx),%rdi
lea    0x24(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x28(%rbx),%rdi
lea    0x28(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x2c(%rbx),%rdi
lea    0x2c(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x30(%rbx),%rdi
lea    0x30(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x34(%rbx),%rdi
lea    0x34(%r14),%rsi
call   1030 <arc4_crypt@plt>
lea    0x38(%rbx),%rdi
lea    0x38(%r14),%rsi
call   1030 <arc4_crypt@plt>
add    $0x3c,%rbx
add    $0x3c,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <arc4_crypt@plt>

LLVM IR (-O0):
define void @arc4_enc128(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
store i32* %8, i32** %5
%9 = load i32*, i32** %4
store i32* %9, i32** %6
store i32 0, i32* %7
br label %10
10: ; preds = %21, %2
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 16
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i32*, i32** %5
%15 = load i32*, i32** %6
%16 = call i32 @arc4_crypt(i32* %14, i32* %15)
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %5
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i32 1
store i32* %20, i32** %6
br label %21
21: ; preds = %13
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %10
24: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @arc4_enc128(i32* %0, i32* %1) {
%3 = tail call i32 @arc4_crypt(i32* %0, i32* %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = tail call i32 @arc4_crypt(i32* %4, i32* %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = getelementptr inbounds i32, i32* %1, i64 2
%9 = tail call i32 @arc4_crypt(i32* %7, i32* %8)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = getelementptr inbounds i32, i32* %1, i64 3
%12 = tail call i32 @arc4_crypt(i32* %10, i32* %11)
%13 = getelementptr inbounds i32, i32* %0, i64 4
%14 = getelementptr inbounds i32, i32* %1, i64 4
%15 = tail call i32 @arc4_crypt(i32* %13, i32* %14)
%16 = getelementptr inbounds i32, i32* %0, i64 5
%17 = getelementptr inbounds i32, i32* %1, i64 5
%18 = tail call i32 @arc4_crypt(i32* %16, i32* %17)
%19 = getelementptr inbounds i32, i32* %0, i64 6
%20 = getelementptr inbounds i32, i32* %1, i64 6
%21 = tail call i32 @arc4_crypt(i32* %19, i32* %20)
%22 = getelementptr inbounds i32, i32* %0, i64 7
%23 = getelementptr inbounds i32, i32* %1, i64 7
%24 = tail call i32 @arc4_crypt(i32* %22, i32* %23)
%25 = getelementptr inbounds i32, i32* %0, i64 8
%26 = getelementptr inbounds i32, i32* %1, i64 8
%27 = tail call i32 @arc4_crypt(i32* %25, i32* %26)
%28 = getelementptr inbounds i32, i32* %0, i64 9
%29 = getelementptr inbounds i32, i32* %1, i64 9
%30 = tail call i32 @arc4_crypt(i32* %28, i32* %29)
%31 = getelementptr inbounds i32, i32* %0, i64 10
%32 = getelementptr inbounds i32, i32* %1, i64 10
%33 = tail call i32 @arc4_crypt(i32* %31, i32* %32)
%34 = getelementptr inbounds i32, i32* %0, i64 11
%35 = getelementptr inbounds i32, i32* %1, i64 11
%36 = tail call i32 @arc4_crypt(i32* %34, i32* %35)
%37 = getelementptr inbounds i32, i32* %0, i64 12
%38 = getelementptr inbounds i32, i32* %1, i64 12
%39 = tail call i32 @arc4_crypt(i32* %37, i32* %38)
%40 = getelementptr inbounds i32, i32* %0, i64 13
%41 = getelementptr inbounds i32, i32* %1, i64 13
%42 = tail call i32 @arc4_crypt(i32* %40, i32* %41)
%43 = getelementptr inbounds i32, i32* %0, i64 14
%44 = getelementptr inbounds i32, i32* %1, i64 14
%45 = tail call i32 @arc4_crypt(i32* %43, i32* %44)
%46 = getelementptr inbounds i32, i32* %0, i64 15
%47 = getelementptr inbounds i32, i32* %1, i64 15
%48 = tail call i32 @arc4_crypt(i32* %46, i32* %47)
ret void
}