#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*/ fprintf(int /*<<< orphan*/, char *, char *, int,
                           double const);
int /*<<< orphan*/ stderr;
double transform_double(double const);
double get_real(const double i_value) {
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.get_real(): received %f"
      "\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/"
      "amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/"
      "dpi_c_ex.c",
      94, i_value);
  double result = transform_double(i_value);
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.get_real(): return %f"
      "\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/"
      "amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/"
      "dpi_c_ex.c",
      96, result);
  return result;
}


x86 assembly (clang, -O0):
<get_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xebe(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    $0x5e,%ecx
call   1040 <fprintf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <transform_double@plt>
movsd  %xmm0,-0x10(%rbp)
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
movsd  -0x10(%rbp),%xmm0
lea    0xf8f(%rip),%rsi
lea    0xeb0(%rip),%rdx
mov    $0x60,%ecx
call   1040 <fprintf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_real>:
push   %r14
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
lea    0xeee(%rip),%r14
mov    %r14,%rdx
mov    $0x5e,%ecx
call   1040 <fprintf@plt>
movsd  (%rsp),%xmm0
call   1030 <transform_double@plt>
movsd  %xmm0,(%rsp)
mov    (%rbx),%edi
lea    0xfa1(%rip),%rsi
mov    %r14,%rdx
mov    $0x60,%ecx
call   1040 <fprintf@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"[INFO](%s:%d:) dpi_c.get_real(): received %f\0A\00"
@.str.1 = [216 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/dpi_c_ex.c\00"
@.str.2 = [44 x i8] c"[INFO](%s:%d:) dpi_c.get_real(): return %f\0A\00"
define double @get_real(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load i32, i32* @stderr
%5 = load double, double* %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 94, double %5)
%7 = load double, double* %2
%8 = call double @transform_double(double %7)
store double %8, double* %3
%9 = load i32, i32* @stderr
%10 = load double, double* %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 96, double %10)
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"[INFO](%s:%d:) dpi_c.get_real(): received %f\0A\00"
@.str.1 = [216 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/dpi_c_ex.c\00"
@.str.2 = [44 x i8] c"[INFO](%s:%d:) dpi_c.get_real(): return %f\0A\00"
define double @get_real(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 94, double %0)
%4 = tail call double @transform_double(double %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 96, double %4)
ret double %4
}