xunge/DecIR huggingface dataset:
unsigned int round_next_p_two(unsigned int n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<round_next_p_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_next_p_two>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @round_next_p_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @round_next_p_two(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ get_options();
int /*<<< orphan*/ get_torrc_fname(int /*<<< orphan*/);
int write_configuration_file(int /*<<< orphan*/, int /*<<< orphan*/);
int options_save_current(void) {
  return write_configuration_file(get_torrc_fname(0), get_options());
}


x86 assembly (clang, -O0):
<options_save_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <get_torrc_fname@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <get_options@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <write_configuration_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_save_current>:
push   %rbx
xor    %edi,%edi
call   1040 <get_torrc_fname@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <get_options@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <write_configuration_file@plt>

LLVM IR (-O0):
define i32 @options_save_current() {
%1 = call i32 @get_torrc_fname(i32 0)
%2 = call i32 (...) @get_options()
%3 = call i32 @write_configuration_file(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @options_save_current() {
%1 = tail call i32 @get_torrc_fname(i32 0)
%2 = tail call i32 (...) @get_options()
%3 = tail call i32 @write_configuration_file(i32 %1, i32 %2)
ret i32 %3
}
void arcprecision_(prec) int *prec;
{ circleprecision(*prec); }


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

x86 assembly (clang, -O2):
<arcprecision_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <circleprecision@plt>

LLVM IR (-O0):
define void @arcprecision_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @circleprecision to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @arcprecision_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @circleprecision to i32 (i32, ...)*)(i32 %2)
ret void
}
int set_dip_index(struct xhda_codec *codec, struct xhda_node *node,
                  unsigned int cmd) {
  return 0;
}


x86 assembly (clang, -O0):
<set_dip_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.xhda_codec = type opaque
%struct.xhda_node = type opaque
define i32 @set_dip_index(%struct.xhda_codec* %0, %struct.xhda_node* %1, i32 %2) {
%4 = alloca %struct.xhda_codec*
%5 = alloca %struct.xhda_node*
%6 = alloca i32
store %struct.xhda_codec* %0, %struct.xhda_codec** %4
store %struct.xhda_node* %1, %struct.xhda_node** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.xhda_codec = type opaque
%struct.xhda_node = type opaque
define i32 @set_dip_index(%struct.xhda_codec* nocapture readnone %0, %struct.xhda_node* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xb4() {
  Assert_real((islower(180) == 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_islower.c",
              905, ("islower should be 0 for 0xb4"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xb4>:
push   %rax
mov    $0xb4,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x389,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb4\00"
define void @t_islower_0xb4() {
%1 = call i64 @islower(i32 180)
%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 905, i8* getelementptr inbounds ([29 x i8], [29 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb4\00"
define void @t_islower_0xb4() {
%1 = tail call i64 @islower(i32 180)
%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 905, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int hash_int(unsigned int buckets, void *key) {
  int *sno = (int *)key;
  return (*sno) % buckets;
}


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

x86 assembly (clang, -O2):
<hash_int>:
mov    (%rsi),%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_int(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = urem i32 %4, %0
ret i32 %5
}
int lchild(int x) { return 2 * x; }


x86 assembly (clang, -O0):
<lchild>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchild>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @lchild(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int iotjs_entry(int, char **);
int main(int argc, char **argv) { return iotjs_entry(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <iotjs_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <iotjs_entry@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @iotjs_entry(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
long hash(char *word) {
  long num = 42;
  for (int count = 0; count < strlen(word); count++) {
    num += word[count] * (count + 1);
  }
  return num;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <hash+0x64>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <hash+0x1b>
mov    -0x10(%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 i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 42, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %4
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %26
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
%19 = mul nsw i32 %16, %18
%20 = sext i32 %19 to i64
%21 = load i64, i64* %3
%22 = add nsw i64 %21, %20
store i64 %22, i64* %3
br label %23
23: ; preds = %10
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
%27 = load i64, i64* %3
ret i64 %27
}

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 %6, label %4
4: ; preds = %6, %1
%5 = phi i64 [ 42, %1 ], [ %16, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i64 [ %12, %6 ], [ 0, %1 ]
%8 = phi i64 [ %16, %6 ], [ 42, %1 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = sext i8 %10 to i64
%12 = add nuw nsw i64 %7, 1
%13 = mul i64 %12, %11
%14 = shl i64 %13, 32
%15 = ashr exact i64 %14, 32
%16 = add nsw i64 %8, %15
%17 = tail call i32 @strlen(i8* %0)
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %12, %18
br i1 %19, label %6, label %4
}
void initializeKeyboard() {}


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

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

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

LLVM IR (-O2):
define void @initializeKeyboard() {
ret void
}
/* Variables and functions */
scalar_t__ Status(void *);
int /*<<< orphan*/ sleep(int);
void Wait(void *x) {
  while (Status(x) < 0)
    sleep(5);
}


x86 assembly (clang, -O0):
<Wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Status@plt>
cmp    $0x0,%rax
jge    114e <Wait+0x2e>
mov    $0x5,%edi
call   1040 <sleep@plt>
jmp    112c <Wait+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wait>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <Status@plt>
test   %rax,%rax
jns    1149 <Wait+0x29>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
jmp    1130 <Wait+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Wait(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = call i64 @Status(i8* %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @sleep(i32 5)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @Wait(i8* %0) {
%2 = tail call i64 @Status(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @sleep(i32 5)
%6 = tail call i64 @Status(i8* %0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort_helper(int *, int /*<<< orphan*/, int);
void sort(int *cards, int card_num) { sort_helper(cards, 0, card_num - 1); }


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

x86 assembly (clang, -O2):
<sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <sort_helper@plt>

LLVM IR (-O0):
define void @sort(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 = sub nsw i32 %6, 1
%8 = call i32 @sort_helper(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @sort_helper(i32* %0, i32 0, i32 %3)
ret void
}
int BcdToInt11(char xx[]) { return (xx[0] * 256 + xx[1]); }


x86 assembly (clang, -O0):
<BcdToInt11>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BcdToInt11>:
movsbl (%rdi),%ecx
shl    $0x8,%ecx
movsbl 0x1(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @BcdToInt11(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = mul nsw i32 %6, 256
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @BcdToInt11(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %4, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(void *, size_t const, int const, int /*<<< orphan*/ *);
int freadx(void *ptr, const size_t size, const int nitems, FILE *fp) {
  return (fread(ptr, size, nitems, fp));
}


x86 assembly (clang, -O0):
<freadx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freadx>:
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @freadx(i8* %0, i64 %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @fread(i8* %9, i64 %10, i32 %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @freadx(i8* nocapture %0, i64 %1, i32 %2, i32* nocapture %3) {
%5 = tail call i32 @fread(i8* %0, i64 %1, i32 %2, i32* %3)
ret i32 %5
}
int pixel_get_signed_g16(unsigned int pixel) {
  return (short)((pixel & 0xFFFF0000) >> 16);
}


x86 assembly (clang, -O0):
<pixel_get_signed_g16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_get_signed_g16>:
mov    %edi,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @pixel_get_signed_g16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
%6 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @pixel_get_signed_g16(i32 %0) {
%2 = ashr i32 %0, 16
ret i32 %2
}
int my_hash1(const void *key) { return (*(const int *)key % 11); }


x86 assembly (clang, -O0):
<my_hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_hash1>:
movslq (%rdi),%rax
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_hash1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 11
ret i32 %6
}

LLVM IR (-O2):
define i32 @my_hash1(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 11
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_ack_timeout_time_set(int /*<<< orphan*/);
void nrf_802154_ack_timeout_set(uint32_t time) {
  nrf_802154_ack_timeout_time_set(time);
}


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

x86 assembly (clang, -O2):
<nrf_802154_ack_timeout_set>:
jmp    1030 <nrf_802154_ack_timeout_time_set@plt>

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

LLVM IR (-O2):
define void @nrf_802154_ack_timeout_set(i32 %0) {
%2 = tail call i32 @nrf_802154_ack_timeout_time_set(i32 %0)
ret void
}
/* Variables and functions */
char tolower(unsigned char);
char *strlow(char *string) {
  char *convert;
  convert = string;
  do {
    *convert = tolower((unsigned char)*convert);
  } while (*convert++);
  return string;
}


x86 assembly (clang, -O0):
<strlow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1124 <strlow+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlow>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strlow+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strlow(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call signext i8 @tolower(i8 zeroext %7)
%9 = load i8*, i8** %3
store i8 %8, i8* %9
br label %10
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
%13 = load i8, i8* %11
%14 = icmp ne i8 %13, 0
br i1 %14, label %5, label %15
15: ; preds = %10
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @strlow(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @tolower(i8 zeroext %4)
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ rand();
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
int hogcpu(void) {
  while (1)
    sqrt(rand());
  return 0;
}


x86 assembly (clang, -O0):
<hogcpu>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <hogcpu+0x9>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <sqrt@plt>
jmp    1129 <hogcpu+0x9>

x86 assembly (clang, -O2):
<hogcpu>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <sqrt@plt>
jmp    1130 <hogcpu+0x10>

LLVM IR (-O0):
define i32 @hogcpu() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @rand()
%3 = call i32 @sqrt(i32 %2)
br label %1
}

LLVM IR (-O2):
define i32 @hogcpu() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @rand()
%3 = tail call i32 @sqrt(i32 %2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ draw_pixel(int, int);
void d2d_DrawPixel(int x0, int y0) { draw_pixel(x0, y0); }


x86 assembly (clang, -O0):
<d2d_DrawPixel>:
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 <draw_pixel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2d_DrawPixel>:
jmp    1030 <draw_pixel@plt>

LLVM IR (-O0):
define void @d2d_DrawPixel(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 @draw_pixel(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @d2d_DrawPixel(i32 %0, i32 %1) {
%3 = tail call i32 @draw_pixel(i32 %0, i32 %1)
ret void
}
void ff_hevc_put_hevc_epel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v8_8_sse4() {
ret void
}
int solve() {
  int sum = 0, sum_of_squares = 0, N = 100;
  for (int i = 0; i <= N; i++) {
    sum += i;
    sum_of_squares += i * i;
  }
  int result = sum_of_squares - sum * sum;
  return result > 0 ? result : -result;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1150 <solve+0x50>
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <solve+0x20>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1174 <solve+0x74>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    117c <solve+0x7c>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
mov    $0x17ff976,%eax
ret

LLVM IR (-O0):
define i32 @solve() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 100, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %19, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %1
%13 = add nsw i32 %12, %11
store i32 %13, i32* %1
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, %16
store i32 %18, i32* %2
br label %19
19: ; preds = %10
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %2
%24 = load i32, i32* %1
%25 = load i32, i32* %1
%26 = mul nsw i32 %24, %25
%27 = sub nsw i32 %23, %26
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %22
%31 = load i32, i32* %5
br label %35
32: ; preds = %22
%33 = load i32, i32* %5
%34 = sub nsw i32 0, %33
br label %35
35: ; preds = %32, %30
%36 = phi i32 [ %31, %30 ], [ %34, %32 ]
ret i32 %36
}

LLVM IR (-O2):
define i32 @solve() {
ret i32 25164150
}
/* Variables and functions */
scalar_t__ DOcmdcheck();
int DOcommand(char *, char *);
int DOnoop() {
  if (DOcmdcheck())
    return (0);
  return (DOcommand("NOOP", ""));
}


x86 assembly (clang, -O0):
<DOnoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <DOcmdcheck@plt>
cmp    $0x0,%rax
je     1145 <DOnoop+0x25>
movl   $0x0,-0x4(%rbp)
jmp    115b <DOnoop+0x3b>
lea    0xeb4(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <DOcommand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DOnoop>:
push   %rax
xor    %eax,%eax
call   1040 <DOcmdcheck@plt>
test   %rax,%rax
je     1131 <DOnoop+0x11>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec8(%rip),%rdi
lea    0xec5(%rip),%rsi
pop    %rax
jmp    1030 <DOcommand@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"NOOP\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @DOnoop() {
%1 = alloca i32
%2 = call i64 (...) @DOcmdcheck()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @DOcommand(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"NOOP\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @DOnoop() {
%1 = tail call i64 (...) @DOcmdcheck()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @DOcommand(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
void nullFunc() {}


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

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

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

LLVM IR (-O2):
define void @nullFunc() {
ret void
}
void usb_select_endpoint(int idx) {
  (*(volatile unsigned char *)((0x24100000) + 0x2c)) = idx;
}


x86 assembly (clang, -O0):
<usb_select_endpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x2410002c,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_select_endpoint>:
mov    %dil,0x2410002c
24
ret

LLVM IR (-O0):
define void @usb_select_endpoint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 605028396 to i8*)
ret void
}

LLVM IR (-O2):
define void @usb_select_endpoint(i32 %0) {
%2 = trunc i32 %0 to i8
store volatile i8 %2, i8* inttoptr (i64 605028396 to i8*)
ret void
}
/* Variables and functions */
int reboot(int, int, int);
int my_reboot(int cmd) { return reboot(0xfee1dead, 672274793, (cmd)); }


x86 assembly (clang, -O0):
<my_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xfee1dead,%edi
mov    $0x28121969,%esi
call   1030 <reboot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_reboot>:
mov    %edi,%edx
mov    $0xfee1dead,%edi
mov    $0x28121969,%esi
jmp    1030 <reboot@plt>

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

LLVM IR (-O2):
define i32 @my_reboot(i32 %0) {
%2 = tail call i32 @reboot(i32 -18751827, i32 672274793, i32 %0)
ret i32 %2
}
int _evbuffer_testing_use_sendfile(void) {
  int ok = 0;
  return ok;
}


x86 assembly (clang, -O0):
<_evbuffer_testing_use_sendfile>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_evbuffer_testing_use_sendfile() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @_evbuffer_testing_use_sendfile() {
ret i32 0
}
void aux_dix_int(long n, char *ans, int *p) {
  if (n < -9 || 9 < n)
    aux_dix_int(n / 10, ans, p);
  ans[(*p)++] = '0' + -(n % 10);
}


x86 assembly (clang, -O0):
<aux_dix_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0xfffffffffffffff7,-0x8(%rbp)
jl     113e <aux_dix_int+0x2e>
mov    $0x9,%eax
cmp    -0x8(%rbp),%rax
jge    115c <aux_dix_int+0x4c>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <aux_dix_int@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
xor    %eax,%eax
sub    %rdx,%rax
add    $0x30,%rax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux_dix_int>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    -0xa(%rdi),%rax
movabs $0x6666666666666667,%r12
66 66 66
cmp    $0xffffffffffffffec,%rax
ja     1154 <aux_dix_int+0x44>
mov    %rbx,%rax
imul   %r12
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x2,%rdx
add    %rdx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <aux_dix_int@plt>
mov    %rbx,%rax
imul   %r12
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%edx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
mov    $0x30,%al
sub    %bl,%al
movslq (%r15),%rcx
lea    0x1(%rcx),%edx
mov    %edx,(%r15)
mov    %al,(%r14,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @aux_dix_int(i64 %0, i8* nocapture writeonly %1, i32* nocapture %2) {
%4 = add i64 %0, -10
%5 = icmp ult i64 %4, -19
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = sdiv i64 %0, 10
tail call void @aux_dix_int(i64 %7, i8* %1, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = srem i64 %0, 10
%10 = trunc i64 %9 to i8
%11 = sub nsw i8 48, %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i8, i8* %1, i64 %14
store i8 %11, i8* %15
ret void
}
/* Variables and functions */
int compute(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char *infix = malloc(80 * sizeof(char));
  printf("Enter the expression to evaluate (79 chars max):\n");
  scanf("%s", infix);
  infix[78] = '\0';
  printf("=%d\n\n", compute(infix));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x4e(%rax)
mov    -0x10(%rbp),%rdi
call   1060 <compute@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
movb   $0x0,0x4e(%rbx)
mov    %rbx,%rdi
call   1070 <compute@plt>
lea    0xe77(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Enter the expression to evaluate (79 chars max):\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"=%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 80)
store i8* %3, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 78
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = call i32 @compute(i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"=%d\0A\0A\00"
@str = [49 x i8] c"Enter the expression to evaluate (79 chars max):\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = getelementptr inbounds i8, i8* %1, i64 78
store i8 0, i8* %4
%5 = tail call i32 @compute(i8* %1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
void ARpintf_Close(void) {}


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

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

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

LLVM IR (-O2):
define void @ARpintf_Close() {
ret void
}
int node_to_first_cpu(int node) { return 0; }


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

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

LLVM IR (-O0):
define i32 @node_to_first_cpu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @node_to_first_cpu(i32 %0) {
ret i32 0
}
int main() {
  if (25) {
    35;
  }
  if (0) {
    45;
  } else {
    55;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 357;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x165,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113f <hash+0x3f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x16f26017,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x165,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 357
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void nullraster(int xpix, int ypix, int xmin, int ymin, int xmax, int ymax,
                unsigned char **raster_block, int orient, int dither_it) {}


x86 assembly (clang, -O0):
<nullraster>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nullraster(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8** %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8**
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8** %6, i8*** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
ret void
}

LLVM IR (-O2):
define void @nullraster(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8** nocapture %6, i32 %7, i32 %8) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
long long __udivmod32(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
long long __lux_umod32(uint32_t a, uint32_t b) { return __udivmod32(a, b, 0); }


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

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

LLVM IR (-O0):
define i64 @__lux_umod32(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 i64 @__udivmod32(i32 %5, i32 %6, i32 0)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__lux_umod32(i32 %0, i32 %1) {
%3 = tail call i64 @__udivmod32(i32 %0, i32 %1, i32 0)
ret i64 %3
}
/* Type definitions */
struct stemmer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stemmer *);
extern void porter_stemmer_free(struct stemmer *z) { free(z); }


x86 assembly (clang, -O0):
<porter_stemmer_free>:
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):
<porter_stemmer_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.stemmer = type { i32 }
define void @porter_stemmer_free(%struct.stemmer* nocapture %0) {
%2 = tail call i32 @free(%struct.stemmer* %0)
ret void
}
int msm_chg_usb_charger_disconnected(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_chg_usb_charger_disconnected() {
ret i32 0
}
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
int netmask(int);
in_addr_t network(in_addr_t addr, int prefix) {
  return (addr & netmask(prefix));
}


x86 assembly (clang, -O0):
<network>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <netmask@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <netmask@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @network(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 @netmask(i32 %6)
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @network(i32 %0, i32 %1) {
%3 = tail call i32 @netmask(i32 %1)
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ CSSValueIsColor(char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int CSSValueIsBorderColor(const char *str) {
  if (str == NULL)
    return 0;
  return (!strcmp(str, "transparent") || CSSValueIsColor(str));
}


x86 assembly (clang, -O0):
<CSSValueIsBorderColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <CSSValueIsBorderColor+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1181 <CSSValueIsBorderColor+0x61>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1176 <CSSValueIsBorderColor+0x56>
mov    -0x10(%rbp),%rdi
call   1040 <CSSValueIsColor@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSSValueIsBorderColor>:
push   %rbx
test   %rdi,%rdi
je     114e <CSSValueIsBorderColor+0x2e>
mov    %rdi,%rbx
lea    0xed0(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1152 <CSSValueIsBorderColor+0x32>
mov    %rbx,%rdi
call   1040 <CSSValueIsColor@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"transparent\00"
define i32 @CSSValueIsBorderColor(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %18
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strcmp(i8* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i64 @CSSValueIsColor(i8* %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ true, %7 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %6
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [12 x i8] c"transparent\00"
define i32 @CSSValueIsBorderColor(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @CSSValueIsColor(i8* %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6, %1
%11 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}