#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*/ expecti(int, int);
void test() {
  enum { A, B, C };
  enum { D, E, F } value;
  enum { I = 100, J, K };
  expecti(A, 0);
  expecti(B, 1);
  expecti(C, 2);
  expecti(D, 0);
  expecti(E, 1);
  expecti(F, 2);
  value = A;
  expecti(value, D);
  value = B;
  expecti(value, E);
  value = C;
  expecti(value, F);
  expecti(I, 100);
  expecti(J, 101);
  expecti(K, 102);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <expecti@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <expecti@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <expecti@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
mov    $0x65,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
mov    $0x66,%esi
mov    %esi,%edi
call   1030 <expecti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <expecti@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <expecti@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <expecti@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <expecti@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <expecti@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <expecti@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <expecti@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <expecti@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <expecti@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   1030 <expecti@plt>
mov    $0x65,%edi
mov    $0x65,%esi
call   1030 <expecti@plt>
mov    $0x66,%edi
mov    $0x66,%esi
pop    %rax
jmp    1030 <expecti@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = call i32 @expecti(i32 0, i32 0)
%3 = call i32 @expecti(i32 1, i32 1)
%4 = call i32 @expecti(i32 2, i32 2)
%5 = call i32 @expecti(i32 0, i32 0)
%6 = call i32 @expecti(i32 1, i32 1)
%7 = call i32 @expecti(i32 2, i32 2)
store i32 0, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @expecti(i32 %8, i32 0)
store i32 1, i32* %1
%10 = load i32, i32* %1
%11 = call i32 @expecti(i32 %10, i32 1)
store i32 2, i32* %1
%12 = load i32, i32* %1
%13 = call i32 @expecti(i32 %12, i32 2)
%14 = call i32 @expecti(i32 100, i32 100)
%15 = call i32 @expecti(i32 101, i32 101)
%16 = call i32 @expecti(i32 102, i32 102)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @expecti(i32 0, i32 0)
%2 = tail call i32 @expecti(i32 1, i32 1)
%3 = tail call i32 @expecti(i32 2, i32 2)
%4 = tail call i32 @expecti(i32 0, i32 0)
%5 = tail call i32 @expecti(i32 1, i32 1)
%6 = tail call i32 @expecti(i32 2, i32 2)
%7 = tail call i32 @expecti(i32 0, i32 0)
%8 = tail call i32 @expecti(i32 1, i32 1)
%9 = tail call i32 @expecti(i32 2, i32 2)
%10 = tail call i32 @expecti(i32 100, i32 100)
%11 = tail call i32 @expecti(i32 101, i32 101)
%12 = tail call i32 @expecti(i32 102, i32 102)
ret void
}