#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*/ e_decr(int);
int /*<<< orphan*/ e_incr(int);
int /*<<< orphan*/ e_subri(int, int);
int /*<<< orphan*/ e_xxxri(int, int, int /*<<< orphan*/, int);
void e_addri(int r, int i) {
  if (i == 1)
    e_incr(r);
  else if (i == -1)
    e_decr(r);
  else if (i == 128)
    e_subri(r, -i);
  else
    e_xxxri(r, i, 0, 0x05);
}


x86 assembly (clang, -O0):
<e_addri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1165 <e_addri+0x25>
mov    -0x4(%rbp),%edi
call   1040 <e_incr@plt>
jmp    11b7 <e_addri+0x77>
cmpl   $0xffffffff,-0x8(%rbp)
jne    117c <e_addri+0x3c>
mov    -0x4(%rbp),%edi
call   1060 <e_decr@plt>
jmp    11b2 <e_addri+0x72>
cmpl   $0x80,-0x8(%rbp)
jne    119b <e_addri+0x5b>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
call   1030 <e_subri@plt>
jmp    11ad <e_addri+0x6d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x5,%ecx
call   1050 <e_xxxri@plt>
jmp    11b2 <e_addri+0x72>
jmp    11b7 <e_addri+0x77>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_addri>:
cmp    $0xffffffff,%esi
je     1157 <e_addri+0x17>
cmp    $0x80,%esi
je     115c <e_addri+0x1c>
cmp    $0x1,%esi
jne    1166 <e_addri+0x26>
jmp    1040 <e_incr@plt>
jmp    1060 <e_decr@plt>
mov    $0xffffff80,%esi
jmp    1030 <e_subri@plt>
xor    %edx,%edx
mov    $0x5,%ecx
jmp    1050 <e_xxxri@plt>

LLVM IR (-O0):
define void @e_addri(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @e_incr(i32 %8)
br label %30
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = call i32 @e_decr(i32 %14)
br label %29
16: ; preds = %10
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 128
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = sub nsw i32 0, %21
%23 = call i32 @e_subri(i32 %20, i32 %22)
br label %28
24: ; preds = %16
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = call i32 @e_xxxri(i32 %25, i32 %26, i32 0, i32 5)
br label %28
28: ; preds = %24, %19
br label %29
29: ; preds = %28, %13
br label %30
30: ; preds = %29, %7
ret void
}

LLVM IR (-O2):
define void @e_addri(i32 %0, i32 %1) {
switch i32 %1, label %9 [
i32 1, label %3
i32 -1, label %5
i32 128, label %7
]
3: ; preds = %2
%4 = tail call i32 @e_incr(i32 %0)
br label %11
5: ; preds = %2
%6 = tail call i32 @e_decr(i32 %0)
br label %11
7: ; preds = %2
%8 = tail call i32 @e_subri(i32 %0, i32 -128)
br label %11
9: ; preds = %2
%10 = tail call i32 @e_xxxri(i32 %0, i32 %1, i32 0, i32 5)
br label %11
11: ; preds = %5, %9, %7, %3
ret void
}