#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*/ inputBuf;

/* Variables and functions */
int /*<<< orphan*/ LibErrorCorrect_ConvolutionalCode_211(int, int *);
int /*<<< orphan*/ printf(char *, ...);
void LibErrorCorrect_DemoBasic_01(void) {
  size_t i;
  int inputBuf[] = {1, 0, 1, 1, 1};
  int outputBuf[2];
  for (i = 0; i < sizeof(inputBuf) / sizeof(int); i++) {
    LibErrorCorrect_ConvolutionalCode_211(inputBuf[i], outputBuf);
    printf("%d%d, ", outputBuf[0], outputBuf[1]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<LibErrorCorrect_DemoBasic_01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
cmpq   $0x5,-0x8(%rbp)
jae    1190 <LibErrorCorrect_DemoBasic_01+0x70>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
lea    -0x28(%rbp),%rsi
call   1040 <LibErrorCorrect_ConvolutionalCode_211@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114f <LibErrorCorrect_DemoBasic_01+0x2f>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LibErrorCorrect_DemoBasic_01>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    $0x1,%edi
mov    %r14,%rsi
call   1050 <LibErrorCorrect_ConvolutionalCode_211@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <LibErrorCorrect_ConvolutionalCode_211@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    %r14,%rsi
call   1050 <LibErrorCorrect_ConvolutionalCode_211@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    %r14,%rsi
call   1050 <LibErrorCorrect_ConvolutionalCode_211@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    %r14,%rsi
call   1050 <LibErrorCorrect_ConvolutionalCode_211@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.LibErrorCorrect_DemoBasic_01.inputBuf = [5 x i32] [i32 1, i32 0, i32 1, i32 1, i32 1]
@.str = [7 x i8] c"%d%d, \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @LibErrorCorrect_DemoBasic_01() {
%1 = alloca i64
%2 = alloca [5 x i32]
%3 = alloca [2 x i32]
%4 = bitcast [5 x i32]* %2 to i8*
store i64 0, i64* %1
br label %5
5: ; preds = %19, %0
%6 = load i64, i64* %1
%7 = icmp ult i64 %6, 5
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i64, i64* %1
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%13 = call i32 @LibErrorCorrect_ConvolutionalCode_211(i32 %11, i32* %12)
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %17)
br label %19
19: ; preds = %8
%20 = load i64, i64* %1
%21 = add i64 %20, 1
store i64 %21, i64* %1
br label %5
22: ; preds = %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d, \00"
define void @LibErrorCorrect_DemoBasic_01() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%5 = call i32 @LibErrorCorrect_ConvolutionalCode_211(i32 1, i32* %3)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @LibErrorCorrect_ConvolutionalCode_211(i32 0, i32* %3)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = call i32 @LibErrorCorrect_ConvolutionalCode_211(i32 1, i32* %3)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
%17 = call i32 @LibErrorCorrect_ConvolutionalCode_211(i32 1, i32* %3)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
%21 = call i32 @LibErrorCorrect_ConvolutionalCode_211(i32 1, i32* %3)
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23)
%25 = call i32 @putchar(i32 10)
ret void
}