#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ display(char *, char *, char *, int, int, char, char *, int,
                           int, char, char *, int, int, char, char *, int, int,
                           char, char *, int, int, char, double, int, double,
                           double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
double percentage(double, double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, char *, char *, int *,
                          int *, char *, char *, int *, int *, char *, char *,
                          int *, int *, char *, char *, int *, int *, char *,
                          char *, int *, int *, char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
int main() {
  FILE *fp = fopen("master.txt", "r");
  char roll[6], name[25], sub1[5], sub2[5], sub3[5], sub4[5], sub5[5], grade1,
      grade2, grade3, grade4, grade5;
  int marks1, marks2, marks3, marks4, marks5, mm1, mm2, mm3, mm4, mm5;
  int div = 0;
  int flag = 0;
  printf("Enter the roll number of the student : ");
  char roll_search[6];
  scanf("%s", roll_search);
  char str[512];
  while (fgets(str, 512, fp) != NULL) {
    if (strstr(str, roll_search) == NULL)
      continue;
    char last[13];
    sscanf(str,
           "%s %s %s %s %d %d %c %s %d %d %c %s %d %d"
           " %c %s %d %d %c %s %d %d %c",
           roll, name, last, sub1, &marks1, &mm1, &grade1, sub2, &marks2, &mm2,
           &grade2, sub3, &marks3, &mm3, &grade3, sub4, &marks4, &mm4, &grade4,
           sub5, &marks5, &mm5, &grade5);
    if (strcmp(roll, roll_search) != 0)
      break;
    strcat(name, " ");
    strcat(name, last);
    double num = marks1 + marks2 + marks3 + marks4 + marks5;
    double den = mm1 + mm2 + mm3 + mm4 + mm5;
    double per = percentage(num, den);
    if (per >= 60)
      div = 1;
    else if (per >= 45)
      div = 2;
    else if (per >= 30)
      div = 3;
    display(roll, name, sub1, marks1, mm1, grade1, sub2, marks2, mm2, grade2,
            sub3, marks3, mm3, grade3, sub4, marks4, mm4, grade4, sub5, marks5,
            mm5, grade5, per, div, num, den);
    flag = 1;
    break;
  }
  if (flag == 0)
    printf("Searched roll number was not found in the database.\n");
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f8,%rsp
movl   $0x0,-0x2c(%rbp)
lea    0xe46(%rip),%rdi
lea    0xe4a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
lea    0xe28(%rip),%rdi
call   1050 <printf@plt>
lea    -0xb6(%rbp),%rsi
lea    0xe3d(%rip),%rdi
call   10a0 <scanf@plt>
lea    -0x2c0(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x200,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     169f <main+0x4ef>
lea    -0x2c0(%rbp),%rdi
lea    -0xb6(%rbp),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
jne    1256 <main+0xa6>
jmp    1215 <main+0x65>
lea    -0x2c0(%rbp),%rdi
lea    -0x3e(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x2cd(%rbp),%r8
lea    -0x65(%rbp),%r9
lea    -0x6a(%rbp),%rax
mov    %rax,-0x330(%rbp)
lea    -0x6f(%rbp),%rax
mov    %rax,-0x310(%rbp)
lea    -0x74(%rbp),%r13
lea    -0x79(%rbp),%rbx
lea    0xdbb(%rip),%rsi
lea    -0x84(%rbp),%rax
mov    %rax,-0x348(%rbp)
lea    -0x98(%rbp),%rax
mov    %rax,-0x340(%rbp)
lea    -0x7a(%rbp),%rax
mov    %rax,-0x338(%rbp)
lea    -0x88(%rbp),%rax
mov    %rax,-0x328(%rbp)
lea    -0x9c(%rbp),%rax
mov    %rax,-0x320(%rbp)
lea    -0x7b(%rbp),%rax
mov    %rax,-0x318(%rbp)
lea    -0x8c(%rbp),%rax
mov    %rax,-0x308(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x300(%rbp)
lea    -0x7c(%rbp),%rax
mov    %rax,-0x2f8(%rbp)
lea    -0x90(%rbp),%r12
lea    -0xa4(%rbp),%r15
lea    -0x7d(%rbp),%r14
lea    -0x94(%rbp),%r11
lea    -0xa8(%rbp),%r10
lea    -0x7e(%rbp),%rax
mov    %rax,-0x2f0(%rbp)
mov    -0x348(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x340(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x338(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x330(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0x328(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0x320(%rbp),%rax
mov    %rax,0x28(%rsp)
mov    -0x318(%rbp),%rax
mov    %rax,0x30(%rsp)
mov    -0x310(%rbp),%rax
mov    %rax,0x38(%rsp)
mov    -0x308(%rbp),%rax
mov    %rax,0x40(%rsp)
mov    -0x300(%rbp),%rax
mov    %rax,0x48(%rsp)
mov    -0x2f8(%rbp),%rax
mov    %rax,0x50(%rsp)
mov    -0x2f0(%rbp),%rax
mov    %r13,0x58(%rsp)
mov    %r12,0x60(%rsp)
mov    %r15,0x68(%rsp)
mov    %r14,0x70(%rsp)
mov    %rbx,0x78(%rsp)
mov    %r11,0x80(%rsp)
mov    %r10,0x88(%rsp)
mov    %rax,0x90(%rsp)
call   1090 <sscanf@plt>
lea    -0x3e(%rbp),%rdi
lea    -0xb6(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1414 <main+0x264>
jmp    169f <main+0x4ef>
lea    -0x60(%rbp),%rdi
lea    0xc2c(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x60(%rbp),%rdi
lea    -0x2cd(%rbp),%rsi
call   10c0 <strcat@plt>
mov    -0x84(%rbp),%eax
add    -0x88(%rbp),%eax
add    -0x8c(%rbp),%eax
add    -0x90(%rbp),%eax
add    -0x94(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x2d8(%rbp)
ff
mov    -0x98(%rbp),%eax
add    -0x9c(%rbp),%eax
add    -0xa0(%rbp),%eax
add    -0xa4(%rbp),%eax
add    -0xa8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x2e0(%rbp)
ff
movsd  -0x2d8(%rbp),%xmm0
ff
movsd  -0x2e0(%rbp),%xmm1
ff
call   1060 <percentage@plt>
movsd  %xmm0,-0x2e8(%rbp)
ff
movsd  -0x2e8(%rbp),%xmm0
ff
movsd  0xb4b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     14ce <main+0x31e>
movl   $0x1,-0xac(%rbp)
jmp    1525 <main+0x375>
movsd  -0x2e8(%rbp),%xmm0
ff
movsd  0xb2a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     14f7 <main+0x347>
movl   $0x2,-0xac(%rbp)
jmp    1520 <main+0x370>
movsd  -0x2e8(%rbp),%xmm0
ff
movsd  0xb09(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     151b <main+0x36b>
movl   $0x3,-0xac(%rbp)
jmp    1520 <main+0x370>
jmp    1525 <main+0x375>
lea    -0x3e(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x65(%rbp),%rdx
mov    -0x84(%rbp),%ecx
mov    -0x98(%rbp),%r8d
mov    -0x7a(%rbp),%r9b
lea    -0x6a(%rbp),%rax
mov    %rax,-0x388(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x37c(%rbp)
mov    -0x9c(%rbp),%eax
mov    %eax,-0x378(%rbp)
mov    -0x7b(%rbp),%al
mov    %al,-0x371(%rbp)
lea    -0x6f(%rbp),%rax
mov    %rax,-0x370(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x364(%rbp)
mov    -0xa0(%rbp),%eax
mov    %eax,-0x360(%rbp)
mov    -0x7c(%rbp),%al
mov    %al,-0x359(%rbp)
lea    -0x74(%rbp),%rax
mov    %rax,-0x358(%rbp)
mov    -0x90(%rbp),%r13d
mov    -0xa4(%rbp),%r12d
mov    -0x7d(%rbp),%r15b
lea    -0x79(%rbp),%r14
mov    -0x94(%rbp),%ebx
mov    -0xa8(%rbp),%r11d
mov    -0x7e(%rbp),%r10b
movsd  -0x2e8(%rbp),%xmm0
ff
mov    -0xac(%rbp),%eax
mov    %eax,-0x34c(%rbp)
mov    -0x388(%rbp),%rax
movsd  -0x2d8(%rbp),%xmm1
ff
movsd  -0x2e0(%rbp),%xmm2
ff
movsbl %r9b,%r9d
mov    %rax,(%rsp)
mov    -0x37c(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x378(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x371(%rbp),%al
movsbl %al,%eax
mov    %eax,0x18(%rsp)
mov    -0x370(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0x364(%rbp),%eax
mov    %eax,0x28(%rsp)
mov    -0x360(%rbp),%eax
mov    %eax,0x30(%rsp)
mov    -0x359(%rbp),%al
movsbl %al,%eax
mov    %eax,0x38(%rsp)
mov    -0x358(%rbp),%rax
mov    %rax,0x40(%rsp)
mov    -0x34c(%rbp),%eax
mov    %r13d,0x48(%rsp)
mov    %r12d,0x50(%rsp)
movsbl %r15b,%r15d
mov    %r15d,0x58(%rsp)
mov    %r14,0x60(%rsp)
mov    %ebx,0x68(%rsp)
mov    %r11d,0x70(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x78(%rsp)
mov    %eax,0x80(%rsp)
call   1040 <display@plt>
movl   $0x1,-0xb0(%rbp)
cmpl   $0x0,-0xb0(%rbp)
jne    16b8 <main+0x508>
lea    0x9e2(%rip),%rdi
call   1050 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x2c(%rbp),%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2c8,%rsp
lea    0xe40(%rip),%rdi
lea    0xe44(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
lea    0xe37(%rip),%rdi
call   1060 <printf@plt>
lea    0xe53(%rip),%rdi
lea    0x4c(%rsp),%r14
mov    %r14,%rsi
call   10b0 <scanf@plt>
lea    0xc0(%rsp),%rbx
nop
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     130c <main+0x14c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1210 <main+0x50>
sub    $0x8,%rsp
lea    0xb(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0x24(%rsp),%r11
lea    0xc(%rsp),%rbp
lea    0x40(%rsp),%r13
lea    0x45(%rsp),%r12
lea    0x4a(%rsp),%rbx
lea    0xde9(%rip),%rsi
lea    0xc8(%rsp),%rdi
lea    0x5a(%rsp),%r14
lea    0xa8(%rsp),%rcx
lea    0x9b(%rsp),%r8
lea    0x4f(%rsp),%r9
mov    %r14,%rdx
push   %rax
push   %r10
push   %r11
lea    0x53(%rsp),%rax
push   %rax
push   %rbp
lea    0x3c(%rsp),%rax
push   %rax
lea    0x58(%rsp),%rax
push   %rax
push   %r13
lea    0x4d(%rsp),%rax
push   %rax
lea    0x60(%rsp),%rax
push   %rax
lea    0x7c(%rsp),%rax
push   %rax
push   %r12
lea    0x6e(%rsp),%rax
push   %rax
lea    0x84(%rsp),%rax
push   %rax
lea    0xa0(%rsp),%rax
push   %rax
push   %rbx
lea    0x8f(%rsp),%rax
push   %rax
lea    0xa8(%rsp),%rax
push   %rax
lea    0xc4(%rsp),%rax
push   %rax
call   10a0 <sscanf@plt>
add    $0xa0,%rsp
lea    0x4c(%rsp),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1334 <main+0x174>
lea    0xd82(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x2c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd10(%rip),%rsi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <strcat@plt>
lea    0x93(%rsp),%rsi
mov    %rbx,%rdi
call   10d0 <strcat@plt>
mov    0x28(%rsp),%eax
add    0x2c(%rsp),%eax
add    0x24(%rsp),%eax
add    0x20(%rsp),%eax
add    0x1c(%rsp),%eax
cvtsi2sd %eax,%xmm0
mov    0x14(%rsp),%eax
add    0x18(%rsp),%eax
add    0x10(%rsp),%eax
add    0xc(%rsp),%eax
add    0x8(%rsp),%eax
cvtsi2sd %eax,%xmm1
movsd  %xmm0,0x80(%rsp)
movsd  %xmm1,0x68(%rsp)
call   1070 <percentage@plt>
mov    $0x1,%r12d
ucomisd 0xc53(%rip),%xmm0
jae    13d2 <main+0x212>
mov    $0x2,%r12d
ucomisd 0xc4b(%rip),%xmm0
jae    13d2 <main+0x212>
xor    %r12d,%r12d
ucomisd 0xc46(%rip),%xmm0
jb     13d2 <main+0x212>
mov    $0x3,%r12d
mov    0x2c(%rsp),%ecx
mov    0x18(%rsp),%r8d
movsbl 0x7(%rsp),%r9d
mov    0x28(%rsp),%eax
mov    %rax,0x88(%rsp)
mov    0x14(%rsp),%eax
mov    %rax,0x78(%rsp)
movsbl 0x6(%rsp),%eax
mov    %rax,0x70(%rsp)
mov    0x24(%rsp),%eax
mov    %rax,0x60(%rsp)
mov    0x10(%rsp),%eax
mov    %rax,0x58(%rsp)
movsbl 0x5(%rsp),%r13d
mov    0x20(%rsp),%r14d
mov    0xc(%rsp),%ebx
movsbl 0x4(%rsp),%r11d
mov    0x1c(%rsp),%r10d
mov    0x8(%rsp),%eax
movsbl 0x3(%rsp),%ebp
sub    $0x8,%rsp
lea    0x5a(%rsp),%rdi
lea    0xa8(%rsp),%rsi
lea    0x4f(%rsp),%rdx
movsd  0x88(%rsp),%xmm1
movsd  0x70(%rsp),%xmm2
push   %r12
push   %rbp
push   %rax
push   %r10
lea    0x5b(%rsp),%rax
push   %rax
push   %r11
push   %rbx
push   %r14
lea    0x80(%rsp),%rax
push   %rax
push   %r13
push   0xb0(%rsp)
push   0xc0(%rsp)
lea    0xa5(%rsp),%rax
push   %rax
push   0xe0(%rsp)
push   0xf0(%rsp)
push   0x108(%rsp)
lea    0xca(%rsp),%rax
push   %rax
call   1050 <display@plt>
add    $0x90,%rsp
jmp    1318 <main+0x158>

LLVM IR (-O0):
@.str = [11 x i8] c"master.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [40 x i8] c"Enter the roll number of the student : \00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [69 x i8] c"%s %s %s %s %d %d %c %s %d %d %c %s %d %d %c %s %d %d %c %s %d %d %c\00"
@.str.5 = [2 x i8] c" \00"
@.str.6 = [53 x i8] c"Searched roll number was not found in the database.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [6 x i8]
%4 = alloca [25 x i8]
%5 = alloca [5 x i8]
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
%8 = alloca [5 x i8]
%9 = alloca [5 x i8]
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca [6 x i8]
%28 = alloca [512 x i8]
%29 = alloca [13 x i8]
%30 = alloca double
%31 = alloca double
%32 = alloca double
store i32 0, i32* %1
%33 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %33, i32** %2
store i32 0, i32* %25
store i32 0, i32* %26
%34 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%35 = getelementptr inbounds [6 x i8], [6 x i8]* %27, i64 0, i64 0
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %47, %0
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %28, i64 0, i64 0
%39 = load i32*, i32** %2
%40 = call i32* @fgets(i8* %38, i32 512, i32* %39)
%41 = icmp ne i32* %40, null
br i1 %41, label %42, label %134
42: ; preds = %37
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %28, i64 0, i64 0
%44 = getelementptr inbounds [6 x i8], [6 x i8]* %27, i64 0, i64 0
%45 = call i32* @strstr(i8* %43, i8* %44)
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %48
47: ; preds = %42
br label %37
48: ; preds = %42
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %28, i64 0, i64 0
%50 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%51 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%52 = getelementptr inbounds [13 x i8], [13 x i8]* %29, i64 0, i64 0
%53 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%54 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%55 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%56 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%57 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%58 = call i32 @sscanf(i8* %49, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0), i8* %50, i8* %51, i8* %52, i8* %53, i32* %15, i32* %20, i8* %10, i8* %54, i32* %16, i32* %21, i8* %11, i8* %55, i32* %17, i32* %22, i8* %12, i8* %56, i32* %18, i32* %23, i8* %13, i8* %57, i32* %19, i32* %24, i8* %14)
%59 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%60 = getelementptr inbounds [6 x i8], [6 x i8]* %27, i64 0, i64 0
%61 = call i64 @strcmp(i8* %59, i8* %60)
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %48
br label %134
64: ; preds = %48
%65 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%66 = call i32 @strcat(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%67 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%68 = getelementptr inbounds [13 x i8], [13 x i8]* %29, i64 0, i64 0
%69 = call i32 @strcat(i8* %67, i8* %68)
%70 = load i32, i32* %15
%71 = load i32, i32* %16
%72 = add nsw i32 %70, %71
%73 = load i32, i32* %17
%74 = add nsw i32 %72, %73
%75 = load i32, i32* %18
%76 = add nsw i32 %74, %75
%77 = load i32, i32* %19
%78 = add nsw i32 %76, %77
%79 = sitofp i32 %78 to double
store double %79, double* %30
%80 = load i32, i32* %20
%81 = load i32, i32* %21
%82 = add nsw i32 %80, %81
%83 = load i32, i32* %22
%84 = add nsw i32 %82, %83
%85 = load i32, i32* %23
%86 = add nsw i32 %84, %85
%87 = load i32, i32* %24
%88 = add nsw i32 %86, %87
%89 = sitofp i32 %88 to double
store double %89, double* %31
%90 = load double, double* %30
%91 = load double, double* %31
%92 = call double @percentage(double %90, double %91)
store double %92, double* %32
%93 = load double, double* %32
%94 = fcmp oge double %93, 6.000000e+01
br i1 %94, label %95, label %96
95: ; preds = %64
store i32 1, i32* %25
br label %106
96: ; preds = %64
%97 = load double, double* %32
%98 = fcmp oge double %97, 4.500000e+01
br i1 %98, label %99, label %100
99: ; preds = %96
store i32 2, i32* %25
br label %105
100: ; preds = %96
%101 = load double, double* %32
%102 = fcmp oge double %101, 3.000000e+01
br i1 %102, label %103, label %104
103: ; preds = %100
store i32 3, i32* %25
br label %104
104: ; preds = %103, %100
br label %105
105: ; preds = %104, %99
br label %106
106: ; preds = %105, %95
%107 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%108 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%109 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%110 = load i32, i32* %15
%111 = load i32, i32* %20
%112 = load i8, i8* %10
%113 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%114 = load i32, i32* %16
%115 = load i32, i32* %21
%116 = load i8, i8* %11
%117 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%118 = load i32, i32* %17
%119 = load i32, i32* %22
%120 = load i8, i8* %12
%121 = getelementptr inbounds [5 x i8], [5 x i8]* %8, i64 0, i64 0
%122 = load i32, i32* %18
%123 = load i32, i32* %23
%124 = load i8, i8* %13
%125 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%126 = load i32, i32* %19
%127 = load i32, i32* %24
%128 = load i8, i8* %14
%129 = load double, double* %32
%130 = load i32, i32* %25
%131 = load double, double* %30
%132 = load double, double* %31
%133 = call i32 @display(i8* %107, i8* %108, i8* %109, i32 %110, i32 %111, i8 signext %112, i8* %113, i32 %114, i32 %115, i8 signext %116, i8* %117, i32 %118, i32 %119, i8 signext %120, i8* %121, i32 %122, i32 %123, i8 signext %124, i8* %125, i32 %126, i32 %127, i8 signext %128, double %129, i32 %130, double %131, double %132)
store i32 1, i32* %26
br label %134
134: ; preds = %106, %63, %37
%135 = load i32, i32* %26
%136 = icmp eq i32 %135, 0
br i1 %136, label %137, label %139
137: ; preds = %134
%138 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
br label %139
139: ; preds = %137, %134
%140 = load i32*, i32** %2
%141 = call i32 @fclose(i32* %140)
%142 = load i32, i32* %1
ret i32 %142
}

LLVM IR (-O2):
@.str = [11 x i8] c"master.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [40 x i8] c"Enter the roll number of the student : \00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [69 x i8] c"%s %s %s %s %d %d %c %s %d %d %c %s %d %d %c %s %d %d %c %s %d %d %c\00"
@.str.5 = [2 x i8] c" \00"
@str = [52 x i8] c"Searched roll number was not found in the database.\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [25 x i8]
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca [6 x i8]
%24 = alloca [512 x i8]
%25 = alloca [13 x i8]
%26 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%28 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%29 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%31 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%34 = bitcast i32* %13 to i8*
%35 = bitcast i32* %14 to i8*
%36 = bitcast i32* %15 to i8*
%37 = bitcast i32* %16 to i8*
%38 = bitcast i32* %17 to i8*
%39 = bitcast i32* %18 to i8*
%40 = bitcast i32* %19 to i8*
%41 = bitcast i32* %20 to i8*
%42 = bitcast i32* %21 to i8*
%43 = bitcast i32* %22 to i8*
%44 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%45 = getelementptr inbounds [6 x i8], [6 x i8]* %23, i64 0, i64 0
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %45)
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %24, i64 0, i64 0
br label %48
48: ; preds = %51, %0
%49 = call i32* @fgets(i8* %47, i32 512, i32* %26)
%50 = icmp eq i32* %49, null
br i1 %50, label %108, label %51
51: ; preds = %48
%52 = call i32* @strstr(i8* %47, i8* %45)
%53 = icmp eq i32* %52, null
br i1 %53, label %48, label %54
54: ; preds = %51
%55 = getelementptr inbounds [13 x i8], [13 x i8]* %25, i64 0, i64 0
%56 = call i32 @sscanf(i8* %47, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0), i8* %27, i8* %28, i8* %55, i8* %29, i32* %13, i32* %18, i8* %8, i8* %30, i32* %14, i32* %19, i8* %9, i8* %31, i32* %15, i32* %20, i8* %10, i8* %32, i32* %16, i32* %21, i8* %11, i8* %33, i32* %17, i32* %22, i8* %12)
%57 = call i64 @strcmp(i8* %27, i8* %45)
%58 = icmp eq i64 %57, 0
br i1 %58, label %60, label %59
59: ; preds = %54
br label %108
60: ; preds = %54
%61 = call i32 @strcat(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%62 = call i32 @strcat(i8* %28, i8* %55)
%63 = load i32, i32* %13
%64 = load i32, i32* %14
%65 = add nsw i32 %64, %63
%66 = load i32, i32* %15
%67 = add nsw i32 %65, %66
%68 = load i32, i32* %16
%69 = add nsw i32 %67, %68
%70 = load i32, i32* %17
%71 = add nsw i32 %69, %70
%72 = sitofp i32 %71 to double
%73 = load i32, i32* %18
%74 = load i32, i32* %19
%75 = add nsw i32 %74, %73
%76 = load i32, i32* %20
%77 = add nsw i32 %75, %76
%78 = load i32, i32* %21
%79 = add nsw i32 %77, %78
%80 = load i32, i32* %22
%81 = add nsw i32 %79, %80
%82 = sitofp i32 %81 to double
%83 = call double @percentage(double %72, double %82)
%84 = fcmp ult double %83, 6.000000e+01
br i1 %84, label %85, label %90
85: ; preds = %60
%86 = fcmp ult double %83, 4.500000e+01
br i1 %86, label %87, label %90
87: ; preds = %85
%88 = fcmp ult double %83, 3.000000e+01
br i1 %88, label %90, label %89
89: ; preds = %87
br label %90
90: ; preds = %87, %89, %60, %85
%91 = phi i32 [ 3, %89 ], [ 0, %87 ], [ 1, %60 ], [ 2, %85 ]
%92 = load i32, i32* %13
%93 = load i32, i32* %18
%94 = load i8, i8* %8
%95 = load i32, i32* %14
%96 = load i32, i32* %19
%97 = load i8, i8* %9
%98 = load i32, i32* %15
%99 = load i32, i32* %20
%100 = load i8, i8* %10
%101 = load i32, i32* %16
%102 = load i32, i32* %21
%103 = load i8, i8* %11
%104 = load i32, i32* %17
%105 = load i32, i32* %22
%106 = load i8, i8* %12
%107 = call i32 @display(i8* %27, i8* %28, i8* %29, i32 %92, i32 %93, i8 signext %94, i8* %30, i32 %95, i32 %96, i8 signext %97, i8* %31, i32 %98, i32 %99, i8 signext %100, i8* %32, i32 %101, i32 %102, i8 signext %103, i8* %33, i32 %104, i32 %105, i8 signext %106, double %83, i32 %91, double %72, double %82)
br label %110
108: ; preds = %48, %59
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
br label %110
110: ; preds = %90, %108
%111 = call i32 @fclose(i32* %26)
ret i32 0
}