xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ __ESBMC_same_object(char *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
int main() {
  char *p, *q;
  q = p;
  __ESBMC_assume(!__ESBMC_same_object(p, 0));
  p++;
  assert(!__ESBMC_same_object(p, 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <__ESBMC_same_object@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <__ESBMC_same_object@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %esi,%esi
call   1050 <__ESBMC_same_object@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <__ESBMC_assume@plt>
xor    %esi,%esi
call   1050 <__ESBMC_same_object@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
store i8* %3, i8** %2
%4 = load i8*, i8** %1
%5 = call i32 @__ESBMC_same_object(i8* %4, i32 0)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = call i32 @__ESBMC_assume(i32 %8)
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %1
%12 = load i8*, i8** %1
%13 = call i32 @__ESBMC_same_object(i8* %12, i32 0)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__ESBMC_same_object(i8* undef, i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__ESBMC_assume(i32 %3)
%5 = tail call i32 @__ESBMC_same_object(i8* poison, i32 0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Type definitions */
struct libev_context {
  int dummy;
};

/* Variables and functions */
int _libev_signal_register(int, struct libev_context *);
int libev_signal_register(int sig, struct libev_context *context) {
  return _libev_signal_register(sig, context);
}


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

x86 assembly (clang, -O2):
<libev_signal_register>:
jmp    1030 <_libev_signal_register@plt>

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

LLVM IR (-O2):
%struct.libev_context = type { i32 }
define i32 @libev_signal_register(i32 %0, %struct.libev_context* %1) {
%3 = tail call i32 @_libev_signal_register(i32 %0, %struct.libev_context* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a = 5, b = 6;
  f1(a, b);
  printf("a=%d and b=%d", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <f1@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1040 <f1@plt>
lea    0xec9(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a=%d and b=%d\00"
define i32 @main() {
%1 = tail call i32 @f1(i32 5, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 6)
ret i32 0
}
int cmp_uint(const void *aa, const void *bb) {
  const unsigned int *a = aa, *b = bb;
  return (*a < *b) ? -1 : (*a > *b);
}


x86 assembly (clang, -O0):
<cmp_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jae    113b <cmp_uint+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1152 <cmp_uint+0x52>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uint>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
%8 = icmp ugt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rx(int *, int);
int getBit(int *status) {
  uint8_t mybuf[2];
  int rc = rx(mybuf, 1);
  if (status)
    *status = rc;
  return *mybuf & 1;
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <rx@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <getBit+0x31>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1030 <rx@plt>
test   %rbx,%rbx
je     112e <getBit+0x1e>
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getBit(i32* %0) {
%2 = alloca i32*
%3 = alloca [2 x i32]
%4 = alloca i32
store i32* %0, i32** %2
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @rx(i32* %5, i32 1)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = load i32*, i32** %2
store i32 %10, i32* %11
br label %12
12: ; preds = %9, %1
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%14 = load i32, i32* %13
%15 = and i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @getBit(i32* writeonly %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @rx(i32* %4, i32 1)
%6 = icmp eq i32* %0, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 %5, i32* %0
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %4
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
scalar_t__ readlink(char *, char *, int);
int getfullname(char *buff, int buff_size) {
  if (readlink("/proc/self/exe", buff, buff_size) <= 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<getfullname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <readlink@plt>
cmp    $0x0,%rax
jg     1148 <getfullname+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <getfullname+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfullname>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <readlink@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @getfullname(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = icmp sle i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @getfullname(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = icmp slt i64 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
int getLeftChild(int p) { return 2 * p + 1; }


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

x86 assembly (clang, -O2):
<getLeftChild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getLeftChild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ atol(char const *);
int32_t parseTime(const char *term) {
  int32_t ret = (int32_t)atol(term);
  uint8_t h = ret / 10000;
  ret -= h * 10000;
  uint8_t m = ret / 100;
  ret -= m * 100;
  return h * 3600 + m * 60 + ret;
}


x86 assembly (clang, -O0):
<parseTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atol@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
imul   $0x2710,-0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
imul   $0x64,-0x14(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0xe10,-0x10(%rbp),%eax
imul   $0x3c,-0x14(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseTime>:
push   %rax
call   1030 <atol@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0xffffd8f0,%ecx,%edx
add    %edx,%eax
cltq
imul   $0x51eb851f,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
imul   $0xe10,%ecx,%ecx
shl    $0x3,%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%eax
sub    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parseTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @atol(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 10000
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 10000
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 100
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = mul nsw i32 %16, 100
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 3600
%22 = load i32, i32* %5
%23 = mul nsw i32 %22, 60
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %3
%26 = add nsw i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @parseTime(i8* nocapture %0) {
%2 = tail call i32 @atol(i8* %0)
%3 = sdiv i32 %2, 10000
%4 = mul nsw i32 %3, -10000
%5 = add i32 %4, %2
%6 = sdiv i32 %5, 100
%7 = mul nsw i32 %3, 3600
%8 = mul nsw i32 %6, -40
%9 = add i32 %5, %7
%10 = add i32 %9, %8
ret i32 %10
}
int charCmpFn(const void *p1, const void *p2) {
  unsigned char v1, v2;
  v1 = *((unsigned char *)p1);
  v2 = *((unsigned char *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<charCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    113a <charCmpFn+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <charCmpFn+0x54>
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charCmpFn>:
mov    (%rdi),%al
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%al
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @charCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = icmp ult i8 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void init(void) { glEnable(GL_DEPTH_TEST); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
define void @init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
define void @init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
ret void
}
void STAMR3SnapshotFree(void) {}


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

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

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

LLVM IR (-O2):
define void @STAMR3SnapshotFree() {
ret void
}
void foo(const char *p) {
  p = __func__;
  foo(p);
}


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

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

LLVM IR (-O0):
@__func__.foo = [4 x i8] c"foo\00"
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__37__IO__clr();
void Msp430GpioC__1__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__37__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__1__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__37__IO__clr()
ret void
}
/* Type definitions */
struct genwqe_ddcb_cmd {
  int dummy;
};
struct ddcb_cmd {
  int dummy;
};

/* Variables and functions */
int genwqe_card_execute_ddcb(void *, struct genwqe_ddcb_cmd *);
int ddcb_execute(void *card_data, struct ddcb_cmd *req) {
  return genwqe_card_execute_ddcb(card_data, (struct genwqe_ddcb_cmd *)req);
}


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

x86 assembly (clang, -O2):
<ddcb_execute>:
jmp    1030 <genwqe_card_execute_ddcb@plt>

LLVM IR (-O0):
%struct.ddcb_cmd = type { i32 }
%struct.genwqe_ddcb_cmd = type { i32 }
define i32 @ddcb_execute(i8* %0, %struct.ddcb_cmd* %1) {
%3 = alloca i8*
%4 = alloca %struct.ddcb_cmd*
store i8* %0, i8** %3
store %struct.ddcb_cmd* %1, %struct.ddcb_cmd** %4
%5 = load i8*, i8** %3
%6 = load %struct.ddcb_cmd*, %struct.ddcb_cmd** %4
%7 = bitcast %struct.ddcb_cmd* %6 to %struct.genwqe_ddcb_cmd*
%8 = call i32 @genwqe_card_execute_ddcb(i8* %5, %struct.genwqe_ddcb_cmd* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.ddcb_cmd = type { i32 }
%struct.genwqe_ddcb_cmd = type { i32 }
define i32 @ddcb_execute(i8* %0, %struct.ddcb_cmd* %1) {
%3 = bitcast %struct.ddcb_cmd* %1 to %struct.genwqe_ddcb_cmd*
%4 = tail call i32 @genwqe_card_execute_ddcb(i8* %0, %struct.genwqe_ddcb_cmd* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ umask(int);
int reset_umask(int old_mask) {
  umask(old_mask);
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @reset_umask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 1
}
int fun1225() { return 1225; }


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

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

LLVM IR (-O0):
define i32 @fun1225() {
ret i32 1225
}

LLVM IR (-O2):
define i32 @fun1225() {
ret i32 1225
}
/* Variables and functions */
double __infer_nondet_double();
double cbrt(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<cbrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @cbrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @cbrt(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printhash(unsigned char *hash) {
  int i;
  for (i = 0; i < 64; ++i) {
    printf("%02X", hash[i]);
  }
  printf("\nok\n");
}


x86 assembly (clang, -O0):
<printhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1155 <printhash+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printhash+0x13>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xed1(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1140 <printhash+0x20>
lea    0xea5(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
@str = [4 x i8] c"\0Aok\00"
define void @printhash(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 64
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float roundInt(float);
float floatToFix(float number, float delta, int k, int l, int catchOverflow) {
  float div = roundInt(number / delta);
  float ret = delta * div;
  return ret;
}


x86 assembly (clang, -O0):
<floatToFix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <roundInt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatToFix>:
push   %rax
movss  %xmm1,0x4(%rsp)
divss  %xmm1,%xmm0
call   1030 <roundInt@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @floatToFix(float %0, float %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load float, float* %6
%14 = load float, float* %7
%15 = fdiv float %13, %14
%16 = call float @roundInt(float %15)
store float %16, float* %11
%17 = load float, float* %7
%18 = load float, float* %11
%19 = fmul float %17, %18
store float %19, float* %12
%20 = load float, float* %12
ret float %20
}

LLVM IR (-O2):
define float @floatToFix(float %0, float %1, i32 %2, i32 %3, i32 %4) {
%6 = fdiv float %0, %1
%7 = tail call float @roundInt(float %6)
%8 = fmul float %7, %1
ret float %8
}
float expf(float x) { return (float)expf((double)x); }


x86 assembly (clang, -O0):
<expf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expf>:
ucomiss 0xef9(%rip),%xmm0
ja     1120 <expf+0x20>
movss  0xef3(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1120 <expf+0x20>
ret
nopw   0x0(%rax,%rax,1)
jmp    1120 <expf+0x20>

LLVM IR (-O0):
define float @expf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fptrunc double %4 to float
%6 = call float @expf(float %5)
ret float %6
}

LLVM IR (-O2):
define float @expf(float %0) {
%2 = fcmp olt float %0, -1.030000e+02
%3 = fcmp ogt float %0, 8.800000e+01
%4 = or i1 %3, %2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret float undef
}
int test17(int a, int b, int c, int d, int e, int f) {
  int x = a != b;
  int y = c != 0;
  int z = d == e;
  return x == y || x == z;
}


x86 assembly (clang, -O0):
<test17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
je     1166 <test17+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test17>:
cmp    %esi,%edi
setne  %al
test   %edx,%edx
sete   %dl
cmp    %r8d,%ecx
setne  %cl
xor    %al,%dl
xor    %al,%cl
or     %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @test17(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, %1
%8 = icmp eq i32 %2, 0
%9 = icmp ne i32 %3, %4
%10 = xor i1 %7, %8
%11 = xor i1 %7, %9
%12 = or i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ dec2bin(char *, int);
int /*<<< orphan*/ printf(char *);
void bit_xor(int flag, int mask) {
  dec2bin("   flag ", flag);
  dec2bin("   mask ", mask);
  dec2bin("xor (^) ", flag ^ mask);
  printf("\n");
}


x86 assembly (clang, -O0):
<bit_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1040 <dec2bin@plt>
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1040 <dec2bin@plt>
mov    -0x4(%rbp),%esi
xor    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <dec2bin@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_xor>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
call   1040 <dec2bin@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
call   1040 <dec2bin@plt>
xor    %ebp,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1040 <dec2bin@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" flag \00"
@.str.1 = [9 x i8] c" mask \00"
@.str.2 = [9 x i8] c"xor (^) \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @bit_xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
%12 = call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" flag \00"
@.str.1 = [9 x i8] c" mask \00"
@.str.2 = [9 x i8] c"xor (^) \00"
define void @bit_xor(i32 %0, i32 %1) {
%3 = tail call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%5 = xor i32 %1, %0
%6 = tail call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @putchar(i32 10)
ret void
}
void Initialize_C_Int_Model(void) {}


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

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

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

LLVM IR (-O2):
define void @Initialize_C_Int_Model() {
ret void
}
double add(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) {
  if (*currlen + 1 < maxlen)
    buffer[(*currlen)++] = c;
  return 1;
}


x86 assembly (clang, -O0):
<dopr_outch>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x1,%rax
cmp    -0x18(%rbp),%rax
jae    1145 <dopr_outch+0x45>
mov    -0x19(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%rcx
mov    %rcx,%rdi
add    $0x1,%rdi
mov    %rdi,(%rsi)
mov    %dl,(%rax,%rcx,1)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dopr_outch>:
mov    (%rsi),%r8
lea    0x1(%r8),%rax
cmp    %rdx,%rax
jae    1113 <dopr_outch+0x13>
mov    %rax,(%rsi)
mov    %cl,(%rdi,%r8,1)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @dopr_outch(i8* nocapture writeonly %0, i64* nocapture %1, i64 %2, i8 signext %3) {
%5 = load i64, i64* %1
%6 = add i64 %5, 1
%7 = icmp ult i64 %6, %2
br i1 %7, label %8, label %10
8: ; preds = %4
store i64 %6, i64* %1
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %3, i8* %9
br label %10
10: ; preds = %8, %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ avpriv_atomic_lock();
int /*<<< orphan*/ avpriv_atomic_unlock();
void atomic_thread_fence(int order) {
  avpriv_atomic_lock();
  avpriv_atomic_unlock();
}


x86 assembly (clang, -O0):
<atomic_thread_fence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <avpriv_atomic_lock@plt>
mov    $0x0,%al
call   1040 <avpriv_atomic_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_thread_fence>:
push   %rax
xor    %eax,%eax
call   1030 <avpriv_atomic_lock@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <avpriv_atomic_unlock@plt>

LLVM IR (-O0):
define void @atomic_thread_fence(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @avpriv_atomic_lock()
%4 = call i32 (...) @avpriv_atomic_unlock()
ret void
}

LLVM IR (-O2):
define void @atomic_thread_fence(i32 %0) {
%2 = tail call i32 (...) @avpriv_atomic_lock()
%3 = tail call i32 (...) @avpriv_atomic_unlock()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int same_screen;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_same_screen(void *_p, int _v) {
  ((XMotionEvent *)_p)->same_screen = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMotionEvent_same_screen>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XMotionEvent_same_screen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XMotionEvent_same_screen(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned char egg_nibble2char(int nibble) {
  return (nibble < 10) ? nibble + '0' : (nibble - 10) + 'A';
}


x86 assembly (clang, -O0):
<egg_nibble2char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    111f <egg_nibble2char+0x1f>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <egg_nibble2char+0x2b>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<egg_nibble2char>:
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @egg_nibble2char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 48
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 10
%11 = add nsw i32 %10, 65
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @egg_nibble2char(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 55
%4 = add nsw i32 %3, %0
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(int argc, char **argv) {
  fprintf(
      stderr,
      "Usage: %s -encode|-decode [-i input_file] [-o output_file] [-h] [-v]\n",
      argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: %s -encode|-decode [-i input_file] [-o output_file] [-h] [-v]\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: %s -encode|-decode [-i input_file] [-o output_file] [-h] [-v]\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_entropy(long);
int random_at_most(long);
long random(long min, long max) {
  if (max < min) {
    int temp = min;
    min = max;
    max = temp;
  }
  int rand_val = random_at_most(max - min);
  add_entropy(min);
  add_entropy(max);
  return rand_val + min;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1155 <random+0x35>
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
call   1040 <random_at_most@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <add_entropy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <add_entropy@plt>
movslq -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
cmp    %rdi,%rsi
movslq %ebx,%r14
cmovge %rsi,%r14
cmovl  %rsi,%rbx
mov    %r14,%rdi
sub    %rbx,%rdi
call   1040 <random_at_most@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <add_entropy@plt>
mov    %r14,%rdi
call   1030 <add_entropy@plt>
movslq %ebp,%rax
add    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @random(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, %0
%4 = shl i64 %0, 32
%5 = ashr exact i64 %4, 32
%6 = select i1 %3, i64 %5, i64 %1
%7 = select i1 %3, i64 %1, i64 %0
%8 = sub nsw i64 %6, %7
%9 = tail call i32 @random_at_most(i64 %8)
%10 = tail call i32 @add_entropy(i64 %7)
%11 = tail call i32 @add_entropy(i64 %6)
%12 = sext i32 %9 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}
int bitis_io_mem_close(struct bitis_io_mem *mio) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.bitis_io_mem = type opaque
define i32 @bitis_io_mem_close(%struct.bitis_io_mem* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int sqliterkPagenoHeaderOffset(int pageno) {
  if (pageno == 1) {
    return 100;
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<sqliterkPagenoHeaderOffset>:
xor    %ecx,%ecx
cmp    $0x1,%edi
mov    $0x64,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sqliterkPagenoHeaderOffset(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 100, i32 0
ret i32 %3
}
int decToBin(int x) {
  int g, i = 1, binary = 0;
  while (x) {
    g = x % 2;
    x /= 2;
    binary += i * g;
    i *= 10;
  }
  return binary;
}


x86 assembly (clang, -O0):
<decToBin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <decToBin+0x54>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <decToBin+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decToBin>:
test   %edi,%edi
je     113a <decToBin+0x3a>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
mov    %edx,%r8d
sar    %r8d
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
imul   %ecx,%esi
add    %esi,%eax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x1,%edi
cmp    $0x2,%edi
mov    %r8d,%edi
ja     1110 <decToBin+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @decToBin(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 1, %1 ]
%6 = phi i32 [ %8, %3 ], [ %0, %1 ]
%7 = srem i32 %6, 2
%8 = sdiv i32 %6, 2
%9 = mul nsw i32 %5, %7
%10 = add nsw i32 %4, %9
%11 = mul nsw i32 %5, 10
%12 = add i32 %6, 1
%13 = icmp ult i32 %12, 3
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %15
}