#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 suggest() {
  int ammount, cust_type;
  printf("Enter your range: ");
  scanf("%d", &ammount);
  printf("Are you a premium customer or a regular customer ? \n");
  printf("Use 0 for premium and 1 for regular: ");
  scanf("%d", &cust_type);
  if (ammount < 300000) {
    printf("You cannot purchase a car !\n");
  } else if (ammount > 300000 && ammount <= 600000 && cust_type == 1) {
    printf("You should purchase a Mehran\n");
  } else if (ammount > 600000 && ammount <= 1000000 && cust_type == 1) {
    printf("You should purchase a Cultus\n");
  } else if (ammount > 1000000 && ammount <= 1500000 && cust_type == 1) {
    printf("You should purchase a Corolla\n");
  } else if (ammount > 1000000 && ammount <= 1500000 && cust_type == 0) {
    printf("You should purchase a Corolla\n");
    printf("You get 15%% dsicount\n");
  } else if (ammount > 1500000 && cust_type == 1) {
    printf("Car not avalible\n");
  } else if (ammount > 1500000 && cust_type == 0) {
    printf("Car not avalible\n");
    printf("But if you buy a Corolla you get a 15%% discount\n");
  }
}


x86 assembly (clang, -O0):
<suggest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x493e0,-0x8(%rbp)
jge    118a <suggest+0x6a>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
jmp    12df <suggest+0x1bf>
cmpl   $0x493e0,-0x8(%rbp)
jle    11bf <suggest+0x9f>
cmpl   $0x927c0,-0x8(%rbp)
jg     11bf <suggest+0x9f>
cmpl   $0x1,-0xc(%rbp)
jne    11bf <suggest+0x9f>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    12da <suggest+0x1ba>
cmpl   $0x927c0,-0x8(%rbp)
jle    11f4 <suggest+0xd4>
cmpl   $0xf4240,-0x8(%rbp)
jg     11f4 <suggest+0xd4>
cmpl   $0x1,-0xc(%rbp)
jne    11f4 <suggest+0xd4>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    12d5 <suggest+0x1b5>
cmpl   $0xf4240,-0x8(%rbp)
jle    1229 <suggest+0x109>
cmpl   $0x16e360,-0x8(%rbp)
jg     1229 <suggest+0x109>
cmpl   $0x1,-0xc(%rbp)
jne    1229 <suggest+0x109>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    12d0 <suggest+0x1b0>
cmpl   $0xf4240,-0x8(%rbp)
jle    126a <suggest+0x14a>
cmpl   $0x16e360,-0x8(%rbp)
jg     126a <suggest+0x14a>
cmpl   $0x0,-0xc(%rbp)
jne    126a <suggest+0x14a>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    12cb <suggest+0x1ab>
cmpl   $0x16e360,-0x8(%rbp)
jle    1292 <suggest+0x172>
cmpl   $0x1,-0xc(%rbp)
jne    1292 <suggest+0x172>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
jmp    12c6 <suggest+0x1a6>
cmpl   $0x16e360,-0x8(%rbp)
jle    12c1 <suggest+0x1a1>
cmpl   $0x0,-0xc(%rbp)
jne    12c1 <suggest+0x1a1>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
jmp    12c6 <suggest+0x1a6>
jmp    12cb <suggest+0x1ab>
jmp    12d0 <suggest+0x1b0>
jmp    12d5 <suggest+0x1b5>
jmp    12da <suggest+0x1ba>
jmp    12df <suggest+0x1bf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suggest>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x493df,%eax
jg     1196 <suggest+0x66>
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
jmp    125e <suggest+0x12e>
mov    0x8(%rsp),%ecx
cmp    $0x493e0,%eax
je     11be <suggest+0x8e>
cmp    $0x927c0,%eax
ja     11be <suggest+0x8e>
cmp    $0x1,%ecx
jne    11be <suggest+0x8e>
lea    0xf51(%rip),%rdi
call   1030 <puts@plt>
jmp    125e <suggest+0x12e>
lea    -0x927c1(%rax),%edx
cmp    $0x61a7f,%edx
ja     11df <suggest+0xaf>
cmp    $0x1,%ecx
jne    11df <suggest+0xaf>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
jmp    125e <suggest+0x12e>
lea    -0xf4241(%rax),%edx
cmp    $0x7a11f,%edx
ja     1200 <suggest+0xd0>
cmp    $0x1,%ecx
jne    1200 <suggest+0xd0>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
jmp    125e <suggest+0x12e>
cmp    $0x7a11f,%edx
ja     1221 <suggest+0xf1>
test   %ecx,%ecx
jne    1221 <suggest+0xf1>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1d(%rip),%rdi
jmp    1259 <suggest+0x129>
cmp    $0x16e361,%eax
jb     123b <suggest+0x10b>
cmp    $0x1,%ecx
jne    123b <suggest+0x10b>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
jmp    125e <suggest+0x12e>
cmp    $0x16e361,%eax
jb     125e <suggest+0x12e>
test   %ecx,%ecx
jne    125e <suggest+0x12e>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xdfa(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter your range: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [53 x i8] c"Are you a premium customer or a regular customer ? \0A\00"
@.str.3 = [38 x i8] c"Use 0 for premium and 1 for regular: \00"
@.str.4 = [29 x i8] c"You cannot purchase a car !\0A\00"
@.str.5 = [30 x i8] c"You should purchase a Mehran\0A\00"
@.str.6 = [30 x i8] c"You should purchase a Cultus\0A\00"
@.str.7 = [31 x i8] c"You should purchase a Corolla\0A\00"
@.str.8 = [23 x i8] c"You get 15%% dsicount\0A\00"
@.str.9 = [18 x i8] c"Car not avalible\0A\00"
@.str.10 = [50 x i8] c"But if you buy a Corolla you get a 15%% discount\0A\00"
define i32 @suggest() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 300000
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %81
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 300000
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp sle i32 %17, 600000
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
br label %80
24: ; preds = %19, %16, %13
%25 = load i32, i32* %2
%26 = icmp sgt i32 %25, 600000
br i1 %26, label %27, label %35
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp sle i32 %28, 1000000
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
br label %79
35: ; preds = %30, %27, %24
%36 = load i32, i32* %2
%37 = icmp sgt i32 %36, 1000000
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = load i32, i32* %2
%40 = icmp sle i32 %39, 1500000
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %78
46: ; preds = %41, %38, %35
%47 = load i32, i32* %2
%48 = icmp sgt i32 %47, 1000000
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i32, i32* %2
%51 = icmp sle i32 %50, 1500000
br i1 %51, label %52, label %58
52: ; preds = %49
%53 = load i32, i32* %3
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%57 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %77
58: ; preds = %52, %49, %46
%59 = load i32, i32* %2
%60 = icmp sgt i32 %59, 1500000
br i1 %60, label %61, label %66
61: ; preds = %58
%62 = load i32, i32* %3
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %76
66: ; preds = %61, %58
%67 = load i32, i32* %2
%68 = icmp sgt i32 %67, 1500000
br i1 %68, label %69, label %75
69: ; preds = %66
%70 = load i32, i32* %3
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%74 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0))
br label %75
75: ; preds = %72, %69, %66
br label %76
76: ; preds = %75, %64
br label %77
77: ; preds = %76, %55
br label %78
78: ; preds = %77, %44
br label %79
79: ; preds = %78, %33
br label %80
80: ; preds = %79, %22
br label %81
81: ; preds = %80, %11
%82 = load i32, i32* %1
ret i32 %82
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter your range: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [38 x i8] c"Use 0 for premium and 1 for regular: \00"
@.str.8 = [23 x i8] c"You get 15%% dsicount\0A\00"
@.str.10 = [50 x i8] c"But if you buy a Corolla you get a 15%% discount\0A\00"
@str = [52 x i8] c"Are you a premium customer or a regular customer ? \00"
@str.12 = [17 x i8] c"Car not avalible\00"
@str.14 = [30 x i8] c"You should purchase a Corolla\00"
@str.15 = [29 x i8] c"You should purchase a Cultus\00"
@str.16 = [29 x i8] c"You should purchase a Mehran\00"
@str.17 = [28 x i8] c"You cannot purchase a car !\00"
define i32 @suggest() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 300000
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.17, i64 0, i64 0))
br label %51
14: ; preds = %0
%15 = icmp ne i32 %10, 300000
%16 = icmp ult i32 %10, 600001
%17 = and i1 %15, %16
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 1
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.16, i64 0, i64 0))
br label %51
23: ; preds = %14
%24 = add nsw i32 %10, -600001
%25 = icmp ult i32 %24, 400000
%26 = select i1 %25, i1 %19, i1 false
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.15, i64 0, i64 0))
br label %51
29: ; preds = %23
%30 = add nsw i32 %10, -1000001
%31 = icmp ult i32 %30, 500000
%32 = select i1 %31, i1 %19, i1 false
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.14, i64 0, i64 0))
br label %51
35: ; preds = %29
%36 = icmp eq i32 %18, 0
%37 = select i1 %31, i1 %36, i1 false
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.14, i64 0, i64 0))
%40 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %51
41: ; preds = %35
%42 = icmp ugt i32 %10, 1500000
%43 = select i1 %42, i1 %19, i1 false
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0))
br label %51
46: ; preds = %41
%47 = select i1 %42, i1 %36, i1 false
br i1 %47, label %48, label %51
48: ; preds = %46
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0))
%50 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0))
br label %51
51: ; preds = %21, %33, %44, %48, %46, %38, %27, %12
ret i32 undef
}