#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ stdout;
void __create_alter_1(void *cc, void *k, void *v, bool n) {
  *(uint32_t *)v = 0;
  fprintf(stdout, "alter: %s (%u,%u)\n", n ? "new" : "old", *(uint32_t *)k,
          *(uint32_t *)v);
}


x86 assembly (clang, -O0):
<__create_alter_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%ecx
lea    0xed3(%rip),%rdx
lea    0xec8(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%r8d
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__create_alter_1>:
movl   $0x0,(%rdx)
mov    0x2ec3(%rip),%rax
test   %ecx,%ecx
lea    0xef1(%rip),%rcx
lea    0xee6(%rip),%rdx
cmove  %rcx,%rdx
mov    (%rax),%edi
mov    (%rsi),%ecx
lea    0xec4(%rip),%rsi
xor    %r8d,%r8d
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"alter: %s (%u,%u)\0A\00"
@.str.1 = [4 x i8] c"new\00"
@.str.2 = [4 x i8] c"old\00"
define void @__create_alter_1(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = bitcast i8* %9 to i32*
store i32 0, i32* %10
%11 = load i32, i32* @stdout
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%16 = load i8*, i8** %6
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = load i8*, i8** %7
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
%22 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %18, i32 %21)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"alter: %s (%u,%u)\0A\00"
@.str.1 = [4 x i8] c"new\00"
@.str.2 = [4 x i8] c"old\00"
define void @__create_alter_1(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture writeonly %2, i32 %3) {
%5 = bitcast i8* %2 to i32*
store i32 0, i32* %5
%6 = load i32, i32* @stdout
%7 = icmp eq i32 %3, 0
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = bitcast i8* %1 to i32*
%10 = load i32, i32* %9
%11 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %10, i32 0)
ret void
}