#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,
                           char const *);
int /*<<< orphan*/ stderr;
void compute_string(const char *i_value, char **result) {
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.compute_string(): received %s"
      "\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",
      101, i_value);
  *result = "DEAF_BEAF_DRINKS_COFFEE";
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.compute_string(): return %s"
      "\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",
      103, *result);
}


x86 assembly (clang, -O0):
<compute_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xecc(%rip),%rsi
lea    0xef9(%rip),%rdx
mov    $0x65,%ecx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
lea    0xfbc(%rip),%rcx
mov    %rcx,(%rax)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%r8
lea    0xfba(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    $0x67,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r8
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
lea    0xed4(%rip),%rsi
lea    0xf01(%rip),%r14
mov    %r14,%rdx
mov    $0x65,%ecx
call   1030 <fprintf@plt>
lea    0xfc5(%rip),%r8
mov    %r8,(%rbx)
mov    (%r15),%edi
lea    0xfd0(%rip),%rsi
mov    %r14,%rdx
mov    $0x67,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"[INFO](%s:%d:) dpi_c.compute_string(): received %s\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 = [24 x i8] c"DEAF_BEAF_DRINKS_COFFEE\00"
@.str.3 = [50 x i8] c"[INFO](%s:%d:) dpi_c.compute_string(): return %s\0A\00"
define void @compute_string(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 101, i8* %6)
%8 = load i8**, i8*** %4
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0), i32 103, i8* %11)
ret void
}

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