#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 {
  int re_status;
  TYPE_1__ re_lb;
};
typedef enum reject_stat { ____Placeholder_reject_stat } reject_stat;

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


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     1143 <rejected+0x43>
jmp    1157 <rejected+0x57>
mov    -0x10(%rbp),%rax
movl   $0x80,(%rax)
jmp    1185 <rejected+0x85>
mov    0x2e8e(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1185 <rejected+0x85>
mov    0x2e72(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e73(%rip),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rejected>:
cmp    $0x81,%edi
je     1117 <rejected+0x17>
cmp    $0x80,%edi
jne    1123 <rejected+0x23>
movl   $0x80,(%rsi)
ret
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
mov    0x2eab(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsi)
mov    %edi,%eax
mov    %rax,0x10(%rsi)
ret

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

LLVM IR (-O2):
%struct.rpc_err = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
@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 %8 [
i32 128, label %3
i32 129, label %5
]
3: ; preds = %2
%4 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0
store i32 128, i32* %4
br label %15
5: ; preds = %2
%6 = load i32, i32* @RPC_AUTHERROR
%7 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0
store i32 %6, i32* %7
br label %15
8: ; preds = %2
%9 = load i32, i32* @RPC_FAILED
%10 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 0
store i32 %9, i32* %10
%11 = load i64, i64* @MSG_DENIED
%12 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1, i32 0
store i64 %11, i64* %12
%13 = zext i32 %0 to i64
%14 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %1, i64 0, i32 1, i32 1
store i64 %13, i64* %14
br label %15
15: ; preds = %8, %5, %3
ret void
}