#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 /*<<< orphan*/ clxns_iter_free(void *);
scalar_t__ clxns_iter_move_next(void *);
void *clxns_iter_new(void *);
void *hash_table(int /*<<< orphan*/);
char *ht_iterate_empty() {
  void *ht = hash_table(0);
  void *iter = clxns_iter_new(ht);
  int i = 0;
  while (clxns_iter_move_next(iter)) {
    i++;
  }
  do {
    if (!(i == 0))
      return "Incorrect empty iter count";
  } while (0);
  clxns_iter_free(iter);
  return 0;
}


x86 assembly (clang, -O0):
<ht_iterate_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1030 <hash_table@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <clxns_iter_new@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <clxns_iter_move_next@plt>
cmp    $0x0,%rax
je     1188 <ht_iterate_empty+0x48>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <ht_iterate_empty+0x27>
jmp    118d <ht_iterate_empty+0x4d>
cmpl   $0x0,-0x1c(%rbp)
je     11a7 <ht_iterate_empty+0x67>
lea    0xe62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11bd <ht_iterate_empty+0x7d>
jmp    11ac <ht_iterate_empty+0x6c>
mov    -0x18(%rbp),%rdi
call   1050 <clxns_iter_free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_iterate_empty>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <hash_table@plt>
mov    %rax,%rdi
call   1040 <clxns_iter_new@plt>
mov    %rax,%rbx
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <clxns_iter_move_next@plt>
add    $0xffffffff,%ebp
test   %rax,%rax
jne    1160 <ht_iterate_empty+0x20>
test   %ebp,%ebp
je     117d <ht_iterate_empty+0x3d>
lea    0xe85(%rip),%rax
jmp    1187 <ht_iterate_empty+0x47>
mov    %rbx,%rdi
call   1050 <clxns_iter_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Incorrect empty iter count\00"
define i8* @ht_iterate_empty() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = call i8* @hash_table(i32 0)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @clxns_iter_new(i8* %6)
store i8* %7, i8** %3
store i32 0, i32* %4
br label %8
8: ; preds = %12, %0
%9 = load i8*, i8** %3
%10 = call i64 @clxns_iter_move_next(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %8
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %16
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %1
br label %24
20: ; preds = %16
br label %21
21: ; preds = %20
%22 = load i8*, i8** %3
%23 = call i32 @clxns_iter_free(i8* %22)
store i8* null, i8** %1
br label %24
24: ; preds = %21, %19
%25 = load i8*, i8** %1
ret i8* %25
}

LLVM IR (-O2):
@.str = [27 x i8] c"Incorrect empty iter count\00"
define i8* @ht_iterate_empty() {
%1 = tail call i8* @hash_table(i32 0)
%2 = tail call i8* @clxns_iter_new(i8* %1)
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = tail call i64 @clxns_iter_move_next(i8* %2)
%6 = icmp eq i64 %5, 0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = icmp eq i32 %4, 0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @clxns_iter_free(i8* %2)
br label %12
12: ; preds = %8, %10
%13 = phi i8* [ null, %10 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), %8 ]
ret i8* %13
}