xunge/DecIR huggingface dataset:
int test_imm_0Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x0E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Eint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xe,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Eint64_lowword_mem>:
testb  $0xe,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Eint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 14
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_0Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_expander_new_with_mnemonic() {}


x86 assembly (clang, -O0):
<gtk_expander_new_with_mnemonic>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_expander_new_with_mnemonic>:
ret

LLVM IR (-O0):
define void @gtk_expander_new_with_mnemonic() {
ret void
}

LLVM IR (-O2):
define void @gtk_expander_new_with_mnemonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_MediaRenderer_AVTransport_Stop(void *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UpnpMediaRenderer_AVTransport_Stop(void *upnptoken,
                                        unsigned int InstanceID) {
  printf("Invoke: UpnpMediaRenderer_AVTransport_Stop(%u);\r\n", InstanceID);
  UpnpResponse_MediaRenderer_AVTransport_Stop(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_AVTransport_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_MediaRenderer_AVTransport_Stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_AVTransport_Stop>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_AVTransport_Stop@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_Stop(%u);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_Stop(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_MediaRenderer_AVTransport_Stop(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_Stop(%u);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_Stop(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_MediaRenderer_AVTransport_Stop(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *find_option(struct packet *, int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t parse_lease_time(struct packet *pckt) {
  uint8_t *option = find_option(pckt, 51);
  uint32_t ret;
  memcpy(&ret, option, sizeof(uint32_t));
  ret = ntohl(ret);
  return ret;
}


x86 assembly (clang, -O0):
<parse_lease_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x33,%esi
call   1030 <find_option@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1050 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_lease_time>:
push   %rax
mov    $0x33,%esi
call   1030 <find_option@plt>
lea    0x4(%rsp),%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1050 <ntohl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.packet = type { i32 }
define i32 @parse_lease_time(%struct.packet* %0) {
%2 = alloca %struct.packet*
%3 = alloca i32*
%4 = alloca i32
store %struct.packet* %0, %struct.packet** %2
%5 = load %struct.packet*, %struct.packet** %2
%6 = call i32* @find_option(%struct.packet* %5, i32 51)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @memcpy(i32* %4, i32* %7, i32 4)
%9 = load i32, i32* %4
%10 = call i32 @ntohl(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define i32 @parse_lease_time(%struct.packet* %0) {
%2 = alloca i32
%3 = tail call i32* @find_option(%struct.packet* %0, i32 51)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @memcpy(i32* %2, i32* %3, i32 4)
%6 = load i32, i32* %2
%7 = call i32 @ntohl(i32 %6)
ret i32 %7
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int cl_glimpse_size0(struct inode *, int /*<<< orphan*/);
int cl_glimpse_size(struct inode *inode) { return cl_glimpse_size0(inode, 0); }


x86 assembly (clang, -O0):
<cl_glimpse_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <cl_glimpse_size0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_glimpse_size>:
xor    %esi,%esi
jmp    1030 <cl_glimpse_size0@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
define i32 @cl_glimpse_size(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = call i32 @cl_glimpse_size0(%struct.inode* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define i32 @cl_glimpse_size(%struct.inode* %0) {
%2 = tail call i32 @cl_glimpse_size0(%struct.inode* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned long minusccl(unsigned long a, unsigned long b) {
  unsigned long difference = a - b;
  if (difference > a)
    abort();
  return difference;
}


x86 assembly (clang, -O0):
<minusccl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1141 <minusccl+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minusccl>:
sub    %rsi,%rdi
jb     1119 <minusccl+0x9>
mov    %rdi,%rax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i64 @minusccl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sub i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @minusccl(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
%7 = sub i64 %0, %1
ret i64 %7
}
/* Variables and functions */
void putc(char c) {
  while (((*(volatile unsigned long *)0x7F005010) & (1 << 14)))
    ;
  (*(volatile unsigned long *)0x7F005020) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005010,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putc+0x27>
jmp    110a <putc+0xa>
movsbq -0x1(%rbp),%rcx
mov    $0x7f005020,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005010
jne    1100 <putc>
movsbq %dil,%rax
mov    %rax,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726928 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = sext i8 %9 to i64
store volatile i64 %10, i64* inttoptr (i64 2130726944 to i64*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726928 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = sext i8 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 2130726944 to i64*)
ret void
}
int bla() { return 0; }


x86 assembly (clang, -O0):
<bla>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bla() {
ret i32 0
}

LLVM IR (-O2):
define i32 @bla() {
ret i32 0
}
int rpc_listen_init(int sd, void *args) { return 0; }


x86 assembly (clang, -O0):
<rpc_listen_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_listen_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rpc_listen_init(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @rpc_listen_init(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
long hash(char *word) {
  int i;
  long hash_sum = 42;
  for (i = 0; i <= strlen(word) - 1; i++) {
    hash_sum += word[i] * (i + 1);
  }
  return hash_sum;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1177 <hash+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <hash+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x2a,%r15d
test   %eax,%eax
jle    1150 <hash+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
store i64 42, i64* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 1
%10 = icmp sle i32 %6, %9
br i1 %10, label %11, label %27
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = mul nsw i32 %17, %19
%21 = sext i32 %20 to i64
%22 = load i64, i64* %4
%23 = add nsw i64 %22, %21
store i64 %23, i64* %4
br label %24
24: ; preds = %11
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i64, i64* %4
ret i64 %28
}

LLVM IR (-O2):
define i64 @hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i64 [ %14, %4 ], [ 42, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = add nuw nsw i64 %5, 1
%11 = mul i64 %10, %9
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = add nsw i64 %6, %13
%15 = tail call i32 @strlen(i8* %0)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %10, %16
br i1 %17, label %4, label %18
18: ; preds = %4, %1
%19 = phi i64 [ 42, %1 ], [ %14, %4 ]
ret i64 %19
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int b2i(void *b) {
  char buff[4];
  for (int f = 0; f < 4; f++) {
    buff[3 - f] = ((char *)b)[f];
  }
  int32_t i;
  memcpy(&i, buff, 4);
  return i;
}


x86 assembly (clang, -O0):
<b2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1154 <b2i+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    $0x3,%eax
sub    -0x10(%rbp),%eax
cltq
mov    %cl,-0xc(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <b2i+0x13>
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b2i>:
push   %rax
mov    (%rdi),%al
mov    %al,0x3(%rsp)
mov    0x1(%rdi),%al
mov    %al,0x2(%rsp)
mov    0x2(%rdi),%al
mov    %al,0x1(%rsp)
mov    0x3(%rdi),%al
mov    %al,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b2i(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = load i32, i32* %4
%16 = sub nsw i32 3, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%24 = call i32 @memcpy(i32* %5, i8* %23, i32 4)
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @b2i(i8* nocapture %0) {
%2 = alloca [4 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
store i8 %14, i8* %4
%15 = bitcast i32* %3 to i8*
%16 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%17 = load i32, i32* %3
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f(int);
int g(int);
main() {
  if (f(3) != sizeof(short) * 2 * 3)
    abort();
  if (g(3) != sizeof(long) * 2 * 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <f@plt>
cltq
cmp    $0xc,%rax
je     115c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x3,%edi
call   1050 <g@plt>
cltq
cmp    $0x30,%rax
je     1179 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <f@plt>
cmp    $0xc,%eax
jne    1153 <main+0x23>
mov    $0x3,%edi
call   1050 <g@plt>
cmp    $0x30,%eax
jne    1153 <main+0x23>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 3)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 12
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @g(i32 3)
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 48
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 3)
%2 = icmp eq i32 %1, 12
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @g(i32 3)
%7 = icmp eq i32 %6, 48
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct elf_obj {
  int dummy;
};
struct TYPE_3__ {
  unsigned int st_size;
};
typedef TYPE_1__ Elf32_Sym;

/* Variables and functions */
TYPE_1__ *elf_find_func(struct elf_obj *, unsigned int);
unsigned int elf_get_func_len(void *e_obj, unsigned int func) {
  struct elf_obj *obj = e_obj;
  Elf32_Sym *func_sym = elf_find_func(obj, func);
  if (func_sym)
    return func_sym->st_size;
  return 0;
}


x86 assembly (clang, -O0):
<elf_get_func_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <elf_find_func@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1150 <elf_get_func_len+0x40>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <elf_get_func_len+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_get_func_len>:
push   %rax
call   1030 <elf_find_func@plt>
test   %rax,%rax
je     111f <elf_get_func_len+0xf>
mov    (%rax),%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.elf_obj = type { i32 }
%struct.TYPE_3__ = type { i32 }
define i32 @elf_get_func_len(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.elf_obj*
%7 = alloca %struct.TYPE_3__*
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.elf_obj*
store %struct.elf_obj* %9, %struct.elf_obj** %6
%10 = load %struct.elf_obj*, %struct.elf_obj** %6
%11 = load i32, i32* %5
%12 = call %struct.TYPE_3__* @elf_find_func(%struct.elf_obj* %10, i32 %11)
store %struct.TYPE_3__* %12, %struct.TYPE_3__** %7
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %7
%14 = icmp ne %struct.TYPE_3__* %13, null
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load %struct.TYPE_3__*, %struct.TYPE_3__** %7
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %16, i32 0, i32 0
%18 = load i32, i32* %17
store i32 %18, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.elf_obj = type { i32 }
%struct.TYPE_3__ = type { i32 }
define i32 @elf_get_func_len(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to %struct.elf_obj*
%4 = tail call %struct.TYPE_3__* @elf_find_func(%struct.elf_obj* %3, i32 %1)
%5 = icmp eq %struct.TYPE_3__* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 0
%8 = load i32, i32* %7
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fset_buffer_refresh(int /*<<< orphan*/);
void fset_config_change_color_cb(const void *pointer, void *data,
                                 struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  fset_buffer_refresh(0);
}


x86 assembly (clang, -O0):
<fset_config_change_color_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <fset_buffer_refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fset_config_change_color_cb>:
xor    %edi,%edi
jmp    1030 <fset_buffer_refresh@plt>

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @fset_config_change_color_cb(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 @fset_buffer_refresh(i32 0)
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @fset_config_change_color_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 @fset_buffer_refresh(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fnegd(int s, int d) {
  assem_debug("fnegd s%d,d%d\n", d, s);
  output_w32(0xeeb10b40 | ((d & 7) << 12) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_fnegd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xeeb10b40,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fnegd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
and    $0x7,%ebx
shl    $0xc,%ebx
and    $0x7,%r14d
lea    (%r14,%rbx,1),%edi
add    $0xeeb10b40,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fnegd s%d,d%d\0A\00"
define void @emit_fnegd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 7
%10 = shl i32 %9, 12
%11 = or i32 -290387136, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = or i32 %11, %13
%15 = call i32 @output_w32(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fnegd s%d,d%d\0A\00"
define void @emit_fnegd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 12
%5 = and i32 %4, 28672
%6 = and i32 %0, 7
%7 = or i32 %6, %5
%8 = or i32 %7, -290387136
%9 = tail call i32 @output_w32(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIGBUS;
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ register_handler(int /*<<< orphan*/);
void forensics_private_register_signal_handlers() {
  register_handler(SIGABRT);
  register_handler(SIGBUS);
  register_handler(SIGFPE);
  register_handler(SIGILL);
  register_handler(SIGSEGV);
}


x86 assembly (clang, -O0):
<forensics_private_register_signal_handlers>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<forensics_private_register_signal_handlers>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1030 <register_handler@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <register_handler@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIGBUS = global i32 0
@SIGFPE = global i32 0
@SIGILL = global i32 0
@SIGSEGV = global i32 0
define void @forensics_private_register_signal_handlers() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @register_handler(i32 %1)
%3 = load i32, i32* @SIGBUS
%4 = call i32 @register_handler(i32 %3)
%5 = load i32, i32* @SIGFPE
%6 = call i32 @register_handler(i32 %5)
%7 = load i32, i32* @SIGILL
%8 = call i32 @register_handler(i32 %7)
%9 = load i32, i32* @SIGSEGV
%10 = call i32 @register_handler(i32 %9)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIGBUS = global i32 0
@SIGFPE = global i32 0
@SIGILL = global i32 0
@SIGSEGV = global i32 0
define void @forensics_private_register_signal_handlers() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @register_handler(i32 %1)
%3 = load i32, i32* @SIGBUS
%4 = tail call i32 @register_handler(i32 %3)
%5 = load i32, i32* @SIGFPE
%6 = tail call i32 @register_handler(i32 %5)
%7 = load i32, i32* @SIGILL
%8 = tail call i32 @register_handler(i32 %7)
%9 = load i32, i32* @SIGSEGV
%10 = tail call i32 @register_handler(i32 %9)
ret void
}
/* Variables and functions */
double pow(double, double);
double nonlinear_adaptation(double c, double fl) {
  double p = pow((fl * c) / 100.0, 0.42);
  return ((400.0 * p) / (27.13 + p)) + 0.1;
}


x86 assembly (clang, -O0):
<nonlinear_adaptation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xebe(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe90(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonlinear_adaptation>:
push   %rax
mulsd  %xmm1,%xmm0
divsd  0xee3(%rip),%xmm0
movsd  0xee3(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xede(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm0
divsd  %xmm0,%xmm1
addsd  0xed6(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nonlinear_adaptation(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fdiv double %8, 1.000000e+02
%10 = call double @pow(double %9, double 4.200000e-01)
store double %10, double* %5
%11 = load double, double* %5
%12 = fmul double 4.000000e+02, %11
%13 = load double, double* %5
%14 = fadd double 2.713000e+01, %13
%15 = fdiv double %12, %14
%16 = fadd double %15, 1.000000e-01
ret double %16
}

LLVM IR (-O2):
define double @nonlinear_adaptation(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fdiv double %3, 1.000000e+02
%5 = tail call double @pow(double %4, double 4.200000e-01)
%6 = fmul double %5, 4.000000e+02
%7 = fadd double %5, 2.713000e+01
%8 = fdiv double %6, %7
%9 = fadd double %8, 1.000000e-01
ret double %9
}
void freq_gen(double f, double phi, double tau) {}


x86 assembly (clang, -O0):
<freq_gen>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<freq_gen>:
ret

LLVM IR (-O0):
define void @freq_gen(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret void
}

LLVM IR (-O2):
define void @freq_gen(double %0, double %1, double %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *);
char *long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ save_wrk_table(int /*<<< orphan*/);
char *macsaveIntTbl(char *arg) {
  return long2str(arg, save_wrk_table(get_string(arg)));
}


x86 assembly (clang, -O0):
<macsaveIntTbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_string@plt>
mov    %eax,%edi
call   1050 <save_wrk_table@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <long2str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macsaveIntTbl>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_string@plt>
mov    %eax,%edi
call   1050 <save_wrk_table@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <long2str@plt>

LLVM IR (-O0):
define i8* @macsaveIntTbl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @get_string(i8* %4)
%6 = call i32 @save_wrk_table(i32 %5)
%7 = call i8* @long2str(i8* %3, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @macsaveIntTbl(i8* %0) {
%2 = tail call i32 @get_string(i8* %0)
%3 = tail call i32 @save_wrk_table(i32 %2)
%4 = tail call i8* @long2str(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ CG_ConfigString(int);
int /*<<< orphan*/ Q_strncpyz(char *, int /*<<< orphan*/, int);
int strlen(char *);
int CG_ConfigStringCopy(int index, char *buff, int buffsize) {
  Q_strncpyz(buff, CG_ConfigString(index), buffsize);
  return strlen(buff);
}


x86 assembly (clang, -O0):
<CG_ConfigStringCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <CG_ConfigString@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1050 <Q_strncpyz@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_ConfigStringCopy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <CG_ConfigString@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1050 <Q_strncpyz@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @CG_ConfigStringCopy(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i32 @CG_ConfigString(i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @Q_strncpyz(i8* %7, i32 %9, i32 %10)
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @CG_ConfigStringCopy(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @CG_ConfigString(i32 %0)
%5 = tail call i32 @Q_strncpyz(i8* %1, i32 %4, i32 %2)
%6 = tail call i32 @strlen(i8* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main() {
  char *a = (char *)malloc(10);
  free(a);
  a[2] = 123;
  free(malloc(2));
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movb   $0x7b,0x2(%rax)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
store i8 123, i8* %7
%8 = call i8* @malloc(i32 2)
%9 = call i32 @free(i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
%3 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%4 = tail call i32 @free(i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint16_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
uint8_t Count1s(int16_t Word) { return Count1s((uint16_t)Word); }


x86 assembly (clang, -O0):
<Count1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Count1s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Count1s>:
jmp    1100 <Count1s>

LLVM IR (-O0):
define i32 @Count1s(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @Count1s(i64 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @Count1s(i64 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int findComplement(int);
char *when3_shouldReturn0() {
  int complement = findComplement(3);
  do {
    if (!(complement == 0))
      return "error, something went wrong";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<when3_shouldReturn0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <findComplement@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113f <when3_shouldReturn0+0x2f>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <when3_shouldReturn0+0x3c>
jmp    1144 <when3_shouldReturn0+0x34>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<when3_shouldReturn0>:
push   %rax
mov    $0x3,%edi
call   1030 <findComplement@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xeda(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"error, something went wrong\00"
define i8* @when3_shouldReturn0() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @findComplement(i32 3)
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"error, something went wrong\00"
define i8* @when3_shouldReturn0() {
%1 = tail call i32 @findComplement(i32 3)
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
unsigned btor_hash_ptr(const void *p) {
  return 1183477 * (unsigned)(unsigned long)p;
}


x86 assembly (clang, -O0):
<btor_hash_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x120ef5,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btor_hash_ptr>:
imul   $0x120ef5,%edi,%eax
ret

LLVM IR (-O0):
define i32 @btor_hash_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = mul i32 1183477, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @btor_hash_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = mul i32 %3, 1183477
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
int keycmp(char *a, char *b, int x, int y) {
  return x == y && !memcmp(a, b, x);
}


x86 assembly (clang, -O0):
<keycmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
jne    1152 <keycmp+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keycmp>:
xor    %eax,%eax
cmp    %ecx,%edx
jne    1129 <keycmp+0x19>
push   %rax
call   1030 <memcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @keycmp(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @memcmp(i8* %13, i8* %14, i32 %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br label %19
19: ; preds = %12, %4
%20 = phi i1 [ false, %4 ], [ %18, %12 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

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