xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exchange(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char *argv[]) {
  int a = 1, b = 2;
  printf("Before: a=%d, b=%d\n", a, b);
  exchange(&a, &b);
  printf("After : a=%d, b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <exchange@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <exchange@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Before: a=%d, b=%d\0A\00"
@.str.1 = [20 x i8] c"After : a=%d, b=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 2, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 @exchange(i32* %6, i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Before: a=%d, b=%d\0A\00"
@.str.1 = [20 x i8] c"After : a=%d, b=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 2, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%8 = call i32 @exchange(i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int binary_search(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  printf("%d\n", binary_search(nums, n, 14));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    $0xe,%edx
call   1040 <binary_search@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0xe,%edx
call   1040 <binary_search@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @binary_search(i32* %3, i32 8, i32 14)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
int nChars(FILE *f) {
  int charNum = 0;
  fgetc(f);
  while (!feof(f)) {
    ++charNum;
    fgetc(f);
  }
  return charNum;
}


x86 assembly (clang, -O0):
<nChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <nChars+0x3a>
jmp    1171 <nChars+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
jmp    113c <nChars+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nChars>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %rbx,%rdi
call   1040 <feof@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    1157 <nChars+0x37>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %eax,%eax
je     1140 <nChars+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @nChars(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i32 @fgetc(i32* %0)
%9 = tail call i32 @feof(i32* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %7, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int _llseek(unsigned int fd, unsigned long oh, unsigned long ol,
            long long *result, unsigned int origin) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_llseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_llseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_llseek(i32 %0, i64 %1, i64 %2, i64* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64*
%10 = alloca i32
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64* %3, i64** %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_llseek(i32 %0, i64 %1, i64 %2, i64* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
int f0(int a) {
  if (a > 0) {
    a = 1;
  } else {
    a = 2;
  }
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <f0+0x1d>
movl   $0x1,-0x8(%rbp)
jmp    1124 <f0+0x24>
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f0(i32 %0) {
ret i32 undef
}
int main() {
  int some_var = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void main() {
  int offset, length, nlen;
  int i, j;
  for (i = 0; i < nlen; i++) {
    for (j = 0; j < 8; j++) {
      __VERIFIER_assert(0 <= nlen - 1 - i);
      __VERIFIER_assert(nlen - 1 - i < nlen);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1190 <main+0x80>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    117d <main+0x6d>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <main+0x22>
jmp    1182 <main+0x72>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111f <main+0xf>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int func6b(int);
__attribute__((always_)) int func6a(int x) { return func6b(x * 17); }


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

x86 assembly (clang, -O2):
<func6a>:
mov    %edi,%eax
shl    $0x4,%eax
add    %eax,%edi
jmp    1030 <func6b@plt>

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

LLVM IR (-O2):
define i32 @func6a(i32 %0) {
%2 = mul nsw i32 %0, 17
%3 = tail call i32 @func6b(i32 %2)
ret i32 %3
}
int g(double x) {
  { return ((int)x); }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @g(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
void udelay(int count) {
  int i;
  i = 5;
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @udelay(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ is_text(char const);
char *__skip_text(const char *s) {
  while (is_text(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<__skip_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_text@plt>
cmp    $0x0,%rax
je     1143 <__skip_text+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <__skip_text+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__skip_text>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_text@plt>
test   %rax,%rax
jne    1120 <__skip_text+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__skip_text(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_text(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int HelpItem136(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem136() {
ret i32 0
}
unsigned char inb_p(unsigned short port) {
  unsigned char ret;
  asm volatile("inb (%%dx),%%al"
               ";outb %%al,$0x80"
               : "=a"(ret)
               : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
out    %al,$0x80
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb (%dx),%al;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb (%dx),%al;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ zmalloc(scalar_t__);
char *zstrdup(const char *s) { return strcpy(zmalloc(strlen(s) + 1), s); }


x86 assembly (clang, -O0):
<zstrdup>:
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 <zmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <zmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @zstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @zmalloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
int imgfree(int **img, int x, int y) {
  int i;
  for (i = 0; i < x; i++)
    free(img[i]);
  free(img);
  return 0;
}


x86 assembly (clang, -O0):
<imgfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <imgfree+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <imgfree+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgfree>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <imgfree+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <imgfree+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @imgfree(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void term_right(int n) { printf("\033[%dC", n); }


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

x86 assembly (clang, -O2):
<term_right>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dC\00"
define void @term_right(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void ems1Tblk() {}


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

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

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

LLVM IR (-O2):
define void @ems1Tblk() {
ret void
}
unsigned long int Log2Ceil(unsigned long int Value) {
  unsigned long int val, bit = 0;
  do {
    bit++;
    val = 1 << bit;
  } while (val && Value > val);
  return bit;
}


x86 assembly (clang, -O0):
<Log2Ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     114d <Log2Ceil+0x4d>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1110 <Log2Ceil+0x10>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2Ceil>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
cmp    %rdi,%rax
jb     1110 <Log2Ceil+0x10>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @Log2Ceil(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %4
br label %5
5: ; preds = %19, %1
%6 = load i64, i64* %4
%7 = add i64 %6, 1
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = shl i32 1, %9
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
br label %12
12: ; preds = %5
%13 = load i64, i64* %3
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i64, i64* %2
%17 = load i64, i64* %3
%18 = icmp ugt i64 %16, %17
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %5, label %21
21: ; preds = %19
%22 = load i64, i64* %4
ret i64 %22
}

LLVM IR (-O2):
define i64 @Log2Ceil(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = trunc i64 %4 to i32
%6 = shl nuw i32 1, %5
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, %0
br i1 %8, label %2, label %9
9: ; preds = %2
ret i64 %4
}
/* Variables and functions */
char *encode_string_maybe(char const *);
char *kstrdup(char const *);
char *encode_string(const char *s) {
  char *encoded = encode_string_maybe(s);
  if (encoded != s)
    return encoded;
  else
    return kstrdup(s);
}


x86 assembly (clang, -O0):
<encode_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <encode_string_maybe@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1154 <encode_string+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <encode_string+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <kstrdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_string>:
push   %rbx
mov    %rdi,%rbx
call   1040 <encode_string_maybe@plt>
cmp    %rbx,%rax
je     1130 <encode_string+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <kstrdup@plt>

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

LLVM IR (-O2):
define i8* @encode_string(i8* %0) {
%2 = tail call i8* @encode_string_maybe(i8* %0)
%3 = icmp eq i8* %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @kstrdup(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
/* Type definitions */
struct RNApaln_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNApaln_cmdline_parser_required(struct RNApaln_args_info *args_info,
                                    const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<RNApaln_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNApaln_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNApaln_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNApaln_cmdline_parser_required(%struct.RNApaln_args_info* %0, i8* %1) {
%3 = alloca %struct.RNApaln_args_info*
%4 = alloca i8*
store %struct.RNApaln_args_info* %0, %struct.RNApaln_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNApaln_args_info*, %struct.RNApaln_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNApaln_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNApaln_cmdline_parser_required(%struct.RNApaln_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int lfs_scmp(uint32_t a, uint32_t b) { return (int)(unsigned)(a - b); }


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

x86 assembly (clang, -O2):
<lfs_scmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @lfs_scmp(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 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lfs_scmp(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void memcpy_toio(volatile void *dst, const void *src, int count) {
  memcpy((void *)dst, src, count);
}


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

x86 assembly (clang, -O2):
<memcpy_toio>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @memcpy_toio(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @memcpy_toio(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
void decrement_smbd_process_count(void) { return; }


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

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

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

LLVM IR (-O2):
define void @decrement_smbd_process_count() {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void I2CSlaveIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000080C))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<I2CSlaveIntEnableEx>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x80c(%rcx)
ret

LLVM IR (-O0):
define void @I2CSlaveIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 2060
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 2060
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_one(char *s) {
  printf(s);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @print_one(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret i32 0
}
/* Variables and functions */
unsigned char twi_read(int /*<<< orphan*/);
int /*<<< orphan*/ twi_start();
int /*<<< orphan*/ twi_stop();
int /*<<< orphan*/ twi_write(int);
unsigned char DS3231_Read(unsigned char address) {
  unsigned char value = 0;
  twi_start();
  twi_write(((0x68 << 1) & 0xFE));
  twi_write(address);
  twi_start();
  twi_write(((0x68 << 1) | 0x01));
  value = twi_read(0);
  twi_stop();
  return value;
}


x86 assembly (clang, -O0):
<DS3231_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
mov    $0x0,%al
call   1030 <twi_start@plt>
mov    $0xd0,%edi
call   1040 <twi_write@plt>
movzbl -0x1(%rbp),%edi
call   1040 <twi_write@plt>
mov    $0x0,%al
call   1030 <twi_start@plt>
mov    $0xd1,%edi
call   1040 <twi_write@plt>
xor    %edi,%edi
call   1060 <twi_read@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1050 <twi_stop@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS3231_Read>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <twi_start@plt>
mov    $0xd0,%edi
call   1040 <twi_write@plt>
mov    %ebx,%edi
call   1040 <twi_write@plt>
xor    %eax,%eax
call   1030 <twi_start@plt>
mov    $0xd1,%edi
call   1040 <twi_write@plt>
xor    %edi,%edi
call   1060 <twi_read@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <twi_stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @DS3231_Read(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = call i32 (...) @twi_start()
%5 = call i32 @twi_write(i32 208)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = call i32 @twi_write(i32 %7)
%9 = call i32 (...) @twi_start()
%10 = call i32 @twi_write(i32 209)
%11 = call zeroext i8 @twi_read(i32 0)
store i8 %11, i8* %3
%12 = call i32 (...) @twi_stop()
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @DS3231_Read(i8 zeroext %0) {
%2 = tail call i32 (...) @twi_start()
%3 = tail call i32 @twi_write(i32 208)
%4 = zext i8 %0 to i32
%5 = tail call i32 @twi_write(i32 %4)
%6 = tail call i32 (...) @twi_start()
%7 = tail call i32 @twi_write(i32 209)
%8 = tail call zeroext i8 @twi_read(i32 0)
%9 = tail call i32 (...) @twi_stop()
ret i8 %8
}
OP(ed, d3) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int test_untagged_typedef_bitmask(int val) { return val; }


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

x86 assembly (clang, -O2):
<test_untagged_typedef_bitmask>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_untagged_typedef_bitmask(i32 returned %0) {
ret i32 %0
}
unsigned int wma_convert_int(unsigned char *src) {
  return src[3] << 24 | src[2] << 16 | src[1] << 8 | src[0];
}


x86 assembly (clang, -O0):
<wma_convert_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wma_convert_int>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @wma_convert_int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
int kernels_noreturn(void) {
#pragma acc kernels
  __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<kernels_noreturn>:
push   %rbp
mov    %rsp,%rbp
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<kernels_noreturn>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @kernels_noreturn() {
unreachable
}

LLVM IR (-O2):
define i32 @kernels_noreturn() {
tail call void @abort()
unreachable
}
void X509_ATTRIBUTE_get0_object(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int IcsExistFile(char const *filename) {
  FILE *fp;
  if ((fp = fopen(filename, "rb")) != NULL) {
    fclose(fp);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<IcsExistFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <IcsExistFile+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <IcsExistFile+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IcsExistFile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <IcsExistFile+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32 @IcsExistFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %4
%10 = call i32 @fclose(i32* %9)
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @IcsExistFile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t barRead32(uint32_t bar, uint32_t offset) {
  volatile uint32_t *pReg = (volatile uint32_t *)(bar | (offset & 0xFF));
  return (*pReg);
}


x86 assembly (clang, -O0):
<barRead32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<barRead32>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @barRead32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = or i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @barRead32(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = or i32 %3, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}
void keyrelease_handler(int scancode, char ascii) {}


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

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

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

LLVM IR (-O2):
define void @keyrelease_handler(i32 %0, i8 signext %1) {
ret void
}
/* Variables and functions */
scalar_t__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int reboot(int how) {
  int ret = (int)_syscall5(82, (void *)how, ((void *)0), ((void *)0),
                           ((void *)0), ((void *)0));
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rsi
mov    $0x52,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <_syscall5@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115e <reboot+0x4e>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
mov    0x2e90(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <reboot+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot>:
push   %rax
movslq %edi,%rsi
mov    $0x52,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_syscall5@plt>
test   %eax,%eax
js     112e <reboot+0x1e>
pop    %rcx
ret
neg    %eax
mov    0x2ea9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @reboot(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = call i64 @_syscall5(i32 82, i8* %7, i8* null, i8* null, i8* null, i8* null)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
store i32 %14, i32* @errno
store i32 -1, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @reboot(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i64 @_syscall5(i32 82, i8* %3, i8* null, i8* null, i8* null, i8* null)
%5 = trunc i64 %4 to i32
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = sub nsw i32 0, %5
store i32 %8, i32* @errno
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ -1, %7 ], [ %5, %1 ]
ret i32 %10
}
_Bool zc_block_size_parse_cb(char *const issue, void *const context) {
  char **const i = context;
  *i = issue;
  return 0;
}


x86 assembly (clang, -O0):
<zc_block_size_parse_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zc_block_size_parse_cb>:
mov    %rdi,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i1 @zc_block_size_parse_cb(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %5
%8 = load i8*, i8** %3
%9 = load i8**, i8*** %5
store i8* %8, i8** %9
ret i1 false
}

LLVM IR (-O2):
define zeroext i1 @zc_block_size_parse_cb(i8* %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i8**
store i8* %0, i8** %3
ret i1 false
}
void syslog_destroy(ctx) void *ctx;
{ free(ctx); }


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

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

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

LLVM IR (-O2):
define void @syslog_destroy(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
int blank_string(const char *s) {
  while (*s) {
    if (!isspace(*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<blank_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <blank_string+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114a <blank_string+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <blank_string+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <blank_string+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blank_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <blank_string+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <blank_string+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <blank_string+0x20>
jmp    114b <blank_string+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @blank_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void noop_text_cb(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @noop_text_cb(i8* nocapture %0) {
ret void
}
void gtk_entry_set_visibility() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_set_visibility() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: tail [-F | -f | -r] [-q] [-b # | -c # | -n #]"
                        " [file ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"usage: tail [-F | -f | -r] [-q] [-b # | -c # | -n #] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"usage: tail [-F | -f | -r] [-q] [-b # | -c # | -n #] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}