#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 */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ inUse(int /*<<< orphan*/ *);
scalar_t__ initializerHasRun(int /*<<< orphan*/ *);
int /*<<< orphan*/ setInUse(int /*<<< orphan*/ *);
int __cxa_guard_acquire(uint64_t *guard_object) {
  if (initializerHasRun(guard_object))
    return 0;
  if (initializerHasRun(guard_object)) {
    return 0;
  }
  if (inUse(guard_object)) {

    ;
  }
  setInUse(guard_object);
  return 1;
}


x86 assembly (clang, -O0):
<__cxa_guard_acquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <initializerHasRun@plt>
cmp    $0x0,%rax
je     115b <__cxa_guard_acquire+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    11a2 <__cxa_guard_acquire+0x72>
mov    -0x10(%rbp),%rdi
call   1040 <initializerHasRun@plt>
cmp    $0x0,%rax
je     117a <__cxa_guard_acquire+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    11a2 <__cxa_guard_acquire+0x72>
mov    -0x10(%rbp),%rdi
call   1030 <inUse@plt>
cmp    $0x0,%rax
je     1192 <__cxa_guard_acquire+0x62>
jmp    1192 <__cxa_guard_acquire+0x62>
mov    -0x10(%rbp),%rdi
call   1050 <setInUse@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cxa_guard_acquire>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <initializerHasRun@plt>
xor    %ebp,%ebp
test   %rax,%rax
jne    1164 <__cxa_guard_acquire+0x34>
mov    %rbx,%rdi
call   1040 <initializerHasRun@plt>
test   %rax,%rax
jne    1164 <__cxa_guard_acquire+0x34>
mov    %rbx,%rdi
call   1030 <inUse@plt>
mov    %rbx,%rdi
call   1050 <setInUse@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__cxa_guard_acquire(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i64 @initializerHasRun(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %21
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i64 @initializerHasRun(i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %21
13: ; preds = %8
%14 = load i32*, i32** %3
%15 = call i64 @inUse(i32* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
br label %18
18: ; preds = %17, %13
%19 = load i32*, i32** %3
%20 = call i32 @setInUse(i32* %19)
store i32 1, i32* %2
br label %21
21: ; preds = %18, %12, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @__cxa_guard_acquire(i32* %0) {
%2 = tail call i64 @initializerHasRun(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @initializerHasRun(i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 @inUse(i32* %0)
%9 = tail call i32 @setInUse(i32* %0)
br label %10
10: ; preds = %4, %1, %7
%11 = phi i32 [ 1, %7 ], [ 0, %1 ], [ 0, %4 ]
ret i32 %11
}