#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_cq {
  int dummy;
};
struct ibv_context {
  int dummy;
};
struct ibv_comp_channel {
  int dummy;
};

/* Variables and functions */
struct ibv_cq *_create_cq(struct ibv_context *, int, void *,
                          struct ibv_comp_channel *, int);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
struct ibv_cq *ibv_create_cq(struct ibv_context *context, int cqe,
                             void *cq_context, struct ibv_comp_channel *channel,
                             int comp_vector) {
  dmtcp_plugin_disable_ckpt();
  struct ibv_cq *user_copy =
      _create_cq(context, cqe, cq_context, channel, comp_vector);
  dmtcp_plugin_enable_ckpt();
  return user_copy;
}


x86 assembly (clang, -O0):
<ibv_create_cq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <_create_cq@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_create_cq>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1030 <_create_cq@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ibv_cq = type { i32 }
%struct.ibv_context = type { i32 }
%struct.ibv_comp_channel = type { i32 }
define %struct.ibv_cq* @ibv_create_cq(%struct.ibv_context* %0, i32 %1, i8* %2, %struct.ibv_comp_channel* %3, i32 %4) {
%6 = alloca %struct.ibv_context*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.ibv_comp_channel*
%10 = alloca i32
%11 = alloca %struct.ibv_cq*
store %struct.ibv_context* %0, %struct.ibv_context** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store %struct.ibv_comp_channel* %3, %struct.ibv_comp_channel** %9
store i32 %4, i32* %10
%12 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%13 = load %struct.ibv_context*, %struct.ibv_context** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load %struct.ibv_comp_channel*, %struct.ibv_comp_channel** %9
%17 = load i32, i32* %10
%18 = call %struct.ibv_cq* @_create_cq(%struct.ibv_context* %13, i32 %14, i8* %15, %struct.ibv_comp_channel* %16, i32 %17)
store %struct.ibv_cq* %18, %struct.ibv_cq** %11
%19 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%20 = load %struct.ibv_cq*, %struct.ibv_cq** %11
ret %struct.ibv_cq* %20
}

LLVM IR (-O2):
%struct.ibv_cq = type { i32 }
%struct.ibv_context = type { i32 }
%struct.ibv_comp_channel = type { i32 }
define %struct.ibv_cq* @ibv_create_cq(%struct.ibv_context* %0, i32 %1, i8* %2, %struct.ibv_comp_channel* %3, i32 %4) {
%6 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%7 = tail call %struct.ibv_cq* @_create_cq(%struct.ibv_context* %0, i32 %1, i8* %2, %struct.ibv_comp_channel* %3, i32 %4)
%8 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret %struct.ibv_cq* %7
}