#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 errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ warning_prefix();
__attribute__((noreturn)) void error_with_errno(const char *message) {
  int saved_errno;
  saved_errno = errno;
  warning_prefix();
  fputs(message, stderr);
  fputs(": error number ", stderr);
  fprintf(stderr, "%i\n", saved_errno);
  exit(1);
}


x86 assembly (clang, -O0):
<error_with_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <warning_prefix@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
lea    0xe7f(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe77(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<error_with_errno>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e8a(%rip),%rax
mov    (%rax),%r14d
xor    %eax,%eax
call   1040 <warning_prefix@plt>
mov    0x2e81(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
mov    0x0(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <fputs@plt>
mov    0x0(%rbp),%edi
lea    0xe8d(%rip),%rsi
mov    %r14d,%edx
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c": error number \00"
@.str.1 = [4 x i8] c"%i\0A\00"
define void @error_with_errno(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = call i32 (...) @warning_prefix()
%6 = load i8*, i8** %2
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* %6, i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stderr
%12 = load i32, i32* %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c": error number \00"
@.str.1 = [4 x i8] c"%i\0A\00"
define void @error_with_errno(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 (...) @warning_prefix()
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %0, i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%10 = tail call i32 @exit(i32 1)
unreachable
}