#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__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strtoul(char *, int /*<<< orphan*/ *, int);
int tagfile(char *, char *, char *, char *, char *, scalar_t__, scalar_t__);
int main(int argc, char **argv) {
  int c;
  char *kernel, *rootfs, *bin, *boardid, *chipid;
  uint32_t loadaddr, entry;
  kernel = rootfs = bin = boardid = chipid = NULL;
  entry = 0;
  loadaddr = 0x80010000;
  printf("Broadcom image tagger - v0.1.0\n");
  printf("Copyright (C) 2008 Axel Gembe\n");
  while ((c = getopt(argc, argv, "i:f:o:b:c:l:e:h")) != -1) {
    switch (c) {
    case 'i':
      kernel = optarg;
      break;
    case 'f':
      rootfs = optarg;
      break;
    case 'o':
      bin = optarg;
      break;
    case 'b':
      boardid = optarg;
      break;
    case 'c':
      chipid = optarg;
      break;
    case 'l':
      loadaddr = strtoul(optarg, NULL, 16);
      break;
    case 'e':
      entry = strtoul(optarg, NULL, 16);
      break;
    case 'h':
    default:
      fprintf(stderr, "Usage: imagetag <parameters>\n");
      fprintf(stderr, "-i <kernel>   - The LZMA compressed kernel file to "
                      "include in the image\n");
      fprintf(stderr,
              "-f <rootfs>   - The RootFS file to include in the image\n");
      fprintf(stderr, "-o <bin>      - The output file\n");
      fprintf(stderr, "-b <boardid>  - The board id to set in the image (i.e. "
                      "\"96345GW2\")\n");
      fprintf(
          stderr,
          "-c <chipid>   - The chip id to set in the image (i.e. \"6345\")\n");
      fprintf(stderr, "-l <loadaddr> - Address where the kernel expects to be "
                      "loaded (defaults to 0x80010000)\n");
      fprintf(
          stderr,
          "-e <entry>    - Address where the kernel entry point will end up\n");
      fprintf(stderr, "-h            - Displays this text\n");
      return 1;
    }
  }
  if (!boardid || !chipid) {
    fprintf(stderr, "You need to specify the board (-b) and chip id (-c)!\n");
    return 1;
  }
  if (entry == 0) {
    fprintf(stderr, "You need to specify the kernel entry (-e)\n");
    return 1;
  }
  return tagfile(kernel, rootfs, bin, boardid, chipid, loadaddr, entry);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x50(%rbp)
mov    $0x80010000,%eax
mov    %rax,-0x48(%rbp)
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1373 <main+0x223>
mov    -0x14(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x58(%rbp)
sub    $0xd,%eax
ja     12a5 <main+0x155>
mov    -0x58(%rbp),%rax
lea    0xe0a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2df2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    136e <main+0x21e>
mov    0x2ddf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    136e <main+0x21e>
mov    0x2dcc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    136e <main+0x21e>
mov    0x2db9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    136e <main+0x21e>
mov    0x2da6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    136e <main+0x21e>
mov    0x2d93(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1070 <strtoul@plt>
mov    %rax,-0x48(%rbp)
jmp    136e <main+0x21e>
mov    0x2d72(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1070 <strtoul@plt>
mov    %rax,-0x50(%rbp)
jmp    136e <main+0x21e>
jmp    12a5 <main+0x155>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
lea    0xddb(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2d02(%rip),%rax
mov    (%rax),%edi
lea    0xe0f(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
lea    0xe33(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2cd8(%rip),%rax
mov    (%rax),%edi
lea    0xe3f(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xe6e(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
lea    0xf08(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fe <main+0x2ae>
jmp    11b7 <main+0x67>
cmpq   $0x0,-0x38(%rbp)
je     1389 <main+0x239>
cmpq   $0x0,-0x40(%rbp)
jne    13aa <main+0x25a>
mov    0x2c48(%rip),%rax
mov    (%rax),%edi
lea    0xef0(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fe <main+0x2ae>
cmpq   $0x0,-0x50(%rbp)
jne    13d6 <main+0x286>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
lea    0xefa(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fe <main+0x2ae>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x50(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <tagfile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%r15d
lea    0x1140(%rip),%rdi
call   1030 <puts@plt>
lea    0x1153(%rip),%rdi
call   1030 <puts@plt>
mov    $0x80010000,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
lea    0xea4(%rip),%r13
mov    0x2e5d(%rip),%r14
lea    0xe5e(%rip),%rbp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %r12d,%r12d
jmp    11e2 <main+0x92>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <strtoul@plt>
mov    %rax,%r12
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1060 <getopt@plt>
cmp    $0x65,%eax
je     11d0 <main+0x80>
lea    -0x62(%rax),%ecx
cmp    $0xd,%ecx
ja     124f <main+0xff>
movslq 0x0(%rbp,%rcx,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    (%r14),%rax
mov    %rax,0x30(%rsp)
jmp    11e2 <main+0x92>
mov    (%r14),%rax
mov    %rax,0x28(%rsp)
jmp    11e2 <main+0x92>
mov    (%r14),%rax
mov    %rax,0x10(%rsp)
jmp    11e2 <main+0x92>
mov    (%r14),%rax
mov    %rax,0x20(%rsp)
jmp    11e2 <main+0x92>
mov    (%r14),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <strtoul@plt>
mov    %rax,0x18(%rsp)
jmp    11e2 <main+0x92>
mov    (%r14),%rax
mov    %rax,0x8(%rsp)
jmp    11e2 <main+0x92>
cmp    $0xffffffff,%eax
jne    129b <main+0x14b>
mov    0x30(%rsp),%rcx
test   %rcx,%rcx
mov    0x28(%rsp),%r8
je     131d <main+0x1cd>
test   %r8,%r8
je     131d <main+0x1cd>
test   %r12,%r12
je     132f <main+0x1df>
mov    %r12,(%rsp)
mov    0x20(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
mov    0x18(%rsp),%r9
call   1040 <tagfile@plt>
jmp    1349 <main+0x1f9>
mov    0x2d36(%rip),%rbx
mov    (%rbx),%edi
lea    0xd9d(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdad(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xde8(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe13(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe26(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe5c(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe8d(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0b(%rip),%rsi
jmp    133f <main+0x1ef>
mov    0x2cb4(%rip),%rax
mov    (%rax),%edi
lea    0xf1d(%rip),%rsi
jmp    133f <main+0x1ef>
mov    0x2ca2(%rip),%rax
mov    (%rax),%edi
lea    0xf41(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Broadcom image tagger - v0.1.0\0A\00"
@.str.1 = [31 x i8] c"Copyright (C) 2008 Axel Gembe\0A\00"
@.str.2 = [16 x i8] c"i:f:o:b:c:l:e:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.3 = [30 x i8] c"Usage: imagetag <parameters>\0A\00"
@.str.4 = [73 x i8] c"-i <kernel> - The LZMA compressed kernel file to include in the image\0A\00"
@.str.5 = [57 x i8] c"-f <rootfs> - The RootFS file to include in the image\0A\00"
@.str.6 = [33 x i8] c"-o <bin> - The output file\0A\00"
@.str.7 = [68 x i8] c"-b <boardid> - The board id to set in the image (i.e. \2296345GW2\22)\0A\00"
@.str.8 = [63 x i8] c"-c <chipid> - The chip id to set in the image (i.e. \226345\22)\0A\00"
@.str.9 = [88 x i8] c"-l <loadaddr> - Address where the kernel expects to be loaded (defaults to 0x80010000)\0A\00"
@.str.10 = [66 x i8] c"-e <entry> - Address where the kernel entry point will end up\0A\00"
@.str.11 = [36 x i8] c"-h - Displays this text\0A\00"
@.str.12 = [54 x i8] c"You need to specify the board (-b) and chip id (-c)!\0A\00"
@.str.13 = [43 x i8] c"You need to specify the kernel entry (-e)\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 i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %11
store i8* null, i8** %10
store i8* null, i8** %9
store i8* null, i8** %8
store i8* null, i8** %7
store i64 0, i64* %13
store i64 2147549184, i64* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %59, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 %19, i32* %6
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %60
21: ; preds = %16
%22 = load i32, i32* %6
switch i32 %22, label %40 [
i32 105, label %23
i32 102, label %25
i32 111, label %27
i32 98, label %29
i32 99, label %31
i32 108, label %33
i32 101, label %36
i32 104, label %39
]
23: ; preds = %21
%24 = load i8*, i8** @optarg
store i8* %24, i8** %7
br label %59
25: ; preds = %21
%26 = load i8*, i8** @optarg
store i8* %26, i8** %8
br label %59
27: ; preds = %21
%28 = load i8*, i8** @optarg
store i8* %28, i8** %9
br label %59
29: ; preds = %21
%30 = load i8*, i8** @optarg
store i8* %30, i8** %10
br label %59
31: ; preds = %21
%32 = load i8*, i8** @optarg
store i8* %32, i8** %11
br label %59
33: ; preds = %21
%34 = load i8*, i8** @optarg
%35 = call i64 @strtoul(i8* %34, i32* null, i32 16)
store i64 %35, i64* %12
br label %59
36: ; preds = %21
%37 = load i8*, i8** @optarg
%38 = call i64 @strtoul(i8* %37, i32* null, i32 16)
store i64 %38, i64* %13
br label %59
39: ; preds = %21
br label %40
40: ; preds = %21, %39
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%49 = load i32, i32* @stderr
%50 = call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0))
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.9, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.10, i64 0, i64 0))
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %3
br label %84
59: ; preds = %36, %33, %31, %29, %27, %25, %23
br label %16
60: ; preds = %16
%61 = load i8*, i8** %10
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i8*, i8** %11
%65 = icmp ne i8* %64, null
br i1 %65, label %69, label %66
66: ; preds = %63, %60
%67 = load i32, i32* @stderr
%68 = call i32 @fprintf(i32 %67, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %84
69: ; preds = %63
%70 = load i64, i64* %13
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i32, i32* @stderr
%74 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %3
br label %84
75: ; preds = %69
%76 = load i8*, i8** %7
%77 = load i8*, i8** %8
%78 = load i8*, i8** %9
%79 = load i8*, i8** %10
%80 = load i8*, i8** %11
%81 = load i64, i64* %12
%82 = load i64, i64* %13
%83 = call i32 @tagfile(i8* %76, i8* %77, i8* %78, i8* %79, i8* %80, i64 %81, i64 %82)
store i32 %83, i32* %3
br label %84
84: ; preds = %75, %72, %66, %40
%85 = load i32, i32* %3
ret i32 %85
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"i:f:o:b:c:l:e:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.3 = [30 x i8] c"Usage: imagetag <parameters>\0A\00"
@.str.4 = [73 x i8] c"-i <kernel> - The LZMA compressed kernel file to include in the image\0A\00"
@.str.5 = [57 x i8] c"-f <rootfs> - The RootFS file to include in the image\0A\00"
@.str.6 = [33 x i8] c"-o <bin> - The output file\0A\00"
@.str.7 = [68 x i8] c"-b <boardid> - The board id to set in the image (i.e. \2296345GW2\22)\0A\00"
@.str.8 = [63 x i8] c"-c <chipid> - The chip id to set in the image (i.e. \226345\22)\0A\00"
@.str.9 = [88 x i8] c"-l <loadaddr> - Address where the kernel expects to be loaded (defaults to 0x80010000)\0A\00"
@.str.10 = [66 x i8] c"-e <entry> - Address where the kernel entry point will end up\0A\00"
@.str.11 = [36 x i8] c"-h - Displays this text\0A\00"
@.str.12 = [54 x i8] c"You need to specify the board (-b) and chip id (-c)!\0A\00"
@.str.13 = [43 x i8] c"You need to specify the kernel entry (-e)\0A\00"
@str = [31 x i8] c"Broadcom image tagger - v0.1.0\00"
@str.14 = [30 x i8] c"Copyright (C) 2008 Axel Gembe\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.14, i64 0, i64 0))
br label %5
5: ; preds = %41, %2
%6 = phi i8* [ %42, %41 ], [ null, %2 ]
%7 = phi i8* [ %14, %41 ], [ null, %2 ]
%8 = phi i8* [ %21, %41 ], [ null, %2 ]
%9 = phi i8* [ %27, %41 ], [ null, %2 ]
%10 = phi i8* [ %32, %41 ], [ null, %2 ]
%11 = phi i64 [ %36, %41 ], [ 2147549184, %2 ]
%12 = phi i64 [ %39, %41 ], [ 0, %2 ]
br label %13
13: ; preds = %5, %43
%14 = phi i8* [ %7, %5 ], [ %44, %43 ]
%15 = phi i8* [ %8, %5 ], [ %21, %43 ]
%16 = phi i8* [ %9, %5 ], [ %27, %43 ]
%17 = phi i8* [ %10, %5 ], [ %32, %43 ]
%18 = phi i64 [ %11, %5 ], [ %36, %43 ]
%19 = phi i64 [ %12, %5 ], [ %39, %43 ]
br label %20
20: ; preds = %13, %45
%21 = phi i8* [ %15, %13 ], [ %46, %45 ]
%22 = phi i8* [ %16, %13 ], [ %27, %45 ]
%23 = phi i8* [ %17, %13 ], [ %32, %45 ]
%24 = phi i64 [ %18, %13 ], [ %36, %45 ]
%25 = phi i64 [ %19, %13 ], [ %39, %45 ]
br label %26
26: ; preds = %20, %47
%27 = phi i8* [ %22, %20 ], [ %48, %47 ]
%28 = phi i8* [ %23, %20 ], [ %32, %47 ]
%29 = phi i64 [ %24, %20 ], [ %36, %47 ]
%30 = phi i64 [ %25, %20 ], [ %39, %47 ]
br label %31
31: ; preds = %26, %49
%32 = phi i8* [ %28, %26 ], [ %50, %49 ]
%33 = phi i64 [ %29, %26 ], [ %36, %49 ]
%34 = phi i64 [ %30, %26 ], [ %39, %49 ]
br label %35
35: ; preds = %31, %51
%36 = phi i64 [ %33, %31 ], [ %53, %51 ]
%37 = phi i64 [ %34, %31 ], [ %39, %51 ]
br label %38
38: ; preds = %35, %54
%39 = phi i64 [ %56, %54 ], [ %37, %35 ]
%40 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
switch i32 %40, label %57 [
i32 -1, label %76
i32 105, label %41
i32 102, label %43
i32 111, label %45
i32 98, label %47
i32 99, label %49
i32 108, label %51
i32 101, label %54
]
41: ; preds = %38
%42 = load i8*, i8** @optarg
br label %5
43: ; preds = %38
%44 = load i8*, i8** @optarg
br label %13
45: ; preds = %38
%46 = load i8*, i8** @optarg
br label %20
47: ; preds = %38
%48 = load i8*, i8** @optarg
br label %26
49: ; preds = %38
%50 = load i8*, i8** @optarg
br label %31
51: ; preds = %38
%52 = load i8*, i8** @optarg
%53 = tail call i64 @strtoul(i8* nocapture %52, i32* null, i32 16)
br label %35
54: ; preds = %38
%55 = load i8*, i8** @optarg
%56 = tail call i64 @strtoul(i8* nocapture %55, i32* null, i32 16)
br label %38
57: ; preds = %38
%58 = load i32, i32* @stderr
%59 = tail call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = tail call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = tail call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
%64 = load i32, i32* @stderr
%65 = tail call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%66 = load i32, i32* @stderr
%67 = tail call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = tail call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%70 = load i32, i32* @stderr
%71 = tail call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.9, i64 0, i64 0))
%72 = load i32, i32* @stderr
%73 = tail call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.10, i64 0, i64 0))
%74 = load i32, i32* @stderr
%75 = tail call i32 @fprintf(i32 %74, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
br label %90
76: ; preds = %38
%77 = icmp ne i8* %27, null
%78 = icmp ne i8* %32, null
%79 = select i1 %77, i1 %78, i1 false
br i1 %79, label %83, label %80
80: ; preds = %76
%81 = load i32, i32* @stderr
%82 = tail call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
br label %90
83: ; preds = %76
%84 = icmp eq i64 %39, 0
br i1 %84, label %85, label %88
85: ; preds = %83
%86 = load i32, i32* @stderr
%87 = tail call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0))
br label %90
88: ; preds = %83
%89 = tail call i32 @tagfile(i8* %6, i8* %14, i8* %21, i8* %27, i8* %32, i64 %36, i64 %39)
br label %90
90: ; preds = %88, %85, %80, %57
%91 = phi i32 [ 1, %57 ], [ 1, %85 ], [ %89, %88 ], [ 1, %80 ]
ret i32 %91
}