#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 */
typedef int /*<<< orphan*/ vbuf;
typedef int /*<<< orphan*/ kbuf;

/* Variables and functions */
int /*<<< orphan*/ cheese_format_key(void const *, char *, int,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ cheese_format_value(void const *, char *, int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *);
int my_walk_fn(const void *key, const void *value, void *opaque) {
  char kbuf[256];
  char vbuf[256];
  ((opaque) = (opaque));
  cheese_format_key(key, kbuf, sizeof(kbuf), NULL);
  cheese_format_value(value, vbuf, sizeof(vbuf), NULL);
  printf("walk '%s':'%s'...\n", kbuf, vbuf);
  return 0;
}


x86 assembly (clang, -O0):
<my_walk_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rsi
mov    $0x100,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <cheese_format_key@plt>
mov    -0x10(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    $0x100,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1050 <cheese_format_value@plt>
lea    -0x120(%rbp),%rsi
lea    -0x220(%rbp),%rdx
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_walk_fn>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%rbx
lea    0x100(%rsp),%r14
mov    %r14,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1040 <cheese_format_key@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1050 <cheese_format_value@plt>
lea    0xe8e(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"walk '%s':'%s'...\0A\00"
define i32 @my_walk_fn(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
store i8* %9, i8** %6
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%12 = call i32 @cheese_format_key(i8* %10, i8* %11, i32 256, i32* null)
%13 = load i8*, i8** %5
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%15 = call i32 @cheese_format_value(i8* %13, i8* %14, i32 256, i32* null)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"walk '%s':'%s'...\0A\00"
define i32 @my_walk_fn(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i32 @cheese_format_key(i8* %0, i8* %6, i32 256, i32* null)
%9 = call i32 @cheese_format_value(i8* %1, i8* %7, i32 256, i32* null)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}