#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*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stderr;
void _sdr_cache_create_callback(uint8_t sdr_version, uint16_t record_count,
                                uint32_t most_recent_addition_timestamp,
                                uint32_t most_recent_erase_timestamp,
                                uint16_t record_id, void *data) {
  int *count;
  assert(data);
  count = (int *)data;
  (*count)++;
  fprintf(stderr, "Caching SDR record %d of %d (current record ID %d) \r",
          *count, record_count, record_id);
}


x86 assembly (clang, -O0):
<_sdr_cache_create_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sdr_cache_create_callback>:
push   %rbp
push   %r14
push   %rbx
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %esi,%ebp
mov    %r9,%rdi
call   1030 <assert@plt>
mov    (%rbx),%edx
add    $0x1,%edx
mov    %edx,(%rbx)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    %ebp,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Caching SDR record %d of %d (current record ID %d) \0D\00"
define void @_sdr_cache_create_callback(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i8*, i8** %12
%15 = call i32 @assert(i8* %14)
%16 = load i8*, i8** %12
%17 = bitcast i8* %16 to i32*
store i32* %17, i32** %13
%18 = load i32*, i32** %13
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = load i32, i32* @stderr
%22 = load i32*, i32** %13
%23 = load i32, i32* %22
%24 = load i32, i32* %8
%25 = load i32, i32* %11
%26 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %25)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Caching SDR record %d of %d (current record ID %d) \0D\00"
define void @_sdr_cache_create_callback(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = tail call i32 @assert(i8* %5)
%8 = bitcast i8* %5 to i32*
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %1, i32 %4)
ret void
}