#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*/ eset(int);
int fileRead(char *, char *, int);
int Mfilrd(int nargs, int *argsv) {
  if (nargs < 3) {
    eset(21);
    return -1;
  }
  char *name = (char *)argsv[0];
  char *buff = (char *)argsv[1];
  int bufflen = argsv[2];
  return fileRead(name, buff, bufflen);
}


x86 assembly (clang, -O0):
<Mfilrd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114f <Mfilrd+0x2f>
mov    $0x15,%edi
call   1030 <eset@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <Mfilrd+0x63>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <fileRead@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mfilrd>:
push   %rax
cmp    $0x2,%edi
jg     1137 <Mfilrd+0x17>
mov    $0x15,%edi
call   1030 <eset@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
movslq (%rsi),%rdi
movslq 0x4(%rsi),%rax
mov    0x8(%rsi),%edx
mov    %rax,%rsi
pop    %rax
jmp    1040 <fileRead@plt>

LLVM IR (-O0):
define i32 @Mfilrd(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @eset(i32 21)
store i32 -1, i32* %3
br label %31
13: ; preds = %2
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %6
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
store i8* %23, i8** %7
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
store i32 %26, i32* %8
%27 = load i8*, i8** %6
%28 = load i8*, i8** %7
%29 = load i32, i32* %8
%30 = call i32 @fileRead(i8* %27, i8* %28, i32 %29)
store i32 %30, i32* %3
br label %31
31: ; preds = %13, %11
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @Mfilrd(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @eset(i32 21)
br label %17
6: ; preds = %2
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = tail call i32 @fileRead(i8* %9, i8* %13, i32 %15)
br label %17
17: ; preds = %6, %4
%18 = phi i32 [ -1, %4 ], [ %16, %6 ]
ret i32 %18
}