#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 /*<<< orphan*/ mac;

/* Variables and functions */
int O_RDWR;
int O_SYNC;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ daemon(int, int);
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
scalar_t__ memcmp(unsigned char const *, unsigned char *, int);
int open(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, unsigned char *, int);
int sscanf(char *, char *, int *, int *, int *, int *, int *, int *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ write(int, unsigned char *, int);
int main(int argc, char *argv[]) {
  int devfd = 0;
  int sign = 0;
  unsigned char mac[6];
  const unsigned char nomac[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  int byte0, byte1, byte2, byte3, byte4, byte5;
  daemon(1, 1);
  if ((argc != 2) && (argc != 3)) {
    usage(argv[0]);
  } else {
    if (!strcmp(argv[1], "get")) {
      if (argc != 2)
        usage(argv[0]);
      sign = 0;
    } else if (!strcmp(argv[1], "set")) {
      if (argc != 3)
        usage(argv[0]);
      sign = 1;
    } else
      usage(argv[0]);
  }
  devfd = open("/dev/mmcblk0p15", O_RDWR | O_SYNC);
  if (0 > devfd) {
    printf("stamac: open mtd POT error!\n");
    return -1;
  }
  lseek(devfd, (2048 + 4), SEEK_SET);
  read(devfd, mac, sizeof(mac));
  if (0 == sign) {
    if (!memcmp(nomac, mac, sizeof(mac)))
      printf("MAC address of 1st STA connected: 00-00-00-00-00-00\n");
    else
      printf(
          "MAC address of 1st STA connected: %02x-%02x-%02x-%02x-%02x-%02x\n",
          mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
  } else {
    if (memcmp(nomac, mac, sizeof(mac))) {
      printf("stamac: one MAC address existed in POT partition, it's "
             "%02x-%02x-%02x-%02x-%02x-%02x\n",
             mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
    } else {
      if (6 != sscanf(argv[2], "%x:%x:%x:%x:%x:%x", &byte0, &byte1, &byte2,
                      &byte3, &byte4, &byte5))
        printf("stamac: the MAC address you specified is wrong, must be same "
               "as 00:11:22:33:44:55\n");
      else {
        mac[0] = byte0;
        mac[1] = byte1;
        mac[2] = byte2;
        mac[3] = byte3;
        mac[4] = byte4;
        mac[5] = byte5;
        lseek(devfd, -6, SEEK_CUR);
        write(devfd, mac, sizeof(mac));
        printf("stamac: STA MAC address record finished, it's "
               "%02x-%02x-%02x-%02x-%02x-%02x\n",
               mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
      }
    }
  }
  close(devfd);
  return 0;
}


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   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0xe26(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    0xe20(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   10b0 <daemon@plt>
cmpl   $0x2,-0x8(%rbp)
je     1219 <main+0x69>
cmpl   $0x3,-0x8(%rbp)
je     1219 <main+0x69>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <usage@plt>
jmp    12ad <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdde(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    1258 <main+0xa8>
cmpl   $0x2,-0x8(%rbp)
je     124c <main+0x9c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <usage@plt>
movl   $0x0,-0x18(%rbp)
jmp    12a8 <main+0xf8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    1297 <main+0xe7>
cmpl   $0x3,-0x8(%rbp)
je     128b <main+0xdb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <usage@plt>
movl   $0x1,-0x18(%rbp)
jmp    12a3 <main+0xf3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <usage@plt>
jmp    12a8 <main+0xf8>
jmp    12ad <main+0xfd>
mov    0x2d34(%rip),%rax
mov    (%rax),%esi
mov    0x2d23(%rip),%rax
or     (%rax),%esi
lea    0xd48(%rip),%rdi
call   10d0 <open@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jle    12f3 <main+0x143>
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <main+0x306>
mov    -0x14(%rbp),%edi
mov    0x2ccb(%rip),%rax
mov    (%rax),%edx
mov    $0x804,%esi
call   1050 <lseek@plt>
mov    -0x14(%rbp),%edi
lea    -0x1e(%rbp),%rsi
mov    $0x6,%edx
call   1070 <read@plt>
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
jne    1384 <main+0x1d4>
lea    -0x24(%rbp),%rdi
lea    -0x1e(%rbp),%rsi
mov    $0x6,%edx
call   1080 <memcmp@plt>
cmp    $0x0,%rax
jne    1354 <main+0x1a4>
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    137f <main+0x1cf>
movzbl -0x1e(%rbp),%esi
movzbl -0x1d(%rbp),%edx
movzbl -0x1c(%rbp),%ecx
movzbl -0x1b(%rbp),%r8d
movzbl -0x1a(%rbp),%r9d
movzbl -0x19(%rbp),%eax
lea    0xcfb(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14a7 <main+0x2f7>
lea    -0x24(%rbp),%rdi
lea    -0x1e(%rbp),%rsi
mov    $0x6,%edx
call   1080 <memcmp@plt>
cmp    $0x0,%rax
je     13d0 <main+0x220>
movzbl -0x1e(%rbp),%esi
movzbl -0x1d(%rbp),%edx
movzbl -0x1c(%rbp),%ecx
movzbl -0x1b(%rbp),%r8d
movzbl -0x1a(%rbp),%r9d
movzbl -0x19(%rbp),%eax
lea    0xcf0(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14a2 <main+0x2f2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd28(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x34(%rbp),%r9
lea    -0x38(%rbp),%r10
lea    -0x3c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <sscanf@plt>
mov    %eax,%ecx
mov    $0x6,%eax
cmp    %ecx,%eax
je     1427 <main+0x277>
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    149d <main+0x2ed>
mov    -0x28(%rbp),%eax
mov    %al,-0x1e(%rbp)
mov    -0x2c(%rbp),%eax
mov    %al,-0x1d(%rbp)
mov    -0x30(%rbp),%eax
mov    %al,-0x1c(%rbp)
mov    -0x34(%rbp),%eax
mov    %al,-0x1b(%rbp)
mov    -0x38(%rbp),%eax
mov    %al,-0x1a(%rbp)
mov    -0x3c(%rbp),%eax
mov    %al,-0x19(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2b83(%rip),%rax
mov    (%rax),%edx
mov    $0xfffffffa,%esi
call   1050 <lseek@plt>
mov    -0x14(%rbp),%edi
lea    -0x1e(%rbp),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
movzbl -0x1e(%rbp),%esi
movzbl -0x1d(%rbp),%edx
movzbl -0x1c(%rbp),%ecx
movzbl -0x1b(%rbp),%r8d
movzbl -0x1a(%rbp),%r9d
movzbl -0x19(%rbp),%eax
lea    0xcd9(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14a2 <main+0x2f2>
jmp    14a7 <main+0x2f7>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
movw   $0xffff,0x34(%rsp)
movl   $0xffffffff,0x30(%rsp)
ff
mov    $0x1,%edi
mov    $0x1,%esi
call   10c0 <daemon@plt>
mov    %ebx,%eax
and    $0xfffffffe,%eax
mov    $0x1,%bpl
cmp    $0x2,%eax
jne    1239 <main+0x79>
mov    0x8(%r14),%r15
lea    0xdfb(%rip),%rsi
mov    %r15,%rdi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     1231 <main+0x71>
lea    0xdec(%rip),%rsi
mov    %r15,%rdi
call   10a0 <strcmp@plt>
test   %eax,%eax
setne  %bpl
jne    1239 <main+0x79>
cmp    $0x3,%ebx
jne    1239 <main+0x79>
xor    %ebp,%ebp
jmp    1241 <main+0x81>
mov    $0x1,%bpl
cmp    $0x2,%ebx
je     1241 <main+0x81>
mov    (%r14),%rdi
call   10d0 <usage@plt>
mov    0x2da0(%rip),%rax
mov    0x2d91(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xdae(%rip),%rdi
call   10e0 <open@plt>
test   %eax,%eax
js     12dc <main+0x11c>
mov    %eax,%r15d
mov    0x2d5b(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    $0x804,%esi
call   1060 <lseek@plt>
lea    0x12(%rsp),%rbx
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1080 <read@plt>
lea    0x30(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1090 <memcmp@plt>
test   %bpl,%bpl
je     12f2 <main+0x132>
test   %rax,%rax
je     1326 <main+0x166>
movzbl 0x12(%rsp),%esi
movzbl 0x13(%rsp),%edx
movzbl 0x14(%rsp),%ecx
movzbl 0x15(%rsp),%r8d
movzbl 0x16(%rsp),%r9d
movzbl 0x17(%rsp),%eax
mov    %eax,(%rsp)
lea    0xd41(%rip),%rdi
jmp    13f9 <main+0x239>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
jmp    140a <main+0x24a>
test   %rax,%rax
je     1337 <main+0x177>
movzbl 0x12(%rsp),%esi
movzbl 0x13(%rsp),%edx
movzbl 0x14(%rsp),%ecx
movzbl 0x15(%rsp),%r8d
movzbl 0x16(%rsp),%r9d
movzbl 0x17(%rsp),%eax
mov    %eax,(%rsp)
lea    0xd38(%rip),%rdi
jmp    13f9 <main+0x239>
lea    0xe33(%rip),%rdi
call   1030 <puts@plt>
jmp    1400 <main+0x240>
mov    0x10(%r14),%rdi
lea    0x18(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0x1c(%rsp),%rax
mov    %rax,(%rsp)
lea    0xd5a(%rip),%rsi
lea    0x2c(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x24(%rsp),%r8
lea    0x20(%rsp),%r9
call   10b0 <sscanf@plt>
cmp    $0x6,%eax
jne    1415 <main+0x255>
mov    0x2c(%rsp),%al
mov    %al,0x12(%rsp)
mov    0x28(%rsp),%al
mov    %al,0x13(%rsp)
mov    0x24(%rsp),%al
mov    %al,0x14(%rsp)
mov    0x20(%rsp),%al
mov    %al,0x15(%rsp)
mov    0x1c(%rsp),%al
mov    %al,0x16(%rsp)
mov    0x18(%rsp),%al
mov    %al,0x17(%rsp)
mov    0x2c2a(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    $0xfffffffa,%esi
call   1060 <lseek@plt>
lea    0x12(%rsp),%rsi
mov    %r15d,%edi
mov    $0x6,%edx
call   1040 <write@plt>
movzbl 0x12(%rsp),%esi
movzbl 0x13(%rsp),%edx
movzbl 0x14(%rsp),%ecx
movzbl 0x15(%rsp),%r8d
movzbl 0x16(%rsp),%r9d
movzbl 0x17(%rsp),%eax
mov    %eax,(%rsp)
lea    0xcc8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15d,%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf2(%rip),%rdi
call   1030 <puts@plt>
jmp    1400 <main+0x240>

LLVM IR (-O0):
@__const.main.nomac = [6 x i8] c"\FF\FF\FF\FF\FF\FF"
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [16 x i8] c"/dev/mmcblk0p15\00"
@O_RDWR = global i32 0
@O_SYNC = global i32 0
@.str.3 = [29 x i8] c"stamac: open mtd POT error!\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [53 x i8] c"MAC address of 1st STA connected: 00-00-00-00-00-00\0A\00"
@.str.5 = [65 x i8] c"MAC address of 1st STA connected: %02x-%02x-%02x-%02x-%02x-%02x\0A\00"
@.str.6 = [86 x i8] c"stamac: one MAC address existed in POT partition, it's %02x-%02x-%02x-%02x-%02x-%02x\0A\00"
@.str.7 = [18 x i8] c"%x:%x:%x:%x:%x:%x\00"
@.str.8 = [83 x i8] c"stamac: the MAC address you specified is wrong, must be same as 00:11:22:33:44:55\0A\00"
@SEEK_CUR = global i32 0
@.str.9 = [77 x i8] c"stamac: STA MAC address record finished, it's %02x-%02x-%02x-%02x-%02x-%02x\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 [6 x i8]
%9 = alloca [6 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%16 = bitcast [6 x i8]* %9 to i8*
%17 = call i32 @daemon(i32 1, i32 1)
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %28
20: ; preds = %2
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 3
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 @usage(i8* %26)
br label %65
28: ; preds = %20, %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @strcmp(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %43, label %34
34: ; preds = %28
%35 = load i32, i32* %4
%36 = icmp ne i32 %35, 2
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = call i32 @usage(i8* %40)
br label %42
42: ; preds = %37, %34
store i32 0, i32* %7
br label %64
43: ; preds = %28
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i32 @strcmp(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %58, label %49
49: ; preds = %43
%50 = load i32, i32* %4
%51 = icmp ne i32 %50, 3
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 0
%55 = load i8*, i8** %54
%56 = call i32 @usage(i8* %55)
br label %57
57: ; preds = %52, %49
store i32 1, i32* %7
br label %63
58: ; preds = %43
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 0
%61 = load i8*, i8** %60
%62 = call i32 @usage(i8* %61)
br label %63
63: ; preds = %58, %57
br label %64
64: ; preds = %63, %42
br label %65
65: ; preds = %64, %23
%66 = load i32, i32* @O_RDWR
%67 = load i32, i32* @O_SYNC
%68 = or i32 %66, %67
%69 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %68)
store i32 %69, i32* %6
%70 = load i32, i32* %6
%71 = icmp sgt i32 0, %70
br i1 %71, label %72, label %74
72: ; preds = %65
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %193
74: ; preds = %65
%75 = load i32, i32* %6
%76 = load i32, i32* @SEEK_SET
%77 = call i32 @lseek(i32 %75, i32 2052, i32 %76)
%78 = load i32, i32* %6
%79 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%80 = call i32 @read(i32 %78, i8* %79, i32 6)
%81 = load i32, i32* %7
%82 = icmp eq i32 0, %81
br i1 %82, label %83, label %111
83: ; preds = %74
%84 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%85 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%86 = call i64 @memcmp(i8* %84, i8* %85, i32 6)
%87 = icmp ne i64 %86, 0
br i1 %87, label %90, label %88
88: ; preds = %83
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
br label %110
90: ; preds = %83
%91 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 1
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 2
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 3
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 4
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
%106 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 5
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i32 %93, i32 %96, i32 %99, i32 %102, i32 %105, i32 %108)
br label %110
110: ; preds = %90, %88
br label %190
111: ; preds = %74
%112 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%113 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%114 = call i64 @memcmp(i8* %112, i8* %113, i32 6)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %136
116: ; preds = %111
%117 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 1
%121 = load i8, i8* %120
%122 = zext i8 %121 to i32
%123 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 2
%124 = load i8, i8* %123
%125 = zext i8 %124 to i32
%126 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 3
%127 = load i8, i8* %126
%128 = zext i8 %127 to i32
%129 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 4
%130 = load i8, i8* %129
%131 = zext i8 %130 to i32
%132 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 5
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), i32 %119, i32 %122, i32 %125, i32 %128, i32 %131, i32 %134)
br label %189
136: ; preds = %111
%137 = load i8**, i8*** %5
%138 = getelementptr inbounds i8*, i8** %137, i64 2
%139 = load i8*, i8** %138
%140 = call i32 @sscanf(i8* %139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
%141 = icmp ne i32 6, %140
br i1 %141, label %142, label %144
142: ; preds = %136
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.8, i64 0, i64 0))
br label %188
144: ; preds = %136
%145 = load i32, i32* %10
%146 = trunc i32 %145 to i8
%147 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
store i8 %146, i8* %147
%148 = load i32, i32* %11
%149 = trunc i32 %148 to i8
%150 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 1
store i8 %149, i8* %150
%151 = load i32, i32* %12
%152 = trunc i32 %151 to i8
%153 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 2
store i8 %152, i8* %153
%154 = load i32, i32* %13
%155 = trunc i32 %154 to i8
%156 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 3
store i8 %155, i8* %156
%157 = load i32, i32* %14
%158 = trunc i32 %157 to i8
%159 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 4
store i8 %158, i8* %159
%160 = load i32, i32* %15
%161 = trunc i32 %160 to i8
%162 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 5
store i8 %161, i8* %162
%163 = load i32, i32* %6
%164 = load i32, i32* @SEEK_CUR
%165 = call i32 @lseek(i32 %163, i32 -6, i32 %164)
%166 = load i32, i32* %6
%167 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%168 = call i32 @write(i32 %166, i8* %167, i32 6)
%169 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%170 = load i8, i8* %169
%171 = zext i8 %170 to i32
%172 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 1
%173 = load i8, i8* %172
%174 = zext i8 %173 to i32
%175 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 2
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
%178 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 3
%179 = load i8, i8* %178
%180 = zext i8 %179 to i32
%181 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 4
%182 = load i8, i8* %181
%183 = zext i8 %182 to i32
%184 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 5
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.9, i64 0, i64 0), i32 %171, i32 %174, i32 %177, i32 %180, i32 %183, i32 %186)
br label %188
188: ; preds = %144, %142
br label %189
189: ; preds = %188, %116
br label %190
190: ; preds = %189, %110
%191 = load i32, i32* %6
%192 = call i32 @close(i32 %191)
store i32 0, i32* %3
br label %193
193: ; preds = %190, %72
%194 = load i32, i32* %3
ret i32 %194
}

LLVM IR (-O2):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [16 x i8] c"/dev/mmcblk0p15\00"
@O_RDWR = global i32 0
@O_SYNC = global i32 0
@SEEK_SET = global i32 0
@.str.5 = [65 x i8] c"MAC address of 1st STA connected: %02x-%02x-%02x-%02x-%02x-%02x\0A\00"
@.str.6 = [86 x i8] c"stamac: one MAC address existed in POT partition, it's %02x-%02x-%02x-%02x-%02x-%02x\0A\00"
@.str.7 = [18 x i8] c"%x:%x:%x:%x:%x:%x\00"
@SEEK_CUR = global i32 0
@.str.9 = [77 x i8] c"stamac: STA MAC address record finished, it's %02x-%02x-%02x-%02x-%02x-%02x\0A\00"
@str = [82 x i8] c"stamac: the MAC address you specified is wrong, must be same as 00:11:22:33:44:55\00"
@str.10 = [52 x i8] c"MAC address of 1st STA connected: 00-00-00-00-00-00\00"
@str.11 = [28 x i8] c"stamac: open mtd POT error!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [6 x i8]
%4 = alloca [6 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = tail call i32 @daemon(i32 1, i32 1)
%20 = icmp eq i32 %0, 2
%21 = icmp ne i32 %0, 3
%22 = and i32 %0, -2
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %34
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %26, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
br i1 %20, label %38, label %34
30: ; preds = %24
%31 = tail call i32 @strcmp(i8* dereferenceable(1) %26, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
%33 = or i1 %32, %21
br i1 %33, label %34, label %38
34: ; preds = %30, %29, %2
%35 = phi i1 [ true, %2 ], [ true, %29 ], [ %32, %30 ]
%36 = load i8*, i8** %1
%37 = tail call i32 @usage(i8* %36)
br label %38
38: ; preds = %30, %34, %29
%39 = phi i1 [ true, %29 ], [ %35, %34 ], [ false, %30 ]
%40 = load i32, i32* @O_RDWR
%41 = load i32, i32* @O_SYNC
%42 = or i32 %41, %40
%43 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %38
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
br label %138
47: ; preds = %38
%48 = load i32, i32* @SEEK_SET
%49 = tail call i32 @lseek(i32 %43, i32 2052, i32 %48)
%50 = call i32 @read(i32 %43, i8* %11, i32 6)
%51 = call i64 @memcmp(i8* %12, i8* %11, i32 6)
%52 = icmp eq i64 %51, 0
br i1 %39, label %53, label %75
53: ; preds = %47
br i1 %52, label %54, label %56
54: ; preds = %53
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.10, i64 0, i64 0))
br label %136
56: ; preds = %53
%57 = load i8, i8* %11
%58 = zext i8 %57 to i32
%59 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 3
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 4
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
%71 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i32 %58, i32 %61, i32 %64, i32 %67, i32 %70, i32 %73)
br label %136
75: ; preds = %47
br i1 %52, label %95, label %76
76: ; preds = %75
%77 = load i8, i8* %11
%78 = zext i8 %77 to i32
%79 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
%83 = load i8, i8* %82
%84 = zext i8 %83 to i32
%85 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 3
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 4
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), i32 %78, i32 %81, i32 %84, i32 %87, i32 %90, i32 %93)
br label %136
95: ; preds = %75
%96 = getelementptr inbounds i8*, i8** %1, i64 2
%97 = load i8*, i8** %96
%98 = call i32 @sscanf(i8* %97, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10)
%99 = icmp eq i32 %98, 6
br i1 %99, label %102, label %100
100: ; preds = %95
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
br label %136
102: ; preds = %95
%103 = load i32, i32* %5
%104 = trunc i32 %103 to i8
store i8 %104, i8* %11
%105 = load i32, i32* %6
%106 = trunc i32 %105 to i8
%107 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
store i8 %106, i8* %107
%108 = load i32, i32* %7
%109 = trunc i32 %108 to i8
%110 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
store i8 %109, i8* %110
%111 = load i32, i32* %8
%112 = trunc i32 %111 to i8
%113 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 3
store i8 %112, i8* %113
%114 = load i32, i32* %9
%115 = trunc i32 %114 to i8
%116 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 4
store i8 %115, i8* %116
%117 = load i32, i32* %10
%118 = trunc i32 %117 to i8
%119 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
store i8 %118, i8* %119
%120 = load i32, i32* @SEEK_CUR
%121 = call i32 @lseek(i32 %43, i32 -6, i32 %120)
%122 = call i32 @write(i32 %43, i8* %11, i32 6)
%123 = load i8, i8* %11
%124 = zext i8 %123 to i32
%125 = load i8, i8* %107
%126 = zext i8 %125 to i32
%127 = load i8, i8* %110
%128 = zext i8 %127 to i32
%129 = load i8, i8* %113
%130 = zext i8 %129 to i32
%131 = load i8, i8* %116
%132 = zext i8 %131 to i32
%133 = load i8, i8* %119
%134 = zext i8 %133 to i32
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.9, i64 0, i64 0), i32 %124, i32 %126, i32 %128, i32 %130, i32 %132, i32 %134)
br label %136
136: ; preds = %76, %102, %100, %54, %56
%137 = call i32 @close(i32 %43)
br label %138
138: ; preds = %136, %45
%139 = phi i32 [ -1, %45 ], [ 0, %136 ]
ret i32 %139
}