#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 rtc_time {
  int tm_mon;
  int tm_year;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
  int tm_wday;
};

/* Variables and functions */
int /*<<< orphan*/ RTC_ALM_READ;
int /*<<< orphan*/ RTC_ALM_SET;
int /*<<< orphan*/ RTC_RD_TIME;
int /*<<< orphan*/ _IO(char, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int ioctl(int, int /*<<< orphan*/, struct rtc_time *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int auto_pwoff_alarm_test_tm(int fd) {
  int retval;
  struct rtc_time rtc_tm;
  retval = ioctl(fd, RTC_RD_TIME, &rtc_tm);
  if (retval == -1) {
    perror("ioctl RTC_RD_TIME fail!\n");
    exit(errno);
  }
  rtc_tm.tm_mon++;
  fprintf(stderr,
          "Current RTC date/time is %04d-%02d-%02d, %02d:%02d:%02d w(%d)\n",
          rtc_tm.tm_year + 1900, rtc_tm.tm_mon, rtc_tm.tm_mday, rtc_tm.tm_hour,
          rtc_tm.tm_min, rtc_tm.tm_sec, rtc_tm.tm_wday);
  rtc_tm.tm_sec += 10;
  if (rtc_tm.tm_sec >= 60) {
    rtc_tm.tm_sec %= 60;
    rtc_tm.tm_min++;
  }
  if (rtc_tm.tm_min == 60) {
    rtc_tm.tm_min = 0;
    rtc_tm.tm_hour++;
  }
  if (rtc_tm.tm_hour == 24)
    rtc_tm.tm_hour = 0;
  retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
  if (retval == -1) {
    perror("ioctl RTC_ALM_SET fail!\n");
    exit(errno);
  }
  retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
  if (retval == -1) {
    perror("ioctl RTC_ALM_READ fail!\n");
    exit(errno);
  }
  fprintf(stderr, "Alarm time now is set to %02d:%02d:%02d\n", rtc_tm.tm_hour,
          rtc_tm.tm_min, rtc_tm.tm_sec);
  fprintf(stderr, "Waiting 10 seconds for poweroff alarm...\n");
  fprintf(stderr, "Sleeping...\n");
  retval = ioctl(fd, _IO('p', 0x23), 0);
  if (retval == -1) {
    perror("ioctl RTC_PWR_OFF fail!\n");
    exit(errno);
  }
  return 0;
}


x86 assembly (clang, -O0):
<auto_pwoff_alarm_test_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1197 <auto_pwoff_alarm_test_tm+0x47>
lea    0xe7c(%rip),%rdi
call   1060 <perror@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
add    $0x76c,%edx
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x18(%rbp),%r11d
mov    -0x14(%rbp),%r10d
mov    -0x10(%rbp),%eax
lea    0xe4a(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3c,-0x14(%rbp)
jl     120d <auto_pwoff_alarm_test_tm+0xbd>
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3c,-0x18(%rbp)
jne    1227 <auto_pwoff_alarm_test_tm+0xd7>
movl   $0x0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x18,-0x1c(%rbp)
jne    1238 <auto_pwoff_alarm_test_tm+0xe8>
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1274 <auto_pwoff_alarm_test_tm+0x124>
lea    0xdf7(%rip),%rdi
call   1060 <perror@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x4(%rbp),%edi
mov    0x2d4a(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    12b0 <auto_pwoff_alarm_test_tm+0x160>
lea    0xdd4(%rip),%rdi
call   1060 <perror@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xdc1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xde6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x70,%edi
mov    $0x23,%esi
call   1030 <_IO@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1349 <auto_pwoff_alarm_test_tm+0x1f9>
lea    0xdb5(%rip),%rdi
call   1060 <perror@plt>
mov    0x2c8e(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_pwoff_alarm_test_tm>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%r15d
mov    0x2e54(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
je     12db <auto_pwoff_alarm_test_tm+0x18b>
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%r8d
add    $0x1,%ecx
mov    %ecx,0x8(%rsp)
mov    0x2e48(%rip),%r14
mov    (%r14),%edi
mov    $0x76c,%edx
add    0xc(%rsp),%edx
mov    0x14(%rsp),%r9d
mov    0x18(%rsp),%r10d
mov    0x1c(%rsp),%ebp
mov    0x20(%rsp),%ebx
sub    $0x8,%rsp
lea    0xe60(%rip),%rsi
xor    %eax,%eax
push   %rbx
push   %rbp
push   %r10
call   1050 <fprintf@plt>
add    $0x20,%rsp
mov    0x1c(%rsp),%ecx
lea    0xa(%rcx),%eax
mov    %eax,0x1c(%rsp)
cmp    $0x32,%ecx
jl     120b <auto_pwoff_alarm_test_tm+0xbb>
mov    %eax,%ecx
mov    $0x88888889,%edx
imul   %rcx,%rdx
shr    $0x25,%rdx
imul   $0x3c,%edx,%ecx
sub    %ecx,%eax
mov    %eax,0x1c(%rsp)
mov    0x18(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x18(%rsp)
cmp    $0x3c,%eax
je     1214 <auto_pwoff_alarm_test_tm+0xc4>
mov    0x14(%rsp),%eax
cmp    $0x18,%eax
je     122c <auto_pwoff_alarm_test_tm+0xdc>
jmp    1234 <auto_pwoff_alarm_test_tm+0xe4>
mov    0x18(%rsp),%eax
cmp    $0x3c,%eax
jne    1200 <auto_pwoff_alarm_test_tm+0xb0>
movl   $0x0,0x18(%rsp)
mov    0x14(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x14(%rsp)
cmp    $0x18,%eax
jne    1234 <auto_pwoff_alarm_test_tm+0xe4>
movl   $0x0,0x14(%rsp)
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %r15d,%edi
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
je     12e4 <auto_pwoff_alarm_test_tm+0x194>
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %r15d,%edi
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
je     12ed <auto_pwoff_alarm_test_tm+0x19d>
mov    (%r14),%edi
mov    0x14(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
lea    0xe06(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xe1e(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xe37(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x70,%edi
mov    $0x23,%esi
call   1030 <_IO@plt>
mov    %r15d,%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
je     12f6 <auto_pwoff_alarm_test_tm+0x1a6>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd1e(%rip),%rdi
jmp    12fd <auto_pwoff_alarm_test_tm+0x1ad>
lea    0xd6d(%rip),%rdi
jmp    12fd <auto_pwoff_alarm_test_tm+0x1ad>
lea    0xd7d(%rip),%rdi
jmp    12fd <auto_pwoff_alarm_test_tm+0x1ad>
lea    0xdee(%rip),%rdi
call   1060 <perror@plt>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.rtc_time = type { i32, i32, i32, i32, i32, i32, i32 }
@RTC_RD_TIME = global i32 0
@.str = [25 x i8] c"ioctl RTC_RD_TIME fail!\0A\00"
@errno = global i32 0
@stderr = global i32 0
@.str.1 = [63 x i8] c"Current RTC date/time is %04d-%02d-%02d, %02d:%02d:%02d w(%d)\0A\00"
@RTC_ALM_SET = global i32 0
@.str.2 = [25 x i8] c"ioctl RTC_ALM_SET fail!\0A\00"
@RTC_ALM_READ = global i32 0
@.str.3 = [26 x i8] c"ioctl RTC_ALM_READ fail!\0A\00"
@.str.4 = [41 x i8] c"Alarm time now is set to %02d:%02d:%02d\0A\00"
@.str.5 = [42 x i8] c"Waiting 10 seconds for poweroff alarm...\0A\00"
@.str.6 = [13 x i8] c"Sleeping...\0A\00"
@.str.7 = [25 x i8] c"ioctl RTC_PWR_OFF fail!\0A\00"
define i32 @auto_pwoff_alarm_test_tm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.rtc_time
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @RTC_RD_TIME
%7 = call i32 @ioctl(i32 %5, i32 %6, %struct.rtc_time* %4)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @errno
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 0
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %15
%18 = load i32, i32* @stderr
%19 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 1
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1900
%22 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 0
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 2
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 3
%27 = load i32, i32* %26
%28 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 4
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 5
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 6
%33 = load i32, i32* %32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %23, i32 %25, i32 %27, i32 %29, i32 %31, i32 %33)
%35 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 5
%36 = load i32, i32* %35
%37 = add nsw i32 %36, 10
store i32 %37, i32* %35
%38 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 5
%39 = load i32, i32* %38
%40 = icmp sge i32 %39, 60
br i1 %40, label %41, label %48
41: ; preds = %14
%42 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 5
%43 = load i32, i32* %42
%44 = srem i32 %43, 60
store i32 %44, i32* %42
%45 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 4
%46 = load i32, i32* %45
%47 = add nsw i32 %46, 1
store i32 %47, i32* %45
br label %48
48: ; preds = %41, %14
%49 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 4
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 60
br i1 %51, label %52, label %57
52: ; preds = %48
%53 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 4
store i32 0, i32* %53
%54 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 3
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 1
store i32 %56, i32* %54
br label %57
57: ; preds = %52, %48
%58 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 3
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 24
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 3
store i32 0, i32* %62
br label %63
63: ; preds = %61, %57
%64 = load i32, i32* %2
%65 = load i32, i32* @RTC_ALM_SET
%66 = call i32 @ioctl(i32 %64, i32 %65, %struct.rtc_time* %4)
store i32 %66, i32* %3
%67 = load i32, i32* %3
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %73
69: ; preds = %63
%70 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%71 = load i32, i32* @errno
%72 = call i32 @exit(i32 %71)
unreachable
73: ; preds = %63
%74 = load i32, i32* %2
%75 = load i32, i32* @RTC_ALM_READ
%76 = call i32 @ioctl(i32 %74, i32 %75, %struct.rtc_time* %4)
store i32 %76, i32* %3
%77 = load i32, i32* %3
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %83
79: ; preds = %73
%80 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%81 = load i32, i32* @errno
%82 = call i32 @exit(i32 %81)
unreachable
83: ; preds = %73
%84 = load i32, i32* @stderr
%85 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 3
%86 = load i32, i32* %85
%87 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 4
%88 = load i32, i32* %87
%89 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %4, i32 0, i32 5
%90 = load i32, i32* %89
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %86, i32 %88, i32 %90)
%92 = load i32, i32* @stderr
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%94 = load i32, i32* @stderr
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%96 = load i32, i32* %2
%97 = call i32 @_IO(i8 signext 112, i32 35)
%98 = call i32 @ioctl(i32 %96, i32 %97, %struct.rtc_time* null)
store i32 %98, i32* %3
%99 = load i32, i32* %3
%100 = icmp eq i32 %99, -1
br i1 %100, label %101, label %105
101: ; preds = %83
%102 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%103 = load i32, i32* @errno
%104 = call i32 @exit(i32 %103)
unreachable
105: ; preds = %83
ret i32 0
}

LLVM IR (-O2):
%struct.rtc_time = type { i32, i32, i32, i32, i32, i32, i32 }
@RTC_RD_TIME = global i32 0
@.str = [25 x i8] c"ioctl RTC_RD_TIME fail!\0A\00"
@errno = global i32 0
@stderr = global i32 0
@.str.1 = [63 x i8] c"Current RTC date/time is %04d-%02d-%02d, %02d:%02d:%02d w(%d)\0A\00"
@RTC_ALM_SET = global i32 0
@.str.2 = [25 x i8] c"ioctl RTC_ALM_SET fail!\0A\00"
@RTC_ALM_READ = global i32 0
@.str.3 = [26 x i8] c"ioctl RTC_ALM_READ fail!\0A\00"
@.str.4 = [41 x i8] c"Alarm time now is set to %02d:%02d:%02d\0A\00"
@.str.5 = [42 x i8] c"Waiting 10 seconds for poweroff alarm...\0A\00"
@.str.6 = [13 x i8] c"Sleeping...\0A\00"
@.str.7 = [25 x i8] c"ioctl RTC_PWR_OFF fail!\0A\00"
define i32 @auto_pwoff_alarm_test_tm(i32 %0) {
%2 = alloca %struct.rtc_time
%3 = bitcast %struct.rtc_time* %2 to i8*
%4 = load i32, i32* @RTC_RD_TIME
%5 = call i32 @ioctl(i32 %0, i32 %4, %struct.rtc_time* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @errno
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 0
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = load i32, i32* @stderr
%16 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 1
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1900
%19 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 2
%20 = load i32, i32* %19
%21 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 3
%22 = load i32, i32* %21
%23 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 4
%24 = load i32, i32* %23
%25 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 5
%26 = load i32, i32* %25
%27 = getelementptr inbounds %struct.rtc_time, %struct.rtc_time* %2, i64 0, i32 6
%28 = load i32, i32* %27
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %14, i32 %20, i32 %22, i32 %24, i32 %26, i32 %28)
%30 = load i32, i32* %25
%31 = add nsw i32 %30, 10
store i32 %31, i32* %25
%32 = icmp sgt i32 %30, 49
br i1 %32, label %33, label %37
33: ; preds = %11
%34 = urem i32 %31, 60
store i32 %34, i32* %25
%35 = load i32, i32* %23
%36 = add nsw i32 %35, 1
store i32 %36, i32* %23
br label %39
37: ; preds = %11
%38 = load i32, i32* %23
br label %39
39: ; preds = %37, %33
%40 = phi i32 [ %38, %37 ], [ %36, %33 ]
%41 = icmp eq i32 %40, 60
br i1 %41, label %42, label %45
42: ; preds = %39
store i32 0, i32* %23
%43 = load i32, i32* %21
%44 = add nsw i32 %43, 1
store i32 %44, i32* %21
br label %47
45: ; preds = %39
%46 = load i32, i32* %21
br label %47
47: ; preds = %45, %42
%48 = phi i32 [ %46, %45 ], [ %44, %42 ]
%49 = icmp eq i32 %48, 24
br i1 %49, label %50, label %51
50: ; preds = %47
store i32 0, i32* %21
br label %51
51: ; preds = %50, %47
%52 = load i32, i32* @RTC_ALM_SET
%53 = call i32 @ioctl(i32 %0, i32 %52, %struct.rtc_time* %2)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %59
55: ; preds = %51
%56 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%57 = load i32, i32* @errno
%58 = call i32 @exit(i32 %57)
unreachable
59: ; preds = %51
%60 = load i32, i32* @RTC_ALM_READ
%61 = call i32 @ioctl(i32 %0, i32 %60, %struct.rtc_time* %2)
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%65 = load i32, i32* @errno
%66 = call i32 @exit(i32 %65)
unreachable
67: ; preds = %59
%68 = load i32, i32* @stderr
%69 = load i32, i32* %21
%70 = load i32, i32* %23
%71 = load i32, i32* %25
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %69, i32 %70, i32 %71)
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%77 = call i32 @_IO(i8 signext 112, i32 35)
%78 = call i32 @ioctl(i32 %0, i32 %77, %struct.rtc_time* null)
%79 = icmp eq i32 %78, -1
br i1 %79, label %80, label %84
80: ; preds = %67
%81 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%82 = load i32, i32* @errno
%83 = call i32 @exit(i32 %82)
unreachable
84: ; preds = %67
ret i32 0
}