#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 next_token(char **);
int /*<<< orphan*/ printf(char *);
void meta_event(char **a) {
  printf("meta_event\n");
  switch (next_token(a)) {
  case 0x00:
    for (int i = 0; i < 3; i++)
      next_token(a);
    break;
  default:
    for (int i = 0; i < 2; i++)
      next_token(a);
  }
}


x86 assembly (clang, -O0):
<meta_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <next_token@plt>
test   %eax,%eax
jne    117b <meta_event+0x5b>
jmp    114e <meta_event+0x2e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1176 <meta_event+0x56>
mov    -0x8(%rbp),%rdi
call   1040 <next_token@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <meta_event+0x35>
jmp    11a8 <meta_event+0x88>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    11a3 <meta_event+0x83>
mov    -0x8(%rbp),%rdi
call   1040 <next_token@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1182 <meta_event+0x62>
jmp    11a8 <meta_event+0x88>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meta_event>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <next_token@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <next_token@plt>
mov    %rbx,%rdi
call   1040 <next_token@plt>
test   %ebp,%ebp
je     1157 <meta_event+0x37>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <next_token@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"meta_event\0A\00"
define void @meta_event(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8**, i8*** %2
%7 = call i32 @next_token(i8** %6)
switch i32 %7, label %19 [
i32 0, label %8
]
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i8**, i8*** %2
%14 = call i32 @next_token(i8** %13)
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %9
18: ; preds = %9
br label %30
19: ; preds = %1
store i32 0, i32* %4
br label %20
20: ; preds = %26, %19
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 2
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i8**, i8*** %2
%25 = call i32 @next_token(i8** %24)
br label %26
26: ; preds = %23
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %20
29: ; preds = %20
br label %30
30: ; preds = %29, %18
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"meta_event\00"
define void @meta_event(i8** %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @next_token(i8** %0)
%4 = icmp eq i32 %3, 0
%5 = tail call i32 @next_token(i8** %0)
%6 = tail call i32 @next_token(i8** %0)
br i1 %4, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @next_token(i8** %0)
br label %9
9: ; preds = %1, %7
ret void
}