#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*/ clear();
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *);
int get(int a, int b) {
  int n;
  if (b < a)
    n = b, b = a, a = n;
  printf("[%d,%d]\n", a, b);
  do {
    printf("input an integer: ");
    if (scanf("%d", &n) != 1)
      clear();
  } while (n < a || b < n);
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115c <get+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     119e <get+0x6e>
mov    $0x0,%al
call   1050 <clear@plt>
jmp    11a3 <get+0x73>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     11c0 <get+0x90>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1170 <get+0x40>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
cmp    %edi,%esi
jge    114b <get+0x1b>
mov    %esi,0xc(%rsp)
mov    %esi,%ebp
jmp    1151 <get+0x21>
mov    %r14d,%ebp
mov    %esi,%r14d
lea    0xea8(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9e(%rip),%r15
lea    0xeaa(%rip),%r12
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     11a1 <get+0x71>
xor    %eax,%eax
call   1050 <clear@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
jl     1180 <get+0x50>
cmp    %eax,%r14d
jl     1180 <get+0x50>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"[%d,%d]\0A\00"
@.str.1 = [19 x i8] c"input an integer: \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %5
store i32 %11, i32* %6
%12 = load i32, i32* %4
store i32 %12, i32* %5
%13 = load i32, i32* %6
store i32 %13, i32* %4
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
br label %18
18: ; preds = %33, %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%21 = icmp ne i32 %20, 1
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (...) @clear()
br label %24
24: ; preds = %22, %18
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = icmp slt i32 %30, %31
br label %33
33: ; preds = %29, %25
%34 = phi i1 [ true, %25 ], [ %32, %29 ]
br i1 %34, label %18, label %35
35: ; preds = %33
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [9 x i8] c"[%d,%d]\0A\00"
@.str.1 = [19 x i8] c"input an integer: \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp slt i32 %1, %0
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %1, i32* %3
br label %7
7: ; preds = %6, %2
%8 = phi i32 [ %1, %6 ], [ %0, %2 ]
%9 = phi i32 [ %0, %6 ], [ %1, %2 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %17, %7
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = icmp eq i32 %13, 1
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 (...) @clear()
br label %17
17: ; preds = %11, %15
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, %8
%20 = icmp slt i32 %9, %18
%21 = or i1 %19, %20
br i1 %21, label %11, label %22
22: ; preds = %17
ret i32 undef
}