#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 EOF;
unsigned int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int b, i;
  char *sym;
  unsigned int len;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s symbol_name length\n", argv[0]);
    exit(1);
  }
  sym = argv[1];
  len = atoi(argv[2]);
  b = getchar();
  if (b == EOF)
    goto abort;
  printf("/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\n"
         "unsigned char %s[%u] =\n{\n",
         sym, len);
  while (1) {
    printf("0x%02x", b);
    b = getchar();
    if (b == EOF)
      goto end;
    for (i = 0; i < 16 - 1; i++) {
      printf(", 0x%02x", b);
      b = getchar();
      if (b == EOF)
        goto end;
    }
    printf(",\n");
  }
end:
  printf("\n};\n");
abort:
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1196 <main+0x46>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe79(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e22(%rip),%rcx
cmp    (%rcx),%eax
jne    11d3 <main+0x83>
jmp    1291 <main+0x141>
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ddb(%rip),%rcx
cmp    (%rcx),%eax
jne    121a <main+0xca>
jmp    1283 <main+0x133>
movl   $0x0,-0x18(%rbp)
cmpl   $0xf,-0x18(%rbp)
jge    1270 <main+0x120>
mov    -0x14(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2d98(%rip),%rcx
cmp    (%rcx),%eax
jne    125d <main+0x10d>
jmp    1283 <main+0x133>
jmp    1262 <main+0x112>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1221 <main+0xd1>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e8 <main+0x98>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x3,%edi
jne    11d5 <main+0x75>
mov    0x8(%rsi),%r14
mov    0x10(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e5e(%rip),%r12
cmp    (%r12),%eax
je     11ce <main+0x6e>
mov    %eax,%ebx
lea    0xe85(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
jne    11f7 <main+0x97>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe18(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe6e(%rip),%rbx
lea    0xe70(%rip),%r14
lea    0xe62(%rip),%r15
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     11c2 <main+0x62>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
jne    1210 <main+0xb0>
jmp    11c2 <main+0x62>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s symbol_name length\0A\00"
@EOF = global i32 0
@.str.1 = [78 x i8] c"/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\0Aunsigned char %s[%u] =\0A{\0A\00"
@.str.2 = [7 x i8] c"0x%02x\00"
@.str.3 = [9 x i8] c", 0x%02x\00"
@.str.4 = [3 x i8] c",\0A\00"
@.str.5 = [5 x i8] c"\0A};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %8
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %9
%27 = call i32 (...) @getchar()
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = load i32, i32* @EOF
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %19
br label %64
32: ; preds = %19
%33 = load i8*, i8** %8
%34 = load i32, i32* %9
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* %33, i32 %34)
br label %36
36: ; preds = %32, %60
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = call i32 (...) @getchar()
store i32 %39, i32* %6
%40 = load i32, i32* %6
%41 = load i32, i32* @EOF
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %44
43: ; preds = %36
br label %62
44: ; preds = %36
store i32 0, i32* %7
br label %45
45: ; preds = %57, %44
%46 = load i32, i32* %7
%47 = icmp slt i32 %46, 15
br i1 %47, label %48, label %60
48: ; preds = %45
%49 = load i32, i32* %6
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %49)
%51 = call i32 (...) @getchar()
store i32 %51, i32* %6
%52 = load i32, i32* %6
%53 = load i32, i32* @EOF
%54 = icmp eq i32 %52, %53
br i1 %54, label %55, label %56
55: ; preds = %48
br label %62
56: ; preds = %48
br label %57
57: ; preds = %56
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %45
60: ; preds = %45
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %36
62: ; preds = %55, %43
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %62, %31
%65 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s symbol_name length\0A\00"
@EOF = global i32 0
@.str.1 = [78 x i8] c"/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\0Aunsigned char %s[%u] =\0A{\0A\00"
@.str.2 = [7 x i8] c"0x%02x\00"
@.str.3 = [9 x i8] c", 0x%02x\00"
@str = [2 x i8] c",\00"
@str.6 = [4 x i8] c"\0A};\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = tail call i32 (...) @getchar()
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %108, label %18
18: ; preds = %9
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %14)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%21 = tail call i32 (...) @getchar()
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %106, label %24
24: ; preds = %18, %100
%25 = phi i32 [ %103, %100 ], [ %21, %18 ]
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = tail call i32 (...) @getchar()
%28 = load i32, i32* @EOF
%29 = icmp eq i32 %27, %28
br i1 %29, label %106, label %30
30: ; preds = %24
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%32 = tail call i32 (...) @getchar()
%33 = load i32, i32* @EOF
%34 = icmp eq i32 %32, %33
br i1 %34, label %106, label %35
35: ; preds = %30
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%37 = tail call i32 (...) @getchar()
%38 = load i32, i32* @EOF
%39 = icmp eq i32 %37, %38
br i1 %39, label %106, label %40
40: ; preds = %35
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%42 = tail call i32 (...) @getchar()
%43 = load i32, i32* @EOF
%44 = icmp eq i32 %42, %43
br i1 %44, label %106, label %45
45: ; preds = %40
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%47 = tail call i32 (...) @getchar()
%48 = load i32, i32* @EOF
%49 = icmp eq i32 %47, %48
br i1 %49, label %106, label %50
50: ; preds = %45
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%52 = tail call i32 (...) @getchar()
%53 = load i32, i32* @EOF
%54 = icmp eq i32 %52, %53
br i1 %54, label %106, label %55
55: ; preds = %50
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %52)
%57 = tail call i32 (...) @getchar()
%58 = load i32, i32* @EOF
%59 = icmp eq i32 %57, %58
br i1 %59, label %106, label %60
60: ; preds = %55
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%62 = tail call i32 (...) @getchar()
%63 = load i32, i32* @EOF
%64 = icmp eq i32 %62, %63
br i1 %64, label %106, label %65
65: ; preds = %60
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %62)
%67 = tail call i32 (...) @getchar()
%68 = load i32, i32* @EOF
%69 = icmp eq i32 %67, %68
br i1 %69, label %106, label %70
70: ; preds = %65
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %67)
%72 = tail call i32 (...) @getchar()
%73 = load i32, i32* @EOF
%74 = icmp eq i32 %72, %73
br i1 %74, label %106, label %75
75: ; preds = %70
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %72)
%77 = tail call i32 (...) @getchar()
%78 = load i32, i32* @EOF
%79 = icmp eq i32 %77, %78
br i1 %79, label %106, label %80
80: ; preds = %75
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %77)
%82 = tail call i32 (...) @getchar()
%83 = load i32, i32* @EOF
%84 = icmp eq i32 %82, %83
br i1 %84, label %106, label %85
85: ; preds = %80
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %82)
%87 = tail call i32 (...) @getchar()
%88 = load i32, i32* @EOF
%89 = icmp eq i32 %87, %88
br i1 %89, label %106, label %90
90: ; preds = %85
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %87)
%92 = tail call i32 (...) @getchar()
%93 = load i32, i32* @EOF
%94 = icmp eq i32 %92, %93
br i1 %94, label %106, label %95
95: ; preds = %90
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %92)
%97 = tail call i32 (...) @getchar()
%98 = load i32, i32* @EOF
%99 = icmp eq i32 %97, %98
br i1 %99, label %106, label %100
100: ; preds = %95
%101 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %97)
%103 = tail call i32 (...) @getchar()
%104 = load i32, i32* @EOF
%105 = icmp eq i32 %103, %104
br i1 %105, label %106, label %24
106: ; preds = %100, %24, %30, %35, %40, %45, %50, %55, %60, %65, %70, %75, %80, %85, %90, %95, %18
%107 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
br label %108
108: ; preds = %9, %106
%109 = tail call i32 @exit(i32 0)
unreachable
}