#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, long);
int /*<<< orphan*/ stderr;
long transform_long_int(long const);
long int get_longint(const long int i_value) {
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.get_longint(): received %ld"
      "\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",
      81, (long int)(i_value));
  long int result = transform_long_int(i_value);
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "dpi_c.get_longint(): return %ld"
      "\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",
      83, (long int)(result));
  return result;
}


x86 assembly (clang, -O0):
<get_longint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xec0(%rip),%rsi
lea    0xeeb(%rip),%rdx
mov    $0x51,%ecx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <transform_long_int@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%r8
lea    0xf98(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    $0x53,%ecx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_longint>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r15
mov    (%r15),%edi
lea    0xec7(%rip),%rsi
lea    0xef2(%rip),%r14
mov    %r14,%rdx
mov    $0x51,%ecx
mov    %rbx,%r8
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <transform_long_int@plt>
mov    %rax,%rbx
mov    (%r15),%edi
lea    0xfa5(%rip),%rsi
mov    %r14,%rdx
mov    $0x53,%ecx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"[INFO](%s:%d:) dpi_c.get_longint(): received %ld\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.get_longint(): return %ld\0A\00"
define i64 @get_longint(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i32, i32* @stderr
%5 = load i64, i64* %2
%6 = call i32 @fprintf(i32 %4, 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 81, i64 %5)
%7 = load i64, i64* %2
%8 = call i64 @transform_long_int(i64 %7)
store i64 %8, i64* %3
%9 = load i32, i32* @stderr
%10 = load i64, i64* %3
%11 = call i32 @fprintf(i32 %9, 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 83, i64 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"[INFO](%s:%d:) dpi_c.get_longint(): received %ld\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.get_longint(): return %ld\0A\00"
define i64 @get_longint(i64 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, 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 81, i64 %0)
%4 = tail call i64 @transform_long_int(i64 %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, 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 83, i64 %4)
ret i64 %4
}