#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 elif_group(int);
int /*<<< orphan*/ get_lexeme(int);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int elif_groups(int skip) {
  int cond_res;
  cond_res = elif_group(skip);
  while ((strcmp((get_lexeme(1)), ("#")) == 0) &&
         (strcmp((get_lexeme(2)), ("elif")) == 0))
    if (elif_group(skip || cond_res))
      cond_res = 1;
  return cond_res;
}


x86 assembly (clang, -O0):
<elif_groups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <elif_group@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <get_lexeme@plt>
mov    %eax,%edi
lea    0xea7(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1192 <elif_groups+0x62>
mov    $0x2,%edi
call   1050 <get_lexeme@plt>
mov    %eax,%edi
lea    0xe7f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    11a2 <elif_groups+0x72>
jmp    11dd <elif_groups+0xad>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jne    11bb <elif_groups+0x8b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <elif_group@plt>
cmp    $0x0,%eax
je     11d8 <elif_groups+0xa8>
movl   $0x1,-0x8(%rbp)
jmp    1146 <elif_groups+0x16>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elif_groups>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <elif_group@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <get_lexeme@plt>
lea    0xeaf(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
test   %rax,%rax
je     116a <elif_groups+0x3a>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe91(%rip),%r14
lea    0xe88(%rip),%r15
jmp    1199 <elif_groups+0x69>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <get_lexeme@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    115d <elif_groups+0x2d>
mov    $0x2,%edi
call   1050 <get_lexeme@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    115d <elif_groups+0x2d>
xor    %edi,%edi
mov    %ebp,%eax
or     %ebx,%eax
setne  %dil
call   1040 <elif_group@plt>
test   %eax,%eax
je     1180 <elif_groups+0x50>
mov    $0x1,%ebx
jmp    1180 <elif_groups+0x50>

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
@.str.1 = [5 x i8] c"elif\00"
define i32 @elif_groups(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @elif_group(i32 %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %28, %1
%7 = call i32 @get_lexeme(i32 1)
%8 = call i64 @strcmp(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = call i32 @get_lexeme(i32 2)
%12 = call i64 @strcmp(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br i1 %15, label %16, label %29
16: ; preds = %14
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
br label %22
22: ; preds = %19, %16
%23 = phi i1 [ true, %16 ], [ %21, %19 ]
%24 = zext i1 %23 to i32
%25 = call i32 @elif_group(i32 %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 1, i32* %3
br label %28
28: ; preds = %27, %22
br label %6
29: ; preds = %14
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
@.str.1 = [5 x i8] c"elif\00"
define i32 @elif_groups(i32 %0) {
%2 = tail call i32 @elif_group(i32 %0)
%3 = tail call i32 @get_lexeme(i32 1)
%4 = tail call i64 @strcmp(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %23
6: ; preds = %1
%7 = icmp ne i32 %0, 0
br label %8
8: ; preds = %6, %13
%9 = phi i32 [ %2, %6 ], [ %19, %13 ]
%10 = tail call i32 @get_lexeme(i32 2)
%11 = tail call i64 @strcmp(i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = icmp ne i32 %9, 0
%15 = select i1 %7, i1 true, i1 %14
%16 = zext i1 %15 to i32
%17 = tail call i32 @elif_group(i32 %16)
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i32 %9, i32 1
%20 = tail call i32 @get_lexeme(i32 1)
%21 = tail call i64 @strcmp(i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %8, label %23
23: ; preds = %8, %13, %1
%24 = phi i32 [ %2, %1 ], [ %19, %13 ], [ %9, %8 ]
ret i32 %24
}