#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 ht {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int ht_lookup(struct ht *, char *);
int /*<<< orphan*/ printf(char *, ...);
void assertLookups(struct ht *table) {
  printf("Checking if a node with key %s exists in the table...", "key1");
  assert(ht_lookup(table, "key1"));
  printf("OK\nChecking if node with key %s exists in the table...", "key2");
  assert(ht_lookup(table, "key2"));
  printf("OK\nChecking if node with key %s exists in the table...", "key3");
  assert(ht_lookup(table, "key3"));
  printf("OK\nChecking node with key %s isn't in the table...", "meow");
  assert(!ht_lookup(table, "meow"));
  printf("OK\n");
}


x86 assembly (clang, -O0):
<assertLookups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeda(%rip),%rsi
call   1030 <ht_lookup@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xecc(%rip),%rdi
lea    0xefc(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeea(%rip),%rsi
call   1030 <ht_lookup@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xea0(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <ht_lookup@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xeb5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <ht_lookup@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertLookups>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeb1(%rip),%rdi
lea    0xee0(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ht_lookup@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xec2(%rip),%r14
lea    0xef2(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <ht_lookup@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xed1(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <ht_lookup@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xeb0(%rip),%rdi
lea    0xedc(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ht_lookup@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xeb8(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ht = type { i32 }
@.str = [54 x i8] c"Checking if a node with key %s exists in the table...\00"
@.str.1 = [5 x i8] c"key1\00"
@.str.2 = [55 x i8] c"OK\0AChecking if node with key %s exists in the table...\00"
@.str.3 = [5 x i8] c"key2\00"
@.str.4 = [5 x i8] c"key3\00"
@.str.5 = [51 x i8] c"OK\0AChecking node with key %s isn't in the table...\00"
@.str.6 = [5 x i8] c"meow\00"
@.str.7 = [4 x i8] c"OK\0A\00"
define void @assertLookups(%struct.ht* %0) {
%2 = alloca %struct.ht*
store %struct.ht* %0, %struct.ht** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ht*, %struct.ht** %2
%5 = call i32 @ht_lookup(%struct.ht* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @assert(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = load %struct.ht*, %struct.ht** %2
%9 = call i32 @ht_lookup(%struct.ht* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @assert(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%12 = load %struct.ht*, %struct.ht** %2
%13 = call i32 @ht_lookup(%struct.ht* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @assert(i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%16 = load %struct.ht*, %struct.ht** %2
%17 = call i32 @ht_lookup(%struct.ht* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ht = type { i32 }
@.str = [54 x i8] c"Checking if a node with key %s exists in the table...\00"
@.str.1 = [5 x i8] c"key1\00"
@.str.2 = [55 x i8] c"OK\0AChecking if node with key %s exists in the table...\00"
@.str.3 = [5 x i8] c"key2\00"
@.str.4 = [5 x i8] c"key3\00"
@.str.5 = [51 x i8] c"OK\0AChecking node with key %s isn't in the table...\00"
@.str.6 = [5 x i8] c"meow\00"
@str = [3 x i8] c"OK\00"
define void @assertLookups(%struct.ht* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ht_lookup(%struct.ht* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @ht_lookup(%struct.ht* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @ht_lookup(%struct.ht* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @ht_lookup(%struct.ht* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}