#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  long s1;
  long s2;
};
struct rpc_err {
  TYPE_1__ re_lb;
  int /*<<< orphan*/ re_status;
};
typedef enum accept_stat { ____Placeholder_accept_stat } accept_stat;

/* Variables and functions */
#define GARBAGE_ARGS 133
scalar_t__ MSG_ACCEPTED;
#define PROC_UNAVAIL 132
#define PROG_MISMATCH 131
#define PROG_UNAVAIL 130
int /*<<< orphan*/ RPC_CANTDECODEARGS;
int /*<<< orphan*/ RPC_FAILED;
int /*<<< orphan*/ RPC_PROCUNAVAIL;
int /*<<< orphan*/ RPC_PROGUNAVAIL;
int /*<<< orphan*/ RPC_PROGVERSMISMATCH;
int /*<<< orphan*/ RPC_SUCCESS;
int /*<<< orphan*/ RPC_SYSTEMERROR;
#define SUCCESS 129
#define SYSTEM_ERR 128
void accepted(register enum accept_stat acpt_stat,
              register struct rpc_err *error) {
  switch (acpt_stat) {
  case PROG_UNAVAIL:
    error->re_status = RPC_PROGUNAVAIL;
    return;
  case PROG_MISMATCH:
    error->re_status = RPC_PROGVERSMISMATCH;
    return;
  case PROC_UNAVAIL:
    error->re_status = RPC_PROCUNAVAIL;
    return;
  case GARBAGE_ARGS:
    error->re_status = RPC_CANTDECODEARGS;
    return;
  case SYSTEM_ERR:
    error->re_status = RPC_SYSTEMERROR;
    return;
  case SUCCESS:
    error->re_status = RPC_SUCCESS;
    return;
  }
  error->re_status = RPC_FAILED;
  error->re_lb.s1 = (long)MSG_ACCEPTED;
  error->re_lb.s2 = (long)acpt_stat;
}


