#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 */
unsigned int next_probe(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void next_probe_test() {
  int i;
  unsigned int key1, key2;
  key1 = 0;
  for (i = 0; i < (1 << 4); i++) {
    key2 = next_probe(key1);
    printf("%2u -> %2u\n", key1, key2);
    key1 = key2;
  }
}


x86 assembly (clang, -O0):
<next_probe_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1171 <next_probe_test+0x51>
mov    -0x8(%rbp),%edi
call   1040 <next_probe@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <next_probe_test+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_probe_test>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
lea    0xecc(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <next_probe@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <next_probe@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%2u -> %2u\0A\00"
define void @next_probe_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @next_probe(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %7
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %4
17: ; preds = %4
ret void
}

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