#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 order = atoi(argv[1]);
  fprintf(stdout, ">>planar_code<<");
  fprintf(stdout, "%c", (unsigned char)order);
  fprintf(stdout, "%c", (unsigned char)order);
  fprintf(stdout, "%c", (unsigned char)2);
  fprintf(stdout, "%c", (unsigned char)0);
  int i;
  for (i = 2; i < order; i++) {
    fprintf(stdout, "%c", (unsigned char)(i - 1));
    fprintf(stdout, "%c", (unsigned char)(i + 1));
    fprintf(stdout, "%c", (unsigned char)0);
  }
  fprintf(stdout, "%c", (unsigned char)order - 1);
  fprintf(stdout, "%c", (unsigned char)1);
  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    12e0 <main+0x1c0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
movzbl %al,%edx
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
movzbl %al,%edx
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
lea    0xe36(%rip),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
lea    0xe1a(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    127f <main+0x15f>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
movzbl %al,%edx
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movzbl %al,%edx
lea    0xdc5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120c <main+0xec>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%eax
movzbl %al,%edx
sub    $0x1,%edx
lea    0xd7e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
lea    0xd67(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
lea    0xd4b(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ced(%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   %r12
push   %rbx
cmp    $0x2,%edi
jne    1255 <main+0x135>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
mov    0x2e8c(%rip),%r12
mov    (%r12),%edi
lea    0xeb7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movzbl %r15b,%r14d
lea    0xeb1(%rip),%rbp
mov    %rbp,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
cmp    $0x3,%r15d
jl     120d <main+0xed>
neg    %r15d
mov    $0x101,%ebx
lea    0xe5b(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edi
movzbl %bl,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    -0xfe(%rbx),%eax
movzbl %al,%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
xor    %edx,%edx
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    $0xff,%eax
jne    11c0 <main+0xa0>
mov    (%r12),%edi
add    $0xffffffff,%r14d
lea    0xdfa(%rip),%rbp
mov    %rbp,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2d75(%rip),%rax
jmp    1276 <main+0x156>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xd98(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r12
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
@stdout = global i32 0
@.str.1 = [16 x i8] c">>planar_code<<\00"
@.str.2 = [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 %72
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* @stdout
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @stdout
%25 = load i32, i32* %6
%26 = trunc i32 %25 to i8
%27 = zext i8 %26 to i32
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @stdout
%30 = load i32, i32* %6
%31 = trunc i32 %30 to i8
%32 = zext i8 %31 to i32
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = load i32, i32* @stdout
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%36 = load i32, i32* @stdout
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 2, i32* %7
br label %38
38: ; preds = %57, %17
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %60
42: ; preds = %38
%43 = load i32, i32* @stdout
%44 = load i32, i32* %7
%45 = sub nsw i32 %44, 1
%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.2, i64 0, i64 0), i32 %47)
%49 = load i32, i32* @stdout
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
%52 = trunc i32 %51 to i8
%53 = zext i8 %52 to i32
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = load i32, i32* @stdout
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %57
57: ; preds = %42
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %38
60: ; preds = %38
%61 = load i32, i32* @stdout
%62 = load i32, i32* %6
%63 = trunc i32 %62 to i8
%64 = zext i8 %63 to i32
%65 = sub nsw i32 %64, 1
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = load i32, i32* @stdout
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%69 = load i32, i32* @stdout
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%71 = load i32, i32* @EXIT_SUCCESS
store i32 %71, i32* %3
br label %72
72: ; preds = %60, %10
%73 = load i32, i32* %3
ret i32 %73
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s n\0A\00"
@EXIT_FAILURE = global i32 0
@stdout = global i32 0
@.str.1 = [16 x i8] c">>planar_code<<\00"
@.str.2 = [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 %45
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = load i32, i32* @stdout
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = and i32 %11, 255
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%19 = load i32, i32* @stdout
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%21 = load i32, i32* @stdout
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%23 = icmp sgt i32 %11, 2
br i1 %23, label %24, label %37
24: ; preds = %8, %24
%25 = phi i32 [ %31, %24 ], [ 2, %8 ]
%26 = load i32, i32* @stdout
%27 = add nuw i32 %25, 255
%28 = and i32 %27, 255
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = load i32, i32* @stdout
%31 = add nuw nsw i32 %25, 1
%32 = and i32 %31, 255
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = load i32, i32* @stdout
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%36 = icmp eq i32 %31, %11
br i1 %36, label %37, label %24
37: ; preds = %24, %8
%38 = load i32, i32* @stdout
%39 = add nsw i32 %15, -1
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @stdout
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%43 = load i32, i32* @stdout
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %45
45: ; preds = %37, %4
%46 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %37 ]
%47 = load i32, i32* %46
ret i32 %47
}