#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  size_t bottom;
  size_t top;
  int /*<<< orphan*/ *err_flags;
};
typedef TYPE_1__ ERR_STATE;

/* Variables and functions */
int /*<<< orphan*/ ERR_FLAG_MARK;
TYPE_1__ *ERR_get_state();
int ERR_set_mark(void) {
  ERR_STATE *es;
  es = ERR_get_state();
  if (es->bottom == es->top)
    return 0;
  es->err_flags[es->top] |= ERR_FLAG_MARK;
  return 1;
}


x86 assembly (clang, -O0):
<ERR_set_mark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ERR_get_state@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    1144 <ERR_set_mark+0x34>
movl   $0x0,-0x4(%rbp)
jmp    116a <ERR_set_mark+0x5a>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_set_mark>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <ERR_get_state@plt>
mov    0x8(%rax),%rcx
cmp    %rcx,(%rax)
je     1138 <ERR_set_mark+0x28>
mov    0x2ec6(%rip),%rdx
mov    (%rdx),%edx
mov    0x10(%rax),%rax
or     %edx,(%rax,%rcx,4)
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64, i32* }
@ERR_FLAG_MARK = global i32 0
define i32 @ERR_set_mark() {
%1 = alloca i32
%2 = alloca %struct.TYPE_3__*
%3 = call %struct.TYPE_3__* (...) @ERR_get_state()
store %struct.TYPE_3__* %3, %struct.TYPE_3__** %2
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = icmp eq i64 %6, %9
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 0, i32* %1
br label %23
12: ; preds = %0
%13 = load i32, i32* @ERR_FLAG_MARK
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 2
%16 = load i32*, i32** %15
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = getelementptr inbounds i32, i32* %16, i64 %19
%21 = load i32, i32* %20
%22 = or i32 %21, %13
store i32 %22, i32* %20
store i32 1, i32* %1
br label %23
23: ; preds = %12, %11
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64, i32* }
@ERR_FLAG_MARK = global i32 0
define i32 @ERR_set_mark() {
%1 = tail call %struct.TYPE_3__* (...) @ERR_get_state()
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = icmp eq i64 %3, %5
br i1 %6, label %14, label %7
7: ; preds = %0
%8 = load i32, i32* @ERR_FLAG_MARK
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 %5
%12 = load i32, i32* %11
%13 = or i32 %12, %8
store i32 %13, i32* %11
br label %14
14: ; preds = %0, %7
%15 = phi i32 [ 1, %7 ], [ 0, %0 ]
ret i32 %15
}