#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 f95_st_openf(void *, void *, void *, void *, void *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, void *, void *,
                           void *, void *, void *);
scalar_t__ getpid();
int /*<<< orphan*/ stderr;
int _gfortran_st_open(void *ptr1, void *ptr2, void *ptr3, void *ptr4,
                      void *ptr5) {
  fprintf(stderr, "[%d] gfortran_st_open(%p, %p, %p, %p, %p)\n", (int)getpid(),
          ptr1, ptr2, ptr3, ptr4, ptr5);
  return f95_st_openf(ptr1, ptr2, ptr3, ptr4, ptr5);
}


x86 assembly (clang, -O0):
<_gfortran_st_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
lea    0xe81(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <f95_st_openf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gfortran_st_open>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    0x2e8f(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9f(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
mov    %rbx,%rcx
mov    %r13,%r8
mov    %r12,%r9
push   %r14
push   %r15
call   1050 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <f95_st_openf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"[%d] gfortran_st_open(%p, %p, %p, %p, %p)\0A\00"
define i32 @_gfortran_st_open(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* @stderr
%12 = call i64 (...) @getpid()
%13 = trunc i64 %12 to i32
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18)
%20 = load i8*, i8** %6
%21 = load i8*, i8** %7
%22 = load i8*, i8** %8
%23 = load i8*, i8** %9
%24 = load i8*, i8** %10
%25 = call i32 @f95_st_openf(i8* %20, i8* %21, i8* %22, i8* %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"[%d] gfortran_st_open(%p, %p, %p, %p, %p)\0A\00"
define i32 @_gfortran_st_open(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = load i32, i32* @stderr
%7 = tail call i64 (...) @getpid()
%8 = trunc i64 %7 to i32
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %0, i8* %1, i8* %2, i8* %3, i8* %4)
%10 = tail call i32 @f95_st_openf(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4)
ret i32 %10
}