#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 int uint8_t;
typedef int uint64_t;
typedef int uint32_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ n8;
typedef int /*<<< orphan*/ n4;
typedef int /*<<< orphan*/ n2;
typedef int /*<<< orphan*/ n1;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int atoi(char *);
int /*<<< orphan*/ emit(int *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int htole16(int);
int htole32(int);
int htole64(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *strrchr(char *, char);
int strtoll(char *, char **, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int xc = 1;
  int size = 0;
  uint64_t n8 = 0;
  uint32_t n4 = 0;
  uint16_t n2 = 0;
  uint8_t n1 = 0;
  char *end = (char *)0;
  const char *name = (char *)0;
  int debug = 0;
  do {
    name = ((name = strrchr(argv[0], '/')) == (char *)0) ? argv[0] : name + 1;
    if (argc < 2) {
      errno = EINVAL;
      perror(argv[0]);
      break;
    }
    if (argv[1][0] == '-') {
      debug = 0;
    } else if (argv[1][0] == '+') {
      debug = !0;
    } else {
      errno = EINVAL;
      perror(argv[1]);
      break;
    }
    if (argv[1][1] == '?') {
      fprintf(stderr,
              "usage: %s [ -1 | -2 | -4 | -8 | +1 | +2 | +4 | +8 ] NUMBER\n",
              name);
      xc = 0;
      break;
    }
    if (argc != 3) {
      errno = EINVAL;
      perror(argv[0]);
      break;
    }
    n8 = strtoll(argv[2], &end, 0);
    if (end == argv[2]) {
      errno = EINVAL;
      perror(argv[2]);
      break;
    }
    size = atoi(&(argv[1][1]));
    if (size == sizeof(n1)) {
      n1 = n8;
      if (debug) {
        fprintf(stderr, "%s: %02x\n", name, n1);
      }
      emit(&n1, sizeof(n1));
    } else if (size == sizeof(n2)) {
      n2 = n8;
      if (debug) {
        fprintf(stderr, "%s: %04x\n", name, n2);
      }
      n2 = htole16(n2);
      emit(&n2, sizeof(n2));
    } else if (size == sizeof(n4)) {
      n4 = n8;
      if (debug) {
        fprintf(stderr, "%s: %08lx\n", name, (unsigned long)n4);
      }
      n4 = htole32(n4);
      emit(&n4, sizeof(n4));
    } else if (size == sizeof(n8)) {
      if (debug) {
        fprintf(stderr, "%s: %016llx\n", name, (unsigned long long)n8);
      }
      n8 = htole64(n8);
      emit(&n8, sizeof(n8));
    } else {
      errno = EINVAL;
      perror(argv[1]);
      break;
    }
    xc = 0;
  } while (0);
  return xc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1216 <main+0x86>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    1222 <main+0x92>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1257 <main+0xc7>
mov    0x2d95(%rip),%rax
mov    (%rax),%ecx
mov    0x2d94(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <perror@plt>
jmp    151c <main+0x38c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1277 <main+0xe7>
movl   $0x0,-0x3c(%rbp)
jmp    12c0 <main+0x130>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1297 <main+0x107>
movl   $0x1,-0x3c(%rbp)
jmp    12bb <main+0x12b>
mov    0x2d32(%rip),%rax
mov    (%rax),%ecx
mov    0x2d31(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <perror@plt>
jmp    151c <main+0x38c>
jmp    12c0 <main+0x130>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3f,%eax
jne    12fc <main+0x16c>
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xd17(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
jmp    151c <main+0x38c>
cmpl   $0x3,-0x8(%rbp)
je     1329 <main+0x199>
mov    0x2cc3(%rip),%rax
mov    (%rax),%ecx
mov    0x2cc2(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <perror@plt>
jmp    151c <main+0x38c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1060 <strtoll@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x10(%rcx),%rax
jne    1375 <main+0x1e5>
mov    0x2c78(%rip),%rax
mov    (%rax),%ecx
mov    0x2c77(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <perror@plt>
jmp    151c <main+0x38c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
add    $0x1,%rdi
call   1090 <atoi@plt>
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
jne    13d8 <main+0x248>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     13c5 <main+0x235>
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
mov    -0x28(%rbp),%ecx
lea    0xc7e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10a0 <emit@plt>
jmp    1515 <main+0x385>
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
jne    1432 <main+0x2a2>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1414 <main+0x284>
mov    0x2be3(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
mov    -0x24(%rbp),%ecx
lea    0xc39(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%edi
call   1040 <htole16@plt>
mov    %eax,-0x24(%rbp)
lea    -0x24(%rbp),%rdi
mov    $0x4,%esi
call   10a0 <emit@plt>
jmp    1510 <main+0x380>
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
jne    148d <main+0x2fd>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     146f <main+0x2df>
mov    0x2b89(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
movslq -0x20(%rbp),%rcx
lea    0xbe8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%edi
call   1030 <htole32@plt>
mov    %eax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   10a0 <emit@plt>
jmp    150b <main+0x37b>
movslq -0x18(%rbp),%rax
cmp    $0x4,%rax
jne    14e2 <main+0x352>
cmpl   $0x0,-0x3c(%rbp)
je     14c4 <main+0x334>
mov    0x2b34(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
movslq -0x1c(%rbp),%rcx
lea    0xb9e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1c(%rbp),%edi
call   10b0 <htole64@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
call   10a0 <emit@plt>
jmp    1506 <main+0x376>
mov    0x2ae7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ae6(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <perror@plt>
jmp    151c <main+0x38c>
jmp    150b <main+0x37b>
jmp    1510 <main+0x380>
jmp    1515 <main+0x385>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,0x8(%rsp)
mov    (%rsi),%r15
mov    %r15,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%r14
test   %rax,%rax
cmove  %r15,%r14
cmp    $0x1,%ebp
jle    1249 <main+0xe9>
mov    0x8(%rbx),%rdi
mov    (%rdi),%r12b
cmp    $0x2b,%r12b
je     11b5 <main+0x55>
cmp    $0x2d,%r12b
jne    1260 <main+0x100>
cmpb   $0x3f,0x1(%rdi)
jne    11dc <main+0x7c>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
xor    %ebx,%ebx
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1293 <main+0x133>
cmp    $0x3,%ebp
jne    1249 <main+0xe9>
mov    0x10(%rbx),%rdi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1040 <strtoll@plt>
mov    0x8(%rsp),%rdi
cmp    0x10(%rbx),%rdi
je     1260 <main+0x100>
mov    %eax,%ebp
mov    0x8(%rbx),%rbx
lea    0x1(%rbx),%rdi
call   1070 <atoi@plt>
cmp    $0x4,%eax
jne    1274 <main+0x114>
mov    %ebp,0x4(%rsp)
cmp    $0x2d,%r12b
je     1236 <main+0xd6>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xe12(%rip),%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1080 <emit@plt>
xor    %ebx,%ebx
jmp    1293 <main+0x133>
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
mov    0x2d7f(%rip),%rcx
mov    %eax,(%rcx)
mov    %r15,%rdi
jmp    1289 <main+0x129>
mov    0x2d69(%rip),%rax
mov    (%rax),%eax
mov    0x2d68(%rip),%rcx
mov    %eax,(%rcx)
jmp    1289 <main+0x129>
mov    0x2d55(%rip),%rax
mov    (%rax),%eax
mov    0x2d54(%rip),%rcx
mov    %eax,(%rcx)
mov    %rbx,%rdi
call   1060 <perror@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
@stderr = global i32 0
@.str = [60 x i8] c"usage: %s [ -1 | -2 | -4 | -8 | +1 | +2 | +4 | +8 ] NUMBER\0A\00"
@.str.1 = [10 x i8] c"%s: %02x\0A\00"
@.str.2 = [10 x i8] c"%s: %04x\0A\00"
@.str.3 = [11 x i8] c"%s: %08lx\0A\00"
@.str.4 = [13 x i8] c"%s: %016llx\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i8* null, i8** %12
store i8* null, i8** %13
store i32 0, i32* %14
br label %15
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i8* @strrchr(i8* %18, i8 signext 47)
store i8* %19, i8** %13
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
br label %28
25: ; preds = %15
%26 = load i8*, i8** %13
%27 = getelementptr inbounds i8, i8* %26, i64 1
br label %28
28: ; preds = %25, %21
%29 = phi i8* [ %24, %21 ], [ %27, %25 ]
store i8* %29, i8** %13
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 2
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load i32, i32* @EINVAL
store i32 %33, i32* @errno
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 @perror(i8* %36)
br label %182
38: ; preds = %28
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i64 0
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 45
br i1 %45, label %46, label %47
46: ; preds = %38
store i32 0, i32* %14
br label %63
47: ; preds = %38
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = getelementptr inbounds i8, i8* %50, i64 0
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 43
br i1 %54, label %55, label %56
55: ; preds = %47
store i32 1, i32* %14
br label %62
56: ; preds = %47
%57 = load i32, i32* @EINVAL
store i32 %57, i32* @errno
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = call i32 @perror(i8* %60)
br label %182
62: ; preds = %55
br label %63
63: ; preds = %62, %46
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 1
%66 = load i8*, i8** %65
%67 = getelementptr inbounds i8, i8* %66, i64 1
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 63
br i1 %70, label %71, label %75
71: ; preds = %63
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %13
%74 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %73)
store i32 0, i32* %6
br label %182
75: ; preds = %63
%76 = load i32, i32* %4
%77 = icmp ne i32 %76, 3
br i1 %77, label %78, label %84
78: ; preds = %75
%79 = load i32, i32* @EINVAL
store i32 %79, i32* @errno
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = call i32 @perror(i8* %82)
br label %182
84: ; preds = %75
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 2
%87 = load i8*, i8** %86
%88 = call i32 @strtoll(i8* %87, i8** %12, i32 0)
store i32 %88, i32* %8
%89 = load i8*, i8** %12
%90 = load i8**, i8*** %5
%91 = getelementptr inbounds i8*, i8** %90, i64 2
%92 = load i8*, i8** %91
%93 = icmp eq i8* %89, %92
br i1 %93, label %94, label %100
94: ; preds = %84
%95 = load i32, i32* @EINVAL
store i32 %95, i32* @errno
%96 = load i8**, i8*** %5
%97 = getelementptr inbounds i8*, i8** %96, i64 2
%98 = load i8*, i8** %97
%99 = call i32 @perror(i8* %98)
br label %182
100: ; preds = %84
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 1
%103 = load i8*, i8** %102
%104 = getelementptr inbounds i8, i8* %103, i64 1
%105 = call i32 @atoi(i8* %104)
store i32 %105, i32* %7
%106 = load i32, i32* %7
%107 = sext i32 %106 to i64
%108 = icmp eq i64 %107, 4
br i1 %108, label %109, label %120
109: ; preds = %100
%110 = load i32, i32* %8
store i32 %110, i32* %11
%111 = load i32, i32* %14
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %109
%114 = load i32, i32* @stderr
%115 = load i8*, i8** %13
%116 = load i32, i32* %11
%117 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %115, i32 %116)
br label %118
118: ; preds = %113, %109
%119 = call i32 @emit(i32* %11, i32 4)
br label %181
120: ; preds = %100
%121 = load i32, i32* %7
%122 = sext i32 %121 to i64
%123 = icmp eq i64 %122, 4
br i1 %123, label %124, label %137
124: ; preds = %120
%125 = load i32, i32* %8
store i32 %125, i32* %10
%126 = load i32, i32* %14
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %133
128: ; preds = %124
%129 = load i32, i32* @stderr
%130 = load i8*, i8** %13
%131 = load i32, i32* %10
%132 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %130, i32 %131)
br label %133
133: ; preds = %128, %124
%134 = load i32, i32* %10
%135 = call i32 @htole16(i32 %134)
store i32 %135, i32* %10
%136 = call i32 @emit(i32* %10, i32 4)
br label %180
137: ; preds = %120
%138 = load i32, i32* %7
%139 = sext i32 %138 to i64
%140 = icmp eq i64 %139, 4
br i1 %140, label %141, label %155
141: ; preds = %137
%142 = load i32, i32* %8
store i32 %142, i32* %9
%143 = load i32, i32* %14
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %151
145: ; preds = %141
%146 = load i32, i32* @stderr
%147 = load i8*, i8** %13
%148 = load i32, i32* %9
%149 = sext i32 %148 to i64
%150 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %146, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %147, i64 %149)
br label %151
151: ; preds = %145, %141
%152 = load i32, i32* %9
%153 = call i32 @htole32(i32 %152)
store i32 %153, i32* %9
%154 = call i32 @emit(i32* %9, i32 4)
br label %179
155: ; preds = %137
%156 = load i32, i32* %7
%157 = sext i32 %156 to i64
%158 = icmp eq i64 %157, 4
br i1 %158, label %159, label %172
159: ; preds = %155
%160 = load i32, i32* %14
%161 = icmp ne i32 %160, 0
br i1 %161, label %162, label %168
162: ; preds = %159
%163 = load i32, i32* @stderr
%164 = load i8*, i8** %13
%165 = load i32, i32* %8
%166 = sext i32 %165 to i64
%167 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %163, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %164, i64 %166)
br label %168
168: ; preds = %162, %159
%169 = load i32, i32* %8
%170 = call i32 @htole64(i32 %169)
store i32 %170, i32* %8
%171 = call i32 @emit(i32* %8, i32 4)
br label %178
172: ; preds = %155
%173 = load i32, i32* @EINVAL
store i32 %173, i32* @errno
%174 = load i8**, i8*** %5
%175 = getelementptr inbounds i8*, i8** %174, i64 1
%176 = load i8*, i8** %175
%177 = call i32 @perror(i8* %176)
br label %182
178: ; preds = %168
br label %179
179: ; preds = %178, %151
br label %180
180: ; preds = %179, %133
br label %181
181: ; preds = %180, %118
store i32 0, i32* %6
br label %182
182: ; preds = %181, %172, %94, %78, %71, %56, %32
%183 = load i32, i32* %6
ret i32 %183
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
@stderr = global i32 0
@.str = [60 x i8] c"usage: %s [ -1 | -2 | -4 | -8 | +1 | +2 | +4 | +8 ] NUMBER\0A\00"
@.str.1 = [10 x i8] c"%s: %02x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%7 = load i8*, i8** %1
%8 = tail call i8* @strrchr(i8* dereferenceable(1) %7, i8 signext 47)
%9 = icmp eq i8* %8, null
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = select i1 %9, i8* %7, i8* %10
%12 = icmp slt i32 %0, 2
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* @EINVAL
store i32 %14, i32* @errno
%15 = tail call i32 @perror(i8* %7)
br label %60
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 45
switch i8 %19, label %21 [
i8 45, label %24
i8 43, label %24
]
21: ; preds = %16
%22 = load i32, i32* @EINVAL
store i32 %22, i32* @errno
%23 = tail call i32 @perror(i8* %18)
br label %60
24: ; preds = %16, %16
%25 = getelementptr inbounds i8, i8* %18, i64 1
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 63
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %60
31: ; preds = %24
%32 = icmp eq i32 %0, 3
br i1 %32, label %36, label %33
33: ; preds = %31
%34 = load i32, i32* @EINVAL
store i32 %34, i32* @errno
%35 = tail call i32 @perror(i8* %7)
br label %60
36: ; preds = %31
%37 = getelementptr inbounds i8*, i8** %1, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @strtoll(i8* %38, i8** %4, i32 0)
%40 = load i8*, i8** %4
%41 = load i8*, i8** %37
%42 = icmp eq i8* %40, %41
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = load i32, i32* @EINVAL
store i32 %44, i32* @errno
%45 = tail call i32 @perror(i8* %40)
br label %60
46: ; preds = %36
%47 = load i8*, i8** %17
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = tail call i32 @atoi(i8* %48)
%50 = icmp eq i32 %49, 4
br i1 %50, label %51, label %57
51: ; preds = %46
store i32 %39, i32* %3
br i1 %20, label %55, label %52
52: ; preds = %51
%53 = load i32, i32* @stderr
%54 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %39)
br label %55
55: ; preds = %52, %51
%56 = call i32 @emit(i32* %3, i32 4)
br label %60
57: ; preds = %46
%58 = load i32, i32* @EINVAL
store i32 %58, i32* @errno
%59 = tail call i32 @perror(i8* %47)
br label %60
60: ; preds = %55, %57, %43, %33, %28, %21, %13
%61 = phi i32 [ 1, %13 ], [ 0, %28 ], [ 1, %33 ], [ 1, %43 ], [ 0, %55 ], [ 1, %57 ], [ 1, %21 ]
ret i32 %61
}