#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 */

/* Variables and functions */
scalar_t__ atoi(char *);
int /*<<< orphan*/ disable_boot_abort();
int /*<<< orphan*/ enable_boot_abort();
scalar_t__ get_boot_abort(unsigned short *);
int /*<<< orphan*/ get_mac(unsigned char *);
scalar_t__ get_mfg_state(unsigned char *);
int /*<<< orphan*/ get_sn(unsigned char *, unsigned char *);
int /*<<< orphan*/ init_board_data();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ set_mac(unsigned char *);
scalar_t__ set_mfg_state(unsigned char);
scalar_t__ set_sn(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ show_board_data();
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  char name[16], buf[32];
  unsigned char size, i = 0, num;
  --argc;
  ++argv;
  if (!*argv)
    usage();
  for (; *argv; *++argv) {
    if (!strcmp(*argv, "get")) {
      if (*++argv) {
        strcpy(buf, *argv);
        if (!strcmp(buf, "mac")) {
          if (!get_mac((unsigned char *)buf))
            printf("%02X:%02X:%02X:%02X:%02X:%02X\n", (unsigned char)buf[0],
                   (unsigned char)buf[1], (unsigned char)buf[2],
                   (unsigned char)buf[3], (unsigned char)buf[4],
                   (unsigned char)buf[5]);
          else
            return -1;
        } else if (!strcmp(buf, "sn")) {
          if (!get_sn((unsigned char *)buf, &size)) {
            for (i = 0; i < size; i++)
              printf("%c", buf[i]);
            printf("\n");
          } else
            return -1;
        } else if (!strcmp(buf, "boot_abort")) {
          if (get_boot_abort((unsigned short *)buf))
            return -1;
        } else if (!strcmp(buf, "mfg_state")) {
          if (get_mfg_state((unsigned char *)buf))
            return -1;
        } else
          usage();
      }
    } else if (!strcmp(*argv, "set")) {
      if (*++argv) {
        strcpy(name, *argv);
        if (*++argv) {
          strcpy(buf, *argv);
          if (!strcmp(name, "mac")) {
            if (set_mac((unsigned char *)buf))
              return -1;
          } else if (!strcmp(name, "sn")) {
            if (set_sn((unsigned char *)buf, strlen(buf)))
              return -1;
          } else if (!strcmp(name, "boot_abort")) {
            if (!strcmp(buf, "enable"))
              enable_boot_abort();
            else if (!strcmp(buf, "disable"))
              disable_boot_abort();
            else
              usage();
          } else if (!strcmp(name, "mfg_state")) {
            num = (unsigned char)atoi(buf);
            if (set_mfg_state(num))
              return -1;
          } else
            usage();
        }
      }
    } else if (!strcmp(*argv, "show")) {
      show_board_data();
    } else if (!strcmp(*argv, "init")) {
      init_board_data();
    } else
      usage();
  }
  return 0;
}


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)
movb   $0x0,-0x42(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1254 <main+0x44>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1259 <main+0x49>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1699 <main+0x489>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd8b(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    143e <main+0x22e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1439 <main+0x229>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <strcpy@plt>
lea    -0x40(%rbp),%rdi
lea    0xd4c(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    1319 <main+0x109>
lea    -0x40(%rbp),%rdi
call   1100 <get_mac@plt>
cmp    $0x0,%eax
jne    1308 <main+0xf8>
movzbl -0x40(%rbp),%esi
movzbl -0x3f(%rbp),%edx
movzbl -0x3e(%rbp),%ecx
movzbl -0x3d(%rbp),%r8d
movzbl -0x3c(%rbp),%r9d
movzbl -0x3b(%rbp),%eax
lea    0xd0f(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1314 <main+0x104>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    1434 <main+0x224>
lea    -0x40(%rbp),%rdi
lea    0xd03(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    13a4 <main+0x194>
lea    -0x40(%rbp),%rdi
lea    -0x41(%rbp),%rsi
call   1130 <get_sn@plt>
cmp    $0x0,%eax
jne    1393 <main+0x183>
movb   $0x0,-0x42(%rbp)
movzbl -0x42(%rbp),%eax
movzbl -0x41(%rbp),%ecx
cmp    %ecx,%eax
jge    1380 <main+0x170>
movzbl -0x42(%rbp),%eax
movsbl -0x40(%rbp,%rax,1),%esi
lea    0xcbe(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x42(%rbp),%al
add    $0x1,%al
mov    %al,-0x42(%rbp)
jmp    134c <main+0x13c>
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    139f <main+0x18f>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    142f <main+0x21f>
lea    -0x40(%rbp),%rdi
lea    0xc7e(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    13e1 <main+0x1d1>
lea    -0x40(%rbp),%rdi
call   10f0 <get_boot_abort@plt>
cmp    $0x0,%rax
je     13dc <main+0x1cc>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    142a <main+0x21a>
lea    -0x40(%rbp),%rdi
lea    0xc4c(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    141e <main+0x20e>
lea    -0x40(%rbp),%rdi
call   1070 <get_mfg_state@plt>
cmp    $0x0,%rax
je     1419 <main+0x209>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    1425 <main+0x215>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    142a <main+0x21a>
jmp    142f <main+0x21f>
jmp    1434 <main+0x224>
jmp    1439 <main+0x229>
jmp    1683 <main+0x473>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xbf6(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    161d <main+0x40d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1618 <main+0x408>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1613 <main+0x403>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <strcpy@plt>
lea    -0x20(%rbp),%rdi
lea    0xb4b(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    14eb <main+0x2db>
lea    -0x40(%rbp),%rdi
call   1120 <set_mac@plt>
cmp    $0x0,%rax
je     14e6 <main+0x2d6>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    160e <main+0x3fe>
lea    -0x20(%rbp),%rdi
lea    0xb31(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    153b <main+0x32b>
lea    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
call   1080 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%esi
call   1040 <set_sn@plt>
cmp    $0x0,%rax
je     1536 <main+0x326>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    1609 <main+0x3f9>
lea    -0x20(%rbp),%rdi
lea    0xae7(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    15af <main+0x39f>
lea    -0x40(%rbp),%rdi
lea    0xae7(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    1579 <main+0x369>
mov    $0x0,%al
call   1030 <enable_boot_abort@plt>
jmp    15aa <main+0x39a>
lea    -0x40(%rbp),%rdi
lea    0xac9(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    159e <main+0x38e>
mov    $0x0,%al
call   10a0 <disable_boot_abort@plt>
jmp    15a5 <main+0x395>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    15aa <main+0x39a>
jmp    1604 <main+0x3f4>
lea    -0x20(%rbp),%rdi
lea    0xa7e(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    15f8 <main+0x3e8>
lea    -0x40(%rbp),%rdi
call   1110 <atoi@plt>
mov    %al,-0x43(%rbp)
movzbl -0x43(%rbp),%edi
call   1060 <set_mfg_state@plt>
cmp    $0x0,%rax
je     15f3 <main+0x3e3>
movl   $0xffffffff,-0x4(%rbp)
jmp    16a0 <main+0x490>
jmp    15ff <main+0x3ef>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1604 <main+0x3f4>
jmp    1609 <main+0x3f9>
jmp    160e <main+0x3fe>
jmp    1613 <main+0x403>
jmp    1618 <main+0x408>
jmp    167e <main+0x46e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xa2a(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    1645 <main+0x435>
mov    $0x0,%al
call   10d0 <show_board_data@plt>
jmp    1679 <main+0x469>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xa07(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    166d <main+0x45d>
mov    $0x0,%al
call   10c0 <init_board_data@plt>
jmp    1674 <main+0x464>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    1679 <main+0x469>
jmp    167e <main+0x46e>
jmp    1683 <main+0x473>
jmp    1688 <main+0x478>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1259 <main+0x49>
movl   $0x0,-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    $0x48,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%r13
add    $0x8,%rbx
test   %r13,%r13
jne    1253 <main+0x33>
xor    %ebp,%ebp
xor    %eax,%eax
call   10f0 <usage@plt>
mov    (%rbx),%r13
test   %r13,%r13
je     158a <main+0x36a>
movabs $0x746174735f67666d,%rbp
74 61 74
lea    0xd9c(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xdcb(%rip),%r12
jmp    1291 <main+0x71>
xor    %eax,%eax
call   10e0 <show_board_data@plt>
nopl   0x0(%rax)
mov    0x8(%rbx),%r13
add    $0x8,%rbx
test   %r13,%r13
je     1581 <main+0x361>
mov    %r13,%rdi
mov    %r14,%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     12f0 <main+0xd0>
mov    %r13,%rdi
mov    %r12,%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     1360 <main+0x140>
mov    %r13,%rdi
lea    0xd89(%rip),%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     1272 <main+0x52>
mov    %r13,%rdi
lea    0xd7b(%rip),%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     142a <main+0x20a>
xor    %eax,%eax
call   10f0 <usage@plt>
jmp    1280 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
je     1280 <main+0x60>
mov    %r15,%rdi
call   1060 <strcpy@plt>
cmpl   $0x63616d,0x10(%rsp)
jne    13b4 <main+0x194>
mov    %r15,%rdi
call   1110 <get_mac@plt>
test   %eax,%eax
jne    1585 <main+0x365>
movzbl 0x10(%rsp),%esi
movzbl 0x11(%rsp),%edx
movzbl 0x12(%rsp),%ecx
movzbl 0x13(%rsp),%r8d
movzbl 0x14(%rsp),%r9d
movzbl 0x15(%rsp),%eax
mov    %eax,(%rsp)
lea    0xcb7(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1280 <main+0x60>
nopl   0x0(%rax)
mov    0x8(%rbx),%rsi
test   %rsi,%rsi
je     1436 <main+0x216>
lea    0x30(%rsp),%rdi
call   1060 <strcpy@plt>
mov    0x10(%rbx),%rsi
add    $0x10,%rbx
test   %rsi,%rsi
je     1280 <main+0x60>
mov    %r15,%rdi
call   1060 <strcpy@plt>
cmpl   $0x63616d,0x30(%rsp)
jne    143f <main+0x21f>
mov    %r15,%rdi
call   1130 <set_mac@plt>
test   %rax,%rax
je     1280 <main+0x60>
jmp    1585 <main+0x365>
mov    0x10(%rsp),%eax
mov    $0x6e73,%ecx
xor    %ecx,%eax
movzbl 0x12(%rsp),%ecx
or     %ax,%cx
je     14bd <main+0x29d>
mov    0x10(%rsp),%rax
movabs $0x6f62615f746f6f62,%rcx
61 62 6f
xor    %rcx,%rax
mov    0x13(%rsp),%rcx
movabs $0x74726f62615f74,%rdx
xor    %rdx,%rcx
or     %rax,%rcx
je     150a <main+0x2ea>
mov    0x10(%rsp),%rax
xor    %rbp,%rax
movzwl 0x18(%rsp),%ecx
xor    $0x65,%rcx
or     %rax,%rcx
jne    12dd <main+0xbd>
mov    %r15,%rdi
call   1080 <get_mfg_state@plt>
test   %rax,%rax
je     1280 <main+0x60>
jmp    1585 <main+0x365>
xor    %eax,%eax
call   10d0 <init_board_data@plt>
jmp    1280 <main+0x60>
add    $0x8,%rbx
jmp    1280 <main+0x60>
mov    0x30(%rsp),%eax
mov    $0x6e73,%ecx
xor    %ecx,%eax
movzbl 0x32(%rsp),%ecx
or     %ax,%cx
je     151d <main+0x2fd>
mov    0x30(%rsp),%rax
movabs $0x6f62615f746f6f62,%rcx
61 62 6f
xor    %rcx,%rax
mov    0x33(%rsp),%rcx
movabs $0x74726f62615f74,%rdx
xor    %rdx,%rcx
or     %rax,%rcx
je     153a <main+0x31a>
mov    0x30(%rsp),%rax
xor    %rbp,%rax
movzwl 0x38(%rsp),%ecx
xor    $0x65,%rcx
or     %rax,%rcx
jne    12dd <main+0xbd>
mov    %r15,%rdi
call   1120 <atoi@plt>
movzbl %al,%edi
call   1070 <set_mfg_state@plt>
test   %rax,%rax
je     1280 <main+0x60>
jmp    1585 <main+0x365>
mov    %r15,%rdi
lea    0xf(%rsp),%rsi
call   1140 <get_sn@plt>
test   %eax,%eax
jne    1585 <main+0x365>
mov    %rbp,%r13
cmpb   $0x0,0xf(%rsp)
je     14f8 <main+0x2d8>
xor    %ebp,%ebp
xchg   %ax,%ax
movsbl 0x10(%rsp,%rbp,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
movzbl 0xf(%rsp),%eax
cmp    %rax,%rbp
jb     14e0 <main+0x2c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rbp
jmp    1280 <main+0x60>
mov    %r15,%rdi
call   1100 <get_boot_abort@plt>
test   %rax,%rax
je     1280 <main+0x60>
jmp    1585 <main+0x365>
mov    %r15,%rdi
call   1090 <strlen@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1050 <set_sn@plt>
test   %rax,%rax
je     1280 <main+0x60>
jmp    1585 <main+0x365>
mov    0x10(%rsp),%eax
mov    $0x62616e65,%ecx
xor    %ecx,%eax
mov    0x13(%rsp),%ecx
mov    $0x656c62,%edx
xor    %edx,%ecx
or     %eax,%ecx
je     1575 <main+0x355>
movabs $0x656c6261736964,%rax
cmp    %rax,0x10(%rsp)
jne    12dd <main+0xbd>
xor    %eax,%eax
call   10b0 <disable_boot_abort@plt>
jmp    1280 <main+0x60>
xor    %eax,%eax
call   1040 <enable_boot_abort@plt>
jmp    1280 <main+0x60>
xor    %ebp,%ebp
jmp    158a <main+0x36a>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"mac\00"
@.str.2 = [31 x i8] c"%02X:%02X:%02X:%02X:%02X:%02X\0A\00"
@.str.3 = [3 x i8] c"sn\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [11 x i8] c"boot_abort\00"
@.str.7 = [10 x i8] c"mfg_state\00"
@.str.8 = [4 x i8] c"set\00"
@.str.9 = [7 x i8] c"enable\00"
@.str.10 = [8 x i8] c"disable\00"
@.str.11 = [5 x i8] c"show\00"
@.str.12 = [5 x i8] c"init\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca [32 x i8]
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8**, i8*** %5
%16 = load i8*, i8** %15
%17 = icmp ne i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %2
%19 = call i32 (...) @usage()
br label %20
20: ; preds = %18, %2
br label %21
21: ; preds = %232, %20
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %236
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %126, label %30
30: ; preds = %25
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i32 1
store i8** %32, i8*** %5
%33 = load i8*, i8** %32
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %125
35: ; preds = %30
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%37 = load i8**, i8*** %5
%38 = load i8*, i8** %37
%39 = call i32 @strcpy(i8* %36, i8* %38)
%40 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%41 = call i32 @strcmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp ne i32 %41, 0
br i1 %42, label %69, label %43
43: ; preds = %35
%44 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%45 = call i32 @get_mac(i8* %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %67, label %47
47: ; preds = %43
%48 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 1
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 2
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 3
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 4
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 5
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %50, i32 %53, i32 %56, i32 %59, i32 %62, i32 %65)
br label %68
67: ; preds = %43
store i32 -1, i32* %3
br label %237
68: ; preds = %47
br label %124
69: ; preds = %35
%70 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%71 = call i32 @strcmp(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%72 = icmp ne i32 %71, 0
br i1 %72, label %98, label %73
73: ; preds = %69
%74 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%75 = call i32 @get_sn(i8* %74, i8* %8)
%76 = icmp ne i32 %75, 0
br i1 %76, label %96, label %77
77: ; preds = %73
store i8 0, i8* %9
br label %78
78: ; preds = %91, %77
%79 = load i8, i8* %9
%80 = zext i8 %79 to i32
%81 = load i8, i8* %8
%82 = zext i8 %81 to i32
%83 = icmp slt i32 %80, %82
br i1 %83, label %84, label %94
84: ; preds = %78
%85 = load i8, i8* %9
%86 = zext i8 %85 to i64
%87 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 %86
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %84
%92 = load i8, i8* %9
%93 = add i8 %92, 1
store i8 %93, i8* %9
br label %78
94: ; preds = %78
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %97
96: ; preds = %73
store i32 -1, i32* %3
br label %237
97: ; preds = %94
br label %123
98: ; preds = %69
%99 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%100 = call i32 @strcmp(i8* %99, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%101 = icmp ne i32 %100, 0
br i1 %101, label %109, label %102
102: ; preds = %98
%103 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%104 = bitcast i8* %103 to i16*
%105 = call i64 @get_boot_abort(i16* %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %108
107: ; preds = %102
store i32 -1, i32* %3
br label %237
108: ; preds = %102
br label %122
109: ; preds = %98
%110 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%111 = call i32 @strcmp(i8* %110, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%112 = icmp ne i32 %111, 0
br i1 %112, label %119, label %113
113: ; preds = %109
%114 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%115 = call i64 @get_mfg_state(i8* %114)
%116 = icmp ne i64 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %113
store i32 -1, i32* %3
br label %237
118: ; preds = %113
br label %121
119: ; preds = %109
%120 = call i32 (...) @usage()
br label %121
121: ; preds = %119, %118
br label %122
122: ; preds = %121, %108
br label %123
123: ; preds = %122, %97
br label %124
124: ; preds = %123, %68
br label %125
125: ; preds = %124, %30
br label %231
126: ; preds = %25
%127 = load i8**, i8*** %5
%128 = load i8*, i8** %127
%129 = call i32 @strcmp(i8* %128, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%130 = icmp ne i32 %129, 0
br i1 %130, label %212, label %131
131: ; preds = %126
%132 = load i8**, i8*** %5
%133 = getelementptr inbounds i8*, i8** %132, i32 1
store i8** %133, i8*** %5
%134 = load i8*, i8** %133
%135 = icmp ne i8* %134, null
br i1 %135, label %136, label %211
136: ; preds = %131
%137 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%138 = load i8**, i8*** %5
%139 = load i8*, i8** %138
%140 = call i32 @strcpy(i8* %137, i8* %139)
%141 = load i8**, i8*** %5
%142 = getelementptr inbounds i8*, i8** %141, i32 1
store i8** %142, i8*** %5
%143 = load i8*, i8** %142
%144 = icmp ne i8* %143, null
br i1 %144, label %145, label %210
145: ; preds = %136
%146 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%147 = load i8**, i8*** %5
%148 = load i8*, i8** %147
%149 = call i32 @strcpy(i8* %146, i8* %148)
%150 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%151 = call i32 @strcmp(i8* %150, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%152 = icmp ne i32 %151, 0
br i1 %152, label %159, label %153
153: ; preds = %145
%154 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%155 = call i64 @set_mac(i8* %154)
%156 = icmp ne i64 %155, 0
br i1 %156, label %157, label %158
157: ; preds = %153
store i32 -1, i32* %3
br label %237
158: ; preds = %153
br label %209
159: ; preds = %145
%160 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%161 = call i32 @strcmp(i8* %160, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%162 = icmp ne i32 %161, 0
br i1 %162, label %171, label %163
163: ; preds = %159
%164 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%165 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%166 = call i32 @strlen(i8* %165)
%167 = call i64 @set_sn(i8* %164, i32 %166)
%168 = icmp ne i64 %167, 0
br i1 %168, label %169, label %170
169: ; preds = %163
store i32 -1, i32* %3
br label %237
170: ; preds = %163
br label %208
171: ; preds = %159
%172 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%173 = call i32 @strcmp(i8* %172, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%174 = icmp ne i32 %173, 0
br i1 %174, label %191, label %175
175: ; preds = %171
%176 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%177 = call i32 @strcmp(i8* %176, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%178 = icmp ne i32 %177, 0
br i1 %178, label %181, label %179
179: ; preds = %175
%180 = call i32 (...) @enable_boot_abort()
br label %190
181: ; preds = %175
%182 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%183 = call i32 @strcmp(i8* %182, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%184 = icmp ne i32 %183, 0
br i1 %184, label %187, label %185
185: ; preds = %181
%186 = call i32 (...) @disable_boot_abort()
br label %189
187: ; preds = %181
%188 = call i32 (...) @usage()
br label %189
189: ; preds = %187, %185
br label %190
190: ; preds = %189, %179
br label %207
191: ; preds = %171
%192 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%193 = call i32 @strcmp(i8* %192, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%194 = icmp ne i32 %193, 0
br i1 %194, label %204, label %195
195: ; preds = %191
%196 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%197 = call i64 @atoi(i8* %196)
%198 = trunc i64 %197 to i8
store i8 %198, i8* %10
%199 = load i8, i8* %10
%200 = call i64 @set_mfg_state(i8 zeroext %199)
%201 = icmp ne i64 %200, 0
br i1 %201, label %202, label %203
202: ; preds = %195
store i32 -1, i32* %3
br label %237
203: ; preds = %195
br label %206
204: ; preds = %191
%205 = call i32 (...) @usage()
br label %206
206: ; preds = %204, %203
br label %207
207: ; preds = %206, %190
br label %208
208: ; preds = %207, %170
br label %209
209: ; preds = %208, %158
br label %210
210: ; preds = %209, %136
br label %211
211: ; preds = %210, %131
br label %230
212: ; preds = %126
%213 = load i8**, i8*** %5
%214 = load i8*, i8** %213
%215 = call i32 @strcmp(i8* %214, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%216 = icmp ne i32 %215, 0
br i1 %216, label %219, label %217
217: ; preds = %212
%218 = call i32 (...) @show_board_data()
br label %229
219: ; preds = %212
%220 = load i8**, i8*** %5
%221 = load i8*, i8** %220
%222 = call i32 @strcmp(i8* %221, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%223 = icmp ne i32 %222, 0
br i1 %223, label %226, label %224
224: ; preds = %219
%225 = call i32 (...) @init_board_data()
br label %228
226: ; preds = %219
%227 = call i32 (...) @usage()
br label %228
228: ; preds = %226, %224
br label %229
229: ; preds = %228, %217
br label %230
230: ; preds = %229, %211
br label %231
231: ; preds = %230, %125
br label %232
232: ; preds = %231
%233 = load i8**, i8*** %5
%234 = getelementptr inbounds i8*, i8** %233, i32 1
store i8** %234, i8*** %5
%235 = load i8*, i8** %234
br label %21
236: ; preds = %21
store i32 0, i32* %3
br label %237
237: ; preds = %236, %202, %169, %157, %117, %107, %96, %67
%238 = load i32, i32* %3
ret i32 %238
}

LLVM IR (-O2):
@.str = [4 x i8] c"get\00"
@.str.2 = [31 x i8] c"%02X:%02X:%02X:%02X:%02X:%02X\0A\00"
@.str.3 = [3 x i8] c"sn\00"
@.str.6 = [11 x i8] c"boot_abort\00"
@.str.7 = [10 x i8] c"mfg_state\00"
@.str.8 = [4 x i8] c"set\00"
@.str.9 = [7 x i8] c"enable\00"
@.str.11 = [5 x i8] c"show\00"
@.str.12 = [5 x i8] c"init\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = alloca [32 x i8]
%5 = alloca i8
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = tail call i32 (...) @usage()
%13 = load i8*, i8** %8
%14 = icmp eq i8* %13, null
br i1 %14, label %159, label %15
15: ; preds = %2, %11
%16 = phi i8* [ %13, %11 ], [ %9, %2 ]
%17 = bitcast [32 x i8]* %4 to i16*
%18 = bitcast [16 x i8]* %3 to i32*
%19 = bitcast [32 x i8]* %4 to i64*
%20 = bitcast [32 x i8]* %4 to i32*
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 1
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 2
%23 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 3
%24 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 4
%25 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 5
br label %26
26: ; preds = %15, %154
%27 = phi i8* [ %16, %15 ], [ %157, %154 ]
%28 = phi i8** [ %8, %15 ], [ %156, %154 ]
%29 = call i32 @strcmp(i8* %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %91
31: ; preds = %26
%32 = getelementptr inbounds i8*, i8** %28, i64 1
%33 = load i8*, i8** %32
%34 = icmp eq i8* %33, null
br i1 %34, label %154, label %35
35: ; preds = %31
%36 = call i32 @strcpy(i8* %7, i8* %33)
%37 = load i32, i32* %20
%38 = icmp eq i32 %37, 6513005
br i1 %38, label %39, label %56
39: ; preds = %35
%40 = call i32 @get_mac(i8* %7)
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %159
42: ; preds = %39
%43 = load i8, i8* %7
%44 = zext i8 %43 to i32
%45 = load i8, i8* %21
%46 = zext i8 %45 to i32
%47 = load i8, i8* %22
%48 = zext i8 %47 to i32
%49 = load i8, i8* %23
%50 = zext i8 %49 to i32
%51 = load i8, i8* %24
%52 = zext i8 %51 to i32
%53 = load i8, i8* %25
%54 = zext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %44, i32 %46, i32 %48, i32 %50, i32 %52, i32 %54)
br label %154
56: ; preds = %35
%57 = call i32 @bcmp(i8* dereferenceable(3) %7, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i64 3)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %77
59: ; preds = %56
%60 = call i32 @get_sn(i8* %7, i8* %5)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %159
62: ; preds = %59
%63 = load i8, i8* %5
%64 = icmp eq i8 %63, 0
br i1 %64, label %75, label %65
65: ; preds = %62, %65
%66 = phi i64 [ %71, %65 ], [ 0, %62 ]
%67 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = call i32 @putchar(i32 %69)
%71 = add nuw nsw i64 %66, 1
%72 = load i8, i8* %5
%73 = zext i8 %72 to i64
%74 = icmp ult i64 %71, %73
br i1 %74, label %65, label %75
75: ; preds = %65, %62
%76 = call i32 @putchar(i32 10)
br label %154
77: ; preds = %56
%78 = call i32 @bcmp(i8* dereferenceable(11) %7, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 11)
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %77
%81 = call i64 @get_boot_abort(i16* %17)
%82 = icmp eq i64 %81, 0
br i1 %82, label %154, label %159
83: ; preds = %77
%84 = call i32 @bcmp(i8* dereferenceable(10) %7, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i64 10)
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %83
%87 = call i64 @get_mfg_state(i8* %7)
%88 = icmp eq i64 %87, 0
br i1 %88, label %154, label %159
89: ; preds = %83
%90 = call i32 (...) @usage()
br label %154
91: ; preds = %26
%92 = call i32 @strcmp(i8* %27, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %142
94: ; preds = %91
%95 = getelementptr inbounds i8*, i8** %28, i64 1
%96 = load i8*, i8** %95
%97 = icmp eq i8* %96, null
br i1 %97, label %154, label %98
98: ; preds = %94
%99 = call i32 @strcpy(i8* %6, i8* %96)
%100 = getelementptr inbounds i8*, i8** %28, i64 2
%101 = load i8*, i8** %100
%102 = icmp eq i8* %101, null
br i1 %102, label %154, label %103
103: ; preds = %98
%104 = call i32 @strcpy(i8* %7, i8* %101)
%105 = load i32, i32* %18
%106 = icmp eq i32 %105, 6513005
br i1 %106, label %107, label %110
107: ; preds = %103
%108 = call i64 @set_mac(i8* %7)
%109 = icmp eq i64 %108, 0
br i1 %109, label %154, label %159
110: ; preds = %103
%111 = call i32 @bcmp(i8* dereferenceable(3) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i64 3)
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %117
113: ; preds = %110
%114 = call i32 @strlen(i8* %7)
%115 = call i64 @set_sn(i8* %7, i32 %114)
%116 = icmp eq i64 %115, 0
br i1 %116, label %154, label %159
117: ; preds = %110
%118 = call i32 @bcmp(i8* dereferenceable(11) %6, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 11)
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %132
120: ; preds = %117
%121 = call i32 @bcmp(i8* dereferenceable(7) %7, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i64 7)
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = call i32 (...) @enable_boot_abort()
br label %154
125: ; preds = %120
%126 = load i64, i64* %19
%127 = icmp eq i64 %126, 28548142445324644
br i1 %127, label %128, label %130
128: ; preds = %125
%129 = call i32 (...) @disable_boot_abort()
br label %154
130: ; preds = %125
%131 = call i32 (...) @usage()
br label %154
132: ; preds = %117
%133 = call i32 @bcmp(i8* dereferenceable(10) %6, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i64 10)
%134 = icmp eq i32 %133, 0
br i1 %134, label %135, label %140
135: ; preds = %132
%136 = call i64 @atoi(i8* %7)
%137 = trunc i64 %136 to i8
%138 = call i64 @set_mfg_state(i8 zeroext %137)
%139 = icmp eq i64 %138, 0
br i1 %139, label %154, label %159
140: ; preds = %132
%141 = call i32 (...) @usage()
br label %154
142: ; preds = %91
%143 = call i32 @strcmp(i8* %27, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%144 = icmp eq i32 %143, 0
br i1 %144, label %145, label %147
145: ; preds = %142
%146 = call i32 (...) @show_board_data()
br label %154
147: ; preds = %142
%148 = call i32 @strcmp(i8* %27, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%149 = icmp eq i32 %148, 0
br i1 %149, label %150, label %152
150: ; preds = %147
%151 = call i32 (...) @init_board_data()
br label %154
152: ; preds = %147
%153 = call i32 (...) @usage()
br label %154
154: ; preds = %42, %80, %86, %89, %75, %31, %145, %152, %150, %94, %107, %128, %130, %123, %135, %140, %113, %98
%155 = phi i8** [ %28, %152 ], [ %28, %150 ], [ %28, %145 ], [ %100, %140 ], [ %100, %135 ], [ %100, %130 ], [ %100, %128 ], [ %100, %123 ], [ %100, %113 ], [ %100, %107 ], [ %100, %98 ], [ %95, %94 ], [ %32, %89 ], [ %32, %86 ], [ %32, %80 ], [ %32, %75 ], [ %32, %42 ], [ %32, %31 ]
%156 = getelementptr inbounds i8*, i8** %155, i64 1
%157 = load i8*, i8** %156
%158 = icmp eq i8* %157, null
br i1 %158, label %159, label %26
159: ; preds = %39, %59, %80, %86, %107, %113, %135, %154, %11
%160 = phi i32 [ 0, %11 ], [ 0, %154 ], [ -1, %135 ], [ -1, %113 ], [ -1, %107 ], [ -1, %86 ], [ -1, %80 ], [ -1, %59 ], [ -1, %39 ]
ret i32 %160
}