x86 assembly (clang, -O0):
<accepted>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     11b2 <accepted+0xb2>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e65(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    11e0 <accepted+0xe0>
mov    0x2ea0(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    11e0 <accepted+0xe0>
mov    0x2e63(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    11e0 <accepted+0xe0>
mov    0x2e46(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    11e0 <accepted+0xe0>
mov    0x2e51(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    11e0 <accepted+0xe0>
mov    0x2e34(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    11e0 <accepted+0xe0>
mov    0x2dff(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    0x2ddf(%rip),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<accepted>:
lea    -0x80(%rdi),%eax
cmp    $0x5,%eax
ja     1121 <accepted+0x21>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2ec1(%rip),%rax
jmp    116c <accepted+0x6c>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsi)
mov    0x2e74(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rsi)
mov    %edi,%eax
mov    %rax,0x8(%rsi)
ret
mov    0x2e90(%rip),%rax
jmp    116c <accepted+0x6c>
mov    0x2e4f(%rip),%rax
jmp    116c <accepted+0x6c>
mov    0x2e96(%rip),%rax
jmp    116c <accepted+0x6c>
mov    0x2e65(%rip),%rax
jmp    116c <accepted+0x6c>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsi)
ret

LLVM IR (-O0):
%struct.rpc_err = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i64, i64 }
@RPC_PROGUNAVAIL = global i32 0
@RPC_PROGVERSMISMATCH = global i32 0
@RPC_PROCUNAVAIL = global i32 0
@RPC_CANTDECODEARGS = global i32 0
@RPC_SYSTEMERROR = global i32 0
@RPC_SUCCESS = global i32 0
@RPC_FAILED = global i32 0
@MSG_ACCEPTED = global i64 0
define void @accepted(i32 %0, %struct.rpc_err* %1) {
%3 = alloca i32
%4 = alloca %struct.rpc_err*
store i32 %0, i32* %3
store %struct.rpc_err* %1, %struct.rpc_err** %4
%5 = load i32, i32* %3
switch i32 %5, label %30 [
i32 130, label %6
i32 131, label %10
i32 132, label %14
i32 133, label %18
i32 128, label %22
i32 129, label %26
]
6: ; preds = %2
%7 = load i32, i32* @RPC_PROGUNAVAIL
%8 = load %struct.rpc_err*, %struct.rpc_err** %4
%9 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %8, i32 0, i32 1
store i32 %7, i32* %9
br label %43
10: ; preds = %2
%11 = load i32, i32* @RPC_PROGVERSMISMATCH
%12 = load %struct.rpc_err*, %struct.rpc_err** %4
%13 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %12, i32 0, i32 1
store i32 %11, i32* %13
br label %43
14: ; preds = %2
%15 = load i32, i32* @RPC_PROCUNAVAIL
%16 = load %struct.rpc_err*, %struct.rpc_err** %4
%17 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %16, i32 0, i32 1
store i32 %15, i32* %17
br label %43
18: ; preds = %2
%19 = load i32, i32* @RPC_CANTDECODEARGS
%20 = load %struct.rpc_err*, %struct.rpc_err** %4
%21 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %20, i32 0, i32 1
store i32 %19, i32* %21
br label %43
22: ; preds = %2
%23 = load i32, i32* @RPC_SYSTEMERROR
%24 = load %struct.rpc_err*, %struct.rpc_err** %4
%25 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %24, i32 0, i32 1
store i32 %23, i32* %25
br label %43
26: ; preds = %2
%27 = load i32, i32* @RPC_SUCCESS
%28 = load %struct.rpc_err*, %struct.rpc_err** %4
%29 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %28, i32 0, i32 1
store i32 %27, i32* %29
br label %43
30: ; preds = %2
%31 = load i32, i32* @RPC_FAILED
%32 = load %struct.rpc_err*, %struct.rpc_err** %4
%33 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %32, i32 0, i32 1
store i32 %31, i32* %33
%34 = load i64, i64* @MSG_ACCEPTED
%35 = load %struct.rpc_err*, %struct.rpc_err** %4
%36 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %35, i32 0, i32 0
%37 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %36, i32 0, i32 0
store i64 %34, i64* %37
%38 = load i32, i32* %3
%39 = zext i32 %38 to i64
%40 = load %struct.rpc_err*, %struct.rpc_err** %4
%41 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %40, i32 0, i32 0
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 1
store i64 %39, i64* %42
br label %43
43: ; preds = %30, %26, %22, %18, %14, %10, %6
ret void
}

LLVM IR (-O2):
%struct.rpc_err = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i64, i64 }
@RPC_PROGUNAVAIL = global i32 0
@RPC_PROGVERSMISMATCH = global i32 0
@RPC_PROCUNAVAIL = global i32 0
@RPC_CANTDECODEARGS = global i32 0
@RPC_SYSTEMERROR = global i32 0
@RPC_SUCCESS = global i32 0
@RPC_FAILED = global i32 0
@MSG_ACCEPTED = global i64 0
define void @accepted(i32 %0, %struct.rpc_err* nocapture writeonly %1) {
switch i32 %0, label %21 [
i32 130, label %3
i32 131, label %6
i32 132, label %9
i32 133, label %12
i32 128, label %15
i32 129, label %18
]
3: ; preds = %2
%4 = load i32, i32* @RPC_PROGUNAVAIL
%5 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %4, i32* %5
br label %28
6: ; preds = %2
%7 = load i32, i32* @RPC_PROGVERSMISMATCH
%8 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %7, i32* %8
br label %28
9: ; preds = %2
%10 = load i32, i32* @RPC_PROCUNAVAIL
%11 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %10, i32* %11
br label %28
12: ; preds = %2
%13 = load i32, i32* @RPC_CANTDECODEARGS
%14 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %13, i32* %14
br label %28
15: ; preds = %2
%16 = load i32, i32* @RPC_SYSTEMERROR
%17 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %16, i32* %17
br label %28
18: ; preds = %2
%19 = load i32, i32* @RPC_SUCCESS
%20 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %19, i32* %20
br label %28
21: ; preds = %2
%22 = load i32, i32* @RPC_FAILED
%23 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %22, i32* %23
%24 = load i64, i64* @MSG_ACCEPTED
%25 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0, i32 0
store i64 %24, i64* %25
%26 = zext i32 %0 to i64
%27 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0, i32 1
store i64 %26, i64* %27
br label %28
28: ; preds = %21, %18, %15, %12, %9, %6, %3
ret void
}