#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 /*<<< orphan*/ exit(int);
int LHCOtoPDG(int lhcopid, double ntrack, double btag) {
  switch (lhcopid) {
  case 0:
    return 22;
  case 1:
    if (ntrack > 0)
      return -11;
    else
      return 11;
  case 2:
    if (ntrack > 0)
      return -13;
    else
      return 13;
  case 3:
    if (ntrack > 0)
      return -15;
    else
      return 15;
  case 4:
    if (btag == 2)
      return 55;
    else if (btag == 1)
      return -55;
    else
      return 211234;
  case 5:
    return 121416;
  default:
    exit(1);
  }
}


x86 assembly (clang, -O0):
<LHCOtoPDG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x5,%rax
ja     123e <LHCOtoPDG+0x12e>
mov    -0x20(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x16,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1174 <LHCOtoPDG+0x64>
movl   $0xfffffff5,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movl   $0xb,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    119e <LHCOtoPDG+0x8e>
movl   $0xfffffff3,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movl   $0xd,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11c8 <LHCOtoPDG+0xb8>
movl   $0xfffffff1,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movl   $0xf,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movsd  -0x18(%rbp),%xmm0
movsd  0xe1f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11fd <LHCOtoPDG+0xed>
jp     11fd <LHCOtoPDG+0xed>
movl   $0x37,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movsd  -0x18(%rbp),%xmm0
movsd  0xdfe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1226 <LHCOtoPDG+0x116>
jp     1226 <LHCOtoPDG+0x116>
movl   $0xffffffc9,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movl   $0x33922,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
movl   $0x1da48,-0x4(%rbp)
jmp    1248 <LHCOtoPDG+0x138>
mov    $0x1,%edi
call   1030 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LHCOtoPDG>:
push   %rax
cmp    $0x5,%edi
ja     11a2 <LHCOtoPDG+0x92>
mov    $0x16,%eax
mov    %edi,%ecx
lea    0xee8(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    $0xfffffff5,%ecx
mov    $0xb,%eax
jmp    116b <LHCOtoPDG+0x5b>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    $0xfffffff3,%ecx
mov    $0xd,%eax
jmp    116b <LHCOtoPDG+0x5b>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    $0xfffffff1,%ecx
mov    $0xf,%eax
cmova  %ecx,%eax
pop    %rcx
ret
mov    $0x37,%eax
ucomisd 0xe83(%rip),%xmm1
jne    1181 <LHCOtoPDG+0x71>
jnp    116e <LHCOtoPDG+0x5e>
ucomisd 0xe7f(%rip),%xmm1
mov    $0x33922,%ecx
mov    $0xffffffc9,%eax
cmovne %ecx,%eax
cmovp  %ecx,%eax
pop    %rcx
ret
mov    $0x1da48,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @LHCOtoPDG(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
%8 = load i32, i32* %5
switch i32 %8, label %35 [
i32 0, label %9
i32 1, label %10
i32 2, label %15
i32 3, label %20
i32 4, label %25
i32 5, label %34
]
9: ; preds = %3
store i32 22, i32* %4
br label %37
10: ; preds = %3
%11 = load double, double* %6
%12 = fcmp ogt double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 -11, i32* %4
br label %37
14: ; preds = %10
store i32 11, i32* %4
br label %37
15: ; preds = %3
%16 = load double, double* %6
%17 = fcmp ogt double %16, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 -13, i32* %4
br label %37
19: ; preds = %15
store i32 13, i32* %4
br label %37
20: ; preds = %3
%21 = load double, double* %6
%22 = fcmp ogt double %21, 0.000000e+00
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 -15, i32* %4
br label %37
24: ; preds = %20
store i32 15, i32* %4
br label %37
25: ; preds = %3
%26 = load double, double* %7
%27 = fcmp oeq double %26, 2.000000e+00
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 55, i32* %4
br label %37
29: ; preds = %25
%30 = load double, double* %7
%31 = fcmp oeq double %30, 1.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 -55, i32* %4
br label %37
33: ; preds = %29
store i32 211234, i32* %4
br label %37
34: ; preds = %3
store i32 121416, i32* %4
br label %37
35: ; preds = %3
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %34, %33, %32, %28, %24, %23, %19, %18, %14, %13, %9
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @LHCOtoPDG(i32 %0, double %1, double %2) {
switch i32 %0, label %19 [
i32 0, label %21
i32 1, label %4
i32 2, label %7
i32 3, label %10
i32 4, label %13
i32 5, label %18
]
4: ; preds = %3
%5 = fcmp ogt double %1, 0.000000e+00
%6 = select i1 %5, i32 -11, i32 11
br label %21
7: ; preds = %3
%8 = fcmp ogt double %1, 0.000000e+00
%9 = select i1 %8, i32 -13, i32 13
br label %21
10: ; preds = %3
%11 = fcmp ogt double %1, 0.000000e+00
%12 = select i1 %11, i32 -15, i32 15
br label %21
13: ; preds = %3
%14 = fcmp oeq double %2, 2.000000e+00
br i1 %14, label %21, label %15
15: ; preds = %13
%16 = fcmp oeq double %2, 1.000000e+00
%17 = select i1 %16, i32 -55, i32 211234
br label %21
18: ; preds = %3
br label %21
19: ; preds = %3
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %15, %13, %10, %7, %4, %3, %18
%22 = phi i32 [ 121416, %18 ], [ 22, %3 ], [ %6, %4 ], [ %9, %7 ], [ %12, %10 ], [ 55, %13 ], [ %17, %15 ]
ret i32 %22
}