#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 count_lines(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void delete_data_from_file(char *file, int start_del_line, int end_del_line,
                           int notflag) {
  printf("\nThis is Delete operation with Start Line-->%d End Line-->%d NOT "
         "Flag-->%d",
         start_del_line, end_del_line, notflag);
  FILE *fileptr1;
  fileptr1 = fopen(file, "r");
  if (fileptr1 == NULL) {
    fputs("File does not exist", stderr);
    exit(1);
  }
  int lines = count_lines(fileptr1);
  rewind(fileptr1);
  fclose(fileptr1);
}


x86 assembly (clang, -O0):
<delete_data_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11d8 <delete_data_from_file+0x68>
mov    0x2e20(%rip),%rax
mov    (%rax),%esi
lea    0xe84(%rip),%rdi
call   1060 <fputs@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1070 <count_lines@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_data_from_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
test   %rax,%rax
je     11b0 <delete_data_from_file+0x40>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <count_lines@plt>
mov    %rbx,%rdi
call   1050 <rewind@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
lea    0xe8d(%rip),%rdi
call   1060 <fputs@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"\0AThis is Delete operation with Start Line-->%d End Line-->%d NOT Flag-->%d\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"File does not exist\00"
@stderr = global i32 0
define void @delete_data_from_file(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %16, i32** %9
%17 = load i32*, i32** %9
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %4
%20 = load i32, i32* @stderr
%21 = call i32 @fputs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %4
%24 = load i32*, i32** %9
%25 = call i32 @count_lines(i32* %24)
store i32 %25, i32* %10
%26 = load i32*, i32** %9
%27 = call i32 @rewind(i32* %26)
%28 = load i32*, i32** %9
%29 = call i32 @fclose(i32* %28)
ret void
}

LLVM IR (-O2):
@.str = [75 x i8] c"\0AThis is Delete operation with Start Line-->%d End Line-->%d NOT Flag-->%d\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"File does not exist\00"
@stderr = global i32 0
define void @delete_data_from_file(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = tail call i32 @fputs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %4
%13 = tail call i32 @count_lines(i32* %6)
%14 = tail call i32 @rewind(i32* %6)
%15 = tail call i32 @fclose(i32* %6)
ret void
}