#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 */
int /*<<< orphan*/ change_rtc_date(int);
int /*<<< orphan*/ change_rtc_day(int);
int /*<<< orphan*/ change_rtc_hour(int);
int /*<<< orphan*/ change_rtc_minute(int);
int /*<<< orphan*/ change_rtc_month(int);
int /*<<< orphan*/ change_rtc_second(int);
int /*<<< orphan*/ change_rtc_year(int);
int uart_get_int();
int /*<<< orphan*/ uart_printf(char *);
int /*<<< orphan*/ uart_puts(char *);
void change_rtc_time(void) {
  int value = 0;
  uart_puts("");
  while (1) {
    uart_puts("Please input year: (00 ~ 99)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 0 && value <= 99)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_year(value);
  while (1) {
    uart_puts("Please input month: (1 ~ 12)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 1 && value <= 12)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_month(value);
  while (1) {
    uart_puts("Please input date: (1 ~ 31)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 1 && value <= 31)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_date(value);
  while (1) {
    uart_puts("Please input day: (1 ~ 7)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 1 && value <= 7)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_day(value);
  while (1) {
    uart_puts("Please input hour: (0 ~ 23)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 0 && value <= 23)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_hour(value);
  while (1) {
    uart_puts("Please input minute: (0 ~ 59)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 0 && value <= 59)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_minute(value);
  while (1) {
    uart_puts("Please input second: (0 ~ 59)");
    uart_printf(" >> ");
    value = uart_get_int();
    if (value >= 0 && value <= 59)
      break;
    uart_puts("");
  }
  uart_puts("");
  change_rtc_second(value);
  uart_puts("\nTime is:");
  return;
}


x86 assembly (clang, -O0):
<change_rtc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6b(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xe3e(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xe4f(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     11f6 <change_rtc_time+0x56>
cmpl   $0x63,-0x4(%rbp)
jg     11f6 <change_rtc_time+0x56>
jmp    1207 <change_rtc_time+0x67>
lea    0xe24(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    11bb <change_rtc_time+0x1b>
lea    0xe13(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   1080 <change_rtc_year@plt>
lea    0xe00(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xdef(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1256 <change_rtc_time+0xb6>
cmpl   $0xc,-0x4(%rbp)
jg     1256 <change_rtc_time+0xb6>
jmp    1267 <change_rtc_time+0xc7>
lea    0xdc4(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    121b <change_rtc_time+0x7b>
lea    0xdb3(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   10a0 <change_rtc_month@plt>
lea    0xdbd(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xd8f(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     12b6 <change_rtc_time+0x116>
cmpl   $0x1f,-0x4(%rbp)
jg     12b6 <change_rtc_time+0x116>
jmp    12c7 <change_rtc_time+0x127>
lea    0xd64(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    127b <change_rtc_time+0xdb>
lea    0xd53(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   10b0 <change_rtc_date@plt>
lea    0xd79(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xd2f(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1316 <change_rtc_time+0x176>
cmpl   $0x7,-0x4(%rbp)
jg     1316 <change_rtc_time+0x176>
jmp    1327 <change_rtc_time+0x187>
lea    0xd04(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    12db <change_rtc_time+0x13b>
lea    0xcf3(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   1070 <change_rtc_day@plt>
lea    0xd33(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xccf(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1376 <change_rtc_time+0x1d6>
cmpl   $0x17,-0x4(%rbp)
jg     1376 <change_rtc_time+0x1d6>
jmp    1387 <change_rtc_time+0x1e7>
lea    0xca4(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    133b <change_rtc_time+0x19b>
lea    0xc93(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   1090 <change_rtc_hour@plt>
lea    0xcef(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xc6f(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     13d6 <change_rtc_time+0x236>
cmpl   $0x3b,-0x4(%rbp)
jg     13d6 <change_rtc_time+0x236>
jmp    13e7 <change_rtc_time+0x247>
lea    0xc44(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    139b <change_rtc_time+0x1fb>
lea    0xc33(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   1030 <change_rtc_minute@plt>
lea    0xcad(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xc0f(%rip),%rdi
call   1060 <uart_printf@plt>
mov    $0x0,%al
call   1050 <uart_get_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1436 <change_rtc_time+0x296>
cmpl   $0x3b,-0x4(%rbp)
jg     1436 <change_rtc_time+0x296>
jmp    1447 <change_rtc_time+0x2a7>
lea    0xbe4(%rip),%rdi
call   10c0 <uart_puts@plt>
jmp    13fb <change_rtc_time+0x25b>
lea    0xbd3(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <change_rtc_second@plt>
lea    0xc6b(%rip),%rdi
call   10c0 <uart_puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_rtc_time>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xe72(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xe45(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xe56(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebp
cmp    $0x64,%eax
jb     1216 <change_rtc_time+0x76>
lea    0xe40(%rip),%r14
lea    0xe18(%rip),%r15
lea    0xe2e(%rip),%rbx
nop
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %rbx,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
cmp    $0x63,%eax
ja     11f0 <change_rtc_time+0x50>
mov    %eax,%ebp
lea    0xe04(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebp,%edi
call   1080 <change_rtc_year@plt>
lea    0xdf2(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xde1(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebx
add    $0xffffffff,%eax
cmp    $0xc,%eax
jb     1299 <change_rtc_time+0xf9>
lea    0xdc8(%rip),%r14
lea    0xdc2(%rip),%r15
lea    0xdb6(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %r12,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%eax
cmp    $0xb,%eax
ja     1270 <change_rtc_time+0xd0>
lea    0xd81(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebx,%edi
call   10a0 <change_rtc_month@plt>
lea    0xd8c(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xd5e(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebx
add    $0xffffffff,%eax
cmp    $0x1f,%eax
jb     1319 <change_rtc_time+0x179>
lea    0xd45(%rip),%r14
lea    0xd5c(%rip),%r15
lea    0xd33(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %r12,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%eax
cmp    $0x1e,%eax
ja     12f0 <change_rtc_time+0x150>
lea    0xd01(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebx,%edi
call   10b0 <change_rtc_date@plt>
lea    0xd28(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xcde(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebx
add    $0xffffffff,%eax
cmp    $0x7,%eax
jb     1399 <change_rtc_time+0x1f9>
lea    0xcc5(%rip),%r14
lea    0xcf8(%rip),%r15
lea    0xcb3(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %r12,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%eax
cmp    $0x6,%eax
ja     1370 <change_rtc_time+0x1d0>
lea    0xc81(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebx,%edi
call   1070 <change_rtc_day@plt>
lea    0xcc2(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xc5e(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebp
cmp    $0x18,%eax
jb     1416 <change_rtc_time+0x276>
lea    0xc48(%rip),%r14
lea    0xc95(%rip),%r15
lea    0xc36(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %rbx,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
cmp    $0x17,%eax
ja     13f0 <change_rtc_time+0x250>
mov    %eax,%ebp
lea    0xc04(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebp,%edi
call   1090 <change_rtc_hour@plt>
lea    0xc61(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xbe1(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebp
cmp    $0x3c,%eax
jb     1496 <change_rtc_time+0x2f6>
lea    0xbcb(%rip),%r14
lea    0xc34(%rip),%r15
lea    0xbb9(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %rbx,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
cmp    $0x3b,%eax
ja     1470 <change_rtc_time+0x2d0>
mov    %eax,%ebp
lea    0xb84(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebp,%edi
call   1030 <change_rtc_minute@plt>
lea    0xbff(%rip),%rdi
call   10c0 <uart_puts@plt>
lea    0xb61(%rip),%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
mov    %eax,%ebp
cmp    $0x3c,%eax
jb     1516 <change_rtc_time+0x376>
lea    0xb4b(%rip),%r14
lea    0xbd2(%rip),%r15
lea    0xb39(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   10c0 <uart_puts@plt>
mov    %r15,%rdi
call   10c0 <uart_puts@plt>
mov    %rbx,%rdi
call   1060 <uart_printf@plt>
xor    %eax,%eax
call   1050 <uart_get_int@plt>
cmp    $0x3b,%eax
ja     14f0 <change_rtc_time+0x350>
mov    %eax,%ebp
lea    0xb04(%rip),%rdi
call   10c0 <uart_puts@plt>
mov    %ebp,%edi
call   1040 <change_rtc_second@plt>
lea    0xb9d(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <uart_puts@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [29 x i8] c"Please input year: (00 ~ 99)\00"
@.str.2 = [5 x i8] c" >> \00"
@.str.3 = [29 x i8] c"Please input month: (1 ~ 12)\00"
@.str.4 = [28 x i8] c"Please input date: (1 ~ 31)\00"
@.str.5 = [26 x i8] c"Please input day: (1 ~ 7)\00"
@.str.6 = [28 x i8] c"Please input hour: (0 ~ 23)\00"
@.str.7 = [30 x i8] c"Please input minute: (0 ~ 59)\00"
@.str.8 = [30 x i8] c"Please input second: (0 ~ 59)\00"
@.str.9 = [10 x i8] c"\0ATime is:\00"
define void @change_rtc_time() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %13
%4 = call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @uart_get_int()
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %1
%11 = icmp sle i32 %10, 99
br i1 %11, label %12, label %13
12: ; preds = %9
br label %15
13: ; preds = %9, %3
%14 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %3
15: ; preds = %12
%16 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* %1
%18 = call i32 @change_rtc_year(i32 %17)
br label %19
19: ; preds = %15, %29
%20 = call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (...) @uart_get_int()
store i32 %22, i32* %1
%23 = load i32, i32* %1
%24 = icmp sge i32 %23, 1
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i32, i32* %1
%27 = icmp sle i32 %26, 12
br i1 %27, label %28, label %29
28: ; preds = %25
br label %31
29: ; preds = %25, %19
%30 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %19
31: ; preds = %28
%32 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%33 = load i32, i32* %1
%34 = call i32 @change_rtc_month(i32 %33)
br label %35
35: ; preds = %31, %45
%36 = call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%37 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 (...) @uart_get_int()
store i32 %38, i32* %1
%39 = load i32, i32* %1
%40 = icmp sge i32 %39, 1
br i1 %40, label %41, label %45
41: ; preds = %35
%42 = load i32, i32* %1
%43 = icmp sle i32 %42, 31
br i1 %43, label %44, label %45
44: ; preds = %41
br label %47
45: ; preds = %41, %35
%46 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %35
47: ; preds = %44
%48 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%49 = load i32, i32* %1
%50 = call i32 @change_rtc_date(i32 %49)
br label %51
51: ; preds = %47, %61
%52 = call i32 @uart_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%53 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%54 = call i32 (...) @uart_get_int()
store i32 %54, i32* %1
%55 = load i32, i32* %1
%56 = icmp sge i32 %55, 1
br i1 %56, label %57, label %61
57: ; preds = %51
%58 = load i32, i32* %1
%59 = icmp sle i32 %58, 7
br i1 %59, label %60, label %61
60: ; preds = %57
br label %63
61: ; preds = %57, %51
%62 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %51
63: ; preds = %60
%64 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%65 = load i32, i32* %1
%66 = call i32 @change_rtc_day(i32 %65)
br label %67
67: ; preds = %63, %77
%68 = call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%69 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%70 = call i32 (...) @uart_get_int()
store i32 %70, i32* %1
%71 = load i32, i32* %1
%72 = icmp sge i32 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %67
%74 = load i32, i32* %1
%75 = icmp sle i32 %74, 23
br i1 %75, label %76, label %77
76: ; preds = %73
br label %79
77: ; preds = %73, %67
%78 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %67
79: ; preds = %76
%80 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%81 = load i32, i32* %1
%82 = call i32 @change_rtc_hour(i32 %81)
br label %83
83: ; preds = %79, %93
%84 = call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%85 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%86 = call i32 (...) @uart_get_int()
store i32 %86, i32* %1
%87 = load i32, i32* %1
%88 = icmp sge i32 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %83
%90 = load i32, i32* %1
%91 = icmp sle i32 %90, 59
br i1 %91, label %92, label %93
92: ; preds = %89
br label %95
93: ; preds = %89, %83
%94 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %83
95: ; preds = %92
%96 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%97 = load i32, i32* %1
%98 = call i32 @change_rtc_minute(i32 %97)
br label %99
99: ; preds = %95, %109
%100 = call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%101 = call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%102 = call i32 (...) @uart_get_int()
store i32 %102, i32* %1
%103 = load i32, i32* %1
%104 = icmp sge i32 %103, 0
br i1 %104, label %105, label %109
105: ; preds = %99
%106 = load i32, i32* %1
%107 = icmp sle i32 %106, 59
br i1 %107, label %108, label %109
108: ; preds = %105
br label %111
109: ; preds = %105, %99
%110 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %99
111: ; preds = %108
%112 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%113 = load i32, i32* %1
%114 = call i32 @change_rtc_second(i32 %113)
%115 = call i32 @uart_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [29 x i8] c"Please input year: (00 ~ 99)\00"
@.str.2 = [5 x i8] c" >> \00"
@.str.3 = [29 x i8] c"Please input month: (1 ~ 12)\00"
@.str.4 = [28 x i8] c"Please input date: (1 ~ 31)\00"
@.str.5 = [26 x i8] c"Please input day: (1 ~ 7)\00"
@.str.6 = [28 x i8] c"Please input hour: (0 ~ 23)\00"
@.str.7 = [30 x i8] c"Please input minute: (0 ~ 59)\00"
@.str.8 = [30 x i8] c"Please input second: (0 ~ 59)\00"
@.str.9 = [10 x i8] c"\0ATime is:\00"
define void @change_rtc_time() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @uart_get_int()
%5 = icmp ult i32 %4, 100
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 (...) @uart_get_int()
%11 = icmp ult i32 %10, 100
br i1 %11, label %12, label %6
12: ; preds = %6, %0
%13 = phi i32 [ %4, %0 ], [ %10, %6 ]
%14 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @change_rtc_year(i32 %13)
%16 = tail call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 (...) @uart_get_int()
%19 = add i32 %18, -1
%20 = icmp ult i32 %19, 12
br i1 %20, label %28, label %21
21: ; preds = %12, %21
%22 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%23 = tail call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%24 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 (...) @uart_get_int()
%26 = add i32 %25, -1
%27 = icmp ult i32 %26, 12
br i1 %27, label %28, label %21
28: ; preds = %21, %12
%29 = phi i32 [ %18, %12 ], [ %25, %21 ]
%30 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%31 = tail call i32 @change_rtc_month(i32 %29)
%32 = tail call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%33 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%34 = tail call i32 (...) @uart_get_int()
%35 = add i32 %34, -1
%36 = icmp ult i32 %35, 31
br i1 %36, label %44, label %37
37: ; preds = %28, %37
%38 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%39 = tail call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%40 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = tail call i32 (...) @uart_get_int()
%42 = add i32 %41, -1
%43 = icmp ult i32 %42, 31
br i1 %43, label %44, label %37
44: ; preds = %37, %28
%45 = phi i32 [ %34, %28 ], [ %41, %37 ]
%46 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%47 = tail call i32 @change_rtc_date(i32 %45)
%48 = tail call i32 @uart_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%49 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%50 = tail call i32 (...) @uart_get_int()
%51 = add i32 %50, -1
%52 = icmp ult i32 %51, 7
br i1 %52, label %60, label %53
53: ; preds = %44, %53
%54 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%55 = tail call i32 @uart_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%56 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%57 = tail call i32 (...) @uart_get_int()
%58 = add i32 %57, -1
%59 = icmp ult i32 %58, 7
br i1 %59, label %60, label %53
60: ; preds = %53, %44
%61 = phi i32 [ %50, %44 ], [ %57, %53 ]
%62 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%63 = tail call i32 @change_rtc_day(i32 %61)
%64 = tail call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%65 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%66 = tail call i32 (...) @uart_get_int()
%67 = icmp ult i32 %66, 24
br i1 %67, label %74, label %68
68: ; preds = %60, %68
%69 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%70 = tail call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%71 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%72 = tail call i32 (...) @uart_get_int()
%73 = icmp ult i32 %72, 24
br i1 %73, label %74, label %68
74: ; preds = %68, %60
%75 = phi i32 [ %66, %60 ], [ %72, %68 ]
%76 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%77 = tail call i32 @change_rtc_hour(i32 %75)
%78 = tail call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%79 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%80 = tail call i32 (...) @uart_get_int()
%81 = icmp ult i32 %80, 60
br i1 %81, label %88, label %82
82: ; preds = %74, %82
%83 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%84 = tail call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%85 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%86 = tail call i32 (...) @uart_get_int()
%87 = icmp ult i32 %86, 60
br i1 %87, label %88, label %82
88: ; preds = %82, %74
%89 = phi i32 [ %80, %74 ], [ %86, %82 ]
%90 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%91 = tail call i32 @change_rtc_minute(i32 %89)
%92 = tail call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%93 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%94 = tail call i32 (...) @uart_get_int()
%95 = icmp ult i32 %94, 60
br i1 %95, label %102, label %96
96: ; preds = %88, %96
%97 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%98 = tail call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%99 = tail call i32 @uart_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%100 = tail call i32 (...) @uart_get_int()
%101 = icmp ult i32 %100, 60
br i1 %101, label %102, label %96
102: ; preds = %96, %88
%103 = phi i32 [ %94, %88 ], [ %100, %96 ]
%104 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%105 = tail call i32 @change_rtc_second(i32 %103)
%106 = tail call i32 @uart_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
ret void
}