#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 */
scalar_t__ strcmp(char *, char *);
int lex_multiple_anchor_check_key(char **key_tbl, unsigned sz) {
  unsigned i, j;
  if (sz < 1) {
    return (0);
  }
  for (i = 0; i < sz; i++) {
    for (j = i + 1; j < sz; j++) {
      if (strcmp(key_tbl[i], key_tbl[j]) == 0) {
        return (1);
      }
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<lex_multiple_anchor_check_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jae    1135 <lex_multiple_anchor_check_key+0x25>
movl   $0x0,-0x4(%rbp)
jmp    11bb <lex_multiple_anchor_check_key+0xab>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11b4 <lex_multiple_anchor_check_key+0xa4>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11a1 <lex_multiple_anchor_check_key+0x91>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    118e <lex_multiple_anchor_check_key+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11bb <lex_multiple_anchor_check_key+0xab>
jmp    1193 <lex_multiple_anchor_check_key+0x83>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <lex_multiple_anchor_check_key+0x41>
jmp    11a6 <lex_multiple_anchor_check_key+0x96>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <lex_multiple_anchor_check_key+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lex_multiple_anchor_check_key>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1194 <lex_multiple_anchor_check_key+0x84>
mov    %rdi,%r15
mov    %esi,%eax
xor    %r13d,%r13d
mov    %rax,%r12
mov    %rdi,%rbx
mov    %rax,(%rsp)
jmp    1151 <lex_multiple_anchor_check_key+0x41>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x8,%rbx
add    $0xffffffffffffffff,%r12
mov    (%rsp),%rax
cmp    %rax,%r13
je     1194 <lex_multiple_anchor_check_key+0x84>
mov    %r13,%rbp
add    $0x1,%r13
cmp    %rax,%r13
jae    1140 <lex_multiple_anchor_check_key+0x30>
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbp,8),%rdi
mov    (%rbx,%r14,8),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     118d <lex_multiple_anchor_check_key+0x7d>
add    $0x1,%r14
cmp    %r14d,%r12d
jne    1170 <lex_multiple_anchor_check_key+0x60>
jmp    1140 <lex_multiple_anchor_check_key+0x30>
mov    $0x1,%eax
jmp    1196 <lex_multiple_anchor_check_key+0x86>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lex_multiple_anchor_check_key(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = icmp ult i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %46
11: ; preds = %2
store i32 0, i32* %6
br label %12
12: ; preds = %42, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = icmp ult i32 %13, %14
br i1 %15, label %16, label %45
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add i32 %17, 1
store i32 %18, i32* %7
br label %19
19: ; preds = %38, %16
%20 = load i32, i32* %7
%21 = load i32, i32* %5
%22 = icmp ult i32 %20, %21
br i1 %22, label %23, label %41
23: ; preds = %19
%24 = load i8**, i8*** %4
%25 = load i32, i32* %6
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = load i8**, i8*** %4
%30 = load i32, i32* %7
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %28, i8* %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %23
store i32 1, i32* %3
br label %46
37: ; preds = %23
br label %38
38: ; preds = %37
%39 = load i32, i32* %7
%40 = add i32 %39, 1
store i32 %40, i32* %7
br label %19
41: ; preds = %19
br label %42
42: ; preds = %41
%43 = load i32, i32* %6
%44 = add i32 %43, 1
store i32 %44, i32* %6
br label %12
45: ; preds = %12
store i32 0, i32* %3
br label %46
46: ; preds = %45, %36, %10
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
define i32 @lex_multiple_anchor_check_key(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %27, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %9
6: ; preds = %16, %9
%7 = add nuw nsw i64 %11, 1
%8 = icmp eq i64 %12, %5
br i1 %8, label %27, label %9
9: ; preds = %4, %6
%10 = phi i64 [ 0, %4 ], [ %12, %6 ]
%11 = phi i64 [ 1, %4 ], [ %7, %6 ]
%12 = add nuw nsw i64 %10, 1
%13 = icmp ult i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %0, i64 %10
br label %19
16: ; preds = %19
%17 = trunc i64 %26 to i32
%18 = icmp eq i32 %17, %1
br i1 %18, label %6, label %19
19: ; preds = %14, %16
%20 = phi i64 [ %11, %14 ], [ %26, %16 ]
%21 = load i8*, i8** %15
%22 = getelementptr inbounds i8*, i8** %0, i64 %20
%23 = load i8*, i8** %22
%24 = tail call i64 @strcmp(i8* %21, i8* %23)
%25 = icmp eq i64 %24, 0
%26 = add nuw nsw i64 %20, 1
br i1 %25, label %27, label %16
27: ; preds = %6, %19, %2
%28 = phi i32 [ 0, %2 ], [ 1, %19 ], [ 0, %6 ]
ret i32 %28
}