#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 iam_rec {
  int dummy;
};
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __lvar_rec_set(struct iam_leaf *, struct iam_rec const *);
int /*<<< orphan*/ assert_corr(int /*<<< orphan*/);
int /*<<< orphan*/ assert_inv(int /*<<< orphan*/);
int /*<<< orphan*/ iam_leaf_is_locked(struct iam_leaf *);
int /*<<< orphan*/ n_at_rec(struct iam_leaf *);
int /*<<< orphan*/ n_invariant(struct iam_leaf *);
void lvar_rec_set(struct iam_leaf *l, const struct iam_rec *r) {
  assert_corr(n_at_rec(l));
  assert_corr(iam_leaf_is_locked(l));
  __lvar_rec_set(l, r);
  assert_inv(n_invariant(l));
}


x86 assembly (clang, -O0):
<lvar_rec_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <n_at_rec@plt>
mov    %eax,%edi
call   1070 <assert_corr@plt>
mov    -0x8(%rbp),%rdi
call   1050 <iam_leaf_is_locked@plt>
mov    %eax,%edi
call   1070 <assert_corr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__lvar_rec_set@plt>
mov    -0x8(%rbp),%rdi
call   1080 <n_invariant@plt>
mov    %eax,%edi
call   1060 <assert_inv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvar_rec_set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <n_at_rec@plt>
mov    %eax,%edi
call   1070 <assert_corr@plt>
mov    %rbx,%rdi
call   1050 <iam_leaf_is_locked@plt>
mov    %eax,%edi
call   1070 <assert_corr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__lvar_rec_set@plt>
mov    %rbx,%rdi
call   1080 <n_invariant@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <assert_inv@plt>

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
%struct.iam_rec = type { i32 }
define void @lvar_rec_set(%struct.iam_leaf* %0, %struct.iam_rec* %1) {
%3 = alloca %struct.iam_leaf*
%4 = alloca %struct.iam_rec*
store %struct.iam_leaf* %0, %struct.iam_leaf** %3
store %struct.iam_rec* %1, %struct.iam_rec** %4
%5 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%6 = call i32 @n_at_rec(%struct.iam_leaf* %5)
%7 = call i32 @assert_corr(i32 %6)
%8 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%9 = call i32 @iam_leaf_is_locked(%struct.iam_leaf* %8)
%10 = call i32 @assert_corr(i32 %9)
%11 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%12 = load %struct.iam_rec*, %struct.iam_rec** %4
%13 = call i32 @__lvar_rec_set(%struct.iam_leaf* %11, %struct.iam_rec* %12)
%14 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%15 = call i32 @n_invariant(%struct.iam_leaf* %14)
%16 = call i32 @assert_inv(i32 %15)
ret void
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
%struct.iam_rec = type { i32 }
define void @lvar_rec_set(%struct.iam_leaf* %0, %struct.iam_rec* %1) {
%3 = tail call i32 @n_at_rec(%struct.iam_leaf* %0)
%4 = tail call i32 @assert_corr(i32 %3)
%5 = tail call i32 @iam_leaf_is_locked(%struct.iam_leaf* %0)
%6 = tail call i32 @assert_corr(i32 %5)
%7 = tail call i32 @__lvar_rec_set(%struct.iam_leaf* %0, %struct.iam_rec* %1)
%8 = tail call i32 @n_invariant(%struct.iam_leaf* %0)
%9 = tail call i32 @assert_inv(i32 %8)
ret void
}