xunge/DecIR huggingface dataset:
int sposta(int *r, int *c) {
  *r = *r + 1;
  if (*r > 3) {
    *r = 1;
    *c = *c - 1;
  }
}


x86 assembly (clang, -O0):
<sposta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x3,(%rax)
jle    1141 <sposta+0x41>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sposta>:
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
cmp    $0x3,%eax
jl     1115 <sposta+0x15>
movl   $0x1,(%rdi)
addl   $0xffffffff,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @sposta(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* %0
%5 = icmp sgt i32 %3, 2
br i1 %5, label %6, label %9
6: ; preds = %2
store i32 1, i32* %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %2
ret i32 undef
}
int csub(x)
int x;
{ return x + 1; }


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

x86 assembly (clang, -O2):
<csub>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @csub(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void xnarch_announce_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @xnarch_announce_tick() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
void glmCopyMatrix4d(const double source[16], double target[16]) {
  memcpy(target, source, 16 * sizeof(double));
}


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

x86 assembly (clang, -O2):
<glmCopyMatrix4d>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x80,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @glmCopyMatrix4d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double*, double** %3
%7 = call i32 @memcpy(double* %5, double* %6, i32 128)
ret void
}

LLVM IR (-O2):
define void @glmCopyMatrix4d(double* %0, double* %1) {
%3 = tail call i32 @memcpy(double* %1, double* %0, i32 128)
ret void
}
int __attribute__((target("arch=ivybridge"))) redef(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @redef() {
ret i32 1
}

LLVM IR (-O2):
define i32 @redef() {
ret i32 1
}
/* Variables and functions */
char *mapitem(char *, unsigned int *, unsigned int *, unsigned int *);
int /*<<< orphan*/ validate(char *, unsigned int, unsigned int);
void verifymap(char *map, char *range) {
  unsigned count, first, lower;
  while ((map = mapitem(map, &first, &lower, &count)))
    validate(range, lower, count);
}


x86 assembly (clang, -O0):
<verifymap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <mapitem@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1167 <verifymap+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <validate@plt>
jmp    1130 <verifymap+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifymap>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <mapitem@plt>
test   %rax,%rax
je     1189 <verifymap+0x69>
mov    %rax,%rbx
lea    0xc(%rsp),%r14
lea    0x4(%rsp),%r12
lea    0x8(%rsp),%r13
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r15,%rdi
call   1040 <validate@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1030 <mapitem@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1160 <verifymap+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @verifymap(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i8* @mapitem(i8* %0, i32* %4, i32* %5, i32* %3)
%10 = icmp eq i8* %9, null
br i1 %10, label %18, label %11
11: ; preds = %2, %11
%12 = phi i8* [ %16, %11 ], [ %9, %2 ]
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = call i32 @validate(i8* %1, i32 %13, i32 %14)
%16 = call i8* @mapitem(i8* %12, i32* %4, i32* %5, i32* %3)
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %11
18: ; preds = %11, %2
ret void
}
void foo684(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo684(i32 %0) {
ret void
}
void print_state(int state) {}


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

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

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

LLVM IR (-O2):
define void @print_state(i32 %0) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ check_args(int /*<<< orphan*/);
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char **argv) {
  check_args(parse_args(argc, argv));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_args@plt>
mov    %eax,%edi
call   1030 <check_args@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <parse_args@plt>
mov    %eax,%edi
call   1030 <check_args@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i32 @check_args(i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 @check_args(i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int binarysearch(char *, int /*<<< orphan*/, char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  printf("%d\n", binarysearch(argv[1], strlen(argv[1]), argv[2][0]));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%edx
call   1040 <binarysearch@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    0x10(%rbx),%rcx
movsbl (%rcx),%edx
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <binarysearch@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = call i32 @binarysearch(i8* %8, i32 %12, i8 signext %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = tail call i32 @binarysearch(i8* %4, i32 %5, i8 signext %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NotifyMac1Second();
extern void NotifyRadio1Second() { NotifyMac1Second(); }


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

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

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

LLVM IR (-O2):
define void @NotifyRadio1Second() {
%1 = tail call i32 (...) @NotifyMac1Second()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NFDi_Free(void *);
void NFD_Free(void *ptr) { NFDi_Free(ptr); }


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

x86 assembly (clang, -O2):
<NFD_Free>:
jmp    1030 <NFDi_Free@plt>

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

LLVM IR (-O2):
define void @NFD_Free(i8* %0) {
%2 = tail call i32 @NFDi_Free(i8* %0)
ret void
}
unsigned int HashString(string)
register char *string;
{
  register unsigned int result;
  register int c;
  result = 0;
  while (1) {
    c = *string;
    string++;
    if (c == 0) {
      break;
    }
    result += (result << 3) + c;
  }
  return result;
}


x86 assembly (clang, -O0):
<HashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1134 <HashString+0x34>
jmp    1148 <HashString+0x48>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <HashString+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @HashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test5(int x) {
  extern int foo(int);
  if (x == 0)
    foo(x);
  else if (x == 0)
    link_error();
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1142 <test5+0x22>
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
jmp    1158 <test5+0x38>
cmpl   $0x0,-0x4(%rbp)
jne    1153 <test5+0x33>
mov    $0x0,%al
call   1040 <link_error@plt>
jmp    1158 <test5+0x38>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
test   %edi,%edi
je     1115 <test5+0x5>
ret
xor    %edi,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @foo(i32 %6)
br label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
define void @test5(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @foo(i32 0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plintf(char *, double, double);
void process_root(double real, double im) {
  plintf("Root: %g + I %g \n", real, im);
}


x86 assembly (clang, -O0):
<process_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <plintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Root: %g + I %g \0A\00"
define void @process_root(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @plintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Root: %g + I %g \0A\00"
define void @process_root(double %0, double %1) {
%3 = tail call i32 @plintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %0, double %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t __read_png_int_raw(const uint8_t *buf) {
  int32_t b0, b1, b2, b3;
  b0 = buf[0];
  b1 = buf[1];
  b2 = buf[2];
  b3 = buf[3];
  return b0 << 24 | b1 << 16 | b2 << 8 | b3;
}


x86 assembly (clang, -O0):
<__read_png_int_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__read_png_int_raw>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%eax
shl    $0x18,%ecx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @__read_png_int_raw(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = shl i32 %2, 24
%10 = shl i32 %4, 16
%11 = or i32 %10, %9
%12 = shl i32 %6, 8
%13 = or i32 %11, %12
%14 = or i32 %13, %8
ret i32 %14
}
/* Variables and functions */
float expf(float);
float logisticf(float x) { return 1.0f / (1.0f + expf(-x)); }


x86 assembly (clang, -O0):
<logisticf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <expf@plt>
movss  0xec4(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xeb8(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logisticf>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <expf@plt>
movss  0xeeb(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logisticf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call float @expf(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @logisticf(float %0) {
%2 = fneg float %0
%3 = tail call float @expf(float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float 1.000000e+00, %4
ret float %5
}
/* Type definitions */
struct tm {
  int dummy;
};
struct str {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ str_formattime(struct str *, int /*<<< orphan*/,
                                  char const *, struct tm *);
void str_copyftime(struct str *sa, const char *fmt, struct tm *tm) {
  str_formattime(sa, 0, fmt, tm);
}


x86 assembly (clang, -O0):
<str_copyftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <str_formattime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copyftime>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <str_formattime@plt>

LLVM IR (-O0):
%struct.str = type { i32 }
%struct.tm = type { i32 }
define void @str_copyftime(%struct.str* %0, i8* %1, %struct.tm* %2) {
%4 = alloca %struct.str*
%5 = alloca i8*
%6 = alloca %struct.tm*
store %struct.str* %0, %struct.str** %4
store i8* %1, i8** %5
store %struct.tm* %2, %struct.tm** %6
%7 = load %struct.str*, %struct.str** %4
%8 = load i8*, i8** %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i32 @str_formattime(%struct.str* %7, i32 0, i8* %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.str = type { i32 }
%struct.tm = type { i32 }
define void @str_copyftime(%struct.str* %0, i8* %1, %struct.tm* %2) {
%4 = tail call i32 @str_formattime(%struct.str* %0, i32 0, i8* %1, %struct.tm* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int multiply_convert_str_to_int(int *, char const *, size_t const);
int multiply_convert_str_to_uint32_t(uint32_t *value_out, const char *str,
                                     const size_t len) {
  int ret = 0;
  int value;
  ret = multiply_convert_str_to_int(&value, str, len);
  *value_out = (uint32_t)value;
  return ret;
}


x86 assembly (clang, -O0):
<multiply_convert_str_to_uint32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <multiply_convert_str_to_int@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_convert_str_to_uint32_t>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <multiply_convert_str_to_int@plt>
movslq 0xc(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @multiply_convert_str_to_uint32_t(i64* %0, i8* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i64* %0, i64** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @multiply_convert_str_to_int(i32* %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %8
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
store i64 %13, i64* %14
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @multiply_convert_str_to_uint32_t(i64* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @multiply_convert_str_to_int(i32* %4, i8* %1, i64 %2)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
store i64 %8, i64* %0
ret i32 %6
}
void create_file(void) {}


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

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

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

LLVM IR (-O2):
define void @create_file() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
int is_mid_level_match(char *line, char *device, bool class) {
  if (!class)
    return !memcmp(&line[1], &device[2], 4);
  return !memcmp(&line[1], device, 2);
}


x86 assembly (clang, -O0):
<is_mid_level_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    115c <is_mid_level_match+0x4c>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <is_mid_level_match+0x72>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mid_level_match>:
push   %rax
add    $0x1,%rdi
test   %edx,%edx
je     1120 <is_mid_level_match+0x10>
mov    $0x2,%edx
jmp    1129 <is_mid_level_match+0x19>
add    $0x2,%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_mid_level_match(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = getelementptr inbounds i8, i8* %0, i64 1
br i1 %4, label %6, label %9
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = tail call i32 @memcmp(i8* %5, i8* %7, i32 4)
br label %11
9: ; preds = %3
%10 = tail call i32 @memcmp(i8* %5, i8* %1, i32 2)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %10, %9 ], [ %8, %6 ]
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int num, int denom) {
  div_t r;
  r.quot = num / denom;
  r.rem = num % denom;
  if (num >= 0 && r.rem < 0) {
    r.quot++;
    r.rem -= denom;
  }
  return (r);
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1146 <div+0x46>
cmpl   $0x0,-0x4(%rbp)
jge    1146 <div+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edi,%edi
setns  %dil
test   %edx,%edx
sets   %cl
and    %dil,%cl
movzbl %cl,%ecx
add    %ecx,%eax
xor    %edi,%edi
test   %cl,%cl
cmovne %esi,%edi
sub    %edi,%edx
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = sdiv i32 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %12, i32* %13
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %2
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%18 = load i32, i32* %17
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
%24 = load i32, i32* %5
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%26 = load i32, i32* %25
%27 = sub nsw i32 %26, %24
store i32 %27, i32* %25
br label %28
28: ; preds = %20, %16, %2
%29 = bitcast %struct.TYPE_3__* %3 to i64*
%30 = load i64, i64* %29
ret i64 %30
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp sgt i32 %0, -1
%6 = icmp slt i32 %4, 0
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
%9 = add nsw i32 %3, %8
%10 = select i1 %7, i32 %1, i32 0
%11 = sub nsw i32 %4, %10
%12 = zext i32 %11 to i64
%13 = shl nuw i64 %12, 32
%14 = zext i32 %9 to i64
%15 = or i64 %13, %14
ret i64 %15
}
/* Variables and functions */
int adjustmode(int, int);
setgmode(int f, int n) { return (adjustmode(1, 1)); }


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

x86 assembly (clang, -O2):
<setgmode>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <adjustmode@plt>

LLVM IR (-O0):
define i32 @setgmode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @adjustmode(i32 1, i32 1)
ret i32 %5
}

LLVM IR (-O2):
define i32 @setgmode(i32 %0, i32 %1) {
%3 = tail call i32 @adjustmode(i32 1, i32 1)
ret i32 %3
}
/* Variables and functions */
char tolower(char);
void str_tolower(char *s) {
  while (*s != '\0') {
    *s = tolower(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <str_tolower+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_tolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_tolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <str_tolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <str_tolower+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @str_tolower(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 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @tolower(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @str_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void ece391_strcpy(uint8_t *dst, const uint8_t *src) {
  while ('\0' != (*dst++ = *src++))
    ;
}


x86 assembly (clang, -O0):
<ece391_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
xor    %eax,%eax
cmp    %ecx,%eax
je     113d <ece391_strcpy+0x3d>
jmp    110c <ece391_strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece391_strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsi,%rax,1),%ecx
mov    %ecx,(%rdi,%rax,1)
add    $0x4,%rax
test   %ecx,%ecx
jne    1110 <ece391_strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @ece391_strcpy(i32* nocapture writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %8, %3 ]
%5 = phi i32* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %5
%8 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %7, i32* %4
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int native_write_msr_safe(unsigned int, unsigned int, unsigned int);
__attribute__((always_)) int wrmsr_safe(unsigned msr, unsigned low,
                                        unsigned high) {
  return native_write_msr_safe(msr, low, high);
}


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

x86 assembly (clang, -O2):
<wrmsr_safe>:
jmp    1030 <native_write_msr_safe@plt>

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

LLVM IR (-O2):
define i32 @wrmsr_safe(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @native_write_msr_safe(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RunFuriatune(char *);
void xCacheOn(void) { RunFuriatune("cache on"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"cache on\00"
define void @xCacheOn() {
%1 = tail call i32 @RunFuriatune(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fannkuch(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int n = (argc > 1) ? atoi(argv[1]) : 0;
  printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n));
  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)
cmpl   $0x1,-0x8(%rbp)
jle    1165 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    116f <main+0x3f>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <main+0x3f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fannkuch@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1040 <fannkuch@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Pfannkuchen(%d) = %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %9
%16 = phi i32 [ %13, %9 ], [ 0, %14 ]
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @fannkuch(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Pfannkuchen(%d) = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @fannkuch(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
int byte_col_sjis(int byte) {
  if (byte >= 0x40 && byte < 0x7f)
    return byte - 0x40;
  else if (byte >= 0x80 && byte < 0xfd)
    return byte - 0x41;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_col_sjis>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jl     1129 <byte_col_sjis+0x29>
cmpl   $0x7f,-0x8(%rbp)
jge    1129 <byte_col_sjis+0x29>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_sjis+0x58>
cmpl   $0x80,-0x8(%rbp)
jl     1151 <byte_col_sjis+0x51>
cmpl   $0xfd,-0x8(%rbp)
jge    1151 <byte_col_sjis+0x51>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_sjis+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_col_sjis>:
lea    -0x80(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x7d,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x40(%rdi),%ecx
cmp    $0x3f,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_col_sjis(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 64
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 64
store i32 %11, i32* %2
br label %22
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 128
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 253
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
store i32 %20, i32* %2
br label %22
21: ; preds = %15, %12
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %18, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @byte_col_sjis(i32 %0) {
%2 = add i32 %0, -64
%3 = icmp ult i32 %2, 63
%4 = add i32 %0, -128
%5 = icmp ult i32 %4, 125
%6 = add nsw i32 %0, -65
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
int getBitAt(unsigned int bitmap, unsigned int i) {
  int result = (bitmap >> i) & 1;
  return result;
}


x86 assembly (clang, -O0):
<getBitAt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBitAt>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getBitAt(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 = lshr i32 %6, %7
%9 = and i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @getBitAt(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int lstat(char *, struct stat *);
int main(void) {
  struct stat buf;
  int status;
  status = lstat("/tmp/foo", &buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [9 x i8] c"/tmp/foo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @lstat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
store i32 %4, i32* %3
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [9 x i8] c"/tmp/foo\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @lstat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int close_cfg(char **buf) {
  if (buf != NULL)
    free(*buf);
  *buf = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<close_cfg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <close_cfg+0x23>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_cfg>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1121 <close_cfg+0x11>
mov    (%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @close_cfg(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
store i8* null, i8** %0
ret i32 0
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ this_comparison_is_not_decidable();
void bla4gt(int var) {
  if (var - 10 > INT_MAX - 11)
    this_comparison_is_not_decidable();
}


x86 assembly (clang, -O0):
<bla4gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
sub    $0xb,%ecx
cmp    %ecx,%eax
jle    113c <bla4gt+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_not_decidable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla4gt>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jle    111c <bla4gt+0xc>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_not_decidable@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @bla4gt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 10
%5 = load i32, i32* @INT_MAX
%6 = sub nsw i32 %5, 11
%7 = icmp sgt i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_not_decidable()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @bla4gt(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = icmp sgt i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_not_decidable()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned short const octet(unsigned short const);
unsigned short word(unsigned short);
int is_prior(unsigned short a, unsigned short b) {
  const unsigned short w = word(a - b);
  return w != octet(w);
}


x86 assembly (clang, -O0):
<is_prior>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
movzwl %ax,%edi
call   1040 <word@plt>
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
mov    %eax,-0xc(%rbp)
movzwl -0x6(%rbp),%edi
call   1030 <octet@plt>
mov    %ax,%cx
mov    -0xc(%rbp),%eax
movzwl %cx,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prior>:
push   %rbx
sub    %esi,%edi
movzwl %di,%edi
call   1040 <word@plt>
movzwl %ax,%ebx
mov    %ebx,%edi
call   1030 <octet@plt>
xor    %ecx,%ecx
cmp    %ax,%bx
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_prior(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = trunc i32 %10 to i16
%12 = call zeroext i16 @word(i16 zeroext %11)
store i16 %12, i16* %5
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = load i16, i16* %5
%16 = call zeroext i16 @octet(i16 zeroext %15)
%17 = zext i16 %16 to i32
%18 = icmp ne i32 %14, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_prior(i16 zeroext %0, i16 zeroext %1) {
%3 = sub i16 %0, %1
%4 = tail call zeroext i16 @word(i16 zeroext %3)
%5 = tail call zeroext i16 @octet(i16 zeroext %4)
%6 = icmp ne i16 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}