#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 scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ atoi(char *);
void *calloc(int, int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void *x(void *, int);
int main(int argc, char **args) {
  void *data;
  int len, i;
  if (argc != 3) {
    printf("Usage: %s <string | ip | uint32 | uint16 | uint8 | bool> <data>\n",
           args[0]);
    return 0;
  }
  if (strcmp(args[1], "string") == 0) {
    data = args[2];
    len = strlen(args[2]) + 1;
  } else if (strcmp(args[1], "ip") == 0) {
    data = calloc(1, sizeof(uint32_t));
    *((uint32_t *)data) = inet_addr(args[2]);
    len = sizeof(uint32_t);
  } else if (strcmp(args[1], "uint32") == 0) {
    data = calloc(1, sizeof(uint32_t));
    *((uint32_t *)data) = htonl((uint32_t)atoi(args[2]));
    len = sizeof(uint32_t);
  } else if (strcmp(args[1], "uint16") == 0) {
    data = calloc(1, sizeof(uint16_t));
    *((uint16_t *)data) = htons((uint16_t)atoi(args[2]));
    len = sizeof(uint16_t);
  } else if (strcmp(args[1], "uint8") == 0) {
    data = calloc(1, sizeof(uint8_t));
    *((uint8_t *)data) = atoi(args[2]);
    len = sizeof(uint8_t);
  } else if (strcmp(args[1], "bool") == 0) {
    data = calloc(1, sizeof(char));
    if (strcmp(args[2], "false") == 0)
      ((char *)data)[0] = 0;
    else if (strcmp(args[2], "true") == 0)
      ((char *)data)[0] = 1;
    else {
      printf("Unknown value `%s` for datatype bool!\n", args[2]);
      return -1;
    }
    len = sizeof(char);
  } else {
    printf("Unknown data type `%s`!\n", args[1]);
    return -1;
  }
  printf("XOR'ing %d bytes of data...\n", len);
  data = x(data, len);
  for (i = 0; i < len; i++)
    printf("\\x%02X", ((unsigned char *)data)[i]);
  printf("\n");
}


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     11d1 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14c5 <main+0x335>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe61(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1213 <main+0x83>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    145b <main+0x2cb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe26(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1265 <main+0xd5>
mov    $0x1,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x4,-0x1c(%rbp)
jmp    1456 <main+0x2c6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd7(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12be <main+0x12e>
mov    $0x1,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,%edi
call   1070 <htonl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x4,-0x1c(%rbp)
jmp    1451 <main+0x2c1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd85(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1317 <main+0x187>
mov    $0x1,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x4,-0x1c(%rbp)
jmp    144c <main+0x2bc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd33(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    136b <main+0x1db>
mov    $0x1,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x8,-0x1c(%rbp)
jmp    1447 <main+0x2b7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xce5(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1420 <main+0x290>
mov    $0x1,%esi
mov    %esi,%edi
call   1080 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcbc(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13c3 <main+0x233>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1414 <main+0x284>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc98(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13ed <main+0x25d>
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax)
jmp    140f <main+0x27f>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14c5 <main+0x335>
jmp    1414 <main+0x284>
movl   $0x1,-0x1c(%rbp)
jmp    1442 <main+0x2b2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14c5 <main+0x335>
jmp    1447 <main+0x2b7>
jmp    144c <main+0x2bc>
jmp    1451 <main+0x2c1>
jmp    1456 <main+0x2c6>
jmp    145b <main+0x2cb>
mov    -0x1c(%rbp),%esi
lea    0xc4a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <x@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14b7 <main+0x327>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xc2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1483 <main+0x2f3>
lea    0xbef(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
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
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    126a <main+0xca>
mov    0x8(%rbx),%rdi
lea    0xe7f(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1283 <main+0xe3>
mov    0x8(%rbx),%rdi
lea    0xe6d(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     129b <main+0xfb>
mov    0x8(%rbx),%rdi
lea    0xe57(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12c4 <main+0x124>
mov    0x8(%rbx),%rdi
lea    0xe45(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12f4 <main+0x154>
mov    0x8(%rbx),%rdi
lea    0xe33(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1324 <main+0x184>
mov    0x8(%rbx),%rdi
lea    0xe20(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     134a <main+0x1aa>
mov    0x8(%rbx),%rsi
lea    0xe3e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%r12d
jmp    1403 <main+0x263>
mov    (%rbx),%rsi
lea    0xd8c(%rip),%rdi
xor    %r12d,%r12d
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1403 <main+0x263>
mov    0x10(%rbx),%r14
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%r15d
add    $0x1,%r15d
jmp    13a5 <main+0x205>
mov    $0x4,%r15d
mov    $0x1,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,(%r14)
jmp    13a5 <main+0x205>
mov    $0x4,%r15d
mov    $0x1,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%edi
call   1080 <htonl@plt>
mov    %eax,(%r14)
jmp    13a5 <main+0x205>
mov    $0x4,%r15d
mov    $0x1,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,(%r14)
jmp    13a5 <main+0x205>
mov    $0x8,%r15d
mov    $0x1,%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %rax,(%r14)
jmp    13a5 <main+0x205>
mov    $0x1,%r15d
mov    $0x1,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
lea    0xcf7(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     139c <main+0x1fc>
mov    0x10(%rbx),%rdi
lea    0xce8(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13a0 <main+0x200>
mov    0x10(%rbx),%rsi
lea    0xcd8(%rip),%rdi
jmp    1258 <main+0xb8>
xor    %eax,%eax
jmp    13a2 <main+0x202>
mov    $0x1,%al
mov    %al,(%r14)
lea    0xd03(%rip),%rdi
xor    %r12d,%r12d
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <x@plt>
test   %r15d,%r15d
jle    13f9 <main+0x259>
mov    %rax,%r13
mov    %r15d,%ebx
lea    0xcf6(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movzbl 0x0(%r13,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    13e0 <main+0x240>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Usage: %s <string | ip | uint32 | uint16 | uint8 | bool> <data>\0A\00"
@.str.1 = [7 x i8] c"string\00"
@.str.2 = [3 x i8] c"ip\00"
@.str.3 = [7 x i8] c"uint32\00"
@.str.4 = [7 x i8] c"uint16\00"
@.str.5 = [6 x i8] c"uint8\00"
@.str.6 = [5 x i8] c"bool\00"
@.str.7 = [6 x i8] c"false\00"
@.str.8 = [5 x i8] c"true\00"
@.str.9 = [39 x i8] c"Unknown value `%s` for datatype bool!\0A\00"
@.str.10 = [25 x i8] c"Unknown data type `%s`!\0A\00"
@.str.11 = [29 x i8] c"XOR'ing %d bytes of data...\0A\00"
@.str.12 = [7 x i8] c"\\x%02X\00"
@.str.13 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%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 %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 0, i32* %3
br label %156
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %31
22: ; preds = %16
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
store i8* %25, i8** %6
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @strlen(i8* %28)
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %133
31: ; preds = %16
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %31
%38 = call i8* @calloc(i32 1, i32 4)
store i8* %38, i8** %6
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 @inet_addr(i8* %41)
%43 = load i8*, i8** %6
%44 = bitcast i8* %43 to i32*
store i32 %42, i32* %44
store i32 4, i32* %7
br label %132
45: ; preds = %31
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %61
51: ; preds = %45
%52 = call i8* @calloc(i32 1, i32 4)
store i8* %52, i8** %6
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i64 @atoi(i8* %55)
%57 = trunc i64 %56 to i32
%58 = call i32 @htonl(i32 %57)
%59 = load i8*, i8** %6
%60 = bitcast i8* %59 to i32*
store i32 %58, i32* %60
store i32 4, i32* %7
br label %131
61: ; preds = %45
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %77
67: ; preds = %61
%68 = call i8* @calloc(i32 1, i32 4)
store i8* %68, i8** %6
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 2
%71 = load i8*, i8** %70
%72 = call i64 @atoi(i8* %71)
%73 = trunc i64 %72 to i32
%74 = call i32 @htons(i32 %73)
%75 = load i8*, i8** %6
%76 = bitcast i8* %75 to i32*
store i32 %74, i32* %76
store i32 4, i32* %7
br label %130
77: ; preds = %61
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %91
83: ; preds = %77
%84 = call i8* @calloc(i32 1, i32 8)
store i8* %84, i8** %6
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 2
%87 = load i8*, i8** %86
%88 = call i64 @atoi(i8* %87)
%89 = load i8*, i8** %6
%90 = bitcast i8* %89 to i64*
store i64 %88, i64* %90
store i32 8, i32* %7
br label %129
91: ; preds = %77
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %123
97: ; preds = %91
%98 = call i8* @calloc(i32 1, i32 1)
store i8* %98, i8** %6
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 2
%101 = load i8*, i8** %100
%102 = call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %97
%105 = load i8*, i8** %6
%106 = getelementptr inbounds i8, i8* %105, i64 0
store i8 0, i8* %106
br label %122
107: ; preds = %97
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 2
%110 = load i8*, i8** %109
%111 = call i64 @strcmp(i8* %110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %107
%114 = load i8*, i8** %6
%115 = getelementptr inbounds i8, i8* %114, i64 0
store i8 1, i8* %115
br label %121
116: ; preds = %107
%117 = load i8**, i8*** %5
%118 = getelementptr inbounds i8*, i8** %117, i64 2
%119 = load i8*, i8** %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %119)
store i32 -1, i32* %3
br label %156
121: ; preds = %113
br label %122
122: ; preds = %121, %104
store i32 1, i32* %7
br label %128
123: ; preds = %91
%124 = load i8**, i8*** %5
%125 = getelementptr inbounds i8*, i8** %124, i64 1
%126 = load i8*, i8** %125
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* %126)
store i32 -1, i32* %3
br label %156
128: ; preds = %122
br label %129
129: ; preds = %128, %83
br label %130
130: ; preds = %129, %67
br label %131
131: ; preds = %130, %51
br label %132
132: ; preds = %131, %37
br label %133
133: ; preds = %132, %22
%134 = load i32, i32* %7
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 %134)
%136 = load i8*, i8** %6
%137 = load i32, i32* %7
%138 = call i8* @x(i8* %136, i32 %137)
store i8* %138, i8** %6
store i32 0, i32* %8
br label %139
139: ; preds = %151, %133
%140 = load i32, i32* %8
%141 = load i32, i32* %7
%142 = icmp slt i32 %140, %141
br i1 %142, label %143, label %154
143: ; preds = %139
%144 = load i8*, i8** %6
%145 = load i32, i32* %8
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %144, i64 %146
%148 = load i8, i8* %147
%149 = zext i8 %148 to i32
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %149)
br label %151
151: ; preds = %143
%152 = load i32, i32* %8
%153 = add nsw i32 %152, 1
store i32 %153, i32* %8
br label %139
154: ; preds = %139
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %156
156: ; preds = %154, %123, %116, %11
%157 = load i32, i32* %3
ret i32 %157
}

LLVM IR (-O2):
@.str = [65 x i8] c"Usage: %s <string | ip | uint32 | uint16 | uint8 | bool> <data>\0A\00"
@.str.1 = [7 x i8] c"string\00"
@.str.2 = [3 x i8] c"ip\00"
@.str.3 = [7 x i8] c"uint32\00"
@.str.4 = [7 x i8] c"uint16\00"
@.str.5 = [6 x i8] c"uint8\00"
@.str.6 = [5 x i8] c"bool\00"
@.str.7 = [6 x i8] c"false\00"
@.str.8 = [5 x i8] c"true\00"
@.str.9 = [39 x i8] c"Unknown value `%s` for datatype bool!\0A\00"
@.str.10 = [25 x i8] c"Unknown data type `%s`!\0A\00"
@.str.11 = [29 x i8] c"XOR'ing %d bytes of data...\0A\00"
@.str.12 = [7 x i8] c"\\x%02X\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %101
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @strlen(i8* %14)
%16 = add nsw i32 %15, 1
br label %83
17: ; preds = %7
%18 = load i8*, i8** %8
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = tail call dereferenceable_or_null(4) i8* @calloc(i32 1, i32 4)
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = tail call i32 @inet_addr(i8* %24)
%26 = bitcast i8* %22 to i32*
store i32 %25, i32* %26
br label %83
27: ; preds = %17
%28 = load i8*, i8** %8
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %27
%32 = tail call dereferenceable_or_null(4) i8* @calloc(i32 1, i32 4)
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = tail call i64 @atoi(i8* %34)
%36 = trunc i64 %35 to i32
%37 = tail call i32 @htonl(i32 %36)
%38 = bitcast i8* %32 to i32*
store i32 %37, i32* %38
br label %83
39: ; preds = %27
%40 = load i8*, i8** %8
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %51
43: ; preds = %39
%44 = tail call dereferenceable_or_null(4) i8* @calloc(i32 1, i32 4)
%45 = getelementptr inbounds i8*, i8** %1, i64 2
%46 = load i8*, i8** %45
%47 = tail call i64 @atoi(i8* %46)
%48 = trunc i64 %47 to i32
%49 = tail call i32 @htons(i32 %48)
%50 = bitcast i8* %44 to i32*
store i32 %49, i32* %50
br label %83
51: ; preds = %39
%52 = load i8*, i8** %8
%53 = tail call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %61
55: ; preds = %51
%56 = tail call dereferenceable_or_null(8) i8* @calloc(i32 1, i32 8)
%57 = getelementptr inbounds i8*, i8** %1, i64 2
%58 = load i8*, i8** %57
%59 = tail call i64 @atoi(i8* %58)
%60 = bitcast i8* %56 to i64*
store i64 %59, i64* %60
br label %83
61: ; preds = %51
%62 = load i8*, i8** %8
%63 = tail call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %80
65: ; preds = %61
%66 = tail call dereferenceable_or_null(1) i8* @calloc(i32 1, i32 1)
%67 = getelementptr inbounds i8*, i8** %1, i64 2
%68 = load i8*, i8** %67
%69 = tail call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %78, label %71
71: ; preds = %65
%72 = load i8*, i8** %67
%73 = tail call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %71
%76 = load i8*, i8** %67
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %76)
br label %101
78: ; preds = %71, %65
%79 = phi i8 [ 0, %65 ], [ 1, %71 ]
store i8 %79, i8* %66
br label %83
80: ; preds = %61
%81 = load i8*, i8** %8
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* %81)
br label %101
83: ; preds = %21, %43, %78, %55, %31, %12
%84 = phi i8* [ %14, %12 ], [ %22, %21 ], [ %32, %31 ], [ %44, %43 ], [ %56, %55 ], [ %66, %78 ]
%85 = phi i32 [ %16, %12 ], [ 4, %21 ], [ 4, %31 ], [ 4, %43 ], [ 8, %55 ], [ 1, %78 ]
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 %85)
%87 = tail call i8* @x(i8* %84, i32 %85)
%88 = icmp sgt i32 %85, 0
br i1 %88, label %89, label %99
89: ; preds = %83
%90 = zext i32 %85 to i64
br label %91
91: ; preds = %89, %91
%92 = phi i64 [ 0, %89 ], [ %97, %91 ]
%93 = getelementptr inbounds i8, i8* %87, i64 %92
%94 = load i8, i8* %93
%95 = zext i8 %94 to i32
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %95)
%97 = add nuw nsw i64 %92, 1
%98 = icmp eq i64 %97, %90
br i1 %98, label %99, label %91
99: ; preds = %91, %83
%100 = tail call i32 @putchar(i32 10)
br label %101
101: ; preds = %99, %80, %75, %4
%102 = phi i32 [ 0, %4 ], [ 0, %99 ], [ -1, %75 ], [ -1, %80 ]
ret i32 %102
}