#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_groups(int);
int /*<<< orphan*/ else_group(int);
int /*<<< orphan*/ endif_line();
int /*<<< orphan*/ get_lexeme(int);
int if_group(int);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
void if_section(int skip) {
  int if_cond, elif_cond = 0;
  if_cond = if_group(skip);
  if ((strcmp((get_lexeme(1)), ("#")) == 0) &&
      (strcmp((get_lexeme(2)), ("elif")) == 0))
    elif_cond = elif_groups(skip || if_cond);
  if ((strcmp((get_lexeme(1)), ("#")) == 0) &&
      (strcmp((get_lexeme(2)), ("else")) == 0))
    else_group(skip || if_cond || elif_cond);
  endif_line();
}


x86 assembly (clang, -O0):
<if_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <if_group@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1080 <get_lexeme@plt>
mov    %eax,%edi
lea    0xe70(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ea <if_section+0x8a>
mov    $0x2,%edi
call   1080 <get_lexeme@plt>
mov    %eax,%edi
lea    0xe50(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ea <if_section+0x8a>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jne    11da <if_section+0x7a>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <elif_groups@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1080 <get_lexeme@plt>
mov    %eax,%edi
lea    0xe03(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1263 <if_section+0x103>
mov    $0x2,%edi
call   1080 <get_lexeme@plt>
mov    %eax,%edi
lea    0xde8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1263 <if_section+0x103>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xe(%rbp)
jne    1256 <if_section+0xf6>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jne    1256 <if_section+0xf6>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <else_group@plt>
mov    $0x0,%al
call   1030 <endif_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_section>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1040 <if_group@plt>
mov    %eax,%r14d
mov    $0x1,%edi
call   1080 <get_lexeme@plt>
lea    0xe81(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
jne    11bc <if_section+0x5c>
mov    $0x2,%edi
call   1080 <get_lexeme@plt>
lea    0xe64(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11bc <if_section+0x5c>
xor    %edi,%edi
mov    %ebx,%eax
or     %r14d,%eax
setne  %dil
call   1060 <elif_groups@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1080 <get_lexeme@plt>
lea    0xe33(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1206 <if_section+0xa6>
mov    $0x2,%edi
call   1080 <get_lexeme@plt>
lea    0xe1d(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1206 <if_section+0xa6>
or     %r14d,%ebx
xor    %edi,%edi
or     %ebp,%ebx
setne  %dil
call   1070 <else_group@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <endif_line@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
@.str.1 = [5 x i8] c"elif\00"
@.str.2 = [5 x i8] c"else\00"
define void @if_section(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @if_group(i32 %5)
store i32 %6, i32* %3
%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 %24
10: ; preds = %1
%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 i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ true, %14 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
%23 = call i32 @elif_groups(i32 %22)
store i32 %23, i32* %4
br label %24
24: ; preds = %20, %10, %1
%25 = call i32 @get_lexeme(i32 1)
%26 = call i64 @strcmp(i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %45
28: ; preds = %24
%29 = call i32 @get_lexeme(i32 2)
%30 = call i64 @strcmp(i32 %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %45
32: ; preds = %28
%33 = load i32, i32* %2
%34 = icmp ne i32 %33, 0
br i1 %34, label %41, label %35
35: ; preds = %32
%36 = load i32, i32* %3
%37 = icmp ne i32 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = load i32, i32* %4
%40 = icmp ne i32 %39, 0
br label %41
41: ; preds = %38, %35, %32
%42 = phi i1 [ true, %35 ], [ true, %32 ], [ %40, %38 ]
%43 = zext i1 %42 to i32
%44 = call i32 @else_group(i32 %43)
br label %45
45: ; preds = %41, %28, %24
%46 = call i32 (...) @endif_line()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
@.str.1 = [5 x i8] c"elif\00"
@.str.2 = [5 x i8] c"else\00"
define void @if_section(i32 %0) {
%2 = tail call i32 @if_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 %16
6: ; preds = %1
%7 = tail call i32 @get_lexeme(i32 2)
%8 = tail call i64 @strcmp(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = icmp ne i32 %0, 0
%12 = icmp ne i32 %2, 0
%13 = select i1 %11, i1 true, i1 %12
%14 = zext i1 %13 to i32
%15 = tail call i32 @elif_groups(i32 %14)
br label %16
16: ; preds = %10, %6, %1
%17 = phi i32 [ %15, %10 ], [ 0, %6 ], [ 0, %1 ]
%18 = tail call i32 @get_lexeme(i32 1)
%19 = tail call i64 @strcmp(i32 %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %16
%22 = tail call i32 @get_lexeme(i32 2)
%23 = tail call i64 @strcmp(i32 %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = icmp ne i32 %0, 0
%27 = icmp ne i32 %2, 0
%28 = select i1 %26, i1 true, i1 %27
%29 = icmp ne i32 %17, 0
%30 = select i1 %28, i1 true, i1 %29
%31 = zext i1 %30 to i32
%32 = tail call i32 @else_group(i32 %31)
br label %33
33: ; preds = %25, %21, %16
%34 = tail call i32 (...) @endif_line()
ret void
}