#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 */
struct ibv_qp_init_attr {
  int dummy;
};
struct ibv_qp_attr {
  int dummy;
};
struct ibv_qp {
  int dummy;
};

/* Variables and functions */
int _query_qp(struct ibv_qp *, struct ibv_qp_attr *, int,
              struct ibv_qp_init_attr *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask,
                 struct ibv_qp_init_attr *init_attr) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _query_qp(qp, attr, attr_mask, init_attr);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_query_qp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <_query_qp@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_query_qp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <_query_qp@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ibv_qp = type { i32 }
%struct.ibv_qp_attr = type { i32 }
%struct.ibv_qp_init_attr = type { i32 }
define i32 @ibv_query_qp(%struct.ibv_qp* %0, %struct.ibv_qp_attr* %1, i32 %2, %struct.ibv_qp_init_attr* %3) {
%5 = alloca %struct.ibv_qp*
%6 = alloca %struct.ibv_qp_attr*
%7 = alloca i32
%8 = alloca %struct.ibv_qp_init_attr*
%9 = alloca i32
store %struct.ibv_qp* %0, %struct.ibv_qp** %5
store %struct.ibv_qp_attr* %1, %struct.ibv_qp_attr** %6
store i32 %2, i32* %7
store %struct.ibv_qp_init_attr* %3, %struct.ibv_qp_init_attr** %8
%10 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%11 = load %struct.ibv_qp*, %struct.ibv_qp** %5
%12 = load %struct.ibv_qp_attr*, %struct.ibv_qp_attr** %6
%13 = load i32, i32* %7
%14 = load %struct.ibv_qp_init_attr*, %struct.ibv_qp_init_attr** %8
%15 = call i32 @_query_qp(%struct.ibv_qp* %11, %struct.ibv_qp_attr* %12, i32 %13, %struct.ibv_qp_init_attr* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.ibv_qp = type { i32 }
%struct.ibv_qp_attr = type { i32 }
%struct.ibv_qp_init_attr = type { i32 }
define i32 @ibv_query_qp(%struct.ibv_qp* %0, %struct.ibv_qp_attr* %1, i32 %2, %struct.ibv_qp_init_attr* %3) {
%5 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%6 = tail call i32 @_query_qp(%struct.ibv_qp* %0, %struct.ibv_qp_attr* %1, i32 %2, %struct.ibv_qp_init_attr* %3)
%7 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %6
}