#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 reg_state {
  int dummy;
};
struct lre_hash {
  int dummy;
};
struct live_range {
  int dummy;
};

/* Variables and functions */
struct lre_hash **lre_probe(struct reg_state *, struct live_range *,
                            struct live_range *);
int interfere(struct reg_state *rstate, struct live_range *left,
              struct live_range *right) {
  struct lre_hash **ptr;
  ptr = lre_probe(rstate, left, right);
  return ptr && *ptr;
}


x86 assembly (clang, -O0):
<interfere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <lre_probe@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
je     1157 <interfere+0x47>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interfere>:
push   %rax
call   1030 <lre_probe@plt>
test   %rax,%rax
je     1129 <interfere+0x19>
mov    %rax,%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.reg_state = type { i32 }
%struct.live_range = type { i32 }
%struct.lre_hash = type { i32 }
define i32 @interfere(%struct.reg_state* %0, %struct.live_range* %1, %struct.live_range* %2) {
%4 = alloca %struct.reg_state*
%5 = alloca %struct.live_range*
%6 = alloca %struct.live_range*
%7 = alloca %struct.lre_hash**
store %struct.reg_state* %0, %struct.reg_state** %4
store %struct.live_range* %1, %struct.live_range** %5
store %struct.live_range* %2, %struct.live_range** %6
%8 = load %struct.reg_state*, %struct.reg_state** %4
%9 = load %struct.live_range*, %struct.live_range** %5
%10 = load %struct.live_range*, %struct.live_range** %6
%11 = call %struct.lre_hash** @lre_probe(%struct.reg_state* %8, %struct.live_range* %9, %struct.live_range* %10)
store %struct.lre_hash** %11, %struct.lre_hash*** %7
%12 = load %struct.lre_hash**, %struct.lre_hash*** %7
%13 = icmp ne %struct.lre_hash** %12, null
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load %struct.lre_hash**, %struct.lre_hash*** %7
%16 = load %struct.lre_hash*, %struct.lre_hash** %15
%17 = icmp ne %struct.lre_hash* %16, null
br label %18
18: ; preds = %14, %3
%19 = phi i1 [ false, %3 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
%struct.reg_state = type { i32 }
%struct.live_range = type { i32 }
%struct.lre_hash = type { i32 }
define i32 @interfere(%struct.reg_state* %0, %struct.live_range* %1, %struct.live_range* %2) {
%4 = tail call %struct.lre_hash** @lre_probe(%struct.reg_state* %0, %struct.live_range* %1, %struct.live_range* %2)
%5 = icmp eq %struct.lre_hash** %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load %struct.lre_hash*, %struct.lre_hash** %4
%8 = icmp ne %struct.lre_hash* %7, null
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}