#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*/ dot_replace(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
char *ustrdup(char const *);
void dot_emit(const char *from, const char *to) {
  char *from_ = ustrdup(from);
  char *to_ = ustrdup(to);
  dot_replace(from_);
  dot_replace(to_);
  fprintf(stderr, "%s -> %s;\n", from_, to_);
  free(from_);
  free(to_);
}


x86 assembly (clang, -O0):
<dot_emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ustrdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <ustrdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <dot_replace@plt>
mov    -0x20(%rbp),%rdi
call   1050 <dot_replace@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe6c(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_emit>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
call   1060 <ustrdup@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1060 <ustrdup@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1050 <dot_replace@plt>
mov    %rbx,%rdi
call   1050 <dot_replace@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s -> %s;\0A\00"
define void @dot_emit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @ustrdup(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = call i8* @ustrdup(i8* %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @dot_replace(i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @dot_replace(i8* %13)
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = load i8*, i8** %5
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %6
%22 = call i32 @free(i8* %21)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s -> %s;\0A\00"
define void @dot_emit(i8* %0, i8* %1) {
%3 = tail call i8* @ustrdup(i8* %0)
%4 = tail call i8* @ustrdup(i8* %1)
%5 = tail call i32 @dot_replace(i8* %3)
%6 = tail call i32 @dot_replace(i8* %4)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%9 = tail call i32 @free(i8* %3)
%10 = tail call i32 @free(i8* %4)
ret void
}