#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 time_t;
typedef int /*<<< orphan*/ str;
typedef int /*<<< orphan*/ ntptime;

/* Variables and functions */
int O_RDWR;
int O_SYNC;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ config_get(char *);
int /*<<< orphan*/ daemon(int, int);
int /*<<< orphan*/ localtime(int *);
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putenv(char *);
int /*<<< orphan*/ read(int, int *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int time(int /*<<< orphan*/ *);
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ write(int, int *, int);
int main(int argc, char *argv[]) {
  int devfd = 0;
  time_t ntptime = 0;
  int sign = 0;
  char str[128] = {0};
  char timezone[64];
  char tz_env[64];
  daemon(1, 1);
  if (2 != argc) {
    usage(argv[0]);
  } else {
    if (!strcmp(argv[1], "get"))
      sign = 0;
    else if (!strcmp(argv[1], "set"))
      sign = 1;
    else
      usage(argv[0]);
  }
  devfd = open("/dev/mmcblk0p15", O_RDWR | O_SYNC);
  if (0 > devfd) {
    printf("NTPST: open mtd POT error!\n");
    return -1;
  }
  lseek(devfd, 2048, SEEK_SET);
  read(devfd, &ntptime, sizeof(ntptime));
  if (0 == sign) {
    if (0xFFFFFFFF == ntptime) {
      printf("NTP synchronized date/time: 00-00-00\n");
    } else {
      memset(timezone, 0, 64);
      strcpy(timezone, config_get("time_zone"));
      sprintf(tz_env, "TZ=%s", timezone);
      putenv(tz_env);
      strftime(str, sizeof(str), "%T, %b %d, %Y", localtime(&ntptime));
      printf("NTP synchronized date/time: %s\n", str);
    }
  } else {
    if (0xFFFFFFFF != ntptime) {
      strftime(str, sizeof(str), "%T, %b %d, %Y", localtime(&ntptime));
      printf(
          "NTPST: one NTP Sync Timestamp existed in POT partition, it's %s\n",
          str);
    } else {
      ntptime = time(NULL);
      lseek(devfd, -4, SEEK_CUR);
      write(devfd, &ntptime, sizeof(ntptime));
      strftime(str, sizeof(str), "%T, %b %d, %Y", localtime(&ntptime));
      printf("NTPST: NTP Sync Timestamp record finished, it's %s\n", str);
    }
  }
  close(devfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1080 <memset@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   10f0 <daemon@plt>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     127c <main+0x6c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <usage@plt>
jmp    12e4 <main+0xd4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd75(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    12a5 <main+0x95>
movl   $0x0,-0x1c(%rbp)
jmp    12df <main+0xcf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd50(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    12ce <main+0xbe>
movl   $0x1,-0x1c(%rbp)
jmp    12da <main+0xca>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <usage@plt>
jmp    12df <main+0xcf>
jmp    12e4 <main+0xd4>
mov    0x2cfd(%rip),%rax
mov    (%rax),%esi
mov    0x2cec(%rip),%rax
or     (%rax),%esi
lea    0xd0b(%rip),%rdi
call   1120 <open@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jle    132a <main+0x11a>
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    150f <main+0x2ff>
mov    -0x14(%rbp),%edi
mov    0x2c94(%rip),%rax
mov    (%rax),%edx
mov    $0x800,%esi
call   1070 <lseek@plt>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   10a0 <read@plt>
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jne    1429 <main+0x219>
mov    $0xffffffff,%eax
cmp    -0x18(%rbp),%eax
jne    137d <main+0x16d>
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1424 <main+0x214>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
lea    -0xe0(%rbp),%rax
mov    %rax,-0x130(%rbp)
lea    0xcb5(%rip),%rdi
call   10b0 <config_get@plt>
mov    -0x130(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
lea    -0x120(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xc97(%rip),%rsi
call   1130 <sprintf@plt>
lea    -0x120(%rbp),%rdi
call   10c0 <putenv@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0x128(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x128(%rbp),%rdi
mov    %eax,%ecx
mov    $0x80,%esi
lea    0xc60(%rip),%rdx
call   1110 <strftime@plt>
lea    -0xa0(%rbp),%rsi
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1500 <main+0x2f0>
mov    $0xffffffff,%eax
cmp    -0x18(%rbp),%eax
je     1482 <main+0x272>
lea    -0xa0(%rbp),%rax
mov    %rax,-0x138(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x138(%rbp),%rdi
mov    %eax,%ecx
mov    $0x80,%esi
lea    0xc07(%rip),%rdx
call   1110 <strftime@plt>
lea    -0xa0(%rbp),%rsi
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    14fb <main+0x2eb>
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <time@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2b40(%rip),%rax
mov    (%rax),%edx
mov    $0xfffffffc,%esi
call   1070 <lseek@plt>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1050 <write@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0x140(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x140(%rbp),%rdi
mov    %eax,%ecx
mov    $0x80,%esi
lea    0xb89(%rip),%rdx
call   1110 <strftime@plt>
lea    -0xa0(%rbp),%rsi
lea    0xbe5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1500 <main+0x2f0>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
movl   $0x0,0xc(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
mov    $0x1,%edi
mov    $0x1,%esi
call   1100 <daemon@plt>
cmp    $0x2,%ebx
jne    12aa <main+0x8a>
mov    0x8(%r14),%rbx
lea    0xd79(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     12b2 <main+0x92>
lea    0xd6a(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strcmp@plt>
test   %eax,%eax
je     13e2 <main+0x1c2>
mov    (%r14),%rdi
call   1110 <usage@plt>
mov    $0x1,%bpl
mov    0x2d2c(%rip),%rax
mov    0x2d1d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xd3a(%rip),%rdi
call   1130 <open@plt>
test   %eax,%eax
js     1399 <main+0x179>
mov    %eax,%ebx
mov    0x2ce4(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    $0x800,%esi
call   1080 <lseek@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   10b0 <read@plt>
mov    0xc(%rsp),%eax
test   %bpl,%bpl
je     13af <main+0x18f>
cmp    $0xffffffff,%eax
je     13e9 <main+0x1c9>
lea    0xd0(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1090 <memset@plt>
lea    0xce1(%rip),%rdi
call   10c0 <config_get@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
lea    0xcd5(%rip),%rsi
lea    0x90(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   1140 <sprintf@plt>
mov    %r15,%rdi
call   10d0 <putenv@plt>
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xcaf(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
call   1120 <strftime@plt>
lea    0xca2(%rip),%rdi
jmp    1455 <main+0x235>
lea    0xd50(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%eax
jmp    1468 <main+0x248>
cmp    $0xffffffff,%eax
je     13f7 <main+0x1d7>
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xc63(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
call   1120 <strftime@plt>
lea    0xc76(%rip),%rdi
jmp    1455 <main+0x235>
xor    %ebp,%ebp
jmp    12b5 <main+0x95>
lea    0xcdb(%rip),%rdi
call   1050 <puts@plt>
jmp    145f <main+0x23f>
xor    %edi,%edi
call   10f0 <time@plt>
mov    %eax,0xc(%rsp)
mov    0x2bcf(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    $0xfffffffc,%esi
call   1080 <lseek@plt>
lea    0xc(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1060 <write@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xbee(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
call   1120 <strftime@plt>
lea    0xc42(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.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 = [28 x i8] c"NTPST: open mtd POT error!\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [38 x i8] c"NTP synchronized date/time: 00-00-00\0A\00"
@.str.5 = [10 x i8] c"time_zone\00"
@.str.6 = [6 x i8] c"TZ=%s\00"
@.str.7 = [14 x i8] c"%T, %b %d, %Y\00"
@.str.8 = [32 x i8] c"NTP synchronized date/time: %s\0A\00"
@.str.9 = [65 x i8] c"NTPST: one NTP Sync Timestamp existed in POT partition, it's %s\0A\00"
@SEEK_CUR = global i32 0
@.str.10 = [52 x i8] c"NTPST: NTP Sync Timestamp record finished, it's %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [128 x i8]
%10 = alloca [64 x i8]
%11 = alloca [64 x i8]
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
store i32 0, i32* %8
%12 = bitcast [128 x i8]* %9 to i8*
%13 = call i32 @daemon(i32 1, i32 1)
%14 = load i32, i32* %4
%15 = icmp ne i32 2, %14
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @usage(i8* %19)
br label %42
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %21
store i32 0, i32* %8
br label %41
28: ; preds = %21
%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.1, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %28
store i32 1, i32* %8
br label %40
35: ; preds = %28
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i32 @usage(i8* %38)
br label %40
40: ; preds = %35, %34
br label %41
41: ; preds = %40, %27
br label %42
42: ; preds = %41, %16
%43 = load i32, i32* @O_RDWR
%44 = load i32, i32* @O_SYNC
%45 = or i32 %43, %44
%46 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %45)
store i32 %46, i32* %6
%47 = load i32, i32* %6
%48 = icmp sgt i32 0, %47
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %106
51: ; preds = %42
%52 = load i32, i32* %6
%53 = load i32, i32* @SEEK_SET
%54 = call i32 @lseek(i32 %52, i32 2048, i32 %53)
%55 = load i32, i32* %6
%56 = call i32 @read(i32 %55, i32* %7, i32 4)
%57 = load i32, i32* %8
%58 = icmp eq i32 0, %57
br i1 %58, label %59, label %81
59: ; preds = %51
%60 = load i32, i32* %7
%61 = icmp eq i32 -1, %60
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %80
64: ; preds = %59
%65 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%66 = call i32 @memset(i8* %65, i32 0, i32 64)
%67 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%68 = call i32 @config_get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%69 = call i32 @strcpy(i8* %67, i32 %68)
%70 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%71 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%72 = call i32 @sprintf(i8* %70, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %71)
%73 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%74 = call i32 @putenv(i8* %73)
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%76 = call i32 @localtime(i32* %7)
%77 = call i32 @strftime(i8* %75, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %76)
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %78)
br label %80
80: ; preds = %64, %62
br label %103
81: ; preds = %51
%82 = load i32, i32* %7
%83 = icmp ne i32 -1, %82
br i1 %83, label %84, label %90
84: ; preds = %81
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%86 = call i32 @localtime(i32* %7)
%87 = call i32 @strftime(i8* %85, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0), i8* %88)
br label %102
90: ; preds = %81
%91 = call i32 @time(i32* null)
store i32 %91, i32* %7
%92 = load i32, i32* %6
%93 = load i32, i32* @SEEK_CUR
%94 = call i32 @lseek(i32 %92, i32 -4, i32 %93)
%95 = load i32, i32* %6
%96 = call i32 @write(i32 %95, i32* %7, i32 4)
%97 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%98 = call i32 @localtime(i32* %7)
%99 = call i32 @strftime(i8* %97, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %98)
%100 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %90, %84
br label %103
103: ; preds = %102, %80
%104 = load i32, i32* %6
%105 = call i32 @close(i32 %104)
store i32 0, i32* %3
br label %106
106: ; preds = %103, %49
%107 = load i32, i32* %3
ret i32 %107
}

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 = [10 x i8] c"time_zone\00"
@.str.6 = [6 x i8] c"TZ=%s\00"
@.str.7 = [14 x i8] c"%T, %b %d, %Y\00"
@.str.8 = [32 x i8] c"NTP synchronized date/time: %s\0A\00"
@.str.9 = [65 x i8] c"NTPST: one NTP Sync Timestamp existed in POT partition, it's %s\0A\00"
@SEEK_CUR = global i32 0
@.str.10 = [52 x i8] c"NTPST: NTP Sync Timestamp record finished, it's %s\0A\00"
@str = [37 x i8] c"NTP synchronized date/time: 00-00-00\00"
@str.11 = [27 x i8] c"NTPST: open mtd POT error!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [128 x i8]
%5 = alloca [64 x i8]
%6 = alloca [64 x i8]
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%11 = tail call i32 @daemon(i32 1, i32 1)
%12 = icmp eq i32 %0, 2
br i1 %12, label %13, label %21
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %13
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18, %2
%22 = load i8*, i8** %1
%23 = tail call i32 @usage(i8* %22)
br label %24
24: ; preds = %21, %18, %13
%25 = phi i1 [ true, %13 ], [ false, %18 ], [ true, %21 ]
%26 = load i32, i32* @O_RDWR
%27 = load i32, i32* @O_SYNC
%28 = or i32 %27, %26
%29 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %24
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.11, i64 0, i64 0))
br label %66
33: ; preds = %24
%34 = load i32, i32* @SEEK_SET
%35 = tail call i32 @lseek(i32 %29, i32 2048, i32 %34)
%36 = call i32 @read(i32 %29, i32* %3, i32 4)
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, -1
br i1 %25, label %39, label %51
39: ; preds = %33
br i1 %38, label %40, label %42
40: ; preds = %39
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %64
42: ; preds = %39
%43 = call i32 @memset(i8* %9, i32 0, i32 64)
%44 = call i32 @config_get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%45 = call i32 @strcpy(i8* %9, i32 %44)
%46 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%47 = call i32 @putenv(i8* %10)
%48 = call i32 @localtime(i32* %3)
%49 = call i32 @strftime(i8* %8, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %8)
br label %64
51: ; preds = %33
br i1 %38, label %56, label %52
52: ; preds = %51
%53 = call i32 @localtime(i32* %3)
%54 = call i32 @strftime(i8* %8, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0), i8* %8)
br label %64
56: ; preds = %51
%57 = tail call i32 @time(i32* null)
store i32 %57, i32* %3
%58 = load i32, i32* @SEEK_CUR
%59 = tail call i32 @lseek(i32 %29, i32 -4, i32 %58)
%60 = call i32 @write(i32 %29, i32* %3, i32 4)
%61 = call i32 @localtime(i32* %3)
%62 = call i32 @strftime(i8* %8, i32 128, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0), i8* %8)
br label %64
64: ; preds = %52, %56, %40, %42
%65 = call i32 @close(i32 %29)
br label %66
66: ; preds = %64, %31
%67 = phi i32 [ -1, %31 ], [ 0, %64 ]
ret i32 %67
}