#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 pbc_slice {
  int dummy;
};
struct pbc_rmessage {
  int dummy;
};
struct pbc_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pbc_rmessage_delete(struct pbc_rmessage *);
struct pbc_rmessage *pbc_rmessage_new(struct pbc_env *, char *,
                                      struct pbc_slice *);
double pbc_rmessage_real(struct pbc_rmessage *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
void test_rmessage(struct pbc_env *env, struct pbc_slice *slice) {
  struct pbc_rmessage *m = pbc_rmessage_new(env, "real", slice);
  printf("f = %f\n", pbc_rmessage_real(m, "f", 0));
  printf("d = %f\n", pbc_rmessage_real(m, "d", 0));
  pbc_rmessage_delete(m);
}


x86 assembly (clang, -O0):
<test_rmessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1040 <pbc_rmessage_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe9a(%rip),%rsi
xor    %edx,%edx
call   1050 <pbc_rmessage_real@plt>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe86(%rip),%rsi
xor    %edx,%edx
call   1050 <pbc_rmessage_real@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <pbc_rmessage_delete@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rmessage>:
push   %rbx
mov    %rsi,%rdx
lea    0xeb5(%rip),%rsi
call   1040 <pbc_rmessage_new@plt>
mov    %rax,%rbx
lea    0xeb3(%rip),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1050 <pbc_rmessage_real@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1050 <pbc_rmessage_real@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <pbc_rmessage_delete@plt>

LLVM IR (-O0):
%struct.pbc_env = type { i32 }
%struct.pbc_slice = type { i32 }
%struct.pbc_rmessage = type { i32 }
@.str = [5 x i8] c"real\00"
@.str.1 = [8 x i8] c"f = %f\0A\00"
@.str.2 = [2 x i8] c"f\00"
@.str.3 = [8 x i8] c"d = %f\0A\00"
@.str.4 = [2 x i8] c"d\00"
define void @test_rmessage(%struct.pbc_env* %0, %struct.pbc_slice* %1) {
%3 = alloca %struct.pbc_env*
%4 = alloca %struct.pbc_slice*
%5 = alloca %struct.pbc_rmessage*
store %struct.pbc_env* %0, %struct.pbc_env** %3
store %struct.pbc_slice* %1, %struct.pbc_slice** %4
%6 = load %struct.pbc_env*, %struct.pbc_env** %3
%7 = load %struct.pbc_slice*, %struct.pbc_slice** %4
%8 = call %struct.pbc_rmessage* @pbc_rmessage_new(%struct.pbc_env* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.pbc_slice* %7)
store %struct.pbc_rmessage* %8, %struct.pbc_rmessage** %5
%9 = load %struct.pbc_rmessage*, %struct.pbc_rmessage** %5
%10 = call double @pbc_rmessage_real(%struct.pbc_rmessage* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load %struct.pbc_rmessage*, %struct.pbc_rmessage** %5
%13 = call double @pbc_rmessage_real(%struct.pbc_rmessage* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = load %struct.pbc_rmessage*, %struct.pbc_rmessage** %5
%16 = call i32 @pbc_rmessage_delete(%struct.pbc_rmessage* %15)
ret void
}

LLVM IR (-O2):
%struct.pbc_env = type { i32 }
%struct.pbc_slice = type { i32 }
%struct.pbc_rmessage = type { i32 }
@.str = [5 x i8] c"real\00"
@.str.1 = [8 x i8] c"f = %f\0A\00"
@.str.2 = [2 x i8] c"f\00"
@.str.3 = [8 x i8] c"d = %f\0A\00"
@.str.4 = [2 x i8] c"d\00"
define void @test_rmessage(%struct.pbc_env* %0, %struct.pbc_slice* %1) {
%3 = tail call %struct.pbc_rmessage* @pbc_rmessage_new(%struct.pbc_env* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.pbc_slice* %1)
%4 = tail call double @pbc_rmessage_real(%struct.pbc_rmessage* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call double @pbc_rmessage_real(%struct.pbc_rmessage* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %6)
%8 = tail call i32 @pbc_rmessage_delete(%struct.pbc_rmessage* %3)
ret void
}