#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 petalCount = atoi(argv[1]);
  fprintf(stdout, ">>planar_code<<");
  fprintf(stdout, "%c", (unsigned char)2 * petalCount + 1);
  int i;
  for (i = 2; i <= 2 * petalCount + 1; i++) {
    fprintf(stdout, "%c", (unsigned char)i);
  }
  fprintf(stdout, "%c", (unsigned char)0);
  for (i = 2; i <= 2 * petalCount + 1; i += 2) {
    fprintf(stdout, "%c", (unsigned char)1);
    fprintf(stdout, "%c", (unsigned char)i + 1);
    fprintf(stdout, "%c", (unsigned char)0);
    fprintf(stdout, "%c", (unsigned char)1);
    fprintf(stdout, "%c", (unsigned char)i);
    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    12f1 <main+0x1d1>
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),%edx
shl    $0x1,%edx
add    $0x1,%edx
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     11fc <main+0xdc>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
movzbl %al,%edx
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bd <main+0x9d>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
lea    0xe0a(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     12e5 <main+0x1c5>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
lea    0xdd6(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
movzbl %al,%edx
add    $0x1,%edx
lea    0xdb1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
lea    0xd9a(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
lea    0xd81(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d28(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%eax
movzbl %al,%edx
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
lea    0xd48(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    121c <main+0xfc>
mov    0x2cdc(%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
push   %rax
cmp    $0x2,%edi
jne    1191 <main+0x71>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
mov    0x2e8e(%rip),%r15
mov    (%r15),%edi
lea    0xeba(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    (%rbx,%rbx,1),%r14d
add    $0x1,%r14d
lea    0xeb1(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
cmp    $0x1,%r14d
jg     11c5 <main+0xa5>
mov    (%r15),%edi
lea    0xe97(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e39(%rip),%r12
jmp    11b2 <main+0x92>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe5c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e26(%rip),%r12
mov    (%r12),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    %ebx,%ebx
neg    %ebx
mov    $0x2,%ebp
lea    0xe41(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15),%edi
movzbl %bpl,%edx
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x2,%eax
jne    11e0 <main+0xc0>
mov    (%r15),%edi
lea    0xe09(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2dab(%rip),%r12
cmp    $0x2,%r14d
jl     11b2 <main+0x92>
mov    $0x2,%ebx
lea    0xde7(%rip),%r13
nop
mov    (%r15),%edi
mov    %r13,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %ebx,%ebp
and    $0xfe,%ebp
lea    0x1(%rbp),%edx
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %r13,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %r13,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x2,%ebx
cmp    %r14d,%ebx
jle    1230 <main+0x110>
jmp    11b2 <main+0x92>

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 %78
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 = mul nsw i32 2, %25
%27 = add nsw i32 %26, 1
%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)
store i32 2, i32* %7
br label %29
29: ; preds = %41, %17
%30 = load i32, i32* %7
%31 = load i32, i32* %6
%32 = mul nsw i32 2, %31
%33 = add nsw i32 %32, 1
%34 = icmp sle i32 %30, %33
br i1 %34, label %35, label %44
35: ; preds = %29
%36 = load i32, i32* @stdout
%37 = load i32, i32* %7
%38 = trunc i32 %37 to i8
%39 = zext i8 %38 to i32
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %35
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %29
44: ; preds = %29
%45 = load i32, i32* @stdout
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 2, i32* %7
br label %47
47: ; preds = %73, %44
%48 = load i32, i32* %7
%49 = load i32, i32* %6
%50 = mul nsw i32 2, %49
%51 = add nsw i32 %50, 1
%52 = icmp sle i32 %48, %51
br i1 %52, label %53, label %76
53: ; preds = %47
%54 = load i32, i32* @stdout
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%56 = load i32, i32* @stdout
%57 = load i32, i32* %7
%58 = trunc i32 %57 to i8
%59 = zext i8 %58 to i32
%60 = add nsw i32 %59, 1
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = load i32, i32* @stdout
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%64 = load i32, i32* @stdout
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, 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.2, i64 0, i64 0), i32 %69)
%71 = load i32, i32* @stdout
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %73
73: ; preds = %53
%74 = load i32, i32* %7
%75 = add nsw i32 %74, 2
store i32 %75, i32* %7
br label %47
76: ; preds = %47
%77 = load i32, i32* @EXIT_SUCCESS
store i32 %77, i32* %3
br label %78
78: ; preds = %76, %10
%79 = load i32, i32* %3
ret i32 %79
}

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 %52
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 = shl nsw i32 %11, 1
%16 = or i32 %15, 1
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = icmp slt i32 %16, 2
br i1 %18, label %19, label %22
19: ; preds = %8
%20 = load i32, i32* @stdout
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %52
22: ; preds = %8
%23 = or i32 %15, 1
br label %24
24: ; preds = %22, %24
%25 = phi i32 [ %29, %24 ], [ 2, %22 ]
%26 = load i32, i32* @stdout
%27 = and i32 %25, 255
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = add nuw i32 %25, 1
%30 = icmp eq i32 %25, %23
br i1 %30, label %31, label %24
31: ; preds = %24
%32 = load i32, i32* @stdout
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
br i1 %18, label %52, label %34
34: ; preds = %31, %34
%35 = phi i32 [ %50, %34 ], [ 2, %31 ]
%36 = load i32, i32* @stdout
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%38 = load i32, i32* @stdout
%39 = and i32 %35, 254
%40 = or i32 %39, 1
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %40)
%42 = load i32, i32* @stdout
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%44 = load i32, i32* @stdout
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%46 = load i32, i32* @stdout
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%48 = load i32, i32* @stdout
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%50 = add nuw nsw i32 %35, 2
%51 = icmp sgt i32 %50, %16
br i1 %51, label %52, label %34
52: ; preds = %34, %19, %31, %4
%53 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %31 ], [ @EXIT_SUCCESS, %19 ], [ @EXIT_SUCCESS, %34 ]
%54 = load i32, i32* %53
ret i32 %54
}