#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 */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           char *);
int recvfrom(int, unsigned char *, int, int, struct sockaddr *,
             int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
int Recvfrom(int fd, unsigned char *p, int len, int flags,
             struct sockaddr_in *from, socklen_t *fromlen) {
  int n;
  do {
    n = recvfrom(fd, p, len, flags, (struct sockaddr *)from, fromlen);
  } while (n < 0 && errno == EINTR);
  if (n < 0)
    do {
      fprintf(stderr, "ERROR: [%s:%d] %s: %s\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/"
              "master/ipmipower/src/wrappers.c",
              459, "recvfrom", strerror(errno));
    } while (0);
  return n;
}


x86 assembly (clang, -O0):
<Recvfrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1040 <recvfrom@plt>
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x2c(%rbp)
mov    %al,-0x2d(%rbp)
jge    1193 <Recvfrom+0x63>
mov    0x2e58(%rip),%rax
mov    (%rax),%rax
mov    0x2e46(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    114d <Recvfrom+0x1d>
cmpl   $0x0,-0x2c(%rbp)
jge    11f2 <Recvfrom+0xc2>
jmp    11ad <Recvfrom+0x7d>
mov    0x2e2c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2e18(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    %rax,%r9
lea    0xe2b(%rip),%rsi
lea    0xe3b(%rip),%rdx
mov    $0x1cb,%ecx
lea    0xec9(%rip),%r8
call   1030 <fprintf@plt>
jmp    11f2 <Recvfrom+0xc2>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Recvfrom>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8,%r15
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %rsi,%rbp
mov    %edi,%r14d
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15,%r8
mov    (%rsp),%r9
call   1040 <recvfrom@plt>
mov    %eax,%ebx
mov    0x2e67(%rip),%rax
mov    (%rax),%rdi
test   %ebx,%ebx
jns    1184 <Recvfrom+0x54>
mov    0x2e51(%rip),%rax
cmp    (%rax),%rdi
je     1150 <Recvfrom+0x20>
test   %ebx,%ebx
jns    11ba <Recvfrom+0x8a>
mov    0x2e51(%rip),%rax
mov    (%rax),%ebp
call   1050 <strerror@plt>
lea    0xe63(%rip),%rsi
lea    0xe73(%rip),%rdx
lea    0xf06(%rip),%r8
mov    %ebp,%edi
mov    $0x1cb,%ecx
mov    %rax,%r9
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: [%s:%d] %s: %s\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/master/ipmipower/src/wrappers.c\00"
@.str.2 = [9 x i8] c"recvfrom\00"
define i32 @Recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr_in* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in*
%12 = alloca i32*
%13 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store %struct.sockaddr_in* %4, %struct.sockaddr_in** %11
store i32* %5, i32** %12
br label %14
14: ; preds = %30, %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load %struct.sockaddr_in*, %struct.sockaddr_in** %11
%20 = bitcast %struct.sockaddr_in* %19 to %struct.sockaddr*
%21 = load i32*, i32** %12
%22 = call i32 @recvfrom(i32 %15, i8* %16, i32 %17, i32 %18, %struct.sockaddr* %20, i32* %21)
store i32 %22, i32* %13
br label %23
23: ; preds = %14
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load i64, i64* @errno
%28 = load i64, i64* @EINTR
%29 = icmp eq i64 %27, %28
br label %30
30: ; preds = %26, %23
%31 = phi i1 [ false, %23 ], [ %29, %26 ]
br i1 %31, label %14, label %32
32: ; preds = %30
%33 = load i32, i32* %13
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %42
35: ; preds = %32
br label %36
36: ; preds = %35
%37 = load i32, i32* @stderr
%38 = load i64, i64* @errno
%39 = call i8* @strerror(i64 %38)
%40 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 459, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %36
br label %42
42: ; preds = %41, %32
%43 = load i32, i32* %13
ret i32 %43
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: [%s:%d] %s: %s\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/master/ipmipower/src/wrappers.c\00"
@.str.2 = [9 x i8] c"recvfrom\00"
define i32 @Recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr_in* %4, i32* %5) {
%7 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
br label %8
8: ; preds = %8, %6
%9 = tail call i32 @recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %7, i32* %5)
%10 = icmp slt i32 %9, 0
%11 = load i64, i64* @errno
%12 = load i64, i64* @EINTR
%13 = icmp eq i64 %11, %12
%14 = select i1 %10, i1 %13, i1 false
br i1 %14, label %8, label %15
15: ; preds = %8
br i1 %10, label %16, label %20
16: ; preds = %15
%17 = load i32, i32* @stderr
%18 = tail call i8* @strerror(i64 %11)
%19 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 459, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %16, %15
ret i32 %9
}