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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ channel_encode(int *, int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Hello World!!!");
  int i;
  uint8_t input[] = {254, 79, 143, 0, 0, 0, 0, 0};
  uint8_t answers[] = {182, 22, 66, 201, 81, 0, 0, 0};
  uint8_t answerp[] = {44, 72, 207, 90, 59, 196, 193, 114, 189, 14, 254, 0, 0};
  uint8_t outsys[10] = {0};
  uint8_t outpar[27] = {0};
  uint8_t outall[400] = {0xFF};
  uint8_t input2[] = {0x87, 0x00, 0xa4, 0x4a, 0x4f, 0x45, 0x59, 0x01, 0xcd,
                      0x28, 0xf5, 0x02, 0xcd, 0xf0, 0x8e, 0x03, 0x93, 0xce,
                      0x1e, 0x5b, 0x92, 0x16, 0xd2, 0xff, 0x2c, 0x8c, 0x5c,
                      0x10, 0x04, 0x05, 0x05, 0x03, 0x0a, 0x78, 0x00, 0x00,
                      0x00, 0x00, 0x00, 0xc9, 0x1e};
  uint16_t ll = channel_encode(input2, outall, 328, 6837330, 0);
  uint16_t l = channel_encode(input, outall, 40, 527370, 0);
  uint8_t errors = 0;
  for (i = 0; i < 11; i++) {
    if (answerp[i] != outpar[i])
      errors++;
  }
  for (i = 0; i < 6; i++) {
    if (answers[i] != outsys[i])
      errors++;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    0xebb(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeac(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xea9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x6c,%edx
call   1040 <memset@plt>
lea    -0x770(%rbp),%rdi
xor    %esi,%esi
mov    $0x640,%edx
call   1040 <memset@plt>
movl   $0xff,-0x770(%rbp)
lea    -0x820(%rbp),%rdi
lea    0xe81(%rip),%rsi
mov    $0xa4,%edx
call   1050 <memcpy@plt>
lea    -0x820(%rbp),%rdi
lea    -0x770(%rbp),%rsi
mov    $0x148,%edx
mov    $0x685452,%ecx
xor    %r8d,%r8d
call   1060 <channel_encode@plt>
mov    %eax,-0x824(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x770(%rbp),%rsi
mov    $0x28,%edx
mov    $0x80c0a,%ecx
xor    %r8d,%r8d
call   1060 <channel_encode@plt>
mov    %eax,-0x828(%rbp)
movl   $0x0,-0x82c(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jge    12cb <main+0x18b>
movslq -0x8(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x130(%rbp,%rcx,4),%eax
je     12b8 <main+0x178>
mov    -0x82c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x82c(%rbp)
jmp    12bd <main+0x17d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1283 <main+0x143>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1317 <main+0x1d7>
movslq -0x8(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0xc0(%rbp,%rcx,4),%eax
je     1304 <main+0x1c4>
mov    -0x82c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x82c(%rbp)
jmp    1309 <main+0x1c9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d2 <main+0x192>
mov    0x2cc2(%rip),%rax
mov    (%rax),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x718,%rsp
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xd0(%rsp),%r14
mov    $0x640,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0xff,0xd0(%rsp)
lea    0xeaa(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    $0xa4,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x148,%edx
mov    $0x685452,%ecx
xor    %r8d,%r8d
call   1060 <channel_encode@plt>
mov    %rsp,%rdi
mov    %r14,%rsi
mov    $0x28,%edx
mov    $0x80c0a,%ecx
xor    %r8d,%r8d
call   1060 <channel_encode@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%eax
add    $0x718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@__const.main.input = [8 x i32] [i32 254, i32 79, i32 143, i32 0, i32 0, i32 0, i32 0, i32 0]
@__const.main.answers = [8 x i32] [i32 182, i32 22, i32 66, i32 201, i32 81, i32 0, i32 0, i32 0]
@__const.main.answerp = [13 x i32] [i32 44, i32 72, i32 207, i32 90, i32 59, i32 196, i32 193, i32 114, i32 189, i32 14, i32 254, i32 0, i32 0]
@__const.main.input2 = [41 x i32] [i32 135, i32 0, i32 164, i32 74, i32 79, i32 69, i32 89, i32 1, i32 205, i32 40, i32 245, i32 2, i32 205, i32 240, i32 142, i32 3, i32 147, i32 206, i32 30, i32 91, i32 146, i32 22, i32 210, i32 255, i32 44, i32 140, i32 92, i32 16, i32 4, i32 5, i32 5, i32 3, i32 10, i32 120, i32 0, i32 0, i32 0, i32 0, i32 0, i32 201, i32 30]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
%4 = alloca [8 x i32]
%5 = alloca [13 x i32]
%6 = alloca [10 x i32]
%7 = alloca [27 x i32]
%8 = alloca [400 x i32]
%9 = alloca [41 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%14 = bitcast [8 x i32]* %3 to i8*
%15 = bitcast [8 x i32]* %4 to i8*
%16 = bitcast [13 x i32]* %5 to i8*
%17 = bitcast [10 x i32]* %6 to i8*
%18 = bitcast [27 x i32]* %7 to i8*
%19 = bitcast [400 x i32]* %8 to i8*
%20 = bitcast i8* %19 to <{ i32, [399 x i32] }>*
%21 = getelementptr inbounds <{ i32, [399 x i32] }>, <{ i32, [399 x i32] }>* %20, i32 0, i32 0
store i32 255, i32* %21
%22 = bitcast [41 x i32]* %9 to i8*
%23 = getelementptr inbounds [41 x i32], [41 x i32]* %9, i64 0, i64 0
%24 = getelementptr inbounds [400 x i32], [400 x i32]* %8, i64 0, i64 0
%25 = call i32 @channel_encode(i32* %23, i32* %24, i32 328, i32 6837330, i32 0)
store i32 %25, i32* %10
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%27 = getelementptr inbounds [400 x i32], [400 x i32]* %8, i64 0, i64 0
%28 = call i32 @channel_encode(i32* %26, i32* %27, i32 40, i32 527370, i32 0)
store i32 %28, i32* %11
store i32 0, i32* %12
store i32 0, i32* %2
br label %29
29: ; preds = %46, %0
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 11
br i1 %31, label %32, label %49
32: ; preds = %29
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [13 x i32], [13 x i32]* %5, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [27 x i32], [27 x i32]* %7, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = icmp ne i32 %36, %40
br i1 %41, label %42, label %45
42: ; preds = %32
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 1
store i32 %44, i32* %12
br label %45
45: ; preds = %42, %32
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %29
49: ; preds = %29
store i32 0, i32* %2
br label %50
50: ; preds = %67, %49
%51 = load i32, i32* %2
%52 = icmp slt i32 %51, 6
br i1 %52, label %53, label %70
53: ; preds = %50
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = icmp ne i32 %57, %61
br i1 %62, label %63, label %66
63: ; preds = %53
%64 = load i32, i32* %12
%65 = add nsw i32 %64, 1
store i32 %65, i32* %12
br label %66
66: ; preds = %63, %53
br label %67
67: ; preds = %66
%68 = load i32, i32* %2
%69 = add nsw i32 %68, 1
store i32 %69, i32* %2
br label %50
70: ; preds = %50
%71 = load i32, i32* @EXIT_SUCCESS
ret i32 %71
}

LLVM IR (-O2):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@__const.main.input = [8 x i32] [i32 254, i32 79, i32 143, i32 0, i32 0, i32 0, i32 0, i32 0]
@__const.main.input2 = [41 x i32] [i32 135, i32 0, i32 164, i32 74, i32 79, i32 69, i32 89, i32 1, i32 205, i32 40, i32 245, i32 2, i32 205, i32 240, i32 142, i32 3, i32 147, i32 206, i32 30, i32 91, i32 146, i32 22, i32 210, i32 255, i32 44, i32 140, i32 92, i32 16, i32 4, i32 5, i32 5, i32 3, i32 10, i32 120, i32 0, i32 0, i32 0, i32 0, i32 0, i32 201, i32 30]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca [400 x i32]
%3 = alloca [41 x i32]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [8 x i32]* %1 to i8*
%6 = bitcast [400 x i32]* %2 to i8*
%7 = getelementptr inbounds [400 x i32], [400 x i32]* %2, i64 0, i64 0
store i32 255, i32* %7
%8 = bitcast [41 x i32]* %3 to i8*
%9 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 0
%10 = call i32 @channel_encode(i32* %9, i32* %7, i32 328, i32 6837330, i32 0)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%12 = call i32 @channel_encode(i32* %11, i32* %7, i32 40, i32 527370, i32 0)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}