#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 close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int Close(int fd) {
  int n;
  n = close(fd);
  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",
              446, "close", strerror(errno));
    } while (0);
  return n;
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1199 <Close+0x69>
jmp    1155 <Close+0x25>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%r9
lea    0xe84(%rip),%rsi
lea    0xe94(%rip),%rdx
mov    $0x1be,%ecx
lea    0xf22(%rip),%r8
call   1040 <fprintf@plt>
jmp    1199 <Close+0x69>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rbp
push   %rbx
push   %rax
call   1030 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1179 <Close+0x49>
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea4(%rip),%rsi
lea    0xeb4(%rip),%rdx
lea    0xf47(%rip),%r8
mov    %ebp,%edi
mov    $0x1be,%ecx
mov    %rax,%r9
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@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 = [6 x i8] c"close\00"
@errno = global i32 0
define i32 @Close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = load i32, i32* @stderr
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %10, 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 446, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %9
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@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 = [6 x i8] c"close\00"
@errno = global i32 0
define i32 @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, 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 446, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %4, %1
ret i32 %2
}