#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ writeSyntaxElement_Level_VLC1(int);
int /*<<< orphan*/ writeSyntaxElement_Level_VLCN(int, int);
int main(int argc, char *argv[]) {
  if (argc % 2 != 1) {
    printf("usage: %s level1 vlcnum1 level2 vlcnum2 ...\n", argv[0]);
    return 1;
  }
  for (int i = 1; i < argc; i += 2) {
    int level = atoi(argv[i]);
    int vlcnum = atoi(argv[i + 1]);
    printf("level %d  vlcum %d  -->  ", level, vlcnum);
    if (vlcnum == 0)
      writeSyntaxElement_Level_VLC1(level);
    else
      writeSyntaxElement_Level_VLCN(level, vlcnum);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     118b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    121b <main+0xdb>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1214 <main+0xd4>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    11f6 <main+0xb6>
mov    -0x18(%rbp),%edi
call   1050 <writeSyntaxElement_Level_VLC1@plt>
jmp    1201 <main+0xc1>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <writeSyntaxElement_Level_VLCN@plt>
jmp    1206 <main+0xc6>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1192 <main+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
cmp    $0x1,%ecx
jne    11c5 <main+0x85>
xor    %eax,%eax
cmp    $0x2,%edi
jl     11df <main+0x9f>
mov    %edi,%r12d
mov    $0x1,%ebp
lea    0xeb6(%rip),%r14
jmp    1190 <main+0x50>
nopl   0x0(%rax)
mov    %ebx,%esi
call   1040 <writeSyntaxElement_Level_VLCN@plt>
add    $0x2,%rbp
cmp    %r12,%rbp
jae    11dd <main+0x9d>
mov    (%r15,%rbp,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%r13d
mov    0x8(%r15,%rbp,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %r13d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13d,%edi
test   %ebx,%ebx
jne    1180 <main+0x40>
call   1050 <writeSyntaxElement_Level_VLC1@plt>
jmp    1187 <main+0x47>
mov    (%r15),%rsi
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
jmp    11df <main+0x9f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"usage: %s level1 vlcnum1 level2 vlcnum2 ...\0A\00"
@.str.1 = [26 x i8] c"level %d vlcum %d --> \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 1, i32* %3
br label %53
17: ; preds = %2
store i32 1, i32* %6
br label %18
18: ; preds = %49, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %52
22: ; preds = %18
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %7
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %29, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %8
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37)
%39 = load i32, i32* %8
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %22
%42 = load i32, i32* %7
%43 = call i32 @writeSyntaxElement_Level_VLC1(i32 %42)
br label %48
44: ; preds = %22
%45 = load i32, i32* %7
%46 = load i32, i32* %8
%47 = call i32 @writeSyntaxElement_Level_VLCN(i32 %45, i32 %46)
br label %48
48: ; preds = %44, %41
br label %49
49: ; preds = %48
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 2
store i32 %51, i32* %6
br label %18
52: ; preds = %18
store i32 0, i32* %3
br label %53
53: ; preds = %52, %12
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@.str = [45 x i8] c"usage: %s level1 vlcnum1 level2 vlcnum2 ...\0A\00"
@.str.1 = [26 x i8] c"level %d vlcum %d --> \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = srem i32 %0, 2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %30
7: ; preds = %5
%8 = zext i32 %0 to i64
br label %12
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %30
12: ; preds = %7, %27
%13 = phi i64 [ 1, %7 ], [ %28, %27 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = add nuw nsw i64 %13, 1
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %20)
%22 = icmp eq i32 %20, 0
br i1 %22, label %23, label %25
23: ; preds = %12
%24 = tail call i32 @writeSyntaxElement_Level_VLC1(i32 %16)
br label %27
25: ; preds = %12
%26 = tail call i32 @writeSyntaxElement_Level_VLCN(i32 %16, i32 %20)
br label %27
27: ; preds = %25, %23
%28 = add nuw nsw i64 %13, 2
%29 = icmp ult i64 %28, %8
br i1 %29, label %12, label %30
30: ; preds = %27, %5, %9
%31 = phi i32 [ 1, %9 ], [ 0, %5 ], [ 0, %27 ]
ret i32 %31
}