#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "%s n\n", argv[0]);
    return EXIT_FAILURE;
  }
  int base = atoi(argv[1]);
  if (base < 3) {
    fprintf(stderr, "Size of base should at least be 3.\n");
    return EXIT_FAILURE;
  }
  fprintf(stdout, ">>planar_code<<");
  fprintf(stdout, "%c", (unsigned char)(2 * base + 1));
  int i;
  for (i = 0; i < base; i++) {
    fprintf(stdout, "%c", (unsigned char)(i + 2));
  }
  fprintf(stdout, "%c", (unsigned char)0);
  for (i = base + 2; i < 2 * base + 1; i++) {
    fprintf(stdout, "%c", (unsigned char)1);
    fprintf(stdout, "%c", (unsigned char)i);
    fprintf(stdout, "%c", (unsigned char)(i + 1));
    fprintf(stdout, "%c", (unsigned char)0);
  }
  fprintf(stdout, "%c", (unsigned char)1);
  fprintf(stdout, "%c", (unsigned char)(2 * base + 1));
  fprintf(stdout, "%c", (unsigned char)(base + 2));
  fprintf(stdout, "%c", (unsigned char)0);
  fprintf(stdout, "%c", (unsigned char)2);
  fprintf(stdout, "%c", (unsigned char)(base + 1));
  fprintf(stdout, "%c", (unsigned char)(2 * base + 1));
  fprintf(stdout, "%c", (unsigned char)(base + 3));
  fprintf(stdout, "%c", (unsigned char)0);
  for (i = 3; i < base + 1; i++) {
    fprintf(stdout, "%c", (unsigned char)i);
    fprintf(stdout, "%c", (unsigned char)(i - 1));
    fprintf(stdout, "%c", (unsigned char)(base + i - 1));
    fprintf(stdout, "%c", (unsigned char)(base + i + 1));
    fprintf(stdout, "%c", (unsigned char)0);
  }
  fprintf(stdout, "%c", (unsigned char)(base + 1));
  fprintf(stdout, "%c", (unsigned char)base);
  fprintf(stdout, "%c", (unsigned char)(2 * base));
  fprintf(stdout, "%c", (unsigned char)(base + 2));
  fprintf(stdout, "%c", (unsigned char)0);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x4f>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1556 <main+0x436>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11b1 <main+0x91>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1556 <main+0x436>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    122c <main+0x10c>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
