#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);
int /*<<< orphan*/ scanf(char *, int *);
int search(int);
int /*<<< orphan*/ system(char *);
int main(void) {
  int number, ri, repeat;
  scanf("%d", &repeat);
  for (ri = 1; ri <= repeat; ri++) {
    do {
      scanf("%d", &number);
    } while (number < 101 || number > 999);
    printf("count=%d\n", search(number));
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d2 <main+0x92>
jmp    1177 <main+0x37>
lea    0xe82(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x65,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     11a3 <main+0x63>
cmpl   $0x3e7,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1177 <main+0x37>
mov    -0x8(%rbp),%edi
call   1050 <search@plt>
mov    %eax,%esi
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <main+0x26>
lea    0xe34(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeb1(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11b9 <main+0x79>
mov    $0x1,%r12d
lea    0xe96(%rip),%r14
lea    0x4(%rsp),%rbx
lea    0xe8d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
lea    -0x3e8(%rdi),%eax
cmp    $0xfffffc7d,%eax
jb     1180 <main+0x40>
call   1050 <search@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0x1(%r12),%eax
cmp    (%rsp),%r12d
mov    %eax,%r12d
jl     1180 <main+0x40>
lea    0xe4d(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"count=%d\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 1, i32* %3
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
br label %11
11: ; preds = %19, %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %13
13: ; preds = %11
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 101
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 999
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ true, %13 ], [ %18, %16 ]
br i1 %20, label %11, label %21
21: ; preds = %19
%22 = load i32, i32* %2
%23 = call i32 @search(i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %21
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %6
28: ; preds = %6
%29 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"count=%d\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %21, label %8
8: ; preds = %0, %15
%9 = phi i32 [ %18, %15 ], [ 1, %0 ]
br label %10
10: ; preds = %8, %10
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add i32 %12, -1000
%14 = icmp ult i32 %13, -899
br i1 %14, label %10, label %15
15: ; preds = %10
%16 = call i32 @search(i32 %12)
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i32 %9, 1
%19 = load i32, i32* %2
%20 = icmp slt i32 %9, %19
br i1 %20, label %8, label %21
21: ; preds = %15, %0
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}