#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 */
typedef unsigned char baseMatcher;

/* Variables and functions */
char *ConvertByteStr(unsigned char *, unsigned char *);
int /*<<< orphan*/ EXIT_FAILURE;
unsigned char *GenerateMatchingArray();
unsigned char *HexToBytes(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int i;
  if (argc != 2) {
    printf("ERROR: NEED ONE STRINGS \n");
    exit(EXIT_FAILURE);
  }
  char *strOne = argv[1];
  unsigned char *newStr = HexToBytes(strOne);
  struct baseMatcher *baseMatcher;
  baseMatcher = GenerateMatchingArray();
  char *magicReturnArray = ConvertByteStr(newStr, baseMatcher);
  printf("%s\n", magicReturnArray);
  free(baseMatcher);
  free(newStr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     119c <main+0x3c>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <HexToBytes@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1080 <GenerateMatchingArray@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <ConvertByteStr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    11ac <main+0x4c>
mov    0x8(%rsi),%rdi
call   1060 <HexToBytes@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1080 <GenerateMatchingArray@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <ConvertByteStr@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe4d(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.baseMatcher = type opaque
@.str = [26 x i8] c"ERROR: NEED ONE STRINGS \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.baseMatcher*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
store i8* %20, i8** %7
%21 = load i8*, i8** %7
%22 = call i8* @HexToBytes(i8* %21)
store i8* %22, i8** %8
%23 = call i8* (...) @GenerateMatchingArray()
%24 = bitcast i8* %23 to %struct.baseMatcher*
store %struct.baseMatcher* %24, %struct.baseMatcher** %9
%25 = load i8*, i8** %8
%26 = load %struct.baseMatcher*, %struct.baseMatcher** %9
%27 = bitcast %struct.baseMatcher* %26 to i8*
%28 = call i8* @ConvertByteStr(i8* %25, i8* %27)
store i8* %28, i8** %10
%29 = load i8*, i8** %10
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = load %struct.baseMatcher*, %struct.baseMatcher** %9
%32 = bitcast %struct.baseMatcher* %31 to i8*
%33 = call i32 @free(i8* %32)
%34 = load i8*, i8** %8
%35 = call i32 @free(i8* %34)
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [25 x i8] c"ERROR: NEED ONE STRINGS \00"
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 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i8* @HexToBytes(i8* %10)
%12 = tail call i8* (...) @GenerateMatchingArray()
%13 = tail call i8* @ConvertByteStr(i8* %11, i8* %12)
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
%15 = tail call i32 @free(i8* %12)
%16 = tail call i32 @free(i8* %11)
ret i32 0
}