#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 triple {
  int dummy;
};
struct compile_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ error(struct compile_state *, struct triple *, char *);
int /*<<< orphan*/ internal_error(struct compile_state *, struct triple *,
                                  char *);
int /*<<< orphan*/ is_lvalue(struct compile_state *, struct triple *);
void clvalue(struct compile_state *state, struct triple *def) {
  if (!def) {
    internal_error(state, def, "nothing where lvalue expected?");
  }
  if (!is_lvalue(state, def)) {
    error(state, def, "lvalue expected");
  }
}


x86 assembly (clang, -O0):
<clvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <clvalue+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdx
call   1030 <internal_error@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <is_lvalue@plt>
cmp    $0x0,%eax
jne    1189 <clvalue+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clvalue>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    1150 <clvalue+0x20>
lea    0xeba(%rip),%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <internal_error@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <is_lvalue@plt>
test   %eax,%eax
je     1167 <clvalue+0x37>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeb1(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <error@plt>

LLVM IR (-O0):
%struct.compile_state = type { i32 }
%struct.triple = type { i32 }
@.str = [31 x i8] c"nothing where lvalue expected?\00"
@.str.1 = [16 x i8] c"lvalue expected\00"
define void @clvalue(%struct.compile_state* %0, %struct.triple* %1) {
%3 = alloca %struct.compile_state*
%4 = alloca %struct.triple*
store %struct.compile_state* %0, %struct.compile_state** %3
store %struct.triple* %1, %struct.triple** %4
%5 = load %struct.triple*, %struct.triple** %4
%6 = icmp ne %struct.triple* %5, null
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load %struct.compile_state*, %struct.compile_state** %3
%9 = load %struct.triple*, %struct.triple** %4
%10 = call i32 @internal_error(%struct.compile_state* %8, %struct.triple* %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %7, %2
%12 = load %struct.compile_state*, %struct.compile_state** %3
%13 = load %struct.triple*, %struct.triple** %4
%14 = call i32 @is_lvalue(%struct.compile_state* %12, %struct.triple* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %11
%17 = load %struct.compile_state*, %struct.compile_state** %3
%18 = load %struct.triple*, %struct.triple** %4
%19 = call i32 @error(%struct.compile_state* %17, %struct.triple* %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
%struct.compile_state = type { i32 }
%struct.triple = type { i32 }
@.str = [31 x i8] c"nothing where lvalue expected?\00"
@.str.1 = [16 x i8] c"lvalue expected\00"
define void @clvalue(%struct.compile_state* %0, %struct.triple* %1) {
%3 = icmp eq %struct.triple* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @internal_error(%struct.compile_state* %0, %struct.triple* null, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @is_lvalue(%struct.compile_state* %0, %struct.triple* %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @error(%struct.compile_state* %0, %struct.triple* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}