xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ get2(char *);
int get3(char *c) {
  int i = 0;
  if (*c)
    i = (*c++ - '0') * 100;
  i += get2(c);
  return i;
}


x86 assembly (clang, -O0):
<get3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <get3+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0x64,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get2@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get3>:
push   %rbx
movsbl (%rdi),%eax
imul   $0x64,%eax,%ebx
add    $0xffffed40,%ebx
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
cmove  %eax,%ebx
add    %rcx,%rdi
call   1030 <get2@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get3(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = sext i8 %2 to i64
%5 = mul nsw i64 %4, 100
%6 = add nsw i64 %5, 4294962496
%7 = xor i1 %3, true
%8 = zext i1 %7 to i64
%9 = getelementptr i8, i8* %0, i64 %8
%10 = select i1 %3, i64 0, i64 %6
%11 = tail call i64 @get2(i8* %9)
%12 = add i64 %10, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}
int test_imm_56int64_lowword_mem(long long *val) {
  return ((*val) & (0x56 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_56int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 86
%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_56int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 86
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun2() {
  int n;
  return n;
}


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

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

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

LLVM IR (-O2):
define i32 @fun2() {
ret i32 undef
}
int foo2(int a) {
  int b = a + 1;
  if (b < 0)
    return b;
  return 1;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1125 <foo2+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <foo2+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
lea    0x1(%rdi),%ecx
cmp    $0xffffffff,%edi
mov    $0x1,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo2(i32 %0) {
%2 = icmp slt i32 %0, -1
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 %3, i32 1
ret i32 %4
}
unsigned long long test_07(volatile unsigned long long *x) { return x[5]; }


x86 assembly (clang, -O0):
<test_07>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_07>:
mov    0x28(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @test_07(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 5
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @test_07(i64* %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 5
%3 = load volatile i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint8(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint8(i32 %0) {
ret void
}
isdi(c) {
  printf("isdi=> ");
  return c >= '0' && c <= '9';
}


x86 assembly (clang, -O0):
<isdi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1142 <isdi+0x32>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdi>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffd0,%ebx
xor    %eax,%eax
cmp    $0xa,%ebx
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"isdi=> \00"
define i32 @isdi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 57
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"isdi=> \00"
define i32 @isdi(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = add i32 %0, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ check_pointer();
int main() {
  check_pointer();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_pointer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_pointer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_pointer()
ret i32 0
}
/* Variables and functions */
bool is_short_flag(const char *s) {
  return (s[0] == '-' && s[1] != '\0' && s[2] == '\0');
}


x86 assembly (clang, -O0):
<is_short_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    1144 <is_short_flag+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1144 <is_short_flag+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_short_flag>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    1116 <is_short_flag+0x16>
cmpb   $0x0,0x1(%rdi)
je     1116 <is_short_flag+0x16>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_short_flag(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 = icmp eq i32 %6, 45
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %14, %8, %1
%21 = phi i1 [ false, %8 ], [ false, %1 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_short_flag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %4, %1
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
int is_expired(time_t ts) { return ts + 90 < time(NULL); }


x86 assembly (clang, -O0):
<is_expired>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x5a,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_expired>:
push   %rbx
mov    %rdi,%rbx
add    $0x5a,%rbx
xor    %edi,%edi
call   1030 <time@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_expired(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 90
%5 = call i64 @time(i32* null)
%6 = icmp slt i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_expired(i64 %0) {
%2 = add nsw i64 %0, 90
%3 = tail call i64 @time(i32* null)
%4 = icmp slt i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int comp(const char *str1, const char *str2, const size_t n) {
  size_t i;
  for (i = 0; i < n; ++i) {
    if (str1[i] != str2[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1168 <comp+0x68>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1152 <comp+0x52>
movl   $0x0,-0x4(%rbp)
jmp    116f <comp+0x6f>
jmp    1157 <comp+0x57>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <comp+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    $0x1,%eax
test   %rdx,%rdx
je     1124 <comp+0x24>
xor    %r8d,%r8d
nopl   (%rax)
movzbl (%rdi,%r8,1),%ecx
cmp    (%rsi,%r8,1),%cl
jne    1125 <comp+0x25>
add    $0x1,%r8
cmp    %r8,%rdx
jne    1110 <comp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %7
5: ; preds = %7
%6 = icmp eq i64 %14, %2
br i1 %6, label %15, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %14, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %10, %12
%14 = add nuw i64 %8, 1
br i1 %13, label %5, label %15
15: ; preds = %7, %5, %3
%16 = phi i32 [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() { puts("program dictionary-file"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"program dictionary-file\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"program dictionary-file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
int yy2yyyy(int inYearYY) {
  if (inYearYY > 50) {
    return inYearYY + 1900;
  } else {
    return inYearYY + 2000;
  }
}


x86 assembly (clang, -O0):
<yy2yyyy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jle    1121 <yy2yyyy+0x21>
mov    -0x8(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x4(%rbp)
jmp    112c <yy2yyyy+0x2c>
mov    -0x8(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yy2yyyy>:
lea    0x7d0(%rdi),%ecx
lea    0x76c(%rdi),%eax
cmp    $0x33,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @yy2yyyy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 50
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1900
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 2000
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @yy2yyyy(i32 %0) {
%2 = icmp sgt i32 %0, 50
%3 = select i1 %2, i32 1900, i32 2000
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("         /  ||___|___Love______________|\n");
  printf("  ,___/\"\"|\"\"||___|_________Linux______|\n");
  printf(" || __|\"\"|\"\"||___|____________________|\n");
  printf("*(@)***(@)(@)*|)\"\"\"\"\"\"\"\"\"\"'(@)''(@)])\"\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c" / ||___|___Love______________|\0A\00"
@.str.1 = [41 x i8] c" ,___/\22\22|\22\22||___|_________Linux______|\0A\00"
@.str.2 = [41 x i8] c" || __|\22\22|\22\22||___|____________________|\0A\00"
@.str.3 = [40 x i8] c"*(@)***(@)(@)*|)\22\22\22\22\22\22\22\22\22\22'(@)''(@)])\22\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c" / ||___|___Love______________|\00"
@str.4 = [40 x i8] c" ,___/\22\22|\22\22||___|_________Linux______|\00"
@str.5 = [40 x i8] c" || __|\22\22|\22\22||___|____________________|\00"
@str.6 = [39 x i8] c"*(@)***(@)(@)*|)\22\22\22\22\22\22\22\22\22\22'(@)''(@)])\22\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void Write_Status(char *s) {
  fprintf(stdout, "State: %-60s\r", s);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<Write_Status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write_Status>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"State: %-60s\0D\00"
define void @Write_Status(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"State: %-60s\0D\00"
define void @Write_Status(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lvmhead(int osvers, int osrel, int ossub) {
  printf("disk           busy read/s KB/read  "
         "writ/s KB/writ avque avserv _lvm_");
}


x86 assembly (clang, -O0):
<lvmhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [70 x i8] c"disk busy read/s KB/read writ/s KB/writ avque avserv _lvm_\00"
define void @lvmhead(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"disk busy read/s KB/read writ/s KB/writ avque avserv _lvm_\00"
define void @lvmhead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long, unsigned long);
char *util_print_time(unsigned long t) {
  static char s[40];
  (void)sprintf(s, "%ld.%02ld sec", t / 1000, (t % 1000) / 10);
  return s;
}


x86 assembly (clang, -O0):
<util_print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0x2ee9(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ed6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_print_time>:
push   %rbx
mov    %rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%edi
imul   $0xcccd,%edi,%ecx
shr    $0x13,%ecx
lea    0x2eff(%rip),%rbx
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@util_print_time.s = internal global [40 x i8] zeroinitializer
@.str = [14 x i8] c"%ld.%02ld sec\00"
define i8* @util_print_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 1000
%5 = load i64, i64* %2
%6 = urem i64 %5, 1000
%7 = udiv i64 %6, 10
%8 = call i32 @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %7)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0)
}

LLVM IR (-O2):
@util_print_time.s = internal global [40 x i8] zeroinitializer
@.str = [14 x i8] c"%ld.%02ld sec\00"
define i8* @util_print_time(i64 %0) {
%2 = udiv i64 %0, 1000
%3 = urem i64 %0, 1000
%4 = trunc i64 %3 to i16
%5 = udiv i16 %4, 10
%6 = zext i16 %5 to i64
%7 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %6)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0)
}
void gtk_tool_button_get_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_button_get_label() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void some_func_v0() { puts("some_func_v0"); }


x86 assembly (clang, -O0):
<some_func_v0>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"some_func_v0\00"
define void @some_func_v0() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"some_func_v0\00"
define void @some_func_v0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ COND_VS();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_svs_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_VS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_svs_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_VS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_svs_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_VS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_svs_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_VS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_svs_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_VS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int test_imm_20int64_lowword_mem(long long *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 32
%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_20int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 32
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test(int *a, int *b, int sarg) {
  int i;
  for (i = 0; i < 100; i++)
    assert(a[i] == b[i] + sarg);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jge    116a <test+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <test+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%eax
add    %r14d,%eax
xor    %edi,%edi
cmp    %eax,0x0(%rbp,%rbx,4)
sete   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1130 <test+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test(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
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
%24 = icmp eq i32 %16, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
br label %27
27: ; preds = %11
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @test(i32* nocapture %0, i32* nocapture %1, i32 %2) {
br label %4
4: ; preds = %3, %4
%5 = phi i64 [ 0, %3 ], [ %14, %4 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 %5
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %2
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = add nuw nsw i64 %5, 1
%15 = icmp eq i64 %14, 100
br i1 %15, label %16, label %4
16: ; preds = %4
ret void
}
unsigned invert(unsigned x, unsigned p, unsigned n) {
  return x ^ (~(~0 << n) << p);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = xor i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = shl i32 %5, %1
%7 = xor i32 %6, %0
ret i32 %7
}
int g2_fifo_wait() {
  int i;
  for (i = 0; i < 0x1800; i++) {
    if (!((*((volatile unsigned long *)((0xA05F6000 + 0x88C)))) & 0x11)) {
      return 0;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<g2_fifo_wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1800,-0x8(%rbp)
jge    114d <g2_fifo_wait+0x4d>
mov    $0xa05f688c,%eax
mov    (%rax),%rax
and    $0x11,%rax
cmp    $0x0,%rax
jne    113a <g2_fifo_wait+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <g2_fifo_wait+0x54>
jmp    113f <g2_fifo_wait+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <g2_fifo_wait+0xb>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_fifo_wait>:
mov    $0x1800,%ecx
mov    $0xa05f688c,%edx
xor    %eax,%eax
nopl   0x0(%rax)
testq  $0x11,(%rdx)
je     113e <g2_fifo_wait+0x3e>
testq  $0x11,(%rdx)
je     113e <g2_fifo_wait+0x3e>
testq  $0x11,(%rdx)
je     113e <g2_fifo_wait+0x3e>
testq  $0x11,(%rdx)
je     113e <g2_fifo_wait+0x3e>
add    $0xfffffffc,%ecx
jne    1110 <g2_fifo_wait+0x10>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @g2_fifo_wait() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 6144
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load volatile i64, i64* inttoptr (i64 2690607244 to i64*)
%8 = and i64 %7, 17
%9 = icmp ne i64 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6
store i32 0, i32* %1
br label %16
11: ; preds = %6
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
store i32 -1, i32* %1
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @g2_fifo_wait() {
br label %16
1: ; preds = %16
%2 = load volatile i64, i64* inttoptr (i64 2690607244 to i64*)
%3 = and i64 %2, 17
%4 = icmp eq i64 %3, 0
br i1 %4, label %21, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 2690607244 to i64*)
%7 = and i64 %6, 17
%8 = icmp eq i64 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %5
%10 = load volatile i64, i64* inttoptr (i64 2690607244 to i64*)
%11 = and i64 %10, 17
%12 = icmp eq i64 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %9
%14 = add nuw nsw i32 %17, 4
%15 = icmp eq i32 %14, 6144
br i1 %15, label %21, label %16
16: ; preds = %13, %0
%17 = phi i32 [ 0, %0 ], [ %14, %13 ]
%18 = load volatile i64, i64* inttoptr (i64 2690607244 to i64*)
%19 = and i64 %18, 17
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %1
21: ; preds = %13, %9, %5, %1, %16
%22 = phi i32 [ 0, %16 ], [ 0, %1 ], [ 0, %5 ], [ 0, %9 ], [ -1, %13 ]
ret i32 %22
}
void main(void) {
  int a, b, c;
  c = a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void deterministic_add(const void *buf, int num, double entropy) { return; }


x86 assembly (clang, -O0):
<deterministic_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @deterministic_add(i8* nocapture %0, i32 %1, double %2) {
ret void
}
void gdk_setting_get() {}


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

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

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

LLVM IR (-O2):
define void @gdk_setting_get() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _WarningS(long, char *, char const *);
void Warning_DeprecatedSyntax(long p_position, const char *p_string) {
  _WarningS(p_position, "Deprecated syntax: %s", p_string);
}


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

x86 assembly (clang, -O2):
<Warning_DeprecatedSyntax>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <_WarningS@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Deprecated syntax: %s\00"
define void @Warning_DeprecatedSyntax(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = call i32 @_WarningS(i64 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Deprecated syntax: %s\00"
define void @Warning_DeprecatedSyntax(i64 %0, i8* %1) {
%3 = tail call i32 @_WarningS(i64 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ func();
int main() {
  bar();
  func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1040 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar()
%3 = call i32 (...) @func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @func()
ret i32 0
}
unsigned int cpuidle_get_idle_residency_time(int idle_state) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpuidle_get_idle_residency_time(i32 %0) {
ret i32 0
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ nsendmsg(int, struct msghdr const *, int);
ssize_t __sendmsg(int fd, const struct msghdr *message, int flags) {
  return nsendmsg(fd, message, flags);
}


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

x86 assembly (clang, -O2):
<__sendmsg>:
jmp    1030 <nsendmsg@plt>

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

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @__sendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @nsendmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
__attribute__((always_)) void patch_CAS_3_2_0_1212_extra(void) {
  put_byte(0x10084A63, 0xEA);
}


x86 assembly (clang, -O0):
<patch_CAS_3_2_0_1212_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10084a63,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_CAS_3_2_0_1212_extra>:
mov    $0x10084a63,%edi
mov    $0xea,%esi
jmp    1030 <put_byte@plt>

LLVM IR (-O0):
define void @patch_CAS_3_2_0_1212_extra() {
%1 = call i32 @put_byte(i32 268978787, i32 234)
ret void
}

LLVM IR (-O2):
define void @patch_CAS_3_2_0_1212_extra() {
%1 = tail call i32 @put_byte(i32 268978787, i32 234)
ret void
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_TIME_adj(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int timegm(struct tm *);
ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm) {
  time_t t;
  if ((t = timegm(tm)) == -1)
    return NULL;
  return (ASN1_TIME_adj(s, t, 0, 0));
}


x86 assembly (clang, -O0):
<ASN1_TIME_set_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <timegm@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1152 <ASN1_TIME_set_tm+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1166 <ASN1_TIME_set_tm+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <ASN1_TIME_adj@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_TIME_set_tm>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <timegm@plt>
cmp    $0xffffffff,%eax
je     1140 <ASN1_TIME_set_tm+0x20>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <ASN1_TIME_adj@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32* @ASN1_TIME_set_tm(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca i32
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load %struct.tm*, %struct.tm** %5
%8 = call i32 @timegm(%struct.tm* %7)
store i32 %8, i32* %6
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32* null, i32** %3
br label %15
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = call i32* @ASN1_TIME_adj(i32* %12, i32 %13, i32 0, i32 0)
store i32* %14, i32** %3
br label %15
15: ; preds = %11, %10
%16 = load i32*, i32** %3
ret i32* %16
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32* @ASN1_TIME_set_tm(i32* %0, %struct.tm* %1) {
%3 = tail call i32 @timegm(%struct.tm* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32* @ASN1_TIME_adj(i32* %0, i32 %3, i32 0, i32 0)
br label %7
7: ; preds = %2, %5
%8 = phi i32* [ %6, %5 ], [ null, %2 ]
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ handle_USR1(int /*<<< orphan*/);
int gen_USR1(void) {
  handle_USR1(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_USR1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_USR1@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_USR1>:
push   %rax
xor    %edi,%edi
call   1030 <handle_USR1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_USR1() {
%1 = call i32 @handle_USR1(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_USR1() {
%1 = tail call i32 @handle_USR1(i32 0)
ret i32 0
}
int median(int n) {
  if (n == 0)
    return 0;
  int i = 0, tmp;
  while (n != 0) {
    tmp = n % 10;
    n = (n - tmp) / 10;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<median>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <median+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1161 <median+0x61>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115b <median+0x5b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <median+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<median>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <median+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <median+0x10>
ret

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

LLVM IR (-O2):
define i32 @median(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ display_write_byte(int, int);
void display_clear(void) {
  unsigned int i;
  display_write_byte(0x0c, 0);
  display_write_byte(0x80, 0);
  for (i = 0; i < 504; i++)
    display_write_byte(0, 1);
}


x86 assembly (clang, -O0):
<display_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <display_write_byte@plt>
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <display_write_byte@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f8,-0x4(%rbp)
jae    115e <display_clear+0x4e>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <display_write_byte@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <display_clear+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_clear>:
push   %rbx
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <display_write_byte@plt>
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <display_write_byte@plt>
mov    $0x1f8,%ebx
xchg   %ax,%ax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <display_write_byte@plt>
add    $0xffffffff,%ebx
jne    1130 <display_clear+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @display_clear() {
%1 = alloca i32
%2 = call i32 @display_write_byte(i32 12, i32 0)
%3 = call i32 @display_write_byte(i32 128, i32 0)
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 504
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @display_write_byte(i32 0, i32 1)
br label %9
9: ; preds = %7
%10 = load i32, i32* %1
%11 = add i32 %10, 1
store i32 %11, i32* %1
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @display_clear() {
%1 = tail call i32 @display_write_byte(i32 12, i32 0)
%2 = tail call i32 @display_write_byte(i32 128, i32 0)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @display_write_byte(i32 0, i32 1)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 504
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int __parent(const int idx) {
  assert(idx != 0);
  return (idx - 1) / 2;
}


x86 assembly (clang, -O0):
<__parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__parent>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
add    $0xffffffff,%ebx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @__parent(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = add nsw i32 %0, -1
%6 = sdiv i32 %5, 2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_lsh(void) { write_instr(0x24); }


x86 assembly (clang, -O0):
<eval_lsh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <write_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_lsh>:
mov    $0x24,%edi
jmp    1030 <write_instr@plt>

LLVM IR (-O0):
define void @eval_lsh() {
%1 = call i32 @write_instr(i32 36)
ret void
}

LLVM IR (-O2):
define void @eval_lsh() {
%1 = tail call i32 @write_instr(i32 36)
ret void
}
void remove_semaphores() {}


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

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

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

LLVM IR (-O2):
define void @remove_semaphores() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Idle();
void do_STATE() { Idle(); }


x86 assembly (clang, -O0):
<do_STATE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Idle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_STATE>:
xor    %eax,%eax
jmp    1030 <Idle@plt>

LLVM IR (-O0):
define void @do_STATE() {
%1 = call i32 (...) @Idle()
ret void
}

LLVM IR (-O2):
define void @do_STATE() {
%1 = tail call i32 (...) @Idle()
ret void
}