xunge/DecIR huggingface dataset:
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numeral;
  scanf("%d", &numeral);
  printf("%d\n", exact_square(numeral));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int f(int *);
int *malloc(int);
int main(void) {
  int *a = malloc(sizeof(int) * 2);
  return f(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 8)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @f(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32 @f(i32* %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bar(int i) {
  printf("I hail from bar! I was passed an input of %d...\n", i);
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"I hail from bar! I was passed an input of %d...\0A\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"I hail from bar! I was passed an input of %d...\0A\00"
define void @bar(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int sprint_backtrace(char *buffer, unsigned long addr) {
  *buffer = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<sprint_backtrace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_backtrace>:
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sprint_backtrace(i8* nocapture writeonly %0, i64 %1) {
store i8 0, i8* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: smtpbm ip-address port username\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: smtpbm ip-address port username\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: smtpbm ip-address port username\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void OnIdle() { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @OnIdle() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[10] = {100, -250, 400, 125, 550, 900, 689, 450, 347, 700};
  int k, eb;
  eb = a[0];
  for (k = 1; k < 10; k++)
    if (a[k] < eb)
      eb = a[k];
  printf("En buyuk eleman = %d\n", eb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
movl   $0x1,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    118a <main+0x6a>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x38(%rbp),%eax
jge    1177 <main+0x57>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
jmp    117c <main+0x5c>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1151 <main+0x31>
mov    -0x38(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 100, i32 -250, i32 400, i32 125, i32 550, i32 900, i32 689, i32 450, i32 347, i32 700]
@.str = [22 x i8] c"En buyuk eleman = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 1, i32* %3
br label %8
8: ; preds = %24, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %11
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
store i32 %22, i32* %4
br label %23
23: ; preds = %18, %11
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %8
27: ; preds = %8
%28 = load i32, i32* %4
%29 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"En buyuk eleman = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 -250)
ret i32 0
}
int mte_enabled() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mte_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_something(int);
int foo(int);
int /*<<< orphan*/ h(char *);
void main(int x) {
  foo(1);
  h("toto");
  foo(2);
  foo(foo(2));
  if (foo(3)) {
    int foo;
    do_something(foo);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <foo@plt>
lea    0xeb4(%rip),%rdi
call   1040 <h@plt>
mov    $0x2,%edi
call   1050 <foo@plt>
mov    $0x2,%edi
call   1050 <foo@plt>
mov    %eax,%edi
call   1050 <foo@plt>
mov    $0x3,%edi
call   1050 <foo@plt>
cmp    $0x0,%eax
je     1187 <main+0x57>
mov    -0x8(%rbp),%edi
call   1030 <do_something@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <foo@plt>
lea    0xebe(%rip),%rdi
call   1040 <h@plt>
mov    $0x2,%edi
call   1050 <foo@plt>
mov    $0x2,%edi
call   1050 <foo@plt>
mov    %eax,%edi
call   1050 <foo@plt>
mov    $0x3,%edi
call   1050 <foo@plt>
test   %eax,%eax
je     1176 <main+0x46>
pop    %rax
jmp    1030 <do_something@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"toto\00"
define void @main(i32 %0) {
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @h(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @foo(i32 2)
%5 = tail call i32 @foo(i32 2)
%6 = tail call i32 @foo(i32 %5)
%7 = tail call i32 @foo(i32 3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @do_something(i32 undef)
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char const *, size_t);
void s_move_elems(void *t, size_t t_off, const void *s, size_t s_off, size_t n,
                  size_t e_size) {
  if (t && s)
    memmove((char *)t + t_off * e_size, (const char *)s + s_off * e_size,
            n * e_size);
}


x86 assembly (clang, -O0):
<s_move_elems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1174 <s_move_elems+0x64>
cmpq   $0x0,-0x18(%rbp)
je     1174 <s_move_elems+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   -0x30(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
imul   -0x30(%rbp),%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
imul   -0x30(%rbp),%rdx
call   1030 <memmove@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_move_elems>:
test   %rdi,%rdi
je     1137 <s_move_elems+0x27>
test   %rdx,%rdx
je     1137 <s_move_elems+0x27>
imul   %r9,%rsi
add    %rsi,%rdi
imul   %r9,%rcx
add    %rcx,%rdx
imul   %r9,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
jmp    1030 <memmove@plt>
ret

LLVM IR (-O0):
define void @s_move_elems(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %33
15: ; preds = %6
%16 = load i8*, i8** %9
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %33
18: ; preds = %15
%19 = load i8*, i8** %7
%20 = load i64, i64* %8
%21 = load i64, i64* %12
%22 = mul i64 %20, %21
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8*, i8** %9
%25 = load i64, i64* %10
%26 = load i64, i64* %12
%27 = mul i64 %25, %26
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i64, i64* %11
%30 = load i64, i64* %12
%31 = mul i64 %29, %30
%32 = call i32 @memmove(i8* %23, i8* %28, i64 %31)
br label %33
33: ; preds = %18, %15, %6
ret void
}

LLVM IR (-O2):
define void @s_move_elems(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = icmp ne i8* %0, null
%8 = icmp ne i8* %2, null
%9 = and i1 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = mul i64 %5, %1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = mul i64 %5, %3
%14 = getelementptr inbounds i8, i8* %2, i64 %13
%15 = mul i64 %5, %4
%16 = tail call i32 @memmove(i8* %12, i8* %14, i64 %15)
br label %17
17: ; preds = %10, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_undefined_ps();
__m128 test_mm_undefined_ps() { return _mm_undefined_ps(); }


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

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

LLVM IR (-O0):
define i32 @test_mm_undefined_ps() {
%1 = call i32 (...) @_mm_undefined_ps()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_mm_undefined_ps() {
%1 = tail call i32 (...) @_mm_undefined_ps()
ret i32 %1
}
int Isleap(int year) {
  if (((year % 4) == 0 && (year % 100) != 0) ||
      ((year % 400 == 0) && (year % 4000) != 0)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<Isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <Isleap+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1157 <Isleap+0x57>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1163 <Isleap+0x63>
mov    -0x8(%rbp),%eax
mov    $0xfa0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1163 <Isleap+0x63>
movl   $0x1,-0x4(%rbp)
jmp    116a <Isleap+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Isleap>:
test   $0x3,%dil
jne    112c <Isleap+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <Isleap+0x2c>
ret
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
imul   $0x26e978d5,%edi,%ecx
add    $0x10624c0,%ecx
ror    $0x5,%ecx
cmp    $0x10624d,%ecx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @Isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = srem i32 %0, 4000
%11 = icmp ne i32 %10, 0
%12 = and i1 %9, %11
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %7, %1
%15 = phi i32 [ 1, %1 ], [ %13, %7 ]
ret i32 %15
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ *d_name;
};

/* Variables and functions */
int isdigit(int /*<<< orphan*/);
int starts_with_digit(const struct dirent *dptr) {
  return (isdigit(dptr->d_name[0]));
}


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

x86 assembly (clang, -O2):
<starts_with_digit>:
mov    (%rdi),%rax
mov    (%rax),%ecx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
setb   %al
ret

LLVM IR (-O0):
%struct.dirent = type { i32* }
define i32 @starts_with_digit(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @isdigit(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i32* }
define i32 @starts_with_digit(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add i32 %4, -48
%6 = icmp ult i32 %5, 10
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: netread [-v | --version]      print the version number "
         "and exit\n"
         "       netread [-h | -? | --help]    print this help message "
         "and exit\n"
         "       netread                       capture the network "
         "packets\n\n");
  printf("The netread program is used to capture and dump on its "
         "standard output, the\n"
         "network packets at a low level. To work properly, this "
         "program needs to be run\n"
         "as root or with the cap_net_raw capability. The capture stops "
         "when receiving an\n"
         "INT, QUIT or TERM signal.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfab(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [208 x i8] c"usage: netread [-v | --version] print the version number and exit\0A netread [-h | -? | --help] print this help message and exit\0A netread capture the network packets\0A\0A\00"
@.str.1 = [262 x i8] c"The netread program is used to capture and dump on its standard output, the\0Anetwork packets at a low level. To work properly, this program needs to be run\0Aas root or with the cap_net_raw capability. The capture stops when receiving an\0AINT, QUIT or TERM signal.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [207 x i8] c"usage: netread [-v | --version] print the version number and exit\0A netread [-h | -? | --help] print this help message and exit\0A netread capture the network packets\0A\00"
@str.2 = [261 x i8] c"The netread program is used to capture and dump on its standard output, the\0Anetwork packets at a low level. To work properly, this program needs to be run\0Aas root or with the cap_net_raw capability. The capture stops when receiving an\0AINT, QUIT or TERM signal.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([207 x i8], [207 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([261 x i8], [261 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ my_putstr_to(int /*<<< orphan*/, char const *);
void my_putstr(char const *str) { my_putstr_to(STDOUT_FILENO, str); }


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

x86 assembly (clang, -O2):
<my_putstr>:
mov    %rdi,%rsi
mov    0x2ed6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <my_putstr_to@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @my_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i8*, i8** %2
%5 = call i32 @my_putstr_to(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @my_putstr(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @my_putstr_to(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutBitmapCharacter(void *, char);
scalar_t__ strlen(char *);
void printstring(void *font, char *string) {
  int len, i;
  len = (int)strlen(string);
  for (i = 0; i < len; i++)
    glutBitmapCharacter(font, string[i]);
}


x86 assembly (clang, -O0):
<printstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1172 <printstring+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <glutBitmapCharacter@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1143 <printstring+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printstring>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1156 <printstring+0x36>
mov    %eax,%r12d
xor    %ebx,%ebx
nop
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <glutBitmapCharacter@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printstring+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @printstring(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** %4
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
store i32 0, i32* %6
br label %10
10: ; preds = %22, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @glutBitmapCharacter(i8* %15, i8 signext %20)
br label %22
22: ; preds = %14
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %10
25: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @printstring(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = and i64 %3, 4294967295
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @glutBitmapCharacter(i8* %0, i8 signext %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xd7() {
  Assert_real((isxdigit(215) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              1080, ("isxdigit should be 0 for 0xd7"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0xd7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd7,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x438,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0xd7>:
push   %rax
mov    $0xd7,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x438,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd7\00"
define void @t_isxdigit_0xd7() {
%1 = call i64 @isxdigit(i32 215)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1080, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd7\00"
define void @t_isxdigit_0xd7() {
%1 = tail call i64 @isxdigit(i32 215)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1080, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
short testClosureVrS(short (*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrS>:
jmp    *%rdi

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

LLVM IR (-O2):
define signext i16 @testClosureVrS(i16 ()* nocapture %0) {
%2 = tail call signext i16 %0()
ret i16 %2
}
call6c(i, l, f, d, uc, us, ui, ul) int i;
long l;
float f;
double d;
unsigned char uc;
unsigned short us;
unsigned int ui;
unsigned long ul;
{
  i = i;
  call6d(l, f, d, uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %ecx,%eax
cvtsd2ss %xmm0,%xmm0
mov    %dl,%cl
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %cl,-0x21(%rbp)
mov    %ax,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x20(%rbp),%xmm1
movzbl -0x21(%rbp),%esi
movzwl -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    $0x2,%al
call   1030 <call6d@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6c>:
mov    %rsi,%rdi
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movzbl %dl,%esi
movzwl %cx,%edx
mov    %r8d,%ecx
mov    %r9,%r8
mov    $0x2,%al
jmp    1030 <call6d@plt>

LLVM IR (-O0):
define i32 @call6c(i32 %0, i64 %1, double %2, double %3, i32 %4, i32 %5, i32 %6, i64 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca float
%13 = alloca double
%14 = alloca i8
%15 = alloca i16
%16 = alloca i32
%17 = alloca i64
%18 = fptrunc double %2 to float
%19 = trunc i32 %4 to i8
%20 = trunc i32 %5 to i16
store i32 %0, i32* %10
store i64 %1, i64* %11
store float %18, float* %12
store double %3, double* %13
store i8 %19, i8* %14
store i16 %20, i16* %15
store i32 %6, i32* %16
store i64 %7, i64* %17
%21 = load i32, i32* %10
store i32 %21, i32* %10
%22 = load i64, i64* %11
%23 = load float, float* %12
%24 = fpext float %23 to double
%25 = load double, double* %13
%26 = load i8, i8* %14
%27 = zext i8 %26 to i32
%28 = load i16, i16* %15
%29 = zext i16 %28 to i32
%30 = load i32, i32* %16
%31 = load i64, i64* %17
%32 = call i32 (i64, double, double, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6d to i32 (i64, double, double, i32, i32, i32, i64, ...)*)(i64 %22, double %24, double %25, i32 %27, i32 %29, i32 %30, i64 %31)
%33 = load i32, i32* %9
ret i32 %33
}

LLVM IR (-O2):
define i32 @call6c(i32 %0, i64 %1, double %2, double %3, i32 %4, i32 %5, i32 %6, i64 %7) {
%9 = fptrunc double %2 to float
%10 = fpext float %9 to double
%11 = and i32 %4, 255
%12 = and i32 %5, 65535
%13 = tail call i32 (i64, double, double, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6d to i32 (i64, double, double, i32, i32, i32, i64, ...)*)(i64 %1, double %10, double %3, i32 %11, i32 %12, i32 %6, i64 %7)
ret i32 undef
}
__attribute__((__section__(".text.c"))) int function1(int a) { return a + 1; }


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

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

LLVM IR (-O0):
define i32 @function1(i32 %0) section ".text.c" {
%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 @function1(i32 %0) section ".text.c" {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_not_used(void) { puts("BAD\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_not_used() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_not_used() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int hashWord(const char *word) {
  unsigned int count;
  unsigned int hashValue = 0;
  for (count = 0; word[count] != '\0'; count++)
    hashValue = word[count] + (hashValue << 6) + (hashValue << 16) - hashValue;
  return (hashValue % 160000);
}


x86 assembly (clang, -O0):
<hashWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1159 <hashWord+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hashWord+0x16>
mov    -0x10(%rbp),%eax
mov    $0x27100,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashWord>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     113f <hashWord+0x3f>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   $0x1003f,%eax,%eax
add    %edx,%eax
mov    %ecx,%edx
movzbl (%rdi,%rdx,1),%edx
add    $0x1,%ecx
test   %dl,%dl
jne    1110 <hashWord+0x10>
mov    %eax,%ecx
mov    $0xd1b71759,%edx
imul   %rcx,%rdx
shr    $0x31,%rdx
imul   $0x27100,%edx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashWord(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 65599
%10 = add i32 %9, %8
%11 = add i32 %7, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = urem i32 %10, 160000
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
char *strcpy(char *destinationString, const char *sourceString) {
  while (*sourceString) {
    *destinationString = *sourceString;
    sourceString++;
    destinationString++;
  }
  *destinationString = '\0';
  return destinationString;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <strcpy+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, int);
void zeroBytes(void *vpt, int count) { memset(vpt, '\0', count); }


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

x86 assembly (clang, -O2):
<zeroBytes>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zeroBytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @memset(i8* %5, i8 signext 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @zeroBytes(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i8 signext 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: syslog_inject [-l] [-c]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: syslog_inject [-l] [-c]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: syslog_inject [-l] [-c]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float clampf(float, int /*<<< orphan*/, float);
float saturate(float value) { return clampf(value, 0, 1.0f); }


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
movss  0xed4(%rip),%xmm1
call   1030 <clampf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
movss  0xee8(%rip),%xmm1
xor    %edi,%edi
jmp    1030 <clampf@plt>

LLVM IR (-O0):
define float @saturate(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @clampf(float %3, i32 0, float 1.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @saturate(float %0) {
%2 = tail call float @clampf(float %0, i32 0, float 1.000000e+00)
ret float %2
}
/* Variables and functions */
double exp(scalar_t__);
long log(double);
scalar_t__ logfac(long);
double Poisson1(long k, double ny) {
  return (exp(-ny + log(ny) * k - logfac(k)));
}


x86 assembly (clang, -O0):
<Poisson1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0x20(%rbp),%xmm0
imul   -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <logfac@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Poisson1>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1050 <log@plt>
imul   %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <logfac@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @Poisson1(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fneg double %5
%7 = load double, double* %4
%8 = call i64 @log(double %7)
%9 = load i64, i64* %3
%10 = mul nsw i64 %8, %9
%11 = sitofp i64 %10 to double
%12 = fadd double %6, %11
%13 = load i64, i64* %3
%14 = call i64 @logfac(i64 %13)
%15 = sitofp i64 %14 to double
%16 = fsub double %12, %15
%17 = fptosi double %16 to i64
%18 = call double @exp(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @Poisson1(i64 %0, double %1) {
%3 = tail call i64 @log(double %1)
%4 = mul nsw i64 %3, %0
%5 = sitofp i64 %4 to double
%6 = fsub double %5, %1
%7 = tail call i64 @logfac(i64 %0)
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
%10 = fptosi double %9 to i64
%11 = tail call double @exp(i64 %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
main() {
  int k;
  char str1[] = "Slobomir";
  char *str2 = "FIT";
  char str3[101];
  char str4[] = {'O', 's', 'n', 'o', 'v', 'i', '\0'};
  char str5[] = "sloboda";
  printf("%d\n", strcmp(str5, str1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x5(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x87(%rbp)
mov    0xeb4(%rip),%ax
mov    %ax,-0x83(%rbp)
mov    0xea9(%rip),%al
mov    %al,-0x81(%rbp)
mov    0xe9d(%rip),%rax
mov    %rax,-0x8f(%rbp)
lea    -0x8f(%rbp),%rdi
lea    -0xd(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.str1 = [9 x i8] c"Slobomir\00"
@.str = [4 x i8] c"FIT\00"
@__const.main.str4 = [7 x i8] c"Osnovi\00"
@__const.main.str5 = [8 x i8] c"sloboda\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = alloca i8*
%4 = alloca [101 x i8]
%5 = alloca [7 x i8]
%6 = alloca [8 x i8]
%7 = bitcast [9 x i8]* %2 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%8 = bitcast [7 x i8]* %5 to i8*
%9 = bitcast [8 x i8]* %6 to i8*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%12 = call i32 @strcmp(i8* %10, i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
void put_black_stones(int fV[((21 + 2) * (21 + 2))]) {
  int k;
  for (k = 0; k < (((21 * 21) + 1) / 2); k++)
    fV[((21 + 3) + (k) + 2 * ((k) / 21))] = 1;
}


x86 assembly (clang, -O0):
<put_black_stones>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xdd,-0xc(%rbp)
jge    1158 <put_black_stones+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x18,%ecx
mov    -0xc(%rbp),%eax
mov    $0x15,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x18(%rbp),%rax
shl    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <put_black_stones+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_black_stones>:
lea    0x60(%rdi),%r8
mov    $0x1,%esi
xor    %ecx,%ecx
mov    $0x86186187,%r9d
movabs $0x8618618618618619,%r10
61 18 86
nopl   0x0(%rax,%rax,1)
mov    %rcx,%rax
mul    %r10
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0x4,%rax
movl   $0x1,(%r8,%rax,8)
cmp    $0xdc,%ecx
je     1177 <put_black_stones+0x77>
mov    %esi,%eax
imul   %r9,%rax
shr    $0x20,%rax
mov    %esi,%edx
sub    %eax,%edx
shr    %edx
add    %eax,%edx
shr    $0x4,%edx
lea    (%rdx,%rdx,1),%eax
add    $0x19,%eax
add    %ecx,%eax
movl   $0x1,(%rdi,%rax,4)
add    $0x2,%rcx
add    $0x2,%esi
add    $0x8,%r8
jmp    1120 <put_black_stones+0x20>
ret

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

LLVM IR (-O2):
define void @put_black_stones(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %14, %1
%3 = phi i32 [ 0, %1 ], [ %23, %14 ]
%4 = add nuw nsw i32 %3, 24
%5 = trunc i32 %3 to i8
%6 = udiv i8 %5, 21
%7 = shl nuw nsw i8 %6, 1
%8 = zext i8 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 1, i32* %11
%12 = or i32 %3, 1
%13 = icmp eq i32 %12, 221
br i1 %13, label %24, label %14
14: ; preds = %2
%15 = add nuw nsw i32 %3, 25
%16 = trunc i32 %12 to i8
%17 = udiv i8 %16, 21
%18 = shl nuw nsw i8 %17, 1
%19 = zext i8 %18 to i32
%20 = add nuw nsw i32 %15, %19
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %0, i64 %21
store i32 1, i32* %22
%23 = add nuw nsw i32 %3, 2
br label %2
24: ; preds = %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t BME_LAS1_H(volatile uint16_t *addr,
                                             uint8_t bit) {
  return *(volatile uint16_t *)((uint32_t)addr | (3 << 26) | (bit << 21));
}


x86 assembly (clang, -O0):
<BME_LAS1_H>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
or     $0xc000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x15,%ecx
or     %ecx,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_LAS1_H>:
shl    $0x15,%esi
or     %edi,%esi
movslq %esi,%rax
or     $0xc000000,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @BME_LAS1_H(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 = ptrtoint i32* %5 to i32
%7 = or i32 %6, 201326592
%8 = load i32, i32* %4
%9 = shl i32 %8, 21
%10 = or i32 %7, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @BME_LAS1_H(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = shl i32 %1, 21
%6 = or i32 %5, %4
%7 = or i32 %6, 201326592
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Does not support SS (SPORADIC SERVER)\n");
  return 4;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Does not support SS (SPORADIC SERVER)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@str = [38 x i8] c"Does not support SS (SPORADIC SERVER)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 4
}