#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);
void compute_real(const double i_value, double *result) {
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.compute_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",
      88, i_value);
  *result = transform_double(i_value);
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.compute_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",
      90, *result);
}


x86 assembly (clang, -O0):
<compute_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xeba(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    $0x58,%ecx
call   1040 <fprintf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <transform_double@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xf89(%rip),%rsi
lea    0xeaa(%rip),%rdx
mov    $0x5a,%ecx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_real>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
mov    0x2ea7(%rip),%r15
mov    (%r15),%edi
lea    0xebd(%rip),%rsi
lea    0xee8(%rip),%r14
mov    %r14,%rdx
mov    $0x58,%ecx
call   1040 <fprintf@plt>
movsd  0x8(%rsp),%xmm0
call   1030 <transform_double@plt>
movsd  %xmm0,(%rbx)
mov    (%r15),%edi
lea    0xf9a(%rip),%rsi
mov    %r14,%rdx
mov    $0x5a,%ecx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"[INFO](%s:%d:) dpi_c.compute_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 = [48 x i8] c"[INFO](%s:%d:) dpi_c.compute_real(): return %f\0A\00"
define void @compute_real(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load i32, i32* @stderr
%6 = load double, double* %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 88, double %6)
%8 = load double, double* %3
%9 = call double @transform_double(double %8)
%10 = load double*, double** %4
store double %9, double* %10
%11 = load i32, i32* @stderr
%12 = load double*, double** %4
%13 = load double, double* %12
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 90, double %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"[INFO](%s:%d:) dpi_c.compute_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 = [48 x i8] c"[INFO](%s:%d:) dpi_c.compute_real(): return %f\0A\00"
define void @compute_real(double %0, double* nocapture writeonly %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 88, double %0)
%5 = tail call double @transform_double(double %0)
store double %5, double* %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 90, double %5)
ret void
}