#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*/ assert(int);
int /*<<< orphan*/ otp_decode(char *, int *, int);
int /*<<< orphan*/ otp_decrypt(int *, int *, int *, int);
int /*<<< orphan*/ otp_encode(int *, char *);
int /*<<< orphan*/ otp_encrypt(int *, int *, int *, int);
int strstr(char *, char *);
void selfTest() {
  int buffer[5];
  int inputMsg[] = {7, 4, 11, 11, 14};
  int inputKey[] = {23, 12, 2, 10, 11};
  otp_encrypt(buffer, inputMsg, inputKey, 5);
  assert(buffer[0] == 3);
  assert(buffer[1] == 16);
  assert(buffer[2] == 13);
  assert(buffer[3] == 21);
  assert(buffer[4] == 25);
  otp_decrypt(buffer, buffer, inputKey, 5);
  assert(buffer[0] == inputMsg[0]);
  assert(buffer[1] == inputMsg[1]);
  assert(buffer[2] == inputMsg[2]);
  assert(buffer[3] == inputMsg[3]);
  assert(buffer[4] == inputMsg[4]);
  otp_encode(buffer, "H LLO");
  assert(buffer[0] == inputMsg[0]);
  assert(buffer[1] == 26);
  assert(buffer[2] == inputMsg[2]);
  assert(buffer[3] == inputMsg[3]);
  assert(buffer[4] == inputMsg[4]);
  char buffer2[5];
  otp_decode(buffer2, inputMsg, 5);
  assert(strstr(buffer2, "HELLO"));
}


