#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*/ lruCacheFree();
int lruCacheGet(int);
int /*<<< orphan*/ lruCacheInit(int);
int /*<<< orphan*/ lruCacheSet(int, int);
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int i;
  lruCacheInit(3);
  for (i = 0; i < 5; i++) {
    lruCacheSet(i, i + 1);
    printf("%d\n", lruCacheGet(i));
  }
  printf("\n");
  for (i = 0; i < 5; i++) {
    printf("%d\n", lruCacheGet(i));
  }
  lruCacheFree();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1050 <lruCacheInit@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    11a7 <main+0x57>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0x1,%esi
call   1070 <lruCacheSet@plt>
mov    -0x4(%rbp),%edi
call   1040 <lruCacheGet@plt>
mov    %eax,%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <main+0x19>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    11ec <main+0x9c>
mov    -0x4(%rbp),%edi
call   1040 <lruCacheGet@plt>
mov    %eax,%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <main+0x6c>
mov    $0x0,%al
call   1060 <lruCacheFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1060 <lruCacheInit@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1080 <lruCacheSet@plt>
xor    %edi,%edi
call   1050 <lruCacheGet@plt>
lea    0xe7b(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1080 <lruCacheSet@plt>
mov    $0x1,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1080 <lruCacheSet@plt>
mov    $0x2,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1080 <lruCacheSet@plt>
mov    $0x3,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4,%edi
mov    $0x5,%esi
call   1080 <lruCacheSet@plt>
mov    $0x4,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <lruCacheGet@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <lruCacheFree@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @lruCacheInit(i32 3)
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
%10 = call i32 @lruCacheSet(i32 %7, i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @lruCacheGet(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %6
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %3
17: ; preds = %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %19
19: ; preds = %26, %17
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 5
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = load i32, i32* %1
%24 = call i32 @lruCacheGet(i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %22
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %19
29: ; preds = %19
%30 = call i32 (...) @lruCacheFree()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @lruCacheInit(i32 3)
%2 = tail call i32 @lruCacheSet(i32 0, i32 1)
%3 = tail call i32 @lruCacheGet(i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @lruCacheSet(i32 1, i32 2)
%6 = tail call i32 @lruCacheGet(i32 1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @lruCacheSet(i32 2, i32 3)
%9 = tail call i32 @lruCacheGet(i32 2)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 @lruCacheSet(i32 3, i32 4)
%12 = tail call i32 @lruCacheGet(i32 3)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = tail call i32 @lruCacheSet(i32 4, i32 5)
%15 = tail call i32 @lruCacheGet(i32 4)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @lruCacheGet(i32 0)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = tail call i32 @lruCacheGet(i32 1)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = tail call i32 @lruCacheGet(i32 2)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = tail call i32 @lruCacheGet(i32 3)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = tail call i32 @lruCacheGet(i32 4)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = tail call i32 (...) @lruCacheFree()
ret void
}