#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_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int startcp, endcp, thiscp;
  void hexprint4(int);
  void hexprint6(int);
  if (argc != 3) {
    fprintf(stderr, "\n%s - generate unifont.hex code points as\n", argv[0]);
    fprintf(stderr, "four-digit hexadecimal numbers in a 2 by 2 grid,\n");
    fprintf(stderr, "or six-digit hexadecimal numbers in a 3 by 2 grid.\n");
    fprintf(stderr, "Syntax:\n\n");
    fprintf(stderr, "     %s first_code_point last_code_point > glyphs.hex\n\n",
            argv[0]);
    fprintf(stderr,
            "Example (to generate glyphs for the Private Use Area):\n\n");
    fprintf(stderr, "     %s e000 f8ff > pua.hex\n\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  sscanf(argv[1], "%x", &startcp);
  sscanf(argv[2], "%x", &endcp);
  startcp &= 0xFFFFFF;
  endcp &= 0xFFFFFF;
  for (thiscp = startcp; thiscp <= endcp; thiscp++) {
    if (thiscp <= 0xFFFF) {
      hexprint4(thiscp);
    } else {
      hexprint6(thiscp);
    }
  }
  exit(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   $0x3,-0x8(%rbp)
je     1234 <main+0xe4>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xee7(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xecf(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x14(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     12c1 <main+0x171>
cmpl   $0xffff,-0x1c(%rbp)
jg     12a6 <main+0x156>
mov    -0x1c(%rbp),%edi
call   1030 <hexprint4@plt>
jmp    12ae <main+0x15e>
mov    -0x1c(%rbp),%edi
call   1040 <hexprint6@plt>
jmp    12b3 <main+0x163>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1280 <main+0x130>
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    11d0 <main+0x80>
mov    0x8(%rbx),%rdi
lea    0xfc3(%rip),%r14
lea    0x4(%rsp),%rdx
mov    %r14,%rsi
call   1060 <sscanf@plt>
mov    0x10(%rbx),%rdi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1060 <sscanf@plt>
mov    $0xffffff,%eax
mov    0x4(%rsp),%ebx
and    %eax,%ebx
mov    %ebx,0x4(%rsp)
and    (%rsp),%eax
mov    %eax,(%rsp)
cmp    %eax,%ebx
jbe    11bf <main+0x6f>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
nopw   0x0(%rax,%rax,1)
call   1040 <hexprint6@plt>
lea    0x1(%rbx),%eax
cmp    (%rsp),%ebx
mov    %eax,%ebx
jge    119c <main+0x4c>
mov    %ebx,%edi
cmp    $0xffff,%ebx
ja     11b0 <main+0x60>
call   1030 <hexprint4@plt>
jmp    11b5 <main+0x65>
mov    0x2e09(%rip),%r14
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xe1c(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xe36(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xe57(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xe70(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xe97(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xebc(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"\0A%s - generate unifont.hex code points as\0A\00"
@.str.1 = [50 x i8] c"four-digit hexadecimal numbers in a 2 by 2 grid,\0A\00"
@.str.2 = [52 x i8] c"or six-digit hexadecimal numbers in a 3 by 2 grid.\0A\00"
@.str.3 = [10 x i8] c"Syntax:\0A\0A\00"
@.str.4 = [56 x i8] c" %s first_code_point last_code_point > glyphs.hex\0A\0A\00"
@.str.5 = [57 x i8] c"Example (to generate glyphs for the Private Use Area):\0A\0A\00"
@.str.6 = [30 x i8] c" %s e000 f8ff > pua.hex\0A\0A\00"
@EXIT_FAILURE = global i32 0
@.str.7 = [3 x i8] c"%x\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
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 3
br i1 %10, label %11, label %37
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %33)
%35 = load i32, i32* @EXIT_FAILURE
%36 = call i32 @exit(i32 %35)
unreachable
37: ; preds = %2
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @sscanf(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %6)
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32 @sscanf(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %7)
%46 = load i32, i32* %6
%47 = and i32 %46, 16777215
store i32 %47, i32* %6
%48 = load i32, i32* %7
%49 = and i32 %48, 16777215
store i32 %49, i32* %7
%50 = load i32, i32* %6
store i32 %50, i32* %8
br label %51
51: ; preds = %63, %37
%52 = load i32, i32* %8
%53 = load i32, i32* %7
%54 = icmp sle i32 %52, %53
br i1 %54, label %55, label %66
55: ; preds = %51
%56 = load i32, i32* %8
%57 = icmp sle i32 %56, 65535
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = load i32, i32* %8
br label %62
60: ; preds = %55
%61 = load i32, i32* %8
br label %62
62: ; preds = %60, %58
br label %63
63: ; preds = %62
%64 = load i32, i32* %8
%65 = add nsw i32 %64, 1
store i32 %65, i32* %8
br label %51
66: ; preds = %51
%67 = load i32, i32* @EXIT_SUCCESS
%68 = call i32 @exit(i32 %67)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"\0A%s - generate unifont.hex code points as\0A\00"
@.str.1 = [50 x i8] c"four-digit hexadecimal numbers in a 2 by 2 grid,\0A\00"
@.str.2 = [52 x i8] c"or six-digit hexadecimal numbers in a 3 by 2 grid.\0A\00"
@.str.3 = [10 x i8] c"Syntax:\0A\0A\00"
@.str.4 = [56 x i8] c" %s first_code_point last_code_point > glyphs.hex\0A\0A\00"
@.str.5 = [57 x i8] c"Example (to generate glyphs for the Private Use Area):\0A\0A\00"
@.str.6 = [30 x i8] c" %s e000 f8ff > pua.hex\0A\0A\00"
@EXIT_FAILURE = global i32 0
@.str.7 = [3 x i8] c"%x\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %28, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %1
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %1
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @EXIT_FAILURE
%27 = tail call i32 @exit(i32 %26)
unreachable
28: ; preds = %2
%29 = getelementptr inbounds i8*, i8** %1, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @sscanf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %4)
%35 = load i32, i32* %3
%36 = and i32 %35, 16777215
store i32 %36, i32* %3
%37 = load i32, i32* %4
%38 = and i32 %37, 16777215
store i32 %38, i32* %4
%39 = icmp ugt i32 %36, %38
br i1 %39, label %49, label %40
40: ; preds = %28, %45
%41 = phi i32 [ %46, %45 ], [ %36, %28 ]
%42 = icmp ult i32 %41, 65536
br i1 %42, label %43, label %44
43: ; preds = %40
br label %45
44: ; preds = %40
br label %45
45: ; preds = %43, %44
%46 = add nuw nsw i32 %41, 1
%47 = load i32, i32* %4
%48 = icmp slt i32 %41, %47
br i1 %48, label %40, label %49
49: ; preds = %45, %28
%50 = load i32, i32* @EXIT_SUCCESS
%51 = call i32 @exit(i32 %50)
unreachable
}