#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 */
int StdHepXdrWriteCM(int, int);
int StdHepXdrWriteEvent(int, int);
int StdHepXdrWriteEventEUP(int, int);
int StdHepXdrWriteEventLH(int, int);
int StdHepXdrWriteEventRUP(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int StdHepXdrWrite(int ilbl, int ist) {
  int iret = 0;
  if ((ilbl == 1) || (ilbl == 2))
    iret = StdHepXdrWriteEvent(ilbl, ist);
  else if ((ilbl == 4) || (ilbl == 5))
    iret = StdHepXdrWriteEventLH(ilbl, ist);
  else if (ilbl == 11)
    iret = StdHepXdrWriteEventEUP(ilbl, ist);
  else if (ilbl == 12)
    iret = StdHepXdrWriteEventRUP(ilbl, ist);
  else if ((ilbl == 100) || (ilbl == 200))
    iret = StdHepXdrWriteCM(ilbl, ist);
  else
    fprintf(stderr,
            "     StdHepXdrWrite: don't know what to do with record type %d\n",
            ilbl);
  return iret;
}


x86 assembly (clang, -O0):
<StdHepXdrWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1189 <StdHepXdrWrite+0x29>
cmpl   $0x2,-0x4(%rbp)
jne    119c <StdHepXdrWrite+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <StdHepXdrWriteEvent@plt>
mov    %eax,-0xc(%rbp)
jmp    1253 <StdHepXdrWrite+0xf3>
cmpl   $0x4,-0x4(%rbp)
je     11b0 <StdHepXdrWrite+0x50>
cmpl   $0x5,-0x4(%rbp)
jne    11c3 <StdHepXdrWrite+0x63>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <StdHepXdrWriteEventLH@plt>
mov    %eax,-0xc(%rbp)
jmp    124e <StdHepXdrWrite+0xee>
cmpl   $0xb,-0x4(%rbp)
jne    11e0 <StdHepXdrWrite+0x80>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <StdHepXdrWriteEventEUP@plt>
mov    %eax,-0xc(%rbp)
jmp    1249 <StdHepXdrWrite+0xe9>
cmpl   $0xc,-0x4(%rbp)
jne    11fd <StdHepXdrWrite+0x9d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <StdHepXdrWriteEventRUP@plt>
mov    %eax,-0xc(%rbp)
jmp    1244 <StdHepXdrWrite+0xe4>
cmpl   $0x64,-0x4(%rbp)
je     1214 <StdHepXdrWrite+0xb4>
cmpl   $0xc8,-0x4(%rbp)
jne    1227 <StdHepXdrWrite+0xc7>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1080 <StdHepXdrWriteCM@plt>
mov    %eax,-0xc(%rbp)
jmp    123f <StdHepXdrWrite+0xdf>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xdc6(%rip),%rsi
call   1060 <fprintf@plt>
jmp    1244 <StdHepXdrWrite+0xe4>
jmp    1249 <StdHepXdrWrite+0xe9>
jmp    124e <StdHepXdrWrite+0xee>
jmp    1253 <StdHepXdrWrite+0xf3>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StdHepXdrWrite>:
mov    %edi,%edx
lea    -0x1(%rdx),%eax
cmp    $0x1,%eax
ja     1171 <StdHepXdrWrite+0x11>
mov    %edx,%edi
jmp    1050 <StdHepXdrWriteEvent@plt>
mov    %edx,%eax
and    $0xfffffffe,%eax
cmp    $0x4,%eax
jne    1182 <StdHepXdrWrite+0x22>
mov    %edx,%edi
jmp    1030 <StdHepXdrWriteEventLH@plt>
cmp    $0x63,%edx
jg     119b <StdHepXdrWrite+0x3b>
cmp    $0xb,%edx
je     11af <StdHepXdrWrite+0x4f>
cmp    $0xc,%edx
jne    11b9 <StdHepXdrWrite+0x59>
mov    $0xc,%edi
jmp    1070 <StdHepXdrWriteEventRUP@plt>
cmp    $0x64,%edx
je     11a8 <StdHepXdrWrite+0x48>
cmp    $0xc8,%edx
jne    11b9 <StdHepXdrWrite+0x59>
mov    %edx,%edi
jmp    1080 <StdHepXdrWriteCM@plt>
mov    $0xb,%edi
jmp    1040 <StdHepXdrWriteEventEUP@plt>
push   %rax
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    0xe36(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c" StdHepXdrWrite: don't know what to do with record type %d\0A\00"
define i32 @StdHepXdrWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %15
11: ; preds = %8, %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @StdHepXdrWriteEvent(i32 %12, i32 %13)
store i32 %14, i32* %5
br label %57
15: ; preds = %8
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 4
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 5
br i1 %20, label %21, label %25
21: ; preds = %18, %15
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 @StdHepXdrWriteEventLH(i32 %22, i32 %23)
store i32 %24, i32* %5
br label %56
25: ; preds = %18
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 11
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i32 @StdHepXdrWriteEventEUP(i32 %29, i32 %30)
store i32 %31, i32* %5
br label %55
32: ; preds = %25
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 12
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = call i32 @StdHepXdrWriteEventRUP(i32 %36, i32 %37)
store i32 %38, i32* %5
br label %54
39: ; preds = %32
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 100
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 200
br i1 %44, label %45, label %49
45: ; preds = %42, %39
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = call i32 @StdHepXdrWriteCM(i32 %46, i32 %47)
store i32 %48, i32* %5
br label %53
49: ; preds = %42
%50 = load i32, i32* @stderr
%51 = load i32, i32* %3
%52 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %49, %45
br label %54
54: ; preds = %53, %35
br label %55
55: ; preds = %54, %28
br label %56
56: ; preds = %55, %21
br label %57
57: ; preds = %56, %11
%58 = load i32, i32* %5
ret i32 %58
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c" StdHepXdrWrite: don't know what to do with record type %d\0A\00"
define i32 @StdHepXdrWrite(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @StdHepXdrWriteEvent(i32 %0, i32 %1)
br label %22
7: ; preds = %2
%8 = and i32 %0, -2
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @StdHepXdrWriteEventLH(i32 %0, i32 %1)
br label %22
12: ; preds = %7
switch i32 %0, label %19 [
i32 11, label %13
i32 12, label %15
i32 200, label %17
i32 100, label %17
]
13: ; preds = %12
%14 = tail call i32 @StdHepXdrWriteEventEUP(i32 11, i32 %1)
br label %22
15: ; preds = %12
%16 = tail call i32 @StdHepXdrWriteEventRUP(i32 12, i32 %1)
br label %22
17: ; preds = %12, %12
%18 = tail call i32 @StdHepXdrWriteCM(i32 %0, i32 %1)
br label %22
19: ; preds = %12
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %22
22: ; preds = %10, %15, %19, %17, %13, %5
%23 = phi i32 [ %6, %5 ], [ %11, %10 ], [ %14, %13 ], [ %16, %15 ], [ %18, %17 ], [ 0, %19 ]
ret i32 %23
}