xunge/DecIR huggingface dataset:
int main() {
  struct {
    struct {
      int *a;
      int b;
    } a[2];
  } b = {.a[1].b = 1};
  assert(sizeof b.a == 32);
  assert(sizeof b.a[0] == 16);
  assert(b.a[1].b == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { [2 x %struct.anon.0] }
%struct.anon.0 = type { i32*, i32 }
@__const.main.b = %struct.anon { [2 x %struct.anon.0] [%struct.anon.0 zeroinitializer, %struct.anon.0 { i32* null, i32 1 }] }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = bitcast %struct.anon* %2 to i8*
%4 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%7 = getelementptr inbounds [2 x %struct.anon.0], [2 x %struct.anon.0]* %6, i64 0, i64 1
%8 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *GetFileExt(const char *filename) {
  const char *dot = strrchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<GetFileExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <GetFileExt+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <GetFileExt+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <GetFileExt+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileExt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @GetFileExt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @GetFileExt(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
void pstate(const unsigned char *st, int len) {}


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

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

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

LLVM IR (-O2):
define void @pstate(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_set_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_set_epi64(__m64 A, __m64 B) { return _mm_set_epi64(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_set_epi64>:
jmp    1030 <_mm_set_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_set_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_set_epi64(i32 %0, i32 %1)
ret i32 %3
}
int isBigEndian() {
  {
    (void)((
        int (*)(char failed_static_assertion[(sizeof(short) == 2) ? 1 : -1]))0);
  };
  short x;
  unsigned char EndianTest[2] = {1, 0};
  x = *(short *)EndianTest;
  return (x != 1);
}


x86 assembly (clang, -O0):
<isBigEndian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.isBigEndian.EndianTest = [2 x i8] c"\01\00"
define i32 @isBigEndian() {
%1 = alloca i16
%2 = alloca [2 x i8]
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = bitcast i8* %4 to i16*
%6 = load i16, i16* %5
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = sext i16 %7 to i32
%9 = icmp ne i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isBigEndian() {
ret i32 0
}
int foo(int i) {
  int j = 0;
  switch (i) {
  case -1:
    j = 1;
    break;
  case 1:
    j = 2;
    break;
  case 2:
    j = 3;
    break;
  default:
    j = 42;
    break;
  }
  j = j + 1;
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     1144 <foo+0x44>
jmp    1122 <foo+0x22>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1150 <foo+0x50>
jmp    1133 <foo+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     115c <foo+0x5c>
jmp    1168 <foo+0x68>
movl   $0x1,-0x8(%rbp)
jmp    116f <foo+0x6f>
movl   $0x2,-0x8(%rbp)
jmp    116f <foo+0x6f>
movl   $0x3,-0x8(%rbp)
jmp    116f <foo+0x6f>
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0x1,%edi
mov    $0x2b,%eax
cmp    $0x3,%edi
ja     111a <foo+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 -1, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i32 1, i32* %3
br label %9
6: ; preds = %1
store i32 2, i32* %3
br label %9
7: ; preds = %1
store i32 3, i32* %3
br label %9
8: ; preds = %1
store i32 42, i32* %3
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@switch.table.foo = [4 x i32] [i32 2, i32 43, i32 3, i32 4]
define i32 @foo(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.foo, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 43, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int unlink(char *);
void deleteFile() {
  int ret = unlink("test.txt");
  printf("delete new file ret = %d\n", ret);
  perror("delete file error");
}


x86 assembly (clang, -O0):
<deleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteFile>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [26 x i8] c"delete new file ret = %d\0A\00"
@.str.2 = [18 x i8] c"delete file error\00"
define void @deleteFile() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [26 x i8] c"delete new file ret = %d\0A\00"
@.str.2 = [18 x i8] c"delete file error\00"
define void @deleteFile() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret void
}
long tclmax(long a, long b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<tclmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <tclmax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <tclmax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tclmax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @tclmax(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @tclmax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
size_t strlen_utf8(const char *s) {
  size_t cnt = 0;
  while (*s) {
    unsigned char ch = *(unsigned char *)s++;
    if ((ch < 0x80) || (ch > 0xBF))
      cnt++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strlen_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <strlen_utf8+0x60>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x80,%eax
jl     114f <strlen_utf8+0x4f>
movzbl -0x11(%rbp),%eax
cmp    $0xbf,%eax
jle    115b <strlen_utf8+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen_utf8+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_utf8>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strlen_utf8+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0xc0,%cl
setge  %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strlen_utf8+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen_utf8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = icmp sgt i8 %5, -65
%10 = zext i1 %9 to i64
%11 = add i64 %7, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
void foo133() {}


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

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

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

LLVM IR (-O2):
define void @foo133() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ e();
int main() {
  e();
  a();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @e()
%2 = tail call i32 (...) @a()
ret i32 0
}
void pause(void) {
  for (int i = 0; i < 100000000; i++)
    ;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5f5e100,-0x4(%rbp)
jge    112b <pause+0x2b>
jmp    111d <pause+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <pause+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ os_perf_priv_free(void *);
void perf_priv_free(void *priv) { os_perf_priv_free(priv); }


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

x86 assembly (clang, -O2):
<perf_priv_free>:
jmp    1030 <os_perf_priv_free@plt>

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

LLVM IR (-O2):
define void @perf_priv_free(i8* %0) {
%2 = tail call i32 @os_perf_priv_free(i8* %0)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_23(uint64_t x) {
  __asm__("rolq $23, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_23>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x17,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_23>:
mov    %rdi,%rax
rol    $0x17,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_23(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$23, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_23(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$23, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ irc_bot(char **);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  while (1) {
    irc_bot(argv);
    sleep(2);
  }
}


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    -0x10(%rbp),%rdi
call   1030 <irc_bot@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <irc_bot@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

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
br label %6
6: ; preds = %2, %6
%7 = load i8**, i8*** %5
%8 = call i32 @irc_bot(i8** %7)
%9 = call i32 @sleep(i32 2)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @irc_bot(i8** %1)
%5 = tail call i32 @sleep(i32 2)
br label %3
}
void SSMR3PutU8(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutU8() {
ret void
}
long num_long(unsigned char a, unsigned char b, unsigned char c,
              unsigned char d) {
  return ((long)((((long)a) << 24) | (((long)b) << 16) | (((long)c) << 8) | d));
}


x86 assembly (clang, -O0):
<num_long>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x18,%rax
movzbl -0x2(%rbp),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
movzbl -0x3(%rbp),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
movzbl -0x4(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_long>:
mov    %edi,%eax
shl    $0x18,%rax
mov    %esi,%esi
shl    $0x10,%rsi
or     %rax,%rsi
mov    %edx,%edx
shl    $0x8,%rdx
or     %rsi,%rdx
mov    %ecx,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @num_long(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i64
%11 = shl i64 %10, 24
%12 = load i8, i8* %6
%13 = zext i8 %12 to i64
%14 = shl i64 %13, 16
%15 = or i64 %11, %14
%16 = load i8, i8* %7
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 8
%19 = or i64 %15, %18
%20 = load i8, i8* %8
%21 = zext i8 %20 to i64
%22 = or i64 %19, %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @num_long(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = zext i8 %0 to i64
%6 = shl nuw nsw i64 %5, 24
%7 = zext i8 %1 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %6
%10 = zext i8 %2 to i64
%11 = shl nuw nsw i64 %10, 8
%12 = or i64 %9, %11
%13 = zext i8 %3 to i64
%14 = or i64 %12, %13
ret i64 %14
}
/* Variables and functions */
double stdlib_base_sqrt(double const);
double stdlib_base_rsqrt(const double x) { return 1.0 / stdlib_base_sqrt(x); }


x86 assembly (clang, -O0):
<stdlib_base_rsqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <stdlib_base_sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_rsqrt>:
push   %rax
call   1030 <stdlib_base_sqrt@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @stdlib_base_rsqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @stdlib_base_sqrt(double %3)
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @stdlib_base_rsqrt(double %0) {
%2 = tail call double @stdlib_base_sqrt(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
void *pthread_condsignal_inner(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_noop_access(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_sched_disable();
int /*<<< orphan*/ pthread_sched_enable(int /*<<< orphan*/);
extern int pthread_cond_broadcast(pthread_cond_t *pcond) {
  pthread_noop_access(pcond);
  pthread_sched_disable();
  for (;;) {
    if (pthread_condsignal_inner(pcond) == (void *)0)
      break;
  }
  pthread_sched_enable(0);
  return 0;
}


x86 assembly (clang, -O0):
<pthread_cond_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_noop_access@plt>
mov    $0x0,%al
call   1050 <pthread_sched_disable@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_condsignal_inner@plt>
cmp    $0x0,%rax
jne    1174 <pthread_cond_broadcast+0x34>
jmp    1179 <pthread_cond_broadcast+0x39>
jmp    115c <pthread_cond_broadcast+0x1c>
xor    %edi,%edi
call   1060 <pthread_sched_enable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cond_broadcast>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pthread_noop_access@plt>
xor    %eax,%eax
call   1050 <pthread_sched_disable@plt>
mov    %rbx,%rdi
call   1040 <pthread_condsignal_inner@plt>
test   %rax,%rax
jne    1150 <pthread_cond_broadcast+0x10>
xor    %edi,%edi
call   1060 <pthread_sched_enable@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pthread_cond_broadcast(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pthread_noop_access(i32* %3)
%5 = call i32 (...) @pthread_sched_disable()
br label %6
6: ; preds = %11, %1
%7 = load i32*, i32** %2
%8 = call i8* @pthread_condsignal_inner(i32* %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %6
br label %12
11: ; preds = %6
br label %6
12: ; preds = %10
%13 = call i32 @pthread_sched_enable(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_cond_broadcast(i32* %0) {
%2 = tail call i32 @pthread_noop_access(i32* %0)
%3 = tail call i32 (...) @pthread_sched_disable()
br label %4
4: ; preds = %4, %1
%5 = tail call i8* @pthread_condsignal_inner(i32* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = tail call i32 @pthread_sched_enable(i32 0)
ret i32 0
}
void RTVfsMemorizeIoStreamAsFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsMemorizeIoStreamAsFile() {
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double randomval() { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<randomval>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomval>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randomval() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randomval() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
void ff_hevc_put_hevc_uni_epel_h16_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h16_10_avx2() {
ret void
}
int atoi(char *s) {
  int n = 0;
  int i = 0;
  for (; s[i] >= '0' && s[i] <= '9'; ++i) {
    n = n * 10 + (s[i] - '0');
  }
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1145 <atoi+0x45>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <atoi+0x55>
jmp    117b <atoi+0x7b>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <atoi+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i64 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8 [ %15, %5 ], [ %2, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %7 to i32
%10 = mul nsw i32 %8, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = add nuw nsw i64 %6, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ memrchr(char *, int, int);
int main() {
  char try[1];
  memrchr(try, 1, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <memrchr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = call i32 @memrchr(i8* %3, i32 1, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = call i32 @memrchr(i8* %2, i32 1, i32 1)
ret i32 0
}
int ade7758_configure_ring(struct iio_dev *indio_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @ade7758_configure_ring(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ade7758_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned int ceilLog2(unsigned int const);
unsigned int BitPerWordPackedChar(const unsigned int alphabetSize) {
  return ceilLog2(alphabetSize);
}


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

x86 assembly (clang, -O2):
<BitPerWordPackedChar>:
jmp    1030 <ceilLog2@plt>

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

LLVM IR (-O2):
define i32 @BitPerWordPackedChar(i32 %0) {
%2 = tail call i32 @ceilLog2(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int HasFloatPart(s)
char *s;
{
  while (*s) {
    if ((*s == '.') || (*s == 'e') || (*s == 'E'))
      return (1);
    s++;
  };
  return (0);
}


x86 assembly (clang, -O0):
<HasFloatPart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <HasFloatPart+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1145 <HasFloatPart+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x65,%eax
je     1145 <HasFloatPart+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x45,%eax
jne    1151 <HasFloatPart+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1169 <HasFloatPart+0x69>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <HasFloatPart+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HasFloatPart>:
movabs $0x80000000800001,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
lea    -0x2e(%rcx),%edx
cmp    $0x37,%dl
ja     1124 <HasFloatPart+0x24>
movzbl %dl,%edx
bt     %rdx,%rax
jb     112e <HasFloatPart+0x2e>
test   %cl,%cl
je     1134 <HasFloatPart+0x34>
add    $0x1,%rdi
jmp    1110 <HasFloatPart+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HasFloatPart(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 46, label %7
i8 101, label %7
i8 69, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
void cpu_hlt(void) { __asm__ volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @cpu_hlt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, char *argv[]) {
  foo(argc - 1);
  return 0;
}


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
sub    $0x1,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
add    $0xffffffff,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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 = sub nsw i32 %6, 1
%8 = call i32 @foo(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 @foo(i32 %3)
ret i32 0
}
int cairo_code_draw_squareDial_get_height() { return 88; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_squareDial_get_height() {
ret i32 88
}

LLVM IR (-O2):
define i32 @cairo_code_draw_squareDial_get_height() {
ret i32 88
}
unsigned xrop3_70_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T & D;
  stk2 = S | stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_70_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = xor i32 %6, 255
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  while (1) {
    char buff[1024];
    scanf("%s", buff);
    printf("%s HELLO \n", buff);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x410(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
lea    0xecd(%rip),%r14
mov    %rsp,%rbx
lea    0xec6(%rip),%r15
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"%s HELLO \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"%s HELLO \0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %3
}
/* Variables and functions */
void *realloc(void *, size_t);
void *nn_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<nn_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @nn_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
float lgammaf_r(float, int /*<<< orphan*/ *);
int /*<<< orphan*/ signgam;
float lgammaf(float x) { return lgammaf_r(x, &signgam); }


x86 assembly (clang, -O0):
<lgammaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ebf(%rip),%rdi
call   1030 <lgammaf_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammaf>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <lgammaf_r@plt>

LLVM IR (-O0):
@signgam = global i32 0
define float @lgammaf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @lgammaf_r(float %3, i32* @signgam)
ret float %4
}

LLVM IR (-O2):
@signgam = global i32 0
define float @lgammaf(float %0) {
%2 = tail call float @lgammaf_r(float %0, i32* @signgam)
ret float %2
}
void BusFaultHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<BusFaultHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFaultHandler+0x9>
jmp    1109 <BusFaultHandler+0x9>

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

LLVM IR (-O0):
define void @BusFaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @BusFaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void set_window_attributes() {}


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

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

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

LLVM IR (-O2):
define void @set_window_attributes() {
ret void
}
int test_imm_51uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x51 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_51uint64_highword_reg>:
movabs $0x5100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_51uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 81
%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_51uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 347892350976
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void elg_pform_init() {}


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

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

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

LLVM IR (-O2):
define void @elg_pform_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_WORM(struct list_head *);
uint8_t clear_9840_WORM(struct list_head *m) {
  ;
  return clear_WORM(m);
}


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

x86 assembly (clang, -O2):
<clear_9840_WORM>:
jmp    1030 <clear_WORM@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @clear_9840_WORM(%struct.list_head* %0) {
%2 = tail call i32 @clear_WORM(%struct.list_head* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ opt_speed(char *);
int opt_singola(char *opt) {
  if (opt_speed(opt))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_singola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opt_speed@plt>
cmp    $0x0,%rax
je     113b <opt_singola+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <opt_singola+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_singola>:
push   %rax
call   1030 <opt_speed@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_singola(i8* %0) {
%2 = tail call i64 @opt_speed(i8* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}