xunge/DecIR huggingface dataset:
int FindLast(const char *a, char b) {
  int pos = 0, res = -1;
  while (a[pos]) {
    if (a[pos] == b)
      res = pos;
    pos++;
  }
  return res;
}


x86 assembly (clang, -O0):
<FindLast>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115a <FindLast+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <FindLast+0x4c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <FindLast+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindLast>:
mov    (%rdi),%cl
mov    $0xffffffff,%eax
test   %cl,%cl
je     1123 <FindLast+0x23>
xor    %edx,%edx
nopl   (%rax)
cmp    %sil,%cl
cmove  %edx,%eax
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <FindLast+0x10>
ret

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

LLVM IR (-O2):
define i32 @FindLast(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ -1, %2 ]
%9 = icmp eq i8 %7, %1
%10 = trunc i64 %6 to i32
%11 = select i1 %9, i32 %10, i32 %8
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ -1, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned short);
void random_init(unsigned short seed) { srand(seed); }


x86 assembly (clang, -O0):
<random_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_init>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @random_init(i16 zeroext %0) {
%2 = tail call i32 @srand(i16 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lapic_write(int, int /*<<< orphan*/);
void lapic_eoi(void) { lapic_write(0xb0, 0); }


x86 assembly (clang, -O0):
<lapic_eoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
xor    %esi,%esi
call   1030 <lapic_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lapic_eoi>:
mov    $0xb0,%edi
xor    %esi,%esi
jmp    1030 <lapic_write@plt>

LLVM IR (-O0):
define void @lapic_eoi() {
%1 = call i32 @lapic_write(i32 176, i32 0)
ret void
}

LLVM IR (-O2):
define void @lapic_eoi() {
%1 = tail call i32 @lapic_write(i32 176, i32 0)
ret void
}
char *findNextLine(char *p) {
  while (*p && *p != '\n')
    p++;
  if (*p == '\n')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<findNextLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <findNextLine+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <findNextLine+0x3d>
jmp    114e <findNextLine+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <findNextLine+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    116a <findNextLine+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextLine>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <findNextLine+0x22>
cmp    $0xa,%cl
je     1122 <findNextLine+0x22>
add    $0x1,%rax
jmp    1110 <findNextLine+0x10>
xor    %edx,%edx
cmp    $0xa,%cl
sete   %dl
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @findNextLine(i8* %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 %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp eq i8 %4, 10
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %3, i64 %9
ret i8* %10
}
/* Variables and functions */
char *my_basename(char const *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char const *);
void make_shortname(char *dest, const char *src) {
  char *ext;
  const char *bname;
  bname = my_basename(src);
  strcpy(dest, bname);
  ext = strchr(dest, '.');
  if (ext)
    *ext = '\0';
}


x86 assembly (clang, -O0):
<make_shortname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <my_basename@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117e <make_shortname+0x4e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_shortname>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1050 <my_basename@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     115c <make_shortname+0x2c>
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @make_shortname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i8* @my_basename(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %3
%10 = load i8*, i8** %6
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = call i8* @strchr(i8* %12, i8 signext 46)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i8*, i8** %5
store i8 0, i8* %17
br label %18
18: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
define void @make_shortname(i8* %0, i8* %1) {
%3 = tail call i8* @my_basename(i8* %1)
%4 = tail call i32 @strcpy(i8* %0, i8* %3)
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
store i8 0, i8* %5
br label %8
8: ; preds = %7, %2
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_parent_dir(char *path) {
  char *tmpp = strrchr(path, '/');
  if (tmpp) {
    if (tmpp == path)
      tmpp[1] = '\0';
    else
      tmpp[0] = '\0';
  }
  return path;
}


x86 assembly (clang, -O0):
<get_parent_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <get_parent_dir+0x50>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    1154 <get_parent_dir+0x44>
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    115b <get_parent_dir+0x4b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1160 <get_parent_dir+0x50>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_parent_dir>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1131 <get_parent_dir+0x21>
lea    0x1(%rbx),%rcx
cmp    %rbx,%rax
cmovne %rax,%rcx
movb   $0x0,(%rcx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_parent_dir(i8* returned %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = icmp eq i8* %2, %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = select i1 %5, i8* %6, i8* %2
store i8 0, i8* %7
br label %8
8: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ omp_thread_exit(void *);
int /*<<< orphan*/ printf(char *, int);
void *test_func_2(void *arg) {
  printf("omp_thread: %d\n", *((int *)arg));
  omp_thread_exit(arg);
}


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

x86 assembly (clang, -O2):
<test_func_2>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <omp_thread_exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"omp_thread: %d\0A\00"
define i8* @test_func_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @omp_thread_exit(i8* %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"omp_thread: %d\0A\00"
define noalias i8* @test_func_2(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @omp_thread_exit(i8* %0)
ret i8* undef
}
/* Variables and functions */
scalar_t__ asin(double);
int /*<<< orphan*/ link_failure_asin();
void test_asin(double d) {
  if (asin(d) != asin(d))
    link_failure_asin();
}


x86 assembly (clang, -O0):
<test_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asin@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asin@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_asin+0x3c>
mov    $0x0,%al
call   1040 <link_failure_asin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_asin>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <asin@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <asin@plt>
cmp    %rax,%rbx
jne    1149 <test_asin+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_asin@plt>

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

LLVM IR (-O2):
define void @test_asin(double %0) {
%2 = tail call i64 @asin(double %0)
%3 = tail call i64 @asin(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_asin()
br label %7
7: ; preds = %5, %1
ret void
}
int calcstrsum(char *name) {
  int total = 0;
  int i = 0;
  while (name[i] != '\0') {
    total += name[i];
    ++i;
  }
  return total;
}


x86 assembly (clang, -O0):
<calcstrsum>:
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),%eax
cmp    $0x0,%eax
je     114b <calcstrsum+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <calcstrsum+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcstrsum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <calcstrsum+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calcstrsum+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @calcstrsum(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 = %13, %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 ne i32 %11, 0
br i1 %12, label %13, label %24
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 = load i32, i32* %3
%21 = add nsw i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @calcstrsum(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 i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %15
}
int condition_comma(char c) { return c == ','; }


x86 assembly (clang, -O0):
<condition_comma>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_comma>:
xor    %eax,%eax
cmp    $0x2c,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_comma(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 44
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_comma(i8 signext %0) {
%2 = icmp eq i8 %0, 44
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int ubitmap_fprint(void const *, size_t, int /*<<< orphan*/);
int ubitmap_print(const void *b, size_t len) {
  return ubitmap_fprint(b, len, stdout);
}


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

x86 assembly (clang, -O2):
<ubitmap_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <ubitmap_fprint@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @ubitmap_print(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 = load i32, i32* @stdout
%8 = call i32 @ubitmap_fprint(i8* %5, i64 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @ubitmap_print(i8* %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @ubitmap_fprint(i8* %0, i64 %1, i32 %3)
ret i32 %4
}
void io_wait() { asm volatile("out %%al, $0x80" : : "a"(0)); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
xor    %eax,%eax
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "out %al, $$0x80", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
char *single_column(char ***g, int slice, int index, int pos) {
  return g[pos][slice] + index;
}


x86 assembly (clang, -O0):
<single_column>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_column>:
movslq %ecx,%rax
mov    (%rdi,%rax,8),%rcx
movslq %esi,%rsi
movslq %edx,%rax
add    (%rcx,%rsi,8),%rax
ret

LLVM IR (-O0):
define i8* @single_column(i8*** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8***
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8*** %0, i8**** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8***, i8**** %5
%10 = load i32, i32* %8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8**, i8*** %9, i64 %11
%13 = load i8**, i8*** %12
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
ret i8* %20
}

LLVM IR (-O2):
define i8* @single_column(i8*** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8**, i8*** %0, i64 %5
%7 = load i8**, i8*** %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = load i8*, i8** %9
%11 = sext i32 %2 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
ret i8* %12
}
unsigned long signum_fun_ulong(unsigned long a) { return (a > 0); }


x86 assembly (clang, -O0):
<signum_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_ulong>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i64 @signum_fun_ulong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @signum_fun_ulong(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
int caca_conio_cscanf(char *format, ...) {
  conio_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @caca_conio_cscanf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @conio_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @caca_conio_cscanf(i8* nocapture readnone %0, ...) {
%2 = tail call i32 (...) @conio_init()
ret i32 0
}
int test_65536() { return 65536; }


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

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

LLVM IR (-O0):
define i32 @test_65536() {
ret i32 65536
}

LLVM IR (-O2):
define i32 @test_65536() {
ret i32 65536
}
int __attribute__((__const__)) baz(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @baz() {
ret i32 3
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void prtarr(int *arr, int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%i ", arr[i]);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<prtarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <prtarr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <prtarr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtarr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <prtarr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <prtarr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @prtarr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define void @prtarr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void foo(void) {
#pragma omp target
#pragma omp parallel for
  for (int i = 0; i < 1; i++)
    sched_yield();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    113e <foo+0x2e>
mov    $0x0,%al
call   1030 <sched_yield@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (x - y > 0) {
    x = y - x;
    y++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1159 <main+0x49>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %11, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %2
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
scalar_t__ isnan(float);
int __ocl_isnan_float(float src) { return isnan(src) ? 1 : 0; }


x86 assembly (clang, -O0):
<__ocl_isnan_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__ocl_isnan_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @isnan(float %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @__ocl_isnan_float(float %0) {
%2 = tail call i64 @isnan(float %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *sstrdup(char *s) {
  char *copy = malloc(strlen(s) + 1);
  strcpy(copy, s);
  return copy;
}


x86 assembly (clang, -O0):
<sstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @sstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void destroy_image(unsigned char *pimg) {
  if (pimg != NULL) {
    free(pimg);
  }
}


x86 assembly (clang, -O0):
<destroy_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <destroy_image+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_image>:
test   %rdi,%rdi
je     111a <destroy_image+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @destroy_image(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double VARZCurrentDoubleTime() {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return ((double)tp.tv_sec) + ((double)tp.tv_usec / 1.0e6);
}


x86 assembly (clang, -O0):
<VARZCurrentDoubleTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VARZCurrentDoubleTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @VARZCurrentDoubleTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @VARZCurrentDoubleTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
void watchdog_off() {
  *(volatile unsigned long *)((void *)0xfffffd40 + 0x04) = 0x8000;
}


x86 assembly (clang, -O0):
<watchdog_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffd40,%eax
movq   $0x8000,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchdog_off>:
mov    $0xfffffd44,%eax
movq   $0x8000,(%rax)
ret

LLVM IR (-O0):
define void @watchdog_off() {
store volatile i64 32768, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966592 to i8*), i64 4) to i64*)
ret void
}

LLVM IR (-O2):
define void @watchdog_off() {
store volatile i64 32768, i64* inttoptr (i64 4294966596 to i64*)
ret void
}
void iSeries_pcibios_init(void) {}


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

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

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

LLVM IR (-O2):
define void @iSeries_pcibios_init() {
ret void
}
/* Variables and functions */
double acos(int /*<<< orphan*/);
int /*<<< orphan*/ glmDotProduct2d(double const *, double const *);
double glmComputeNormalizedVectorAngle2dRad(const double v1[2],
                                            const double v2[2]) {
  return acos(glmDotProduct2d(v1, v2));
}


x86 assembly (clang, -O0):
<glmComputeNormalizedVectorAngle2dRad>:
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   1040 <glmDotProduct2d@plt>
mov    %eax,%edi
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeNormalizedVectorAngle2dRad>:
push   %rax
call   1040 <glmDotProduct2d@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @glmComputeNormalizedVectorAngle2dRad(double* %0, double* %1) {
%3 = tail call i32 @glmDotProduct2d(double* %0, double* %1)
%4 = tail call double @acos(i32 %3)
ret double %4
}
/* Variables and functions */
int find_seq(int /*<<< orphan*/);
int find_seq2(int /*<<< orphan*/);
int test_all_bits_one() { return 32 == find_seq(~0) && 32 == find_seq2(~0); }


x86 assembly (clang, -O0):
<test_all_bits_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
call   1040 <find_seq@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    115f <test_all_bits_one+0x3f>
mov    $0xffffffff,%edi
call   1030 <find_seq2@plt>
mov    %eax,%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_bits_one>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <find_seq@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
jne    1148 <test_all_bits_one+0x28>
mov    $0xffffffff,%edi
call   1030 <find_seq2@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_all_bits_one() {
%1 = call i32 @find_seq(i32 -1)
%2 = icmp eq i32 32, %1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @find_seq2(i32 -1)
%5 = icmp eq i32 32, %4
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_all_bits_one() {
%1 = tail call i32 @find_seq(i32 -1)
%2 = icmp eq i32 %1, 32
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @find_seq2(i32 -1)
%5 = icmp eq i32 %4, 32
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int JFT_count_bits(uint64_t v) {
  v = (v - ((v >> 1) & (uint64_t) ~(uint64_t)0 / 3));
  v = (v & (uint64_t) ~(uint64_t)0 / 15 * 3) +
      ((v >> 2) & (uint64_t) ~(uint64_t)0 / 15 * 3);
  v = (v + (v >> 4)) & (uint64_t) ~(uint64_t)0 / 255 * 15;
  v = (v * ((uint64_t) ~(uint64_t)0 / 255)) >> (sizeof(uint64_t) - 1) * 8;
  return v;
}


x86 assembly (clang, -O0):
<JFT_count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x0,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x0,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x0,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0x0,%eax
mov    %eax,-0x4(%rbp)
imul   $0x0,-0x4(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @JFT_count_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 0
%7 = sub nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 0
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 0
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 0
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = mul nsw i32 %19, 0
%21 = ashr i32 %20, 24
store i32 %21, i32* %2
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @JFT_count_bits(i32 %0) {
ret i32 0
}
int main() {
  int sum = 0;
  int i = 10;
  do {
    sum += 1;
  } while (--i);
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_average();
int /*<<< orphan*/ test_is_null();
int main(void) {
  printf("test_average()\n");
  test_average();
  printf("test_is_null()\n");
  test_is_null();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_average@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_is_null@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [15 x i8] c"test_average()\00"
@str.2 = [15 x i8] c"test_is_null()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_average()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 (...) @test_is_null()
ret i32 0
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
int sqlEnumParse(int /*<<< orphan*/, char **, struct hash **);
int /*<<< orphan*/ sqlGetOptQuoteString(char **);
unsigned sqlEnumComma(char **pS, char **values, struct hash **valHashPtr) {
  return sqlEnumParse(sqlGetOptQuoteString(pS), values, valHashPtr);
}


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

x86 assembly (clang, -O2):
<sqlEnumComma>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <sqlGetOptQuoteString@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sqlEnumParse@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define i32 @sqlEnumComma(i8** %0, i8** %1, %struct.hash** %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca %struct.hash**
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store %struct.hash** %2, %struct.hash*** %6
%7 = load i8**, i8*** %4
%8 = call i32 @sqlGetOptQuoteString(i8** %7)
%9 = load i8**, i8*** %5
%10 = load %struct.hash**, %struct.hash*** %6
%11 = call i32 @sqlEnumParse(i32 %8, i8** %9, %struct.hash** %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define i32 @sqlEnumComma(i8** %0, i8** %1, %struct.hash** %2) {
%4 = tail call i32 @sqlGetOptQuoteString(i8** %0)
%5 = tail call i32 @sqlEnumParse(i32 %4, i8** %1, %struct.hash** %2)
ret i32 %5
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void danish_UTF_8_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<danish_UTF_8_close_env>:
jmp    1030 <SN_close_env@plt>

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

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @danish_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
void *_talloc_steal_loc(const void *new_ctx, const void *obj,
                        const char *location) {
  return (void *)obj;
}


x86 assembly (clang, -O0):
<_talloc_steal_loc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_talloc_steal_loc>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @_talloc_steal_loc(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
ret i8* %7
}

LLVM IR (-O2):
define i8* @_talloc_steal_loc(i8* nocapture readnone %0, i8* readnone returned %1, i8* nocapture readnone %2) {
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ handle_41(int /*<<< orphan*/);
int gen_41(void) {
  handle_41(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_41() {
%1 = tail call i32 @handle_41(i32 0)
ret i32 0
}
char *username_completion_function(s, i) const char *s;
int i;
{ return rl_username_completion_function(s, i); }


x86 assembly (clang, -O0):
<username_completion_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <rl_username_completion_function@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @username_completion_function(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rl_username_completion_function to i32 (i8*, i32, ...)*)(i8* %5, i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @username_completion_function(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @rl_username_completion_function to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void inc_zcache_compress_poor(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_compress_poor() {
ret void
}