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

/* Variables and functions */
int /*<<< orphan*/ list_add_int(struct list_int **, int);
scalar_t__ list_exists_int(struct list_int *, int);
int /*<<< orphan*/ list_free(struct list_int **);
int /*<<< orphan*/ printf(char *);
int main() {
  struct list_int *list_int_pt;
  int i = 4;
  int j = 12;
  list_add_int(&list_int_pt, i);
  list_add_int(&list_int_pt, j);
  if (list_exists_int(list_int_pt, j)) {
    printf("Found\n");
  } else {
    printf("Not Found\n");
  }
  list_free(&list_int_pt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0xc,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1040 <list_add_int@plt>
mov    -0x18(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1040 <list_add_int@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1050 <list_exists_int@plt>
cmp    $0x0,%rax
je     119c <main+0x5c>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <main+0x68>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1060 <list_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <list_add_int@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <list_add_int@plt>
mov    0x8(%rsp),%rdi
mov    $0xc,%esi
call   1050 <list_exists_int@plt>
test   %rax,%rax
lea    0xe83(%rip),%rax
lea    0xe80(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <list_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.list_int = type { i32 }
@.str = [7 x i8] c"Found\0A\00"
@.str.1 = [11 x i8] c"Not Found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.list_int*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
store i32 12, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @list_add_int(%struct.list_int** %2, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @list_add_int(%struct.list_int** %2, i32 %7)
%9 = load %struct.list_int*, %struct.list_int** %2
%10 = load i32, i32* %4
%11 = call i64 @list_exists_int(%struct.list_int* %9, i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
%18 = call i32 @list_free(%struct.list_int** %2)
ret i32 0
}

LLVM IR (-O2):
%struct.list_int = type { i32 }
@str = [10 x i8] c"Not Found\00"
@str.2 = [6 x i8] c"Found\00"
define i32 @main() {
%1 = alloca %struct.list_int*
%2 = bitcast %struct.list_int** %1 to i8*
%3 = call i32 @list_add_int(%struct.list_int** %1, i32 4)
%4 = call i32 @list_add_int(%struct.list_int** %1, i32 12)
%5 = load %struct.list_int*, %struct.list_int** %1
%6 = call i64 @list_exists_int(%struct.list_int* %5, i32 12)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
%10 = call i32 @list_free(%struct.list_int** %1)
ret i32 0
}