#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 main() {
  int m, p, c, pass = 0;
  printf("Enter Marks of Maths: ");
  scanf("%d", &m);
  printf("Enter Marks of Physics: ");
  scanf("%d", &p);
  printf("Enter Marks of Chemistry: ");
  scanf("%d", &c);
  if (m >= 60) {
    if (p >= 50) {
      if (c >= 40) {
        if (m + p + c >= 200)
          pass = 1;
      }
    }
  }
  if (m + p >= 150)
    pass = 1;
  if (pass == 1)
    printf("PASSED \n");
  else
    printf("FAIL \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3c,-0x8(%rbp)
jl     11d2 <main+0xb2>
cmpl   $0x32,-0xc(%rbp)
jl     11cd <main+0xad>
cmpl   $0x28,-0x10(%rbp)
jl     11c8 <main+0xa8>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0xc8,%eax
jl     11c3 <main+0xa3>
movl   $0x1,-0x14(%rbp)
jmp    11c8 <main+0xa8>
jmp    11cd <main+0xad>
jmp    11d2 <main+0xb2>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x96,%eax
jl     11ea <main+0xca>
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1205 <main+0xe5>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%edx
lea    (%rcx,%rax,1),%esi
lea    (%rsi,%rdx,1),%edi
cmp    $0xc8,%edi
lea    0xeae(%rip),%r8
lea    0xea1(%rip),%rbx
mov    %rbx,%rdi
cmovge %r8,%rdi
cmp    $0x28,%edx
cmovl  %rbx,%rdi
cmp    $0x32,%ecx
cmovl  %rbx,%rdi
cmp    $0x3c,%eax
cmovl  %rbx,%rdi
cmp    $0x96,%esi
cmovge %r8,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter Marks of Maths: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Enter Marks of Physics: \00"
@.str.3 = [27 x i8] c"Enter Marks of Chemistry: \00"
@.str.4 = [9 x i8] c"PASSED \0A\00"
@.str.5 = [7 x i8] c"FAIL \0A\00"
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 0, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 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* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 60
br i1 %13, label %14, label %31
14: ; preds = %0
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 50
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp sge i32 %18, 40
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
%26 = icmp sge i32 %25, 200
br i1 %26, label %27, label %28
27: ; preds = %20
store i32 1, i32* %5
br label %28
28: ; preds = %27, %20
br label %29
29: ; preds = %28, %17
br label %30
30: ; preds = %29, %14
br label %31
31: ; preds = %30, %0
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = add nsw i32 %32, %33
%35 = icmp sge i32 %34, 150
br i1 %35, label %36, label %37
36: ; preds = %31
store i32 1, i32* %5
br label %37
37: ; preds = %36, %31
%38 = load i32, i32* %5
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %44
42: ; preds = %37
%43 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter Marks of Maths: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Enter Marks of Physics: \00"
@.str.3 = [27 x i8] c"Enter Marks of Chemistry: \00"
@str = [6 x i8] c"FAIL \00"
@str.6 = [8 x i8] c"PASSED \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 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 59
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 49
%17 = select i1 %14, i1 %16, i1 false
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 39
%20 = select i1 %17, i1 %19, i1 false
%21 = add nsw i32 %15, %13
%22 = add nsw i32 %21, %18
%23 = icmp sgt i32 %22, 199
%24 = select i1 %20, i1 %23, i1 false
%25 = icmp sgt i32 %21, 149
%26 = select i1 %25, i1 true, i1 %24
%27 = select i1 %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%28 = call i32 @puts(i8* dereferenceable(1) %27)
ret i32 0
}