xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x6d() {
  Assert_real((isupper(109) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              550, ("isupper should be 0 for m"));
}


x86 assembly (clang, -O0):
<t_isupper_0x6d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6d,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x226,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x6d>:
push   %rax
mov    $0x6d,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x226,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for m\00"
define void @t_isupper_0x6d() {
%1 = call i64 @isupper(i32 109)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for m\00"
define void @t_isupper_0x6d() {
%1 = tail call i64 @isupper(i32 109)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void _primes(size_t, unsigned int *, int);
void primes(size_t num, unsigned int prime_nums[]) {
  return _primes(num, prime_nums, false);
}


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

x86 assembly (clang, -O2):
<primes>:
xor    %edx,%edx
jmp    1030 <_primes@plt>

LLVM IR (-O0):
define void @primes(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = load i32*, i32** %4
ret void
}

LLVM IR (-O2):
define void @primes(i64 %0, i32* %1) {
tail call void @_primes(i64 %0, i32* %1, i32 0)
ret void
}
AR0RX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[10000000]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2625a00(%rax),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     113f <AR0RX1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <AR0RX1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0RX1>:
mov    0x2625a00(%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

LLVM IR (-O0):
define i32 @AR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = getelementptr inbounds i32, i32* %14, i64 10000000
%16 = load i32, i32* %15
%17 = load i32*, i32** %13
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = icmp ule i32 %16, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @AR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
%11 = load i32, i32* %10
%12 = icmp ule i32 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
int find(int a[], int n, int val) {
  int i, true = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == val) {
      true = 1;
      return i;
    }
  }
  if (true == 0)
    return -1;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1161 <find+0x61>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    114e <find+0x4e>
movl   $0x1,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <find+0x72>
jmp    1153 <find+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <find+0x1c>
cmpl   $0x0,-0x20(%rbp)
jne    1172 <find+0x72>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <find+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <find+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @find(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %9
store i32 0, i32* %8
br label %10
10: ; preds = %25, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i32*, i32** %5
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
store i32 1, i32* %9
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %32
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %10
28: ; preds = %10
%29 = load i32, i32* %9
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 -1, i32* %4
br label %32
32: ; preds = %22, %31, %28
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @find(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int inportb(int);
int io_is_transmit_empty() { return inportb(0x3f8 + 5) & 0x20; }


x86 assembly (clang, -O0):
<io_is_transmit_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fd,%edi
call   1030 <inportb@plt>
and    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_is_transmit_empty>:
push   %rax
mov    $0x3fd,%edi
call   1030 <inportb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @io_is_transmit_empty() {
%1 = call i32 @inportb(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}

LLVM IR (-O2):
define i32 @io_is_transmit_empty() {
%1 = tail call i32 @inportb(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ _sizeof_flexarr(size_t *, size_t, size_t, size_t);
int /*<<< orphan*/ errno;
void *malloc(size_t);
void *_malloc_flexarr(size_t sz0, size_t cnt, size_t sz1) {
  size_t sz;
  if (!_sizeof_flexarr(&sz, sz0, cnt, sz1)) {
    errno = ENOMEM;
    return NULL;
  }
  return malloc(sz);
}


x86 assembly (clang, -O0):
<_malloc_flexarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%rdi
call   1030 <_sizeof_flexarr@plt>
cmp    $0x0,%eax
jne    1171 <_malloc_flexarr+0x51>
mov    0x2e87(%rip),%rax
mov    (%rax),%ecx
mov    0x2e76(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    117e <_malloc_flexarr+0x5e>
mov    -0x28(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_malloc_flexarr>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <_sizeof_flexarr@plt>
test   %eax,%eax
je     1141 <_malloc_flexarr+0x21>
mov    (%rsp),%rdi
call   1040 <malloc@plt>
pop    %rcx
ret
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    0x2e87(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i8* @_malloc_flexarr(i64 %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = call i32 @_sizeof_flexarr(i64* %8, i64 %9, i64 %10, i64 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %3
%15 = load i32, i32* @ENOMEM
store i32 %15, i32* @errno
store i8* null, i8** %4
br label %19
16: ; preds = %3
%17 = load i64, i64* %8
%18 = call i8* @malloc(i64 %17)
store i8* %18, i8** %4
br label %19
19: ; preds = %16, %14
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define noalias i8* @_malloc_flexarr(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @_sizeof_flexarr(i64* %4, i64 %0, i64 %1, i64 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = load i32, i32* @ENOMEM
store i32 %9, i32* @errno
br label %13
10: ; preds = %3
%11 = load i64, i64* %4
%12 = call i8* @malloc(i64 %11)
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %12, %10 ], [ null, %8 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Pl_Jump(char *label) {
  Inst_Printf("b",
              "_"
              "%s",
              label);
}


x86 assembly (clang, -O0):
<Pl_Jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pl_Jump>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee1(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"b\00"
@.str.1 = [4 x i8] c"_%s\00"
define void @Pl_Jump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"b\00"
@.str.1 = [4 x i8] c"_%s\00"
define void @Pl_Jump(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ f(struct sigaction *);
int main(void) {
  struct sigaction sa;
  f(&sa);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = call i32 @f(%struct.sigaction* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = call i32 @f(%struct.sigaction* %1)
ret i32 0
}
int test_imm_60uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x60 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_60uint64_midword_reg>:
test   $0x600000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_60uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 96
%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_60uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6291456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_get_monitor_stream() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_get_monitor_stream"
         "\n");
}


x86 assembly (clang, -O0):
<pa_stream_get_monitor_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_stream_get_monitor_stream>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_stream_get_monitor_stream\0A\00"
define i32 @pa_stream_get_monitor_stream() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_stream_get_monitor_stream\00"
define i32 @pa_stream_get_monitor_stream() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned xrop3_52_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_52_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_52_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_52_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_52_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeletePeriCBData(void *periattr) { free(periattr); }


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

x86 assembly (clang, -O2):
<DeletePeriCBData>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DeletePeriCBData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displays_expect_false_failed(int, char const *, int);
void Displayer_display_expect_false_failed(int act, const char *file,
                                           int line) {
  displays_expect_false_failed(act, file, line);
}


x86 assembly (clang, -O0):
<Displayer_display_expect_false_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <displays_expect_false_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Displayer_display_expect_false_failed>:
jmp    1030 <displays_expect_false_failed@plt>

LLVM IR (-O0):
define void @Displayer_display_expect_false_failed(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 i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @displays_expect_false_failed(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @Displayer_display_expect_false_failed(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @displays_expect_false_failed(i32 %0, i8* %1, i32 %2)
ret void
}
float area(int a) { return a * a * 3.14159; }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
imul   %edi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @area(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 3.141590e+00
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @area(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 3.141590e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void f1() {
  int size = 10;
  void *ptr = malloc(size);
  free(ptr);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i8*
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @malloc(i32 %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int strListCompareAlphaCase(const void *arg1, const void *arg2) {
  return strcmp(*(char **)arg1, *(char **)arg2);
}


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

x86 assembly (clang, -O2):
<strListCompareAlphaCase>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strListCompareAlphaCase(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strListCompareAlphaCase(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned xrop3_30_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | S;
  stk1 = T ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_30_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_30_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%r8d
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     $0xff,%ecx
mov    %eax,%edx
xor    %ecx,%edx
and    %r8d,%edx
not    %eax
and    %ecx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_30_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_30_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = xor i32 %7, %8
%10 = and i32 %9, %5
%11 = xor i32 %7, -1
%12 = and i32 %8, %11
%13 = xor i32 %3, -1
%14 = and i32 %13, %6
%15 = or i32 %12, %14
%16 = or i32 %15, %10
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *__alloc(void *x) {
  if (x)
    return x;
  ;
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<__alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <__alloc+0x21>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<__alloc>:
test   %rdi,%rdi
je     1119 <__alloc+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @__alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
ret i8* %6
7: ; preds = %1
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i8* @__alloc(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
ret i8* %0
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bool_read(int, int /*<<< orphan*/ *, int);
uint8_t read_uint32_little_endian(int fd, uint32_t *integer) {
  return bool_read(fd, integer, sizeof *integer);
}


x86 assembly (clang, -O0):
<read_uint32_little_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <bool_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint32_little_endian>:
mov    $0x4,%edx
jmp    1030 <bool_read@plt>

LLVM IR (-O0):
define i32 @read_uint32_little_endian(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 @bool_read(i32 %5, i32* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
define i32 @read_uint32_little_endian(i32 %0, i32* %1) {
%3 = tail call i32 @bool_read(i32 %0, i32* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ rp_DpinSetState(int, int);
void set_gpio(int pin, int value) { rp_DpinSetState(pin, value); }


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

x86 assembly (clang, -O2):
<set_gpio>:
jmp    1030 <rp_DpinSetState@plt>

LLVM IR (-O0):
define void @set_gpio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @rp_DpinSetState(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @set_gpio(i32 %0, i32 %1) {
%3 = tail call i32 @rp_DpinSetState(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct geometry_struct {
  int dummy;
};

/* Variables and functions */
int A_within_B(struct geometry_struct *, struct geometry_struct *, int);
int cone_within_box(struct geometry_struct *geometry_child,
                    struct geometry_struct *geometry_parent) {
  return A_within_B(geometry_child, geometry_parent, (int)300);
}


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

x86 assembly (clang, -O2):
<cone_within_box>:
mov    $0x12c,%edx
jmp    1030 <A_within_B@plt>

LLVM IR (-O0):
%struct.geometry_struct = type { i32 }
define i32 @cone_within_box(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = alloca %struct.geometry_struct*
%4 = alloca %struct.geometry_struct*
store %struct.geometry_struct* %0, %struct.geometry_struct** %3
store %struct.geometry_struct* %1, %struct.geometry_struct** %4
%5 = load %struct.geometry_struct*, %struct.geometry_struct** %3
%6 = load %struct.geometry_struct*, %struct.geometry_struct** %4
%7 = call i32 @A_within_B(%struct.geometry_struct* %5, %struct.geometry_struct* %6, i32 300)
ret i32 %7
}

LLVM IR (-O2):
%struct.geometry_struct = type { i32 }
define i32 @cone_within_box(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = tail call i32 @A_within_B(%struct.geometry_struct* %0, %struct.geometry_struct* %1, i32 300)
ret i32 %3
}
void hello(const char *str) { printf("%s(%d): %s\n", __FUNCTION__, 6, str); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x6,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x6,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s(%d): %s\0A\00"
@__FUNCTION__.hello = [6 x i8] c"hello\00"
define void @hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.hello, i64 0, i64 0), i32 6, i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s(%d): %s\0A\00"
@__FUNCTION__.hello = [6 x i8] c"hello\00"
define void @hello(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.hello, i64 0, i64 0), i32 6, i8* %0)
ret void
}
unsigned hash(string)
char *string;
{
  register char *p;
  register unsigned i, sum;
  for (sum = i = 0, p = string; *p; i += 3)
    sum ^= (*p++) << (i & 07);
  return (sum);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <hash+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <hash+0x1e>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <hash+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
xor    %edx,%edx
xchg   %ax,%ax
movsbl %cl,%esi
mov    %edx,%ecx
and    $0x7,%cl
shl    %cl,%esi
xor    %esi,%eax
add    $0x3,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i8*, i8** %2
store i8* %6, i8** %3
br label %7
7: ; preds = %21, %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = load i32, i32* %4
%17 = and i32 %16, 7
%18 = shl i32 %15, %17
%19 = load i32, i32* %5
%20 = xor i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %11
%22 = load i32, i32* %4
%23 = add i32 %22, 3
store i32 %23, i32* %4
br label %7
24: ; preds = %7
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 0, %1 ]
%7 = phi i32 [ %14, %4 ], [ 0, %1 ]
%8 = phi i8* [ %9, %4 ], [ %0, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %5 to i32
%11 = and i32 %7, 7
%12 = shl nsw i32 %10, %11
%13 = xor i32 %12, %6
%14 = add i32 %7, 3
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i32 [ 0, %1 ], [ %13, %4 ]
ret i32 %18
}
void pps() {}


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

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

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

LLVM IR (-O2):
define void @pps() {
ret void
}
int fun(int a, int b, int c) {
  int max = 0;
  if (a > max) {
    max = a;
  }
  if (b > max) {
    max = b;
  }
  if (c > max) {
    max = c;
  }
  return max;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1126 <fun+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1138 <fun+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114a <fun+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
cmp    %esi,%eax
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @fun(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %7
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %4
store i32 %12, i32* %7
br label %13
13: ; preds = %11, %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %5
store i32 %18, i32* %7
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %6
store i32 %24, i32* %7
br label %25
25: ; preds = %23, %19
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @fun(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
%5 = select i1 %4, i32 %0, i32 0
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %1, i32 %5
%8 = icmp slt i32 %7, %2
%9 = select i1 %8, i32 %2, i32 %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void Delay(unsigned ms) { usleep(ms * 1000); }


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @Delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
float vsClamp(float a, float min, float max) {
  return ((max < ((min > a) ? min : a)) ? max : ((min > a) ? min : a));
}


x86 assembly (clang, -O0):
<vsClamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    113b <vsClamp+0x3b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1145 <vsClamp+0x45>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1167 <vsClamp+0x67>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1199 <vsClamp+0x99>
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1185 <vsClamp+0x85>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    118f <vsClamp+0x8f>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsClamp>:
maxss  %xmm0,%xmm1
minss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @vsClamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %5
br label %15
13: ; preds = %3
%14 = load float, float* %4
br label %15
15: ; preds = %13, %11
%16 = phi float [ %12, %11 ], [ %14, %13 ]
%17 = fcmp olt float %7, %16
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load float, float* %6
br label %30
20: ; preds = %15
%21 = load float, float* %5
%22 = load float, float* %4
%23 = fcmp ogt float %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load float, float* %5
br label %28
26: ; preds = %20
%27 = load float, float* %4
br label %28
28: ; preds = %26, %24
%29 = phi float [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi float [ %19, %18 ], [ %29, %28 ]
ret float %31
}

LLVM IR (-O2):
define float @vsClamp(float %0, float %1, float %2) {
%4 = fcmp ogt float %1, %0
%5 = select i1 %4, float %1, float %0
%6 = fcmp ogt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
void rop3_8_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_8_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_8_0_0>:
not    %dl
and    %sil,%dl
and    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_8_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_8_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = and i8 %4, %1
%7 = and i8 %6, %5
store i8 %7, i8* %0
ret void
}
void load_crls(void) {}


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

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

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

LLVM IR (-O2):
define void @load_crls() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int tcsetpgrp(int fd, pid_t pgrp) { return 0; }


x86 assembly (clang, -O0):
<tcsetpgrp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tcsetpgrp(i32 %0, i32 %1) {
ret i32 0
}
void test3(int a, int b, float c, float d) {
  (void)(a / b);
  (void)(a % b);
  (void)(c / d);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test3(i32 %0, i32 %1, float %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sdiv i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = srem i32 %12, %13
%15 = load float, float* %7
%16 = load float, float* %8
%17 = fdiv float %15, %16
ret void
}

LLVM IR (-O2):
define void @test3(i32 %0, i32 %1, float %2, float %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int func1(jmp_buf *env, int x) {
  if (x == 0)
    longjmp(*env, 1);
  return 1;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1139 <func1+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
test   %esi,%esi
je     111a <func1+0xa>
mov    $0x1,%eax
ret
push   %rax
mov    (%rdi),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>

LLVM IR (-O0):
define i32 @func1(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @longjmp(i32 %9, i32 1)
unreachable
11: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
define i32 @func1(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* %0
%6 = tail call i32 @longjmp(i32 %5, i32 1)
unreachable
7: ; preds = %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ disp_int(int);
int /*<<< orphan*/ disp_str(char *);
void spurious_irq(int irq) {
  disp_str("spurious_irq: ");
  disp_int(irq);
  disp_str("\n");
}


x86 assembly (clang, -O0):
<spurious_irq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <disp_str@plt>
mov    -0x4(%rbp),%edi
call   1040 <disp_int@plt>
lea    0xec9(%rip),%rdi
call   1030 <disp_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spurious_irq>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <disp_str@plt>
mov    %ebx,%edi
call   1040 <disp_int@plt>
lea    0xed2(%rip),%rdi
pop    %rbx
jmp    1030 <disp_str@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"spurious_irq: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @spurious_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @disp_int(i32 %4)
%6 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"spurious_irq: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @spurious_irq(i32 %0) {
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @disp_int(i32 %0)
%4 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy_into_tab(char **, char *, int /*<<< orphan*/);
char **malloc_table(char **, char *, int);
int word_counter(char *, int /*<<< orphan*/);
char **my_str_to_wordtab(char *str) {
  int word_nbr;
  char **board;
  board = NULL;
  word_nbr = word_counter(str, 0);
  board = malloc_table(board, str, word_nbr);
  if (!board)
    return (NULL);
  copy_into_tab(board, str, 0);
  return (board);
}


x86 assembly (clang, -O0):
<my_str_to_wordtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <word_counter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <malloc_table@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117e <my_str_to_wordtab+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1195 <my_str_to_wordtab+0x65>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1050 <copy_into_tab@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_to_wordtab>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %esi,%esi
call   1030 <word_counter@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <malloc_table@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115f <my_str_to_wordtab+0x2f>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <copy_into_tab@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @my_str_to_wordtab(i8* %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
store i8* %0, i8** %3
store i8** null, i8*** %5
%6 = load i8*, i8** %3
%7 = call i32 @word_counter(i8* %6, i32 0)
store i32 %7, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i8** @malloc_table(i8** %8, i8* %9, i32 %10)
store i8** %11, i8*** %5
%12 = load i8**, i8*** %5
%13 = icmp ne i8** %12, null
br i1 %13, label %15, label %14
14: ; preds = %1
store i8** null, i8*** %2
br label %20
15: ; preds = %1
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %3
%18 = call i32 @copy_into_tab(i8** %16, i8* %17, i32 0)
%19 = load i8**, i8*** %5
store i8** %19, i8*** %2
br label %20
20: ; preds = %15, %14
%21 = load i8**, i8*** %2
ret i8** %21
}

LLVM IR (-O2):
define i8** @my_str_to_wordtab(i8* %0) {
%2 = tail call i32 @word_counter(i8* %0, i32 0)
%3 = tail call i8** @malloc_table(i8** null, i8* %0, i32 %2)
%4 = icmp eq i8** %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @copy_into_tab(i8** %3, i8* %0, i32 0)
br label %7
7: ; preds = %1, %5
ret i8** %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", 3 < 4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}