#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
void get_input(int *hour, int *min) {
  while (1) {
    printf("Please input time\nFormat(hh:mm) range(0:00~24:00)\n");
    scanf("%d:%d", hour, min);
    if (*hour < 0 || *hour > 24)
      printf("Wrong hour input(hour : 0~24)\n");
    else if (*min < 0 || *min > 59)
      printf("Wrong minute input(minute : 0~59)\n");
    else if (*hour == 24 && *min > 0)
      printf("Out of boundary(0:00~24:00)\n");
    else
      break;
  }
}


x86 assembly (clang, -O0):
<get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xee8(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     116a <get_input+0x4a>
mov    -0x8(%rbp),%rax
cmpl   $0x18,(%rax)
jle    117b <get_input+0x5b>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <get_input+0xc0>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1195 <get_input+0x75>
mov    -0x10(%rbp),%rax
cmpl   $0x3b,(%rax)
jle    11a6 <get_input+0x86>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <get_input+0xbb>
mov    -0x8(%rbp),%rax
cmpl   $0x18,(%rax)
jne    11d1 <get_input+0xb1>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    11d1 <get_input+0xb1>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <get_input+0xb6>
jmp    11e5 <get_input+0xc5>
jmp    11db <get_input+0xbb>
jmp    11e0 <get_input+0xc0>
jmp    1130 <get_input+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xece(%rip),%r15
lea    0xec1(%rip),%r12
lea    0xf30(%rip),%r13
lea    0xf07(%rip),%rbp
jmp    1155 <get_input+0x35>
nop
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    (%rbx),%eax
mov    %r13,%rdi
cmp    $0x18,%eax
ja     1150 <get_input+0x30>
mov    (%r14),%ecx
mov    %rbp,%rdi
cmp    $0x3b,%ecx
ja     1150 <get_input+0x30>
cmp    $0x18,%eax
jne    1190 <get_input+0x70>
lea    0xeac(%rip),%rdi
test   %ecx,%ecx
jne    1150 <get_input+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Please input time\0AFormat(hh:mm) range(0:00~24:00)\0A\00"
@.str.1 = [6 x i8] c"%d:%d\00"
@.str.2 = [31 x i8] c"Wrong hour input(hour : 0~24)\0A\00"
@.str.3 = [35 x i8] c"Wrong minute input(minute : 0~59)\0A\00"
@.str.4 = [29 x i8] c"Out of boundary(0:00~24:00)\0A\00"
define void @get_input(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %2, %42
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32* %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = icmp sgt i32 %15, 24
br i1 %16, label %17, label %19
17: ; preds = %13, %5
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %42
19: ; preds = %13
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = icmp slt i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i32*, i32** %4
%25 = load i32, i32* %24
%26 = icmp sgt i32 %25, 59
br i1 %26, label %27, label %29
27: ; preds = %23, %19
%28 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %41
29: ; preds = %23
%30 = load i32*, i32** %3
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, 24
br i1 %32, label %33, label %39
33: ; preds = %29
%34 = load i32*, i32** %4
%35 = load i32, i32* %34
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %40
39: ; preds = %33, %29
br label %43
40: ; preds = %37
br label %41
41: ; preds = %40, %27
br label %42
42: ; preds = %41, %17
br label %5
43: ; preds = %39
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d:%d\00"
@str = [50 x i8] c"Please input time\0AFormat(hh:mm) range(0:00~24:00)\00"
@str.5 = [28 x i8] c"Out of boundary(0:00~24:00)\00"
@str.6 = [34 x i8] c"Wrong minute input(minute : 0~59)\00"
@str.7 = [30 x i8] c"Wrong hour input(hour : 0~24)\00"
define void @get_input(i32* %0, i32* %1) {
br label %3
3: ; preds = %2, %15
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %0, i32* %1)
%6 = load i32, i32* %0
%7 = icmp ugt i32 %6, 24
br i1 %7, label %15, label %8
8: ; preds = %3
%9 = load i32, i32* %1
%10 = icmp ugt i32 %9, 59
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = icmp eq i32 %6, 24
%13 = icmp ne i32 %9, 0
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %15, label %18
15: ; preds = %11, %8, %3
%16 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0), %3 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @str.5, i64 0, i64 0), %11 ]
%17 = tail call i32 @puts(i8* dereferenceable(1) %16)
br label %3
18: ; preds = %11
ret void
}