#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_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long s1;
  long s2;
};
struct TYPE_4__ {
  TYPE_1__ RE_lb;
};
struct rpc_err {
  TYPE_2__ ru;
  int /*<<< orphan*/ re_status;
};
typedef enum reject_stat { ____Placeholder_reject_stat } reject_stat;

/* Variables and functions */
#define AUTH_ERROR 129
scalar_t__ MSG_DENIED;
int /*<<< orphan*/ RPC_AUTHERROR;
int /*<<< orphan*/ RPC_FAILED;
#define RPC_MISMATCH 128
int /*<<< orphan*/ RPC_VERSMISMATCH;
void rejected(enum reject_stat rjct_stat, struct rpc_err *error) {
  switch (rjct_stat) {
  case RPC_MISMATCH:
    error->re_status = RPC_VERSMISMATCH;
    return;
  case AUTH_ERROR:
    error->re_status = RPC_AUTHERROR;
    return;
  default:
    error->re_status = RPC_FAILED;
    error->ru.RE_lb.s1 = (long)MSG_DENIED;
    error->ru.RE_lb.s2 = (long)rjct_stat;
    return;
  }
}


x86 assembly (clang, -O0):
<rejected>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x80,%eax
je     1134 <rejected+0x34>
jmp    1121 <rejected+0x21>
mov    -0x14(%rbp),%eax
sub    $0x81,%eax
je     1149 <rejected+0x49>
jmp    115e <rejected+0x5e>
mov    0x2e8d(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    118c <rejected+0x8c>
mov    0x2e88(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
jmp    118c <rejected+0x8c>
mov    0x2e6b(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    0x2e6b(%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):
<rejected>:
cmp    $0x81,%edi
je     1119 <rejected+0x19>
cmp    $0x80,%edi
jne    1126 <rejected+0x26>
mov    0x2eb1(%rip),%rax
jmp    1120 <rejected+0x20>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsi)
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsi)
mov    0x2ea7(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rsi)
mov    %edi,%eax
mov    %rax,0x8(%rsi)
ret

LLVM IR (-O0):
%struct.rpc_err = type { %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64, i64 }
@RPC_VERSMISMATCH = global i32 0
@RPC_AUTHERROR = global i32 0
@RPC_FAILED = global i32 0
@MSG_DENIED = global i64 0
define void @rejected(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 %14 [
i32 128, label %6
i32 129, label %10
]
6: ; preds = %2
%7 = load i32, i32* @RPC_VERSMISMATCH
%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 %29
10: ; preds = %2
%11 = load i32, i32* @RPC_AUTHERROR
%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 %29
14: ; preds = %2
%15 = load i32, i32* @RPC_FAILED
%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
%18 = load i64, i64* @MSG_DENIED
%19 = load %struct.rpc_err*, %struct.rpc_err** %4
%20 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %19, i32 0, i32 0
%21 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %20, i32 0, i32 0
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 0
store i64 %18, i64* %22
%23 = load i32, i32* %3
%24 = zext i32 %23 to i64
%25 = load %struct.rpc_err*, %struct.rpc_err** %4
%26 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %25, i32 0, i32 0
%27 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %26, i32 0, i32 0
%28 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %27, i32 0, i32 1
store i64 %24, i64* %28
br label %29
29: ; preds = %14, %10, %6
ret void
}

LLVM IR (-O2):
%struct.rpc_err = type { %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64, i64 }
@RPC_VERSMISMATCH = global i32 0
@RPC_AUTHERROR = global i32 0
@RPC_FAILED = global i32 0
@MSG_DENIED = global i64 0
define void @rejected(i32 %0, %struct.rpc_err* nocapture writeonly %1) {
switch i32 %0, label %9 [
i32 128, label %3
i32 129, label %6
]
3: ; preds = %2
%4 = load i32, i32* @RPC_VERSMISMATCH
%5 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %4, i32* %5
br label %16
6: ; preds = %2
%7 = load i32, i32* @RPC_AUTHERROR
%8 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %7, i32* %8
br label %16
9: ; preds = %2
%10 = load i32, i32* @RPC_FAILED
%11 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1
store i32 %10, i32* %11
%12 = load i64, i64* @MSG_DENIED
%13 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0, i32 0, i32 0
store i64 %12, i64* %13
%14 = zext i32 %0 to i64
%15 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0, i32 0, i32 1
store i64 %14, i64* %15
br label %16
16: ; preds = %9, %6, %3
ret void
}