add    $0x2,%eax
movzbl %al,%edx
lea    0xe23(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f2 <main+0xd2>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xdfe(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    12e2 <main+0x1c2>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
lea    0xdc8(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
movzbl %al,%edx
lea    0xda6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xd86(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
lea    0xd6f(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    124e <main+0x12e>
mov    0x2ce7(%rip),%rax
mov    (%rax),%edi
lea    0xd48(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ccb(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    $0x2,%eax
movzbl %al,%edx
lea    0xd00(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
lea    0xce9(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c6f(%rip),%rax
mov    (%rax),%edi
lea    0xcd0(%rip),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c53(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xcab(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c33(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xc88(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c10(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    $0x3,%eax
movzbl %al,%edx
lea    0xc68(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x3,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    14b4 <main+0x394>
mov    0x2bbf(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
movzbl %al,%edx
lea    0xc1a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ba2(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
movzbl %al,%edx
lea    0xbfa(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b82(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
sub    $0x1,%eax
movzbl %al,%edx
lea    0xbd7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b5f(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xbb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
lea    0xb9d(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13f9 <main+0x2d9>
mov    0x2b15(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xb6d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2af5(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
movzbl %al,%edx
lea    0xb50(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ad8(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
movzbl %al,%edx
lea    0xb30(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ab8(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
add    $0x2,%eax
movzbl %al,%edx
lea    0xb10(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2a98(%rip),%rax
mov    (%rax),%edi
lea    0xaf9(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2a77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    1164 <main+0x44>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
cmp    $0x2,%eax
jg     118a <main+0x6a>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
jmp    143d <main+0x31d>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe89(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e53(%rip),%rax
jmp    143d <main+0x31d>
mov    %eax,%r12d
mov    0x2e3c(%rip),%r14
mov    (%r14),%edi
lea    0xe8c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    (%r12,%r12,1),%eax
mov    %eax,0xc(%rsp)
lea    (%r12,%r12,1),%r13d
add    $0x1,%r13d
movzbl %r13b,%edx
lea    0xe77(%rip),%rbp
mov    %rbp,%rsi
mov    %edx,0x8(%rsp)
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %r12d,%r15d
neg    %r15d
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    (%r14),%edi
movzbl %bl,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
jne    11e0 <main+0xc0>
mov    (%r14),%edi
lea    0xe2d(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %r12,0x10(%rsp)
lea    0x2(%r12),%eax
mov    %eax,(%rsp)
cmp    %r13d,%eax
jge    1290 <main+0x170>
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%ebx
lea    0x3(%rax),%r13d
lea    0xdff(%rip),%rbp
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r13),%r12d
mov    (%r14),%edi
mov    %rbp,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
movzbl %r12b,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
movzbl %r13b,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r13d
add    $0xffffffff,%ebx
jne    1240 <main+0x120>
mov    (%r14),%edi
lea    0xda0(%rip),%rbp
mov    %rbp,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
mov    0x8(%rsp),%ebx
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
movzbl (%rsp),%edx
mov    %rbp,%rsi
mov    %edx,(%rsp)
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    0x10(%rsp),%r12
lea    0x1(%r12),%eax
movzbl %al,%edx
mov    %rbp,%rsi
mov    %edx,0x4(%rsp)
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x3(%r12),%eax
movzbl %al,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %r12d,%ebx
add    $0x102,%ebx
mov    $0x102,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0xff(%r13),%eax
mov    (%r14),%edi
movzbl %al,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
movzbl %r13b,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
movzbl %bl,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    -0xfe(%rbx),%eax
movzbl %al,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    (%r15,%r13,1),%eax
add    $0x1,%eax
mov    %r13d,%ecx
add    $0x1,%ecx
add    $0x1,%ebx
mov    %ecx,%r13d
cmp    $0x100,%eax
jne    1360 <main+0x240>
mov    (%r14),%edi
lea    0xc59(%rip),%rbp
mov    %rbp,%rsi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
movzbl %r12b,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    0xc(%rsp),%edx
and    $0xfe,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
mov    (%rsp),%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2b8b(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s n\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [36 x i8] c"Size of base should at least be 3.\0A\00"
@stdout = global i32 0
@.str.2 = [16 x i8] c">>planar_code<<\00"
@.str.3 = [3 x i8] c"%c\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %3
br label %188
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 3
br i1 %23, label %24, label %28
24: ; preds = %17
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
store i32 %27, i32* %3
br label %188
28: ; preds = %17
%29 = load i32, i32* @stdout
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @stdout
%32 = load i32, i32* %6
%33 = mul nsw i32 2, %32
%34 = add nsw i32 %33, 1
%35 = trunc i32 %34 to i8
%36 = zext i8 %35 to i32
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %36)
store i32 0, i32* %7
br label %38
38: ; preds = %49, %28
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %52
42: ; preds = %38
%43 = load i32, i32* @stdout
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 2
%46 = trunc i32 %45 to i8
%47 = zext i8 %46 to i32
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %42
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %38
52: ; preds = %38
%53 = load i32, i32* @stdout
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 2
store i32 %56, i32* %7
br label %57
57: ; preds = %79, %52
%58 = load i32, i32* %7
%59 = load i32, i32* %6
%60 = mul nsw i32 2, %59
%61 = add nsw i32 %60, 1
%62 = icmp slt i32 %58, %61
br i1 %62, label %63, label %82
63: ; preds = %57
%64 = load i32, i32* @stdout
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 1)
%66 = load i32, i32* @stdout
%67 = load i32, i32* %7
%68 = trunc i32 %67 to i8
%69 = zext i8 %68 to i32
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %69)
%71 = load i32, i32* @stdout
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
%74 = trunc i32 %73 to i8
%75 = zext i8 %74 to i32
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %75)
%77 = load i32, i32* @stdout
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %79
79: ; preds = %63
%80 = load i32, i32* %7
%81 = add nsw i32 %80, 1
store i32 %81, i32* %7
br label %57
82: ; preds = %57
%83 = load i32, i32* @stdout
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 1)
%85 = load i32, i32* @stdout
%86 = load i32, i32* %6
%87 = mul nsw i32 2, %86
%88 = add nsw i32 %87, 1
%89 = trunc i32 %88 to i8
%90 = zext i8 %89 to i32
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %90)
%92 = load i32, i32* @stdout
%93 = load i32, i32* %6
%94 = add nsw i32 %93, 2
%95 = trunc i32 %94 to i8
%96 = zext i8 %95 to i32
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %96)
%98 = load i32, i32* @stdout
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%100 = load i32, i32* @stdout
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%102 = load i32, i32* @stdout
%103 = load i32, i32* %6
%104 = add nsw i32 %103, 1
%105 = trunc i32 %104 to i8
%106 = zext i8 %105 to i32
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %106)
%108 = load i32, i32* @stdout
%109 = load i32, i32* %6
%110 = mul nsw i32 2, %109
%111 = add nsw i32 %110, 1
%112 = trunc i32 %111 to i8
%113 = zext i8 %112 to i32
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %113)
%115 = load i32, i32* @stdout
%116 = load i32, i32* %6
%117 = add nsw i32 %116, 3
%118 = trunc i32 %117 to i8
%119 = zext i8 %118 to i32
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %119)
%121 = load i32, i32* @stdout
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
store i32 3, i32* %7
br label %123
123: ; preds = %158, %82
%124 = load i32, i32* %7
%125 = load i32, i32* %6
%126 = add nsw i32 %125, 1
%127 = icmp slt i32 %124, %126
br i1 %127, label %128, label %161
128: ; preds = %123
%129 = load i32, i32* @stdout
%130 = load i32, i32* %7
%131 = trunc i32 %130 to i8
%132 = zext i8 %131 to i32
%133 = call i32 (i32, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %132)
%134 = load i32, i32* @stdout
%135 = load i32, i32* %7
%136 = sub nsw i32 %135, 1
%137 = trunc i32 %136 to i8
%138 = zext i8 %137 to i32
%139 = call i32 (i32, i8*, ...) @fprintf(i32 %134, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %138)
%140 = load i32, i32* @stdout
%141 = load i32, i32* %6
%142 = load i32, i32* %7
%143 = add nsw i32 %141, %142
%144 = sub nsw i32 %143, 1
%145 = trunc i32 %144 to i8
%146 = zext i8 %145 to i32
%147 = call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %146)
%148 = load i32, i32* @stdout
%149 = load i32, i32* %6
%150 = load i32, i32* %7
%151 = add nsw i32 %149, %150
%152 = add nsw i32 %151, 1
%153 = trunc i32 %152 to i8
%154 = zext i8 %153 to i32
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %154)
%156 = load i32, i32* @stdout
%157 = call i32 (i32, i8*, ...) @fprintf(i32 %156, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %158
158: ; preds = %128
%159 = load i32, i32* %7
%160 = add nsw i32 %159, 1
store i32 %160, i32* %7
br label %123
161: ; preds = %123
%162 = load i32, i32* @stdout
%163 = load i32, i32* %6
%164 = add nsw i32 %163, 1
%165 = trunc i32 %164 to i8
%166 = zext i8 %165 to i32
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %166)
%168 = load i32, i32* @stdout
%169 = load i32, i32* %6
%170 = trunc i32 %169 to i8
%171 = zext i8 %170 to i32
%172 = call i32 (i32, i8*, ...) @fprintf(i32 %168, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %171)
%173 = load i32, i32* @stdout
%174 = load i32, i32* %6
%175 = mul nsw i32 2, %174
%176 = trunc i32 %175 to i8
%177 = zext i8 %176 to i32
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %173, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %177)
%179 = load i32, i32* @stdout
%180 = load i32, i32* %6
%181 = add nsw i32 %180, 2
%182 = trunc i32 %181 to i8
%183 = zext i8 %182 to i32
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %183)
%185 = load i32, i32* @stdout
%186 = call i32 (i32, i8*, ...) @fprintf(i32 %185, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%187 = load i32, i32* @EXIT_SUCCESS
store i32 %187, i32* %3
br label %188
188: ; preds = %161, %24, %10
%189 = load i32, i32* %3
ret i32 %189
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s n\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [36 x i8] c"Size of base should at least be 3.\0A\00"
@stdout = global i32 0
@.str.2 = [16 x i8] c">>planar_code<<\00"
@.str.3 = [3 x i8] c"%c\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %110
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %110
16: ; preds = %8
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = shl nuw nsw i32 %11, 1
%21 = or i32 %20, 1
%22 = and i32 %21, 255
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %16, %24
%25 = phi i32 [ %30, %24 ], [ 0, %16 ]
%26 = load i32, i32* @stdout
%27 = add nuw i32 %25, 2
%28 = and i32 %27, 255
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i32 %25, 1
%31 = icmp eq i32 %30, %11
br i1 %31, label %32, label %24
32: ; preds = %24
%33 = load i32, i32* @stdout
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%35 = add nsw i32 %11, 2
%36 = icmp slt i32 %35, %21
br i1 %36, label %37, label %51
37: ; preds = %32, %37
%38 = phi i32 [ %45, %37 ], [ %35, %32 ]
%39 = load i32, i32* @stdout
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 1)
%41 = load i32, i32* @stdout
%42 = and i32 %38, 255
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%44 = load i32, i32* @stdout
%45 = add i32 %38, 1
%46 = and i32 %45, 255
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%48 = load i32, i32* @stdout
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%50 = icmp eq i32 %45, %21
br i1 %50, label %51, label %37
51: ; preds = %37, %32
%52 = load i32, i32* @stdout
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 1)
%54 = load i32, i32* @stdout
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%56 = load i32, i32* @stdout
%57 = and i32 %35, 255
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%59 = load i32, i32* @stdout
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%61 = load i32, i32* @stdout
%62 = tail call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%63 = load i32, i32* @stdout
%64 = add i32 %11, 1
%65 = and i32 %64, 255
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %65)
%67 = load i32, i32* @stdout
%68 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%69 = load i32, i32* @stdout
%70 = add i32 %11, 3
%71 = and i32 %70, 255
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %71)
%73 = load i32, i32* @stdout
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %75
75: ; preds = %51, %75
%76 = phi i32 [ %95, %75 ], [ 3, %51 ]
%77 = load i32, i32* @stdout
%78 = and i32 %76, 255
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %78)
%80 = load i32, i32* @stdout
%81 = add nuw i32 %76, 255
%82 = and i32 %81, 255
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %82)
%84 = load i32, i32* @stdout
%85 = add nsw i32 %76, %11
%86 = add i32 %85, 255
%87 = and i32 %86, 255
%88 = tail call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %87)
%89 = load i32, i32* @stdout
%90 = add i32 %85, 1
%91 = and i32 %90, 255
%92 = tail call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %91)
%93 = load i32, i32* @stdout
%94 = tail call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
%95 = add nuw i32 %76, 1
%96 = icmp eq i32 %76, %11
br i1 %96, label %97, label %75
97: ; preds = %75
%98 = load i32, i32* @stdout
%99 = tail call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %65)
%100 = load i32, i32* @stdout
%101 = and i32 %11, 255
%102 = tail call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %101)
%103 = load i32, i32* @stdout
%104 = and i32 %20, 254
%105 = tail call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %104)
%106 = load i32, i32* @stdout
%107 = tail call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%108 = load i32, i32* @stdout
%109 = tail call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %110
110: ; preds = %13, %97, %4
%111 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_FAILURE, %13 ], [ @EXIT_SUCCESS, %97 ]
%112 = load i32, i32* %111
ret i32 %112
}