#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 */
struct fact {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CloseStringDestination(void *, char *);
int /*<<< orphan*/ OpenStringDestination(void *, char *, char *, size_t);
int /*<<< orphan*/ PrintFactWithIdentifier(void *, char *, struct fact *,
                                           int /*<<< orphan*/ *);
void EnvGetFactPPForm(void *theEnv, char *buffer, size_t bufferLength,
                      void *theFact) {
  OpenStringDestination(theEnv, "FactPPForm", buffer, bufferLength);
  PrintFactWithIdentifier(theEnv, "FactPPForm", (struct fact *)theFact, NULL);
  CloseStringDestination(theEnv, "FactPPForm");
}


x86 assembly (clang, -O0):
<EnvGetFactPPForm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea5(%rip),%rsi
call   1040 <OpenStringDestination@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe91(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <PrintFactWithIdentifier@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1050 <CloseStringDestination@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnvGetFactPPForm>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xeb8(%rip),%r15
mov    %r15,%rsi
call   1040 <OpenStringDestination@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <PrintFactWithIdentifier@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <CloseStringDestination@plt>

LLVM IR (-O0):
%struct.fact = type { i32 }
@.str = [11 x i8] c"FactPPForm\00"
define void @EnvGetFactPPForm(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @OpenStringDestination(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %8
%15 = bitcast i8* %14 to %struct.fact*
%16 = call i32 @PrintFactWithIdentifier(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.fact* %15, i32* null)
%17 = load i8*, i8** %5
%18 = call i32 @CloseStringDestination(i8* %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.fact = type { i32 }
@.str = [11 x i8] c"FactPPForm\00"
define void @EnvGetFactPPForm(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = tail call i32 @OpenStringDestination(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2)
%6 = bitcast i8* %3 to %struct.fact*
%7 = tail call i32 @PrintFactWithIdentifier(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.fact* %6, i32* null)
%8 = tail call i32 @CloseStringDestination(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}