#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 */
struct device_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ build_image(char const *, char const *, char const *,
                               unsigned int, int, int,
                               struct device_info const *);
int /*<<< orphan*/ exit(int);
struct device_info *find_board(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  const char *board = NULL, *kernel_image = NULL, *rootfs_image = NULL,
             *output = NULL;
  bool add_jffs2_eof = false, sysupgrade = false;
  unsigned rev = 0;
  const struct device_info *info;
  while (true) {
    int c;
    c = getopt(argc, argv, "B:k:r:o:V:jSh");
    if (c == -1)
      break;
    switch (c) {
    case 'B':
      board = optarg;
      break;
    case 'k':
      kernel_image = optarg;
      break;
    case 'r':
      rootfs_image = optarg;
      break;
    case 'o':
      output = optarg;
      break;
    case 'V':
      sscanf(optarg, "r%u", &rev);
      break;
    case 'j':
      add_jffs2_eof = true;
      break;
    case 'S':
      sysupgrade = true;
      break;
    case 'h':
      usage(argv[0]);
      return 0;
    default:
      usage(argv[0]);
      return 1;
    }
  }
  if (!board)
    do {
      fprintf(stderr,
              "no board has been specified"
              ": %s\n",
              strerror(0));
      if (1)
        exit(1);
    } while (0);
  if (!kernel_image)
    do {
      fprintf(stderr,
              "no kernel image has been specified"
              ": %s\n",
              strerror(0));
      if (1)
        exit(1);
    } while (0);
  if (!rootfs_image)
    do {
      fprintf(stderr,
              "no rootfs image has been specified"
              ": %s\n",
              strerror(0));
      if (1)
        exit(1);
    } while (0);
  if (!output)
    do {
      fprintf(stderr,
              "no output filename has been specified"
              ": %s\n",
              strerror(0));
      if (1)
        exit(1);
    } while (0);
  info = find_board(board);
  if (info == NULL)
    do {
      fprintf(stderr,
              "unsupported board %s"
              ": %s\n",
              board, strerror(0));
      if (1)
        exit(1);
    } while (0);
  build_image(output, kernel_image, rootfs_image, rev, add_jffs2_eof,
              sysupgrade, info);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xee8(%rip),%rdx
call   1080 <getopt@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
jne    11f3 <main+0x73>
jmp    12d4 <main+0x154>
mov    -0x4c(%rbp),%eax
add    $0xffffffbe,%eax
mov    %eax,%ecx
mov    %rcx,-0x58(%rbp)
sub    $0x30,%eax
ja     12b7 <main+0x137>
mov    -0x58(%rbp),%rax
lea    0xded(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dd5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    12cf <main+0x14f>
mov    0x2dc2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    12cf <main+0x14f>
mov    0x2daf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    12cf <main+0x14f>
mov    0x2d9c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    12cf <main+0x14f>
mov    0x2d89(%rip),%rax
mov    (%rax),%rdi
lea    0xe59(%rip),%rsi
lea    -0x3c(%rbp),%rdx
call   1050 <sscanf@plt>
jmp    12cf <main+0x14f>
movl   $0x1,-0x34(%rbp)
jmp    12cf <main+0x14f>
movl   $0x1,-0x38(%rbp)
jmp    12cf <main+0x14f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    145d <main+0x2dd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    145d <main+0x2dd>
jmp    11ce <main+0x4e>
cmpq   $0x0,-0x18(%rbp)
jne    1315 <main+0x195>
jmp    12e4 <main+0x164>
mov    0x2ced(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
xor    %edi,%edi
call   10a0 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    %rax,%rdx
lea    0xdd2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1356 <main+0x1d6>
jmp    1325 <main+0x1a5>
mov    0x2cac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
xor    %edi,%edi
call   10a0 <strerror@plt>
mov    -0x60(%rbp),%edi
mov    %rax,%rdx
lea    0xdb2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpq   $0x0,-0x28(%rbp)
jne    1397 <main+0x217>
jmp    1366 <main+0x1e6>
mov    0x2c6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
xor    %edi,%edi
call   10a0 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    %rax,%rdx
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpq   $0x0,-0x30(%rbp)
jne    13d8 <main+0x258>
jmp    13a7 <main+0x227>
mov    0x2c2a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
xor    %edi,%edi
call   10a0 <strerror@plt>
mov    -0x68(%rbp),%edi
mov    %rax,%rdx
lea    0xd80(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1060 <find_board@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1432 <main+0x2b2>
jmp    13f5 <main+0x275>
mov    0x2bdc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
xor    %edi,%edi
call   10a0 <strerror@plt>
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%rdx
mov    %rax,%rcx
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x3c(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
mov    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <build_image@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%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,%r15
mov    %edi,%r12d
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
lea    0xf1a(%rip),%r14
mov    0x2e47(%rip),%rbx
lea    0xf1a(%rip),%r13
lea    0x14(%rsp),%rbp
xor    %eax,%eax
mov    %rax,0x20(%rsp)
movl   $0x0,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
jmp    11fe <main+0x7e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1050 <sscanf@plt>
mov    %r12d,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1080 <getopt@plt>
cmp    $0x56,%eax
je     11f0 <main+0x70>
lea    -0x42(%rax),%ecx
cmp    $0x30,%ecx
ja     1265 <main+0xe5>
lea    0xde0(%rip),%rdx
movslq (%rdx,%rcx,4),%rax
add    %rdx,%rax
jmp    *%rax
mov    (%rbx),%rax
mov    %rax,0x30(%rsp)
jmp    11fe <main+0x7e>
movl   $0x1,0xc(%rsp)
jmp    11fe <main+0x7e>
movl   $0x1,0x10(%rsp)
jmp    11fe <main+0x7e>
mov    (%rbx),%rax
mov    %rax,0x28(%rsp)
jmp    11fe <main+0x7e>
mov    (%rbx),%rax
mov    %rax,0x18(%rsp)
jmp    11fe <main+0x7e>
mov    (%rbx),%rax
mov    %rax,0x20(%rsp)
jmp    11fe <main+0x7e>
cmp    $0xffffffff,%eax
jne    12d5 <main+0x155>
mov    0x30(%rsp),%r14
test   %r14,%r14
je     12fd <main+0x17d>
mov    0x28(%rsp),%rbx
test   %rbx,%rbx
mov    0x20(%rsp),%r15
mov    0x18(%rsp),%rbp
je     1316 <main+0x196>
test   %r15,%r15
je     132f <main+0x1af>
test   %rbp,%rbp
je     1348 <main+0x1c8>
mov    %r14,%rdi
call   1060 <find_board@plt>
test   %rax,%rax
je     1375 <main+0x1f5>
mov    0x14(%rsp),%ecx
mov    %rax,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
call   1030 <build_image@plt>
jmp    12ec <main+0x16c>
mov    (%r15),%rdi
call   1070 <usage@plt>
mov    $0x1,%eax
jmp    12ee <main+0x16e>
mov    (%r15),%rdi
call   1070 <usage@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cd4(%rip),%rax
mov    (%rax),%ebx
xor    %edi,%edi
call   10a0 <strerror@plt>
lea    0xdc2(%rip),%rsi
jmp    135f <main+0x1df>
mov    0x2cbb(%rip),%rax
mov    (%rax),%ebx
xor    %edi,%edi
call   10a0 <strerror@plt>
lea    0xdca(%rip),%rsi
jmp    135f <main+0x1df>
mov    0x2ca2(%rip),%rax
mov    (%rax),%ebx
xor    %edi,%edi
call   10a0 <strerror@plt>
lea    0xdd9(%rip),%rsi
jmp    135f <main+0x1df>
mov    0x2c89(%rip),%rax
mov    (%rax),%ebx
xor    %edi,%edi
call   10a0 <strerror@plt>
lea    0xde8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c5c(%rip),%rax
mov    (%rax),%ebx
xor    %edi,%edi
call   10a0 <strerror@plt>
lea    0xde6(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.device_info = type { i32 }
@.str = [14 x i8] c"B:k:r:o:V:jSh\00"
@optarg = global i8* null
@.str.1 = [4 x i8] c"r%u\00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"no board has been specified: %s\0A\00"
@.str.3 = [40 x i8] c"no kernel image has been specified: %s\0A\00"
@.str.4 = [40 x i8] c"no rootfs image has been specified: %s\0A\00"
@.str.5 = [43 x i8] c"no output filename has been specified: %s\0A\00"
@.str.6 = [26 x i8] c"unsupported board %s: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca %struct.device_info*
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i8* null, i8** %8
store i8* null, i8** %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
br label %15
15: ; preds = %2, %47
%16 = load i32, i32* %4
%17 = load i8**, i8*** %5
%18 = call i32 @getopt(i32 %16, i8** %17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 %18, i32* %14
%19 = load i32, i32* %14
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %22
21: ; preds = %15
br label %48
22: ; preds = %15
%23 = load i32, i32* %14
switch i32 %23, label %42 [
i32 66, label %24
i32 107, label %26
i32 114, label %28
i32 111, label %30
i32 86, label %32
i32 106, label %35
i32 83, label %36
i32 104, label %37
]
24: ; preds = %22
%25 = load i8*, i8** @optarg
store i8* %25, i8** %6
br label %47
26: ; preds = %22
%27 = load i8*, i8** @optarg
store i8* %27, i8** %7
br label %47
28: ; preds = %22
%29 = load i8*, i8** @optarg
store i8* %29, i8** %8
br label %47
30: ; preds = %22
%31 = load i8*, i8** @optarg
store i8* %31, i8** %9
br label %47
32: ; preds = %22
%33 = load i8*, i8** @optarg
%34 = call i32 @sscanf(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %12)
br label %47
35: ; preds = %22
store i32 1, i32* %10
br label %47
36: ; preds = %22
store i32 1, i32* %11
br label %47
37: ; preds = %22
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = call i32 @usage(i8* %40)
store i32 0, i32* %3
br label %110
42: ; preds = %22
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 0
%45 = load i8*, i8** %44
%46 = call i32 @usage(i8* %45)
store i32 1, i32* %3
br label %110
47: ; preds = %36, %35, %32, %30, %28, %26, %24
br label %15
48: ; preds = %21
%49 = load i8*, i8** %6
%50 = icmp ne i8* %49, null
br i1 %50, label %58, label %51
51: ; preds = %48
br label %52
52: ; preds = %51
%53 = load i32, i32* @stderr
%54 = call i8* @strerror(i32 0)
%55 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %54)
%56 = call i32 @exit(i32 1)
unreachable
57: ; No predecessors!
br label %58
58: ; preds = %57, %48
%59 = load i8*, i8** %7
%60 = icmp ne i8* %59, null
br i1 %60, label %68, label %61
61: ; preds = %58
br label %62
62: ; preds = %61
%63 = load i32, i32* @stderr
%64 = call i8* @strerror(i32 0)
%65 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %64)
%66 = call i32 @exit(i32 1)
unreachable
67: ; No predecessors!
br label %68
68: ; preds = %67, %58
%69 = load i8*, i8** %8
%70 = icmp ne i8* %69, null
br i1 %70, label %78, label %71
71: ; preds = %68
br label %72
72: ; preds = %71
%73 = load i32, i32* @stderr
%74 = call i8* @strerror(i32 0)
%75 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* %74)
%76 = call i32 @exit(i32 1)
unreachable
77: ; No predecessors!
br label %78
78: ; preds = %77, %68
%79 = load i8*, i8** %9
%80 = icmp ne i8* %79, null
br i1 %80, label %88, label %81
81: ; preds = %78
br label %82
82: ; preds = %81
%83 = load i32, i32* @stderr
%84 = call i8* @strerror(i32 0)
%85 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %84)
%86 = call i32 @exit(i32 1)
unreachable
87: ; No predecessors!
br label %88
88: ; preds = %87, %78
%89 = load i8*, i8** %6
%90 = call %struct.device_info* @find_board(i8* %89)
store %struct.device_info* %90, %struct.device_info** %13
%91 = load %struct.device_info*, %struct.device_info** %13
%92 = icmp eq %struct.device_info* %91, null
br i1 %92, label %93, label %101
93: ; preds = %88
br label %94
94: ; preds = %93
%95 = load i32, i32* @stderr
%96 = load i8*, i8** %6
%97 = call i8* @strerror(i32 0)
%98 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %96, i8* %97)
%99 = call i32 @exit(i32 1)
unreachable
100: ; No predecessors!
br label %101
101: ; preds = %100, %88
%102 = load i8*, i8** %9
%103 = load i8*, i8** %7
%104 = load i8*, i8** %8
%105 = load i32, i32* %12
%106 = load i32, i32* %10
%107 = load i32, i32* %11
%108 = load %struct.device_info*, %struct.device_info** %13
%109 = call i32 @build_image(i8* %102, i8* %103, i8* %104, i32 %105, i32 %106, i32 %107, %struct.device_info* %108)
store i32 0, i32* %3
br label %110
110: ; preds = %101, %42, %37
%111 = load i32, i32* %3
ret i32 %111
}

LLVM IR (-O2):
%struct.device_info = type { i32 }
@.str = [14 x i8] c"B:k:r:o:V:jSh\00"
@optarg = global i8* null
@.str.1 = [4 x i8] c"r%u\00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"no board has been specified: %s\0A\00"
@.str.3 = [40 x i8] c"no kernel image has been specified: %s\0A\00"
@.str.4 = [40 x i8] c"no rootfs image has been specified: %s\0A\00"
@.str.5 = [43 x i8] c"no output filename has been specified: %s\0A\00"
@.str.6 = [26 x i8] c"unsupported board %s: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %36, %2
%6 = phi i8* [ %37, %36 ], [ null, %2 ]
%7 = phi i8* [ %13, %36 ], [ null, %2 ]
%8 = phi i8* [ %19, %36 ], [ null, %2 ]
%9 = phi i32 [ %24, %36 ], [ 0, %2 ]
%10 = phi i32 [ %28, %36 ], [ 0, %2 ]
%11 = phi i8* [ %31, %36 ], [ null, %2 ]
br label %12
12: ; preds = %5, %38
%13 = phi i8* [ %7, %5 ], [ %39, %38 ]
%14 = phi i8* [ %8, %5 ], [ %19, %38 ]
%15 = phi i32 [ %9, %5 ], [ %24, %38 ]
%16 = phi i32 [ %10, %5 ], [ %28, %38 ]
%17 = phi i8* [ %11, %5 ], [ %31, %38 ]
br label %18
18: ; preds = %12, %40
%19 = phi i8* [ %14, %12 ], [ %41, %40 ]
%20 = phi i32 [ %15, %12 ], [ %24, %40 ]
%21 = phi i32 [ %16, %12 ], [ %28, %40 ]
%22 = phi i8* [ %17, %12 ], [ %31, %40 ]
br label %23
23: ; preds = %32, %18
%24 = phi i32 [ %20, %18 ], [ 1, %32 ]
%25 = phi i32 [ %21, %18 ], [ %28, %32 ]
%26 = phi i8* [ %22, %18 ], [ %31, %32 ]
br label %27
27: ; preds = %32, %23
%28 = phi i32 [ %25, %23 ], [ 1, %32 ]
%29 = phi i8* [ %26, %23 ], [ %31, %32 ]
br label %30
30: ; preds = %27, %34
%31 = phi i8* [ %29, %27 ], [ %35, %34 ]
br label %32
32: ; preds = %30, %42
%33 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
switch i32 %33, label %48 [
i32 -1, label %51
i32 66, label %34
i32 107, label %36
i32 114, label %38
i32 111, label %40
i32 86, label %42
i32 106, label %23
i32 83, label %27
i32 104, label %45
]
34: ; preds = %32
%35 = load i8*, i8** @optarg
br label %30
36: ; preds = %32
%37 = load i8*, i8** @optarg
br label %5
38: ; preds = %32
%39 = load i8*, i8** @optarg
br label %12
40: ; preds = %32
%41 = load i8*, i8** @optarg
br label %18
42: ; preds = %32
%43 = load i8*, i8** @optarg
%44 = call i32 @sscanf(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %32
45: ; preds = %32
%46 = load i8*, i8** %1
%47 = call i32 @usage(i8* %46)
br label %90
48: ; preds = %32
%49 = load i8*, i8** %1
%50 = call i32 @usage(i8* %49)
br label %90
51: ; preds = %32
%52 = icmp eq i8* %31, null
br i1 %52, label %53, label %58
53: ; preds = %51
%54 = load i32, i32* @stderr
%55 = call i8* @strerror(i32 0)
%56 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %55)
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %51
%59 = icmp eq i8* %6, null
br i1 %59, label %60, label %65
60: ; preds = %58
%61 = load i32, i32* @stderr
%62 = call i8* @strerror(i32 0)
%63 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %62)
%64 = call i32 @exit(i32 1)
unreachable
65: ; preds = %58
%66 = icmp eq i8* %13, null
br i1 %66, label %67, label %72
67: ; preds = %65
%68 = load i32, i32* @stderr
%69 = call i8* @strerror(i32 0)
%70 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i8* %69)
%71 = call i32 @exit(i32 1)
unreachable
72: ; preds = %65
%73 = icmp eq i8* %19, null
br i1 %73, label %74, label %79
74: ; preds = %72
%75 = load i32, i32* @stderr
%76 = call i8* @strerror(i32 0)
%77 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %76)
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %72
%80 = call %struct.device_info* @find_board(i8* %31)
%81 = icmp eq %struct.device_info* %80, null
br i1 %81, label %82, label %87
82: ; preds = %79
%83 = load i32, i32* @stderr
%84 = call i8* @strerror(i32 0)
%85 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %31, i8* %84)
%86 = call i32 @exit(i32 1)
unreachable
87: ; preds = %79
%88 = load i32, i32* %3
%89 = call i32 @build_image(i8* %19, i8* %6, i8* %13, i32 %88, i32 %24, i32 %28, %struct.device_info* %80)
br label %90
90: ; preds = %45, %48, %87
%91 = phi i32 [ 0, %87 ], [ 0, %45 ], [ 1, %48 ]
ret i32 %91
}