#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 random();
int /*<<< orphan*/ rsdec_204(unsigned char *, unsigned char *);
int /*<<< orphan*/ rsenc_204(unsigned char *, unsigned char *);
int main(void) {
  unsigned char rs_in[204], rs_out[204];
  int i, j, k;
  for (i = 0; i < 150000; ++i) {
    for (j = 0; j < 188; ++j) {
      rs_in[j] = (random() & 0xFF);
    }
    rsenc_204(rs_out, rs_in);
    k = random() & 0x7F;
    for (j = 0; j < k; ++j) {
      rs_out[random() % 204] = (random() & 0xFF);
    }
    rsdec_204(rs_in, rs_out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x249f0,-0x1a4(%rbp)
jge    1251 <main+0x121>
movl   $0x0,-0x1a8(%rbp)
cmpl   $0xbc,-0x1a8(%rbp)
jge    11a6 <main+0x76>
mov    $0x0,%al
call   1040 <random@plt>
and    $0xff,%eax
mov    %al,%cl
movslq -0x1a8(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1166 <main+0x36>
lea    -0x1a0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1050 <rsenc_204@plt>
mov    $0x0,%al
call   1040 <random@plt>
and    $0x7f,%eax
mov    %eax,-0x1ac(%rbp)
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x1ac(%rbp),%eax
jge    122a <main+0xfa>
mov    $0x0,%al
call   1040 <random@plt>
and    $0xff,%eax
mov    %al,-0x1ad(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    -0x1ad(%rbp),%cl
mov    $0xcc,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %cl,-0x1a0(%rbp,%rax,1)
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    11d3 <main+0xa3>
lea    -0xd0(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   1030 <rsdec_204@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    114c <main+0x1c>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1a0,%rsp
mov    %rsp,%r14
lea    0xd0(%rsp),%r15
xor    %r12d,%r12d
jmp    116c <main+0x3c>
nop
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <rsdec_204@plt>
add    $0x1,%r12d
cmp    $0x249f0,%r12d
je     11f0 <main+0xc0>
xor    %ebx,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <random@plt>
mov    %al,0xd0(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0xbc,%rbx
jne    1170 <main+0x40>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <rsenc_204@plt>
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%ebp
and    $0x7f,%ebp
je     1150 <main+0x20>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <random@plt>
cltq
imul   $0xffffffffa0a0a0a1,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
imul   $0xcc,%ecx,%ecx
sub    %ecx,%eax
cltq
mov    %bl,(%rsp,%rax,1)
add    $0xffffffff,%ebp
jne    11b0 <main+0x80>
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [204 x i8]
%3 = alloca [204 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %7
7: ; preds = %49, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 150000
br i1 %9, label %10, label %52
10: ; preds = %7
store i32 0, i32* %5
br label %11
11: ; preds = %21, %10
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 188
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = call i32 (...) @random()
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [204 x i8], [204 x i8]* %2, i64 0, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
%25 = getelementptr inbounds [204 x i8], [204 x i8]* %3, i64 0, i64 0
%26 = getelementptr inbounds [204 x i8], [204 x i8]* %2, i64 0, i64 0
%27 = call i32 @rsenc_204(i8* %25, i8* %26)
%28 = call i32 (...) @random()
%29 = and i32 %28, 127
store i32 %29, i32* %6
store i32 0, i32* %5
br label %30
30: ; preds = %42, %24
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %45
34: ; preds = %30
%35 = call i32 (...) @random()
%36 = and i32 %35, 255
%37 = trunc i32 %36 to i8
%38 = call i32 (...) @random()
%39 = srem i32 %38, 204
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [204 x i8], [204 x i8]* %3, i64 0, i64 %40
store i8 %37, i8* %41
br label %42
42: ; preds = %34
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %30
45: ; preds = %30
%46 = getelementptr inbounds [204 x i8], [204 x i8]* %2, i64 0, i64 0
%47 = getelementptr inbounds [204 x i8], [204 x i8]* %3, i64 0, i64 0
%48 = call i32 @rsdec_204(i8* %46, i8* %47)
br label %49
49: ; preds = %45
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %7
52: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [204 x i8]
%2 = alloca [204 x i8]
%3 = getelementptr inbounds [204 x i8], [204 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [204 x i8], [204 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %0, %29
%6 = phi i32 [ 0, %0 ], [ %31, %29 ]
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = call i32 (...) @random()
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [204 x i8], [204 x i8]* %1, i64 0, i64 %8
store i8 %10, i8* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, 188
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = call i32 @rsenc_204(i8* %4, i8* %3)
%16 = call i32 (...) @random()
%17 = and i32 %16, 127
%18 = icmp eq i32 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %14, %19
%20 = phi i32 [ %27, %19 ], [ 0, %14 ]
%21 = call i32 (...) @random()
%22 = trunc i32 %21 to i8
%23 = call i32 (...) @random()
%24 = srem i32 %23, 204
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [204 x i8], [204 x i8]* %2, i64 0, i64 %25
store i8 %22, i8* %26
%27 = add nuw nsw i32 %20, 1
%28 = icmp eq i32 %27, %17
br i1 %28, label %29, label %19
29: ; preds = %19, %14
%30 = call i32 @rsdec_204(i8* %3, i8* %4)
%31 = add nuw nsw i32 %6, 1
%32 = icmp eq i32 %31, 150000
br i1 %32, label %33, label %5
33: ; preds = %29
ret i32 0
}