x86 assembly (clang, -O0):
<selfTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xe91(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe8c(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe8f(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe8d(%rip),%eax
mov    %eax,-0x50(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x60(%rbp),%rdx
mov    $0x5,%ecx
call   1030 <otp_encrypt@plt>
cmpl   $0x3,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x10,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0xd,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x15,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x19,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x60(%rbp),%rdx
mov    $0x5,%ecx
call   1040 <otp_decrypt@plt>
mov    -0x20(%rbp),%eax
cmp    -0x40(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%eax
cmp    -0x38(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x30(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1070 <otp_encode@plt>
mov    -0x20(%rbp),%eax
cmp    -0x40(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1a,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%eax
cmp    -0x38(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x30(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x65(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x5,%edx
call   1060 <otp_decode@plt>
lea    -0x65(%rbp),%rdi
lea    0xd2a(%rip),%rsi
call   1080 <strstr@plt>
mov    %eax,%edi
call   1050 <assert@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selfTest>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    0xea1(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeab(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rsp,%r15
lea    0x20(%rsp),%r14
lea    0x40(%rsp),%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x5,%ecx
call   1030 <otp_encrypt@plt>
xor    %edi,%edi
cmpl   $0x3,(%rsp)
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0x10,0x4(%rsp)
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0xd,0x8(%rsp)
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0x15,0xc(%rsp)
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0x19,0x10(%rsp)
sete   %dil
call   1050 <assert@plt>
mov    %r15,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    $0x5,%ecx
call   1040 <otp_decrypt@plt>
mov    (%rsp),%eax
xor    %edi,%edi
cmp    0x20(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    0x4(%rsp),%eax
xor    %edi,%edi
cmp    0x24(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    0x8(%rsp),%eax
xor    %edi,%edi
cmp    0x28(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    0xc(%rsp),%eax
xor    %edi,%edi
cmp    0x2c(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    0x10(%rsp),%eax
xor    %edi,%edi
cmp    0x30(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdb8(%rip),%rsi
mov    %r15,%rdi
call   1070 <otp_encode@plt>
mov    (%rsp),%eax
xor    %edi,%edi
cmp    0x20(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpl   $0x1a,0x4(%rsp)
sete   %dil
call   1050 <assert@plt>
mov    0x8(%rsp),%eax
xor    %edi,%edi
cmp    0x28(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    0xc(%rsp),%eax
xor    %edi,%edi
cmp    0x2c(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    0x10(%rsp),%eax
xor    %edi,%edi
cmp    0x30(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
lea    0x3b(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1060 <otp_decode@plt>
lea    0xd3f(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strstr@plt>
mov    %eax,%edi
call   1050 <assert@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.selfTest.inputMsg = [5 x i32] [i32 7, i32 4, i32 11, i32 11, i32 14]
@__const.selfTest.inputKey = [5 x i32] [i32 23, i32 12, i32 2, i32 10, i32 11]
@.str = [6 x i8] c"H LLO\00"
@.str.1 = [6 x i8] c"HELLO\00"
define void @selfTest() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = alloca [5 x i8]
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%10 = call i32 @otp_encrypt(i32* %7, i32* %8, i32* %9, i32 5)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 16
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 13
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 21
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 25
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%39 = call i32 @otp_decrypt(i32* %36, i32* %37, i32* %38, i32 5)
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%41 = load i32, i32* %40
%42 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%43 = load i32, i32* %42
%44 = icmp eq i32 %41, %43
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%48 = load i32, i32* %47
%49 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%50 = load i32, i32* %49
%51 = icmp eq i32 %48, %50
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%55 = load i32, i32* %54
%56 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%57 = load i32, i32* %56
%58 = icmp eq i32 %55, %57
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%62 = load i32, i32* %61
%63 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%64 = load i32, i32* %63
%65 = icmp eq i32 %62, %64
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
%68 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%69 = load i32, i32* %68
%70 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%71 = load i32, i32* %70
%72 = icmp eq i32 %69, %71
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%76 = call i32 @otp_encode(i32* %75, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%77 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%78 = load i32, i32* %77
%79 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%80 = load i32, i32* %79
%81 = icmp eq i32 %78, %80
%82 = zext i1 %81 to i32
%83 = call i32 @assert(i32 %82)
%84 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%85 = load i32, i32* %84
%86 = icmp eq i32 %85, 26
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
%89 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%90 = load i32, i32* %89
%91 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%92 = load i32, i32* %91
%93 = icmp eq i32 %90, %92
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%97 = load i32, i32* %96
%98 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%99 = load i32, i32* %98
%100 = icmp eq i32 %97, %99
%101 = zext i1 %100 to i32
%102 = call i32 @assert(i32 %101)
%103 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%104 = load i32, i32* %103
%105 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%106 = load i32, i32* %105
%107 = icmp eq i32 %104, %106
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%111 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%112 = call i32 @otp_decode(i8* %110, i32* %111, i32 5)
%113 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%114 = call i32 @strstr(i8* %113, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%115 = call i32 @assert(i32 %114)
ret void
}

LLVM IR (-O2):
@__const.selfTest.inputMsg = [5 x i32] [i32 7, i32 4, i32 11, i32 11, i32 14]
@__const.selfTest.inputKey = [5 x i32] [i32 23, i32 12, i32 2, i32 10, i32 11]
@.str = [6 x i8] c"H LLO\00"
@.str.1 = [6 x i8] c"HELLO\00"
define void @selfTest() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = alloca [5 x i8]
%5 = bitcast [5 x i32]* %1 to i8*
%6 = bitcast [5 x i32]* %2 to i8*
%7 = bitcast [5 x i32]* %3 to i8*
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%11 = call i32 @otp_encrypt(i32* %8, i32* %9, i32* %10, i32 5)
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 16
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 13
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 21
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 25
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @otp_decrypt(i32* %8, i32* %8, i32* %10, i32 5)
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = icmp eq i32 %37, %38
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = load i32, i32* %16
%43 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%44 = load i32, i32* %43
%45 = icmp eq i32 %42, %44
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load i32, i32* %21
%49 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%50 = load i32, i32* %49
%51 = icmp eq i32 %48, %50
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = load i32, i32* %26
%55 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%56 = load i32, i32* %55
%57 = icmp eq i32 %54, %56
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = load i32, i32* %31
%61 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%62 = load i32, i32* %61
%63 = icmp eq i32 %60, %62
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = call i32 @otp_encode(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%67 = load i32, i32* %8
%68 = load i32, i32* %9
%69 = icmp eq i32 %67, %68
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = load i32, i32* %16
%73 = icmp eq i32 %72, 26
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = load i32, i32* %21
%77 = load i32, i32* %49
%78 = icmp eq i32 %76, %77
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = load i32, i32* %26
%82 = load i32, i32* %55
%83 = icmp eq i32 %81, %82
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = load i32, i32* %31
%87 = load i32, i32* %61
%88 = icmp eq i32 %86, %87
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%92 = call i32 @otp_decode(i8* %91, i32* %9, i32 5)
%93 = call i32 @strstr(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%94 = call i32 @assert(i32 %93)
ret void
}