#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*/ crypto_stream_aes128ctr_beforenm(unsigned char *,
                                                    unsigned char const *);
int /*<<< orphan*/ crypto_stream_aes128ctr_xor_afternm(unsigned char *,
                                                       unsigned char const *,
                                                       unsigned long long,
                                                       unsigned char const *,
                                                       unsigned char *);
int crypto_stream_aes128ctr_xor(unsigned char *out, const unsigned char *in,
                                unsigned long long inlen,
                                const unsigned char *n,
                                const unsigned char *k) {
  unsigned char d[1408];
  crypto_stream_aes128ctr_beforenm(d, k);
  crypto_stream_aes128ctr_xor_afternm(out, in, inlen, n, d);
  return 0;
}


x86 assembly (clang, -O0):
<crypto_stream_aes128ctr_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x5b0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <crypto_stream_aes128ctr_beforenm@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x5b0(%rbp),%r8
call   1030 <crypto_stream_aes128ctr_xor_afternm@plt>
xor    %eax,%eax
add    $0x5b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_stream_aes128ctr_xor>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x580,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %rsp,%r13
mov    %r13,%rdi
mov    %r8,%rsi
call   1040 <crypto_stream_aes128ctr_beforenm@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1030 <crypto_stream_aes128ctr_xor_afternm@plt>
xor    %eax,%eax
add    $0x580,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @crypto_stream_aes128ctr_xor(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [1408 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%12 = getelementptr inbounds [1408 x i8], [1408 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %10
%14 = call i32 @crypto_stream_aes128ctr_beforenm(i8* %12, i8* %13)
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i64, i64* %8
%18 = load i8*, i8** %9
%19 = getelementptr inbounds [1408 x i8], [1408 x i8]* %11, i64 0, i64 0
%20 = call i32 @crypto_stream_aes128ctr_xor_afternm(i8* %15, i8* %16, i64 %17, i8* %18, i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @crypto_stream_aes128ctr_xor(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca [1408 x i8]
%7 = getelementptr inbounds [1408 x i8], [1408 x i8]* %6, i64 0, i64 0
%8 = call i32 @crypto_stream_aes128ctr_beforenm(i8* %7, i8* %4)
%9 = call i32 @crypto_stream_aes128ctr_xor_afternm(i8* %0, i8* %1, i64 %2, i8* %3, i8* %7)
ret i32 0
}