#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 /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ map_squares_to_winlines();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_dupes();
int /*<<< orphan*/ test_store_cmdline_seq(char *);
int main(int argc, char **argv) {
  map_squares_to_winlines();
  printf("ORDER %d, SPLIT_KEY_INDEX %d\n", 4096, ((4096 - 1) / 2));
  if (argc == 2) {
    test_store_cmdline_seq(argv[1]);
    exit(EXIT_SUCCESS);
  }
  test_dupes();
  printf("Done\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <map_squares_to_winlines@plt>
lea    0xe93(%rip),%rdi
mov    $0x1000,%esi
mov    $0x7ff,%edx
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x2,-0x4(%rbp)
jne    11a3 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <test_store_cmdline_seq@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1030 <test_dupes@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <map_squares_to_winlines@plt>
lea    0xe8a(%rip),%rdi
mov    $0x1000,%esi
mov    $0x7ff,%edx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x2,%ebp
je     11a8 <main+0x48>
xor    %eax,%eax
call   1030 <test_dupes@plt>
lea    0xe84(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x8(%rbx),%rdi
call   1060 <test_store_cmdline_seq@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"ORDER %d, SPLIT_KEY_INDEX %d\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [6 x i8] c"Done\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @map_squares_to_winlines()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 4096, i32 2047)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @test_store_cmdline_seq(i8* %12)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = call i32 (...) @test_dupes()
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"ORDER %d, SPLIT_KEY_INDEX %d\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [5 x i8] c"Done\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @map_squares_to_winlines()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 4096, i32 2047)
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @test_store_cmdline_seq(i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = tail call i32 (...) @test_dupes()
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}