#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 143
#define EAGAIN 142
#define EBADF 141
#define ECONNRESET 140
#define EDESTADDRREQ 139
#define EFAULT 138
#define EINTR 137
#define EINVAL 136
#define EISCONN 135
#define EMSGSIZE 134
#define ENOBUFS 133
#define ENOMEM 132
#define ENOTCONN 131
#define ENOTSOCK 130
#define EOPNOTSUPP 129
#define EPIPE 128
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int);
void err_sendmsg(int err) {
  fprintf(stderr, "error: sendmsg(2) syscall failed\n");
  switch (err) {
  case EACCES:
    fprintf(stderr, "       (For  Unix  domain  sockets,  which  are "
                    "identified by pathname)\n");
    fprintf(stderr, "       Write permission is denied on the destination  "
                    "socket  file,  or\n");
    fprintf(stderr, "       search  permission is denied for one of the "
                    "directories the path\n");
    fprintf(stderr, "       prefix. (See path_resolution(2).)\n");
    break;
  case EAGAIN:
    fprintf(stderr, "       The socket is marked non-blocking and  the "
                    "requested  operation\n");
    fprintf(stderr, "       would block.\n");
    break;
  case EBADF:
    fprintf(stderr, "       An invalid descriptor was specified.\n");
    break;
  case ECONNRESET:
    fprintf(stderr, "       Connection reset by peer.\n");
    break;
  case EDESTADDRREQ:
    fprintf(stderr, "       The socket is not connection-mode, and no peer "
                    "address is set.\n");
    break;
  case EFAULT:
    fprintf(stderr, "       An invalid user space address was specified for a "
                    "parameter.\n");
    break;
  case EINTR:
    fprintf(stderr,
            "       A signal occurred before any data was transmitted.\n");
    break;
  case EINVAL:
    fprintf(stderr, "       Invalid argument passed.\n");
    break;
  case EISCONN:
    fprintf(stderr, "       The connection-mode socket was connected already "
                    "but a recipient\n");
    fprintf(stderr, "       was specified.  (Now either  this  error is  "
                    "returned,  or  the\n");
    fprintf(stderr, "       recipient specification is ignored.)\n");
    break;
  case EMSGSIZE:
    fprintf(stderr, "       The  socket  type  requires that message be sent "
                    "atomically, and\n");
    fprintf(
        stderr,
        "       the size of the message to be sent made this impossible.\n");
    break;
  case ENOBUFS:
    fprintf(stderr, "       The output queue for a network interface was full. "
                    " This  gener-\n");
    fprintf(stderr, "       ally  indicates  that the interface has stopped "
                    "sending, but may\n");
    fprintf(stderr, "       be caused by transient congestion. (Normally,  "
                    "this  does  not\n");
    fprintf(stderr, "       occur  in Linux. Packets are just silently dropped "
                    "when a device\n");
    fprintf(stderr, "       queue overflows.)\n");
    break;
  case ENOMEM:
    fprintf(stderr, "       No memory available.\n");
    break;
  case ENOTCONN:
    fprintf(
        stderr,
        "       The socket is not connected, and no target has been given.\n");
    break;
  case ENOTSOCK:
    fprintf(stderr, "       The argument s is not a socket.\n");
    break;
  case EOPNOTSUPP:
    fprintf(stderr, "       Some bit in the flags argument is inappropriate "
                    "for  the  socket\n");
    fprintf(stderr, "       type.\n");
    break;
  case EPIPE:
    fprintf(stderr, "       The  local  end  has  been  shut  down  on a "
                    "connection oriented\n");
    fprintf(stderr, "       socket.  In this case the process will also  "
                    "receive  a  SIGPIPE\n");
    fprintf(stderr, "       unless MSG_NOSIGNAL is set.\n");
    break;
  }
  fprintf(stderr, "       errno is: %d\n", err);
  ;
  fprintf(stderr, "       %s\n", strerror(err));
  ;
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_sendmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xf,%eax
ja     1478 <err_sendmsg+0x348>
mov    -0x10(%rbp),%rax
lea    0xe8e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xf09(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xf3b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
lea    0xf6d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
lea    0xf7b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
lea    0xfac(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    0xfa5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
lea    0xfb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
lea    0xfbc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
lea    0xfe7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
lea    0x1010(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0x102f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2d22(%rip),%rax
mov    (%rax),%edi
lea    0x1034(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
lea    0x1066(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cf4(%rip),%rax
mov    (%rax),%edi
lea    0x1097(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2cd8(%rip),%rax
mov    (%rax),%edi
lea    0x10a8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
lea    0x10da(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2ca5(%rip),%rax
mov    (%rax),%edi
lea    0x10ff(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c8e(%rip),%rax
mov    (%rax),%edi
lea    0x1131(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
lea    0x1163(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
lea    0x1193(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c49(%rip),%rax
mov    (%rax),%edi
lea    0x11c5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0x11c3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
lea    0x11c4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
lea    0x11eb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2bd9(%rip),%rax
mov    (%rax),%edi
lea    0x11f7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
lea    0x1229(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1478 <err_sendmsg+0x348>
mov    0x2ba6(%rip),%rax
mov    (%rax),%edi
lea    0x121b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b8f(%rip),%rax
mov    (%rax),%edi
lea    0x124d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
lea    0x127f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b61(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0x1289(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0x1276(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b1f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_sendmsg>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ea3(%rip),%r14
mov    (%r14),%edi
lea    0xef9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    -0x80(%rbx),%eax
cmp    $0xf,%eax
ja     1306 <err_sendmsg+0x1d6>
lea    0x1063(%rip),%rsi
lea    0xe98(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    (%r14),%edi
lea    0x14e3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x151b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x1556(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
mov    (%r14),%edi
lea    0x145e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x1499(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0x141c(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0x13cd(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0x13a4(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
mov    (%r14),%edi
lea    0x1259(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1291(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x12c9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x12ff(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x133a(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
mov    (%r14),%edi
lea    0x117f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x11ba(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
mov    (%r14),%edi
lea    0x10a4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x10dc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x1116(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0x1058(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0x1014(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0xfc6(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0xf76(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
lea    0xf4b(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
mov    (%r14),%edi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeef(%rip),%rsi
jmp    12fc <err_sendmsg+0x1cc>
mov    (%r14),%edi
lea    0xd96(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xdce(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xe06(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xe41(%rip),%rsi
mov    (%r14),%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1404(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%ebp
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0x13ff(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"error: sendmsg(2) syscall failed\0A\00"
@.str.1 = [73 x i8] c" (For Unix domain sockets, which are identified by pathname)\0A\00"
@.str.2 = [73 x i8] c" Write permission is denied on the destination socket file, or\0A\00"
@.str.3 = [73 x i8] c" search permission is denied for one of the directories the path\0A\00"
@.str.4 = [42 x i8] c" prefix. (See path_resolution(2).)\0A\00"
@.str.5 = [72 x i8] c" The socket is marked non-blocking and the requested operation\0A\00"
@.str.6 = [21 x i8] c" would block.\0A\00"
@.str.7 = [45 x i8] c" An invalid descriptor was specified.\0A\00"
@.str.8 = [34 x i8] c" Connection reset by peer.\0A\00"
@.str.9 = [71 x i8] c" The socket is not connection-mode, and no peer address is set.\0A\00"
@.str.10 = [69 x i8] c" An invalid user space address was specified for a parameter.\0A\00"
@.str.11 = [59 x i8] c" A signal occurred before any data was transmitted.\0A\00"
@.str.12 = [33 x i8] c" Invalid argument passed.\0A\00"
@.str.13 = [73 x i8] c" The connection-mode socket was connected already but a recipient\0A\00"
@.str.14 = [72 x i8] c" was specified. (Now either this error is returned, or the\0A\00"
@.str.15 = [45 x i8] c" recipient specification is ignored.)\0A\00"
@.str.16 = [73 x i8] c" The socket type requires that message be sent atomically, and\0A\00"
@.str.17 = [65 x i8] c" the size of the message to be sent made this impossible.\0A\00"
@.str.18 = [73 x i8] c" The output queue for a network interface was full. This gener-\0A\00"
@.str.19 = [73 x i8] c" ally indicates that the interface has stopped sending, but may\0A\00"
@.str.20 = [71 x i8] c" be caused by transient congestion. (Normally, this does not\0A\00"
@.str.21 = [73 x i8] c" occur in Linux. Packets are just silently dropped when a device\0A\00"
@.str.22 = [26 x i8] c" queue overflows.)\0A\00"
@.str.23 = [29 x i8] c" No memory available.\0A\00"
@.str.24 = [67 x i8] c" The socket is not connected, and no target has been given.\0A\00"
@.str.25 = [40 x i8] c" The argument s is not a socket.\0A\00"
@.str.26 = [73 x i8] c" Some bit in the flags argument is inappropriate for the socket\0A\00"
@.str.27 = [14 x i8] c" type.\0A\00"
@.str.28 = [73 x i8] c" The local end has been shut down on a connection oriented\0A\00"
@.str.29 = [73 x i8] c" socket. In this case the process will also receive a SIGPIPE\0A\00"
@.str.30 = [36 x i8] c" unless MSG_NOSIGNAL is set.\0A\00"
@.str.31 = [21 x i8] c" errno is: %d\0A\00"
@.str.32 = [11 x i8] c" %s\0A\00"
define void @err_sendmsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
switch i32 %5, label %82 [
i32 143, label %6
i32 142, label %15
i32 141, label %20
i32 140, label %23
i32 139, label %26
i32 138, label %29
i32 137, label %32
i32 136, label %35
i32 135, label %38
i32 134, label %45
i32 133, label %50
i32 132, label %61
i32 131, label %64
i32 130, label %67
i32 129, label %70
i32 128, label %75
]
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
br label %82
15: ; preds = %1
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %82
20: ; preds = %1
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %82
23: ; preds = %1
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %82
26: ; preds = %1
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.9, i64 0, i64 0))
br label %82
29: ; preds = %1
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.10, i64 0, i64 0))
br label %82
32: ; preds = %1
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0))
br label %82
35: ; preds = %1
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
br label %82
38: ; preds = %1
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.13, i64 0, i64 0))
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.14, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
br label %82
45: ; preds = %1
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.16, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.17, i64 0, i64 0))
br label %82
50: ; preds = %1
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.18, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.19, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.20, i64 0, i64 0))
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.21, i64 0, i64 0))
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0))
br label %82
61: ; preds = %1
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0))
br label %82
64: ; preds = %1
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.24, i64 0, i64 0))
br label %82
67: ; preds = %1
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.25, i64 0, i64 0))
br label %82
70: ; preds = %1
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.26, i64 0, i64 0))
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0))
br label %82
75: ; preds = %1
%76 = load i32, i32* @stderr
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.28, i64 0, i64 0))
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.29, i64 0, i64 0))
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.30, i64 0, i64 0))
br label %82
82: ; preds = %1, %75, %70, %67, %64, %61, %50, %45, %38, %35, %32, %29, %26, %23, %20, %15, %6
%83 = load i32, i32* @stderr
%84 = load i32, i32* %2
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.31, i64 0, i64 0), i32 %84)
%86 = load i32, i32* @stderr
%87 = load i32, i32* %2
%88 = call i8* @strerror(i32 %87)
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.32, i64 0, i64 0), i8* %88)
%90 = load i32, i32* @stderr
%91 = call i32 @fflush(i32 %90)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"error: sendmsg(2) syscall failed\0A\00"
@.str.1 = [73 x i8] c" (For Unix domain sockets, which are identified by pathname)\0A\00"
@.str.2 = [73 x i8] c" Write permission is denied on the destination socket file, or\0A\00"
@.str.3 = [73 x i8] c" search permission is denied for one of the directories the path\0A\00"
@.str.4 = [42 x i8] c" prefix. (See path_resolution(2).)\0A\00"
@.str.5 = [72 x i8] c" The socket is marked non-blocking and the requested operation\0A\00"
@.str.6 = [21 x i8] c" would block.\0A\00"
@.str.7 = [45 x i8] c" An invalid descriptor was specified.\0A\00"
@.str.8 = [34 x i8] c" Connection reset by peer.\0A\00"
@.str.9 = [71 x i8] c" The socket is not connection-mode, and no peer address is set.\0A\00"
@.str.10 = [69 x i8] c" An invalid user space address was specified for a parameter.\0A\00"
@.str.11 = [59 x i8] c" A signal occurred before any data was transmitted.\0A\00"
@.str.12 = [33 x i8] c" Invalid argument passed.\0A\00"
@.str.13 = [73 x i8] c" The connection-mode socket was connected already but a recipient\0A\00"
@.str.14 = [72 x i8] c" was specified. (Now either this error is returned, or the\0A\00"
@.str.15 = [45 x i8] c" recipient specification is ignored.)\0A\00"
@.str.16 = [73 x i8] c" The socket type requires that message be sent atomically, and\0A\00"
@.str.17 = [65 x i8] c" the size of the message to be sent made this impossible.\0A\00"
@.str.18 = [73 x i8] c" The output queue for a network interface was full. This gener-\0A\00"
@.str.19 = [73 x i8] c" ally indicates that the interface has stopped sending, but may\0A\00"
@.str.20 = [71 x i8] c" be caused by transient congestion. (Normally, this does not\0A\00"
@.str.21 = [73 x i8] c" occur in Linux. Packets are just silently dropped when a device\0A\00"
@.str.22 = [26 x i8] c" queue overflows.)\0A\00"
@.str.23 = [29 x i8] c" No memory available.\0A\00"
@.str.24 = [67 x i8] c" The socket is not connected, and no target has been given.\0A\00"
@.str.25 = [40 x i8] c" The argument s is not a socket.\0A\00"
@.str.26 = [73 x i8] c" Some bit in the flags argument is inappropriate for the socket\0A\00"
@.str.27 = [14 x i8] c" type.\0A\00"
@.str.28 = [73 x i8] c" The local end has been shut down on a connection oriented\0A\00"
@.str.29 = [73 x i8] c" socket. In this case the process will also receive a SIGPIPE\0A\00"
@.str.30 = [36 x i8] c" unless MSG_NOSIGNAL is set.\0A\00"
@.str.31 = [21 x i8] c" errno is: %d\0A\00"
@.str.32 = [11 x i8] c" %s\0A\00"
define void @err_sendmsg(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %51 [
i32 143, label %4
i32 142, label %11
i32 141, label %47
i32 140, label %14
i32 139, label %15
i32 138, label %16
i32 137, label %17
i32 136, label %18
i32 135, label %19
i32 134, label %24
i32 133, label %27
i32 132, label %36
i32 131, label %37
i32 130, label %38
i32 129, label %39
i32 128, label %42
]
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.3, i64 0, i64 0))
br label %47
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.5, i64 0, i64 0))
br label %47
14: ; preds = %1
br label %47
15: ; preds = %1
br label %47
16: ; preds = %1
br label %47
17: ; preds = %1
br label %47
18: ; preds = %1
br label %47
19: ; preds = %1
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.13, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.14, i64 0, i64 0))
br label %47
24: ; preds = %1
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.16, i64 0, i64 0))
br label %47
27: ; preds = %1
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.18, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.19, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.20, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.21, i64 0, i64 0))
br label %47
36: ; preds = %1
br label %47
37: ; preds = %1
br label %47
38: ; preds = %1
br label %47
39: ; preds = %1
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.26, i64 0, i64 0))
br label %47
42: ; preds = %1
%43 = load i32, i32* @stderr
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.28, i64 0, i64 0))
%45 = load i32, i32* @stderr
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.29, i64 0, i64 0))
br label %47
47: ; preds = %1, %4, %11, %14, %15, %16, %17, %18, %19, %24, %27, %36, %37, %38, %39, %42
%48 = phi i8* [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.30, i64 0, i64 0), %42 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0), %39 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.25, i64 0, i64 0), %38 ], [ getelementptr inbounds ([67 x i8], [67 x i8]* @.str.24, i64 0, i64 0), %37 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0), %36 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), %27 ], [ getelementptr inbounds ([65 x i8], [65 x i8]* @.str.17, i64 0, i64 0), %24 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0), %19 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), %18 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0), %17 ], [ getelementptr inbounds ([69 x i8], [69 x i8]* @.str.10, i64 0, i64 0), %16 ], [ getelementptr inbounds ([71 x i8], [71 x i8]* @.str.9, i64 0, i64 0), %15 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), %11 ], [ getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), %4 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), %1 ]
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* %48)
br label %51
51: ; preds = %47, %1
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.31, i64 0, i64 0), i32 %0)
%54 = load i32, i32* @stderr
%55 = tail call i8* @strerror(i32 %0)
%56 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.32, i64 0, i64 0), i8* %55)
%57 = load i32, i32* @stderr
%58 = tail call i32 @fflush(i32 %57)
ret void
}