#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*/ printf(char *, char const *, ...);
void state_print_cb(int fnid, const char *key, const char *kv,
                    unsigned char val, void *arg) {
  if (fnid < 0) {
    printf("  rc_cfg (\"%s\", \"%s\");\n", key, kv);
  } else {
    printf("  rc_ccf (\"%s\", %d); // id:%d\n", key, val, fnid);
  }
}


x86 assembly (clang, -O0):
<state_print_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1151 <state_print_cb+0x41>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116a <state_print_cb+0x5a>
mov    -0x10(%rbp),%rsi
movzbl -0x19(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_print_cb>:
test   %edi,%edi
js     1129 <state_print_cb+0x19>
mov    %edi,%eax
movzbl %cl,%edx
lea    0xef8(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c" rc_cfg (\22%s\22, \22%s\22);\0A\00"
@.str.1 = [31 x i8] c" rc_ccf (\22%s\22, %d); // id:%d\0A\00"
define void @state_print_cb(i32 %0, i8* %1, i8* %2, i8 zeroext %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8 %3, i8* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %5
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
br label %23
17: ; preds = %5
%18 = load i8*, i8** %7
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = load i32, i32* %6
%22 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %20, i32 %21)
br label %23
23: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c" rc_cfg (\22%s\22, \22%s\22);\0A\00"
@.str.1 = [31 x i8] c" rc_ccf (\22%s\22, %d); // id:%d\0A\00"
define void @state_print_cb(i32 %0, i8* %1, i8* %2, i8 zeroext %3, i8* nocapture readnone %4) {
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
br label %12
9: ; preds = %5
%10 = zext i8 %3 to i32
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %10, i32 %0)
br label %12
12: ; preds = %9, %7
ret void
}