#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*/ decrementaStack(int);
int /*<<< orphan*/ geraInstrucao(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, char *);
void geraOperacao(int comp) {
  decrementaStack(1);
  switch (comp) {
  case 3007:
    geraInstrucao(0, 2002, 0, 0, "");
    break;
  case 3009:
    geraInstrucao(0, 2003, 0, 0, "");
    break;
  case 3008:
    geraInstrucao(0, 2000, 0, 0, "");
    break;
  case 3006:
    geraInstrucao(0, 2001, 0, 0, "");
    break;
  }
}


x86 assembly (clang, -O0):
<geraOperacao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <decrementaStack@plt>
mov    -0x4(%rbp),%eax
add    $0xfffff442,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11cb <geraOperacao+0xab>
mov    -0x10(%rbp),%rax
lea    0xea9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %ecx,%ecx
mov    $0x7d2,%esi
lea    0xea2(%rip),%r8
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <geraInstrucao@plt>
jmp    11cb <geraOperacao+0xab>
xor    %ecx,%ecx
mov    $0x7d3,%esi
lea    0xe86(%rip),%r8
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <geraInstrucao@plt>
jmp    11cb <geraOperacao+0xab>
xor    %ecx,%ecx
mov    $0x7d0,%esi
lea    0xe6a(%rip),%r8
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <geraInstrucao@plt>
jmp    11cb <geraOperacao+0xab>
xor    %ecx,%ecx
mov    $0x7d1,%esi
lea    0xe4e(%rip),%r8
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <geraInstrucao@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geraOperacao>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <decrementaStack@plt>
add    $0xfffff442,%ebx
cmp    $0x3,%ebx
ja     1158 <geraOperacao+0x38>
movslq %ebx,%rax
lea    0xec2(%rip),%rcx
mov    (%rcx,%rax,4),%esi
lea    0xeb4(%rip),%r8
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <geraInstrucao@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @geraOperacao(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @decrementaStack(i32 1)
%4 = load i32, i32* %2
switch i32 %4, label %13 [
i32 3007, label %5
i32 3009, label %7
i32 3008, label %9
i32 3006, label %11
]
5: ; preds = %1
%6 = call i32 @geraInstrucao(i32 0, i32 2002, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = call i32 @geraInstrucao(i32 0, i32 2003, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %13
9: ; preds = %1
%10 = call i32 @geraInstrucao(i32 0, i32 2000, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 @geraInstrucao(i32 0, i32 2001, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %1, %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@switch.table.geraOperacao = [4 x i32] [i32 2001, i32 2002, i32 2000, i32 2003]
define void @geraOperacao(i32 %0) {
%2 = tail call i32 @decrementaStack(i32 1)
%3 = add i32 %0, -3006
%4 = icmp ult i32 %3, 4
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.geraOperacao, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @geraInstrucao(i32 0, i32 %8, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %1, %5
ret void
}