#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 */
struct htmlTag {
  int dummy;
};
struct htmlPage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ checkNest(struct htmlPage *, char *, struct htmlTag *,
                             struct htmlTag *);
void validateNestingTags(struct htmlPage *page, struct htmlTag *startTag,
                         struct htmlTag *endTag, char *nesters[],
                         int nesterCount) {
  int i;
  for (i = 0; i < nesterCount; ++i)
    checkNest(page, nesters[i], startTag, endTag);
}


x86 assembly (clang, -O0):
<validateNestingTags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    116a <validateNestingTags+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <checkNest@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1133 <validateNestingTags+0x23>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validateNestingTags>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %r8d,%r8d
jle    115b <validateNestingTags+0x4b>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
mov    %r8d,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rsi
mov    %r13,%rdi
mov    %r12,%rdx
mov    %r15,%rcx
call   1030 <checkNest@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1140 <validateNestingTags+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.htmlPage = type { i32 }
%struct.htmlTag = type { i32 }
define void @validateNestingTags(%struct.htmlPage* %0, %struct.htmlTag* %1, %struct.htmlTag* %2, i8** %3, i32 %4) {
%6 = alloca %struct.htmlPage*
%7 = alloca %struct.htmlTag*
%8 = alloca %struct.htmlTag*
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32
store %struct.htmlPage* %0, %struct.htmlPage** %6
store %struct.htmlTag* %1, %struct.htmlTag** %7
store %struct.htmlTag* %2, %struct.htmlTag** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
store i32 0, i32* %11
br label %12
12: ; preds = %26, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %10
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %29
16: ; preds = %12
%17 = load %struct.htmlPage*, %struct.htmlPage** %6
%18 = load i8**, i8*** %9
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = load %struct.htmlTag*, %struct.htmlTag** %7
%24 = load %struct.htmlTag*, %struct.htmlTag** %8
%25 = call i32 @checkNest(%struct.htmlPage* %17, i8* %22, %struct.htmlTag* %23, %struct.htmlTag* %24)
br label %26
26: ; preds = %16
%27 = load i32, i32* %11
%28 = add nsw i32 %27, 1
store i32 %28, i32* %11
br label %12
29: ; preds = %12
ret void
}

LLVM IR (-O2):
%struct.htmlPage = type { i32 }
%struct.htmlTag = type { i32 }
define void @validateNestingTags(%struct.htmlPage* %0, %struct.htmlTag* %1, %struct.htmlTag* %2, i8** nocapture %3, i32 %4) {
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %16
7: ; preds = %5
%8 = zext i32 %4 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds i8*, i8** %3, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @checkNest(%struct.htmlPage* %0, i8* %12, %struct.htmlTag* %1, %struct.htmlTag* %2)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %5
ret void
}