#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 *, int *);
int main() {
  int a, b, c;
  printf("Enter value of hardness, carbon content and tensile strength of "
         "steel\n");
  scanf("%d %d %d", &a, &b, &c);
  if ((a > 50) && (b < 0.7) && (c > 5600)) {
    printf("Grade:10\n");
  } else if ((a > 50) && (b < 0.7) || (c > 5600)) {
    printf("Grade:9\n");
  } else if ((a > 50) || (b < 0.7) && (c > 5600)) {
    printf("Grade:8\n");
  } else if ((a > 50) && (c > 5600) || (b < 0.7)) {
    printf("Grade:7\n");
  } else if ((a > 50) || (b < 0.7) || (c > 5600)) {
    printf("Grade:6\n");
  } else if ((a < 50) && (b > 0.7) && (c < 5600)) {
    printf("Grade:5\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x32,-0x8(%rbp)
jle    1192 <main+0x72>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe96(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1192 <main+0x72>
cmpl   $0x15e0,-0x10(%rbp)
jle    1192 <main+0x72>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    12e1 <main+0x1c1>
cmpl   $0x32,-0x8(%rbp)
jle    11b3 <main+0x93>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe57(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     11c0 <main+0xa0>
cmpl   $0x15e0,-0x10(%rbp)
jle    11d1 <main+0xb1>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    12dc <main+0x1bc>
cmpl   $0x32,-0x8(%rbp)
jg     11ff <main+0xdf>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe18(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1210 <main+0xf0>
cmpl   $0x15e0,-0x10(%rbp)
jle    1210 <main+0xf0>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    12d7 <main+0x1b7>
cmpl   $0x32,-0x8(%rbp)
jle    1227 <main+0x107>
cmpl   $0x15e0,-0x10(%rbp)
jg     123e <main+0x11e>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xdcc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    124f <main+0x12f>
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
jmp    12d2 <main+0x1b2>
cmpl   $0x32,-0x8(%rbp)
jg     127d <main+0x15d>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xd9a(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     127d <main+0x15d>
cmpl   $0x15e0,-0x10(%rbp)
jle    128e <main+0x16e>
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
jmp    12cd <main+0x1ad>
cmpl   $0x32,-0x8(%rbp)
jge    12c8 <main+0x1a8>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xd5b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12c8 <main+0x1a8>
cmpl   $0x15e0,-0x10(%rbp)
jge    12c8 <main+0x1a8>
lea    0xdc3(%rip),%rdi
call   1030 <printf@plt>
jmp    12cd <main+0x1ad>
jmp    12d2 <main+0x1b2>
jmp    12d7 <main+0x1b7>
jmp    12dc <main+0x1bc>
jmp    12e1 <main+0x1c1>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x33,%eax
jl     1171 <main+0x51>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
test   %eax,%eax
jg     1186 <main+0x66>
cmp    $0x15e0,%ecx
jle    1186 <main+0x66>
lea    0xf00(%rip),%rdi
jmp    11ca <main+0xaa>
mov    0xc(%rsp),%ecx
cmp    $0x15e0,%ecx
jle    11a6 <main+0x86>
lea    0xee3(%rip),%rdi
jmp    11ca <main+0xaa>
cmp    $0x15e1,%ecx
lea    0xed4(%rip),%rcx
lea    0xec5(%rip),%rdi
cmovge %rcx,%rdi
test   %eax,%eax
cmovle %rcx,%rdi
jmp    11ca <main+0xaa>
cmpl   $0x0,0x10(%rsp)
jle    11c3 <main+0xa3>
cmp    $0x31,%eax
jg     11cf <main+0xaf>
cmp    $0x15e0,%ecx
je     11cf <main+0xaf>
lea    0xe8e(%rip),%rdi
jmp    11ca <main+0xaa>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [71 x i8] c"Enter value of hardness, carbon content and tensile strength of steel\0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [10 x i8] c"Grade:10\0A\00"
@.str.3 = [9 x i8] c"Grade:9\0A\00"
@.str.4 = [9 x i8] c"Grade:8\0A\00"
@.str.5 = [9 x i8] c"Grade:7\0A\00"
@.str.6 = [9 x i8] c"Grade:6\0A\00"
@.str.7 = [9 x i8] c"Grade:5\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 50
br i1 %8, label %9, label %18
9: ; preds = %0
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = fcmp olt double %11, 0x3FE6666666666666
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 5600
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %83
18: ; preds = %13, %9, %0
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 50
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
%24 = fcmp olt double %23, 0x3FE6666666666666
br i1 %24, label %28, label %25
25: ; preds = %21, %18
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 5600
br i1 %27, label %28, label %30
28: ; preds = %25, %21
%29 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %82
30: ; preds = %25
%31 = load i32, i32* %2
%32 = icmp sgt i32 %31, 50
br i1 %32, label %40, label %33
33: ; preds = %30
%34 = load i32, i32* %3
%35 = sitofp i32 %34 to double
%36 = fcmp olt double %35, 0x3FE6666666666666
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = load i32, i32* %4
%39 = icmp sgt i32 %38, 5600
br i1 %39, label %40, label %42
40: ; preds = %37, %30
%41 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %81
42: ; preds = %37, %33
%43 = load i32, i32* %2
%44 = icmp sgt i32 %43, 50
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* %4
%47 = icmp sgt i32 %46, 5600
br i1 %47, label %52, label %48
48: ; preds = %45, %42
%49 = load i32, i32* %3
%50 = sitofp i32 %49 to double
%51 = fcmp olt double %50, 0x3FE6666666666666
br i1 %51, label %52, label %54
52: ; preds = %48, %45
%53 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %80
54: ; preds = %48
%55 = load i32, i32* %2
%56 = icmp sgt i32 %55, 50
br i1 %56, label %64, label %57
57: ; preds = %54
%58 = load i32, i32* %3
%59 = sitofp i32 %58 to double
%60 = fcmp olt double %59, 0x3FE6666666666666
br i1 %60, label %64, label %61
61: ; preds = %57
%62 = load i32, i32* %4
%63 = icmp sgt i32 %62, 5600
br i1 %63, label %64, label %66
64: ; preds = %61, %57, %54
%65 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %79
66: ; preds = %61
%67 = load i32, i32* %2
%68 = icmp slt i32 %67, 50
br i1 %68, label %69, label %78
69: ; preds = %66
%70 = load i32, i32* %3
%71 = sitofp i32 %70 to double
%72 = fcmp ogt double %71, 0x3FE6666666666666
br i1 %72, label %73, label %78
73: ; preds = %69
%74 = load i32, i32* %4
%75 = icmp slt i32 %74, 5600
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %78
78: ; preds = %76, %73, %69, %66
br label %79
79: ; preds = %78, %64
br label %80
80: ; preds = %79, %52
br label %81
81: ; preds = %80, %40
br label %82
82: ; preds = %81, %28
br label %83
83: ; preds = %82, %16
%84 = load i32, i32* %1
ret i32 %84
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@str = [70 x i8] c"Enter value of hardness, carbon content and tensile strength of steel\00"
@str.8 = [8 x i8] c"Grade:5\00"
@str.10 = [8 x i8] c"Grade:7\00"
@str.11 = [8 x i8] c"Grade:8\00"
@str.12 = [8 x i8] c"Grade:9\00"
@str.13 = [9 x i8] c"Grade:10\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 50
br i1 %10, label %11, label %20
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 1
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 5600
%16 = select i1 %13, i1 %15, i1 false
br i1 %16, label %30, label %17
17: ; preds = %11
%18 = select i1 %13, i1 true, i1 %15
%19 = select i1 %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.11, i64 0, i64 0)
br label %30
20: ; preds = %0
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 5600
br i1 %22, label %30, label %23
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, 1
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = icmp slt i32 %9, 50
%28 = icmp ne i32 %21, 5600
%29 = select i1 %27, i1 %28, i1 false
br i1 %29, label %30, label %33
30: ; preds = %17, %26, %23, %20, %11
%31 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.13, i64 0, i64 0), %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0), %20 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0), %23 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0), %26 ], [ %19, %17 ]
%32 = call i32 @puts(i8* dereferenceable(1) %31)
br label %33
33: ; preds = %30, %26
ret i32 0
}