#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 check_for_size(int watermelon, int knife) {
  if (watermelon > 200000000 || watermelon < 1) {
    printf("Illegal value: %d is too large or small(max %d, min 10).\n",
           watermelon, 200000000);
    return 1;
  } else if (knife > 9 || knife < 1) {
    printf("Illegal value: %d(should between 1 and 9).\n", knife);
    return 2;
  } else if (watermelon < knife) {
    printf("Illegal value: %d should be greater than %d.\n", watermelon, knife);
    return 3;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_for_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xbebc200,-0x8(%rbp)
jg     1135 <check_for_size+0x25>
cmpl   $0x1,-0x8(%rbp)
jge    1157 <check_for_size+0x47>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0xbebc200,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c5 <check_for_size+0xb5>
cmpl   $0x9,-0xc(%rbp)
jg     116b <check_for_size+0x5b>
cmpl   $0x1,-0xc(%rbp)
jge    1188 <check_for_size+0x78>
mov    -0xc(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    11c5 <check_for_size+0xb5>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b4 <check_for_size+0xa4>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    11c5 <check_for_size+0xb5>
jmp    11b9 <check_for_size+0xa9>
jmp    11be <check_for_size+0xae>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_size>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    -0xbebc201(%rsi),%eax
cmp    $0xf4143dff,%eax
ja     113c <check_for_size+0x2c>
lea    0xed7(%rip),%rdi
mov    $0xbebc200,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    -0xa(%rdx),%eax
cmp    $0xfffffff6,%eax
ja     115b <check_for_size+0x4b>
lea    0xeef(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2,%eax
pop    %rcx
ret
xor    %eax,%eax
cmp    %edx,%esi
jae    1174 <check_for_size+0x64>
lea    0xefe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Illegal value: %d is too large or small(max %d, min 10).\0A\00"
@.str.1 = [44 x i8] c"Illegal value: %d(should between 1 and 9).\0A\00"
@.str.2 = [46 x i8] c"Illegal value: %d should be greater than %d.\0A\00"
define i32 @check_for_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 200000000
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %12, i32 200000000)
store i32 1, i32* %3
br label %34
14: ; preds = %8
%15 = load i32, i32* %5
%16 = icmp sgt i32 %15, 9
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %17, %14
%21 = load i32, i32* %5
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %21)
store i32 2, i32* %3
br label %34
23: ; preds = %17
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %29)
store i32 3, i32* %3
br label %34
31: ; preds = %23
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
store i32 0, i32* %3
br label %34
34: ; preds = %33, %27, %20, %11
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [58 x i8] c"Illegal value: %d is too large or small(max %d, min 10).\0A\00"
@.str.1 = [44 x i8] c"Illegal value: %d(should between 1 and 9).\0A\00"
@.str.2 = [46 x i8] c"Illegal value: %d should be greater than %d.\0A\00"
define i32 @check_for_size(i32 %0, i32 %1) {
%3 = add i32 %0, -200000001
%4 = icmp ult i32 %3, -200000000
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %0, i32 200000000)
br label %16
7: ; preds = %2
%8 = add i32 %1, -10
%9 = icmp ult i32 %8, -9
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %16
12: ; preds = %7
%13 = icmp ult i32 %0, %1
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 %1)
br label %16
16: ; preds = %12, %14, %10, %5
%17 = phi i32 [ 1, %5 ], [ 2, %10 ], [ 3, %14 ], [ 0, %12 ]
ret i32 %17
}