#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 EXIT_SUCCESS;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main(void) {
  int min = 1, max = 1000, answer, number = 0;
  printf("½Ð¿é¤J¥¿½T¼Æ¦r¡G");
  scanf("%d", &answer);
  printf("¶}©l¹CÀ¸!!!\n\n1~1000\n");
  do {
    fflush(stdin);
    printf("\n½Ð¿é¤J¼Æ¦r¡G");
    scanf("%d", &number);
    if (number > answer) {
      max = number - 1;
      printf("%d~%d\n", min, max);
    } else if (number < answer) {
      min = number + 1;
      printf("%d~%d\n", min, max);
    } else
      printf("BINGO!!!\7\7\7");
  } while (number != answer);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x3e8,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11da <main+0xaa>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121b <main+0xeb>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1208 <main+0xd8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1216 <main+0xe6>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121b <main+0xeb>
jmp    1220 <main+0xf0>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1180 <main+0x50>
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rsp)
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3e8,%r12d
mov    $0x1,%ebp
mov    0x2e59(%rip),%r14
lea    0xe8a(%rip),%r15
mov    %rsp,%rbx
jmp    11c3 <main+0x83>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%r13d
lea    0xe8c(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%r12d
mov    (%rsp),%eax
cmp    0x4(%rsp),%eax
je     1220 <main+0xe0>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe41(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%r13d
cmp    0x4(%rsp),%r13d
jg     11a0 <main+0x60>
jge    1210 <main+0xd0>
add    $0x1,%r13d
lea    0xe3b(%rip),%rdi
mov    %r13d,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%ebp
jmp    11ba <main+0x7a>
xchg   %ax,%ax
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ba <main+0x7a>
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\A5\C2\BF\C2\BDT\C2\BC\C3\86\C2\A6r\C2\A1G\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\C2\B6}\C2\A9l\C2\B9C\C3\80\C2\B8!!!\0A\0A1~1000\0A\00"
@stdin = global i32 0
@.str.3 = [23 x i8] c"\0A\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\BC\C3\86\C2\A6r\C2\A1G\00"
@.str.4 = [7 x i8] c"%d~%d\0A\00"
@.str.5 = [12 x i8] c"BINGO!!!\07\07\07\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1000, i32* %3
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %37, %0
%10 = load i32, i32* @stdin
%11 = call i32 @fflush(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %23
17: ; preds = %9
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %20, i32 %21)
br label %36
23: ; preds = %9
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %30, i32 %31)
br label %35
33: ; preds = %23
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %35
35: ; preds = %33, %27
br label %36
36: ; preds = %35, %17
br label %37
37: ; preds = %36
%38 = load i32, i32* %5
%39 = load i32, i32* %4
%40 = icmp ne i32 %38, %39
br i1 %40, label %9, label %41
41: ; preds = %37
%42 = load i32, i32* @EXIT_SUCCESS
ret i32 %42
}

LLVM IR (-O2):
@.str = [29 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\A5\C2\BF\C2\BDT\C2\BC\C3\86\C2\A6r\C2\A1G\00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.3 = [23 x i8] c"\0A\C2\BD\C3\90\C2\BF\C3\A9\C2\A4J\C2\BC\C3\86\C2\A6r\C2\A1G\00"
@.str.4 = [7 x i8] c"%d~%d\0A\00"
@.str.5 = [12 x i8] c"BINGO!!!\07\07\07\00"
@EXIT_SUCCESS = global i32 0
@str = [25 x i8] c"\C2\B6}\C2\A9l\C2\B9C\C3\80\C2\B8!!!\0A\0A1~1000\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %28, %0
%9 = phi i32 [ 1, %0 ], [ %29, %28 ]
%10 = phi i32 [ 1000, %0 ], [ %30, %28 ]
%11 = load i32, i32* @stdin
%12 = call i32 @fflush(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = load i32, i32* %1
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %8
%19 = add nsw i32 %15, -1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 %19)
br label %28
21: ; preds = %8
%22 = icmp slt i32 %15, %16
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = add nsw i32 %15, 1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %24, i32 %10)
br label %28
26: ; preds = %21
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %28
28: ; preds = %18, %26, %23
%29 = phi i32 [ %9, %18 ], [ %24, %23 ], [ %9, %26 ]
%30 = phi i32 [ %19, %18 ], [ %10, %23 ], [ %10, %26 ]
%31 = load i32, i32* %2
%32 = load i32, i32* %1
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %8
34: ; preds = %28
%35 = load i32, i32* @EXIT_SUCCESS
ret i32 %35
}