#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 */
#define EACCES 137
#define EBADF 136
#define EFAULT 135
#define EINVAL 134
#define EIO 133
#define ELOOP 132
#define EMFILE 131
#define ENAMETOOLONG 130
#define ENOENT 129
#define ENOTDIR 128
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void giveOsReport() {
  switch (errno) {
  case ENOTDIR:
    fprintf(stderr, "A component of the pathname is not a directory\n");
    break;
  case EINVAL:
    fprintf(stderr, "Bad argument (e.g. wrong type of file)\n");
    break;
  case ENAMETOOLONG:
    fprintf(stderr, "Name is too long\n");
    break;
  case ENOENT:
    fprintf(stderr, "File does not exist\n");
    break;
  case EACCES:
    fprintf(stderr, "Permission denied\n");
    break;
  case ELOOP:
    fprintf(stderr, "Passes through too many symbolic links\n");
    break;
  case EIO:
    fprintf(stderr, "An I/O error occurred during the operation\n");
    break;
  case EFAULT:
    fprintf(stderr, "Memory addressing problem, or general fault\n");
    break;
  case EBADF:
    fprintf(stderr, "Bad file descriptor (bug in code.)\n");
    break;
  case EMFILE:
    fprintf(stderr, "Too many open files\n");
    break;
  case 0:
    fprintf(stderr, "Error code is 0: no apparent error\n");
    break;
  default:
    fprintf(stderr, "Unrecognized error condition errno = %d\n", errno);
    break;
  }
}


x86 assembly (clang, -O0):
<giveOsReport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
test   %eax,%eax
je     1307 <giveOsReport+0x1f7>
jmp    1131 <giveOsReport+0x21>
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
je     11ef <giveOsReport+0xdf>
jmp    1144 <giveOsReport+0x34>
mov    -0x4(%rbp),%eax
sub    $0x81,%eax
je     1243 <giveOsReport+0x133>
jmp    1157 <giveOsReport+0x47>
mov    -0x4(%rbp),%eax
sub    $0x82,%eax
je     1227 <giveOsReport+0x117>
jmp    116a <giveOsReport+0x5a>
mov    -0x4(%rbp),%eax
sub    $0x83,%eax
je     12eb <giveOsReport+0x1db>
jmp    117d <giveOsReport+0x6d>
mov    -0x4(%rbp),%eax
sub    $0x84,%eax
je     127b <giveOsReport+0x16b>
jmp    1190 <giveOsReport+0x80>
mov    -0x4(%rbp),%eax
sub    $0x85,%eax
je     1297 <giveOsReport+0x187>
jmp    11a3 <giveOsReport+0x93>
mov    -0x4(%rbp),%eax
sub    $0x86,%eax
je     120b <giveOsReport+0xfb>
jmp    11b6 <giveOsReport+0xa6>
mov    -0x4(%rbp),%eax
sub    $0x87,%eax
je     12b3 <giveOsReport+0x1a3>
jmp    11c9 <giveOsReport+0xb9>
mov    -0x4(%rbp),%eax
sub    $0x88,%eax
je     12cf <giveOsReport+0x1bf>
jmp    11dc <giveOsReport+0xcc>
mov    -0x4(%rbp),%eax
sub    $0x89,%eax
je     125f <giveOsReport+0x14f>
jmp    1323 <giveOsReport+0x213>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    0xe17(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
lea    0xe10(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
lea    0xe07(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
lea    0xe13(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
lea    0xe23(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2cd2(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1343 <giveOsReport+0x233>
mov    0x2cb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ca5(%rip),%rax
mov    (%rax),%edx
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<giveOsReport>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
lea    -0x80(%rdx),%eax
cmp    $0x9,%eax
ja     1148 <giveOsReport+0x38>
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
test   %edx,%edx
jne    1236 <giveOsReport+0x126>
mov    (%rax),%edi
lea    0x1014(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xf1b(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xfba(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    0xefe(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
lea    0xf0f(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
lea    0xe6e(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
lea    0xf0d(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
lea    0xf23(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    (%rax),%edi
lea    0xf59(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [48 x i8] c"A component of the pathname is not a directory\0A\00"
@.str.1 = [40 x i8] c"Bad argument (e.g. wrong type of file)\0A\00"
@.str.2 = [18 x i8] c"Name is too long\0A\00"
@.str.3 = [21 x i8] c"File does not exist\0A\00"
@.str.4 = [19 x i8] c"Permission denied\0A\00"
@.str.5 = [40 x i8] c"Passes through too many symbolic links\0A\00"
@.str.6 = [44 x i8] c"An I/O error occurred during the operation\0A\00"
@.str.7 = [45 x i8] c"Memory addressing problem, or general fault\0A\00"
@.str.8 = [36 x i8] c"Bad file descriptor (bug in code.)\0A\00"
@.str.9 = [21 x i8] c"Too many open files\0A\00"
@.str.10 = [36 x i8] c"Error code is 0: no apparent error\0A\00"
@.str.11 = [41 x i8] c"Unrecognized error condition errno = %d\0A\00"
define void @giveOsReport() {
%1 = load i32, i32* @errno
switch i32 %1, label %35 [
i32 128, label %2
i32 134, label %5
i32 130, label %8
i32 129, label %11
i32 137, label %14
i32 132, label %17
i32 133, label %20
i32 135, label %23
i32 136, label %26
i32 131, label %29
i32 0, label %32
]
2: ; preds = %0
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %39
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %39
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %39
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %39
14: ; preds = %0
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %39
17: ; preds = %0
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %39
20: ; preds = %0
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %39
23: ; preds = %0
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %39
26: ; preds = %0
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
br label %39
29: ; preds = %0
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %39
32: ; preds = %0
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
br label %39
35: ; preds = %0
%36 = load i32, i32* @stderr
%37 = load i32, i32* @errno
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %5, %2
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [48 x i8] c"A component of the pathname is not a directory\0A\00"
@.str.1 = [40 x i8] c"Bad argument (e.g. wrong type of file)\0A\00"
@.str.2 = [18 x i8] c"Name is too long\0A\00"
@.str.3 = [21 x i8] c"File does not exist\0A\00"
@.str.4 = [19 x i8] c"Permission denied\0A\00"
@.str.5 = [40 x i8] c"Passes through too many symbolic links\0A\00"
@.str.6 = [44 x i8] c"An I/O error occurred during the operation\0A\00"
@.str.7 = [45 x i8] c"Memory addressing problem, or general fault\0A\00"
@.str.8 = [36 x i8] c"Bad file descriptor (bug in code.)\0A\00"
@.str.9 = [21 x i8] c"Too many open files\0A\00"
@.str.10 = [36 x i8] c"Error code is 0: no apparent error\0A\00"
@.str.11 = [41 x i8] c"Unrecognized error condition errno = %d\0A\00"
define void @giveOsReport() {
%1 = load i32, i32* @errno
switch i32 %1, label %35 [
i32 128, label %2
i32 134, label %5
i32 130, label %8
i32 129, label %11
i32 137, label %14
i32 132, label %17
i32 133, label %20
i32 135, label %23
i32 136, label %26
i32 131, label %29
i32 0, label %32
]
2: ; preds = %0
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %38
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %38
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %38
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %38
14: ; preds = %0
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %38
17: ; preds = %0
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %38
20: ; preds = %0
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %38
23: ; preds = %0
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %38
26: ; preds = %0
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
br label %38
29: ; preds = %0
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %38
32: ; preds = %0
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
br label %38
35: ; preds = %0
%36 = load i32, i32* @stderr
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i32 %1)
br label %38
38: ; preds = %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %5, %2
ret void
}