xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned long ftell(int /*<<< orphan*/ *);
int file_size(char *path) {
  FILE *file;
  unsigned long length;
  file = fopen(path, "rb");
  fseek(file, 0, SEEK_END);
  length = ftell(file);
  fclose(file);
  return length;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @file_size(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i32 0, i32 %3)
%5 = tail call i64 @ftell(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
%7 = trunc i64 %5 to i32
ret i32 %7
}
unsigned mulu(unsigned x, unsigned y) { return x * y; }


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

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

LLVM IR (-O0):
define i32 @mulu(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 = load i32, i32* %4
%7 = mul i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mulu(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int addfunc(int, int);
int test(int a, int b) { return addfunc(a, b); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <addfunc@plt>

LLVM IR (-O0):
define i32 @test(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 = load i32, i32* %4
%7 = call i32 @addfunc(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @addfunc(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, int);
int zomp_writeInt(void *file, int i) { return fprintf((FILE *)file, "%d", i); }


x86 assembly (clang, -O0):
<zomp_writeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zomp_writeInt>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @zomp_writeInt(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @zomp_writeInt(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %4
}
int uasm_rel_higher(long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uasm_rel_higher(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_fmt(char *, int);
int /*<<< orphan*/ write_nl();
void ipf_description(void) {
  write_fmt(":dl break=fit tsize=%d.", 8);
  write_nl();
}


x86 assembly (clang, -O0):
<ipf_description>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
call   1040 <write_fmt@plt>
mov    $0x0,%al
call   1030 <write_nl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipf_description>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
call   1040 <write_fmt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <write_nl@plt>

LLVM IR (-O0):
@.str = [24 x i8] c":dl break=fit tsize=%d.\00"
define void @ipf_description() {
%1 = call i32 @write_fmt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = call i32 (...) @write_nl()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c":dl break=fit tsize=%d.\00"
define void @ipf_description() {
%1 = tail call i32 @write_fmt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 (...) @write_nl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void continued(__attribute__((unused)) int signal) {
  printf("\tHello from SIGCONT handler!\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"\09Hello from SIGCONT handler!\0A\00"
define void @continued(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"\09Hello from SIGCONT handler!\00"
define void @continued(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ base_pixel;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_base_pixel(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->base_pixel;
}


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

x86 assembly (clang, -O2):
<get_XStandardColormap_base_pixel>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XStandardColormap_base_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *createTreeRecursively(int, int /*<<< orphan*/, int, char **);
struct TreeNode *argv2Tree(int argc, char **argv) {
  return createTreeRecursively(1, 0, argc, argv);
}


x86 assembly (clang, -O0):
<argv2Tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <createTreeRecursively@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv2Tree>:
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <createTreeRecursively@plt>

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

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @argv2Tree(i32 %0, i8** %1) {
%3 = tail call %struct.TreeNode* @createTreeRecursively(i32 1, i32 0, i32 %0, i8** %1)
ret %struct.TreeNode* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void eat_cookie(int n) {
  while (n-- > 0) {
    printf("nom");
  }
}


x86 assembly (clang, -O0):
<eat_cookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <eat_cookie+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <eat_cookie+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_cookie>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <eat_cookie+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <eat_cookie+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"nom\00"
define void @eat_cookie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"nom\00"
define void @eat_cookie(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int get_class_gen(char *, int);
int get_item_num(char *str) { return get_class_gen(str, 3); }


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

x86 assembly (clang, -O2):
<get_item_num>:
mov    $0x3,%esi
jmp    1030 <get_class_gen@plt>

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

LLVM IR (-O2):
define i32 @get_item_num(i8* %0) {
%2 = tail call i32 @get_class_gen(i8* %0, i32 3)
ret i32 %2
}
int starts_with(const char *prefix, const char *str) {
  while (*prefix) {
    if (*prefix++ != *str++) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <starts_with+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <starts_with+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <starts_with+0x5d>
jmp    110c <starts_with+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1127 <starts_with+0x27>
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <starts_with+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
int wrong_guess(char *plaintext, int position, char *trigram) {
  char *guess, *reality;
  guess = trigram;
  reality = &plaintext[position];
  while (*guess) {
    if (*guess++ != *reality++)
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<wrong_guess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     1170 <wrong_guess+0x70>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%eax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116b <wrong_guess+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1177 <wrong_guess+0x77>
jmp    1126 <wrong_guess+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrong_guess>:
movslq %esi,%r8
add    %rdi,%r8
xor    %eax,%eax
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movzbl (%rdx,%rsi,1),%ecx
test   %cl,%cl
je     112a <wrong_guess+0x2a>
lea    0x1(%rsi),%rdi
cmp    (%r8,%rsi,1),%cl
mov    %rdi,%rsi
je     1110 <wrong_guess+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @wrong_guess(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
br label %6
6: ; preds = %11, %3
%7 = phi i8* [ %2, %3 ], [ %12, %11 ]
%8 = phi i8* [ %5, %3 ], [ %13, %11 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %8
%15 = icmp eq i8 %9, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %11
%17 = phi i32 [ 1, %11 ], [ 0, %6 ]
ret i32 %17
}
f(int n) {
  struct A {
    int buf[5];
  } a[3][n];
  return sizeof(a[0]);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
imul   $0x3c,%rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
imul   $0x14,%rax,%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shl    $0x2,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
%struct.A = type { [5 x i32] }
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = mul nuw i64 3, %6
%9 = alloca %struct.A, i64 %8
store i64 %6, i64* %4
%10 = mul nsw i64 0, %6
%11 = getelementptr inbounds %struct.A, %struct.A* %9, i64 %10
%12 = mul nuw i64 20, %6
%13 = trunc i64 %12 to i32
%14 = load i8*, i8** %3
ret i32 %13
}

LLVM IR (-O2):
%struct.A = type { [5 x i32] }
define i32 @f(i32 %0) {
%2 = mul i32 %0, 20
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xde() {
  Assert_real((isdigit(222) == 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_isdigit.c",
              1115, ("isdigit should be 0 for 0xde"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xde>:
push   %rax
mov    $0xde,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x45b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xde\00"
define void @t_isdigit_0xde() {
%1 = call i64 @isdigit(i32 222)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xde\00"
define void @t_isdigit_0xde() {
%1 = tail call i64 @isdigit(i32 222)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_uni_epel_h64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h64_12_sse4() {
ret void
}
int hummingboardValidGPIO(int pin) {
  if (pin >= 0 && pin <= 7) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<hummingboardValidGPIO>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <hummingboardValidGPIO+0x27>
cmpl   $0x7,-0x8(%rbp)
jg     1127 <hummingboardValidGPIO+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <hummingboardValidGPIO+0x2e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hummingboardValidGPIO>:
xor    %eax,%eax
cmp    $0x8,%edi
adc    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @hummingboardValidGPIO(i32 %0) {
%2 = icmp ugt i32 %0, 7
%3 = sext i1 %2 to i32
ret i32 %3
}
void QEIVelocityConfigure(unsigned long ulBase, unsigned long ulPreDiv,
                          unsigned long ulPeriod) {
  ;
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) =
      (((*((volatile unsigned long *)(ulBase + 0x00000000))) & ~(0x000001C0)) |
       ulPreDiv);
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ulPeriod - 1;
}


x86 assembly (clang, -O0):
<QEIVelocityConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffe3f,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityConfigure>:
mov    $0xfffffffffffffe3f,%rax
and    (%rdi),%rax
or     %rsi,%rax
mov    %rax,(%rdi)
add    $0xffffffffffffffff,%rdx
mov    %rdx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @QEIVelocityConfigure(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = add i64 %7, 0
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, -449
%12 = load i64, i64* %5
%13 = or i64 %11, %12
%14 = load i64, i64* %4
%15 = add i64 %14, 0
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
%17 = load i64, i64* %6
%18 = sub i64 %17, 1
%19 = load i64, i64* %4
%20 = add i64 %19, 16
%21 = inttoptr i64 %20 to i64*
store volatile i64 %18, i64* %21
ret void
}

LLVM IR (-O2):
define void @QEIVelocityConfigure(i64 %0, i64 %1, i64 %2) {
%4 = inttoptr i64 %0 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -449
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
%8 = add i64 %2, -1
%9 = add i64 %0, 16
%10 = inttoptr i64 %9 to i64*
store volatile i64 %8, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ truclient_step(char *, char *, char *);
Script_View_Init() {
  truclient_step(
      "1", "Evaluate JavaScript code var T02X_StockList_Change_iteration = 0;",
      "snapshot=Init_1.inf");
}


x86 assembly (clang, -O0):
<Script_View_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xf17(%rip),%rdx
call   1030 <truclient_step@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Script_View_Init>:
lea    0xee9(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xf1f(%rip),%rdx
jmp    1030 <truclient_step@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [66 x i8] c"Evaluate JavaScript code var T02X_StockList_Change_iteration = 0;\00"
@.str.2 = [20 x i8] c"snapshot=Init_1.inf\00"
define i32 @Script_View_Init() {
%1 = alloca i32
%2 = call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [66 x i8] c"Evaluate JavaScript code var T02X_StockList_Change_iteration = 0;\00"
@.str.2 = [20 x i8] c"snapshot=Init_1.inf\00"
define i32 @Script_View_Init() {
%1 = tail call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int issep(char);
int /*<<< orphan*/ printf(char *, char *);
void charchange(char *str) {
  int ret;
  while (*str != '\0') {
    ret = issep(*str);
    if (ret == 1) {
      printf("Separator: %s\n", str);
    }
    str++;
  }
}


x86 assembly (clang, -O0):
<charchange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <charchange+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <issep@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1165 <charchange+0x45>
mov    -0x8(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <charchange+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charchange>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1166 <charchange+0x46>
mov    %rdi,%rbx
lea    0xecc(%rip),%r14
jmp    114c <charchange+0x2c>
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1166 <charchange+0x46>
movsbl %al,%edi
call   1040 <issep@plt>
cmp    $0x1,%eax
jne    1140 <charchange+0x20>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1140 <charchange+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Separator: %s\0A\00"
define void @charchange(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = tail call i32 @issep(i8 signext %5)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
void foo145() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gensb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fun(int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int nr_of_trapps = 0;
  int ret = 0;
  long nr_of_reductions = 1;
  fun(&ret);
  printf("RETURNED %d\n", ret);
  if (ret != 3) {
    printf("ERROR\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <fun@plt>
mov    -0x18(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x3,-0x18(%rbp)
je     1198 <main+0x68>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <fun@plt>
mov    0x4(%rsp),%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x3,0x4(%rsp)
jne    1170 <main+0x30>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"RETURNED %d\0A\00"
@.str.1 = [7 x i8] c"ERROR\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i64 1, i64* %8
%9 = call i32 @fun(i32* %7)
%10 = load i32, i32* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"RETURNED %d\0A\00"
@str = [6 x i8] c"ERROR\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @fun(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 3
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int verifFic2(char *rep) {
  struct stat repStat;
  if (stat(rep, &repStat) == -1)
    return -1;
  if (S_ISDIR(repStat.st_mode))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<verifFic2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <verifFic2+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <verifFic2+0x53>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     116c <verifFic2+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <verifFic2+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifFic2>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1143 <verifFic2+0x23>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @verifFic2(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}
int rs_supports_trace(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rs_supports_trace() {
ret i32 0
}
/* Variables and functions */
int shm_unlink(char *);
int UnlockName(char *ProcessName) { return (shm_unlink(ProcessName)); }


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

x86 assembly (clang, -O2):
<UnlockName>:
jmp    1030 <shm_unlink@plt>

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

LLVM IR (-O2):
define i32 @UnlockName(i8* %0) {
%2 = tail call i32 @shm_unlink(i8* %0)
ret i32 %2
}
int rb_islower(int c) { return 'a' <= c && c <= 'z'; }


x86 assembly (clang, -O0):
<rb_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <rb_islower+0x24>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @rb_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int acpi_irq_balance_set(char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acpi_irq_balance_set(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned int rng__u16_in(unsigned int, unsigned int);
unsigned int rng_u16_in(unsigned int range) {
  unsigned int mask;
  mask = range;
  mask = (mask | (mask >> 1));
  mask = (mask | (mask >> 2));
  mask = (mask | (mask >> 4));
  mask = (mask | (mask >> 8));
  return rng__u16_in(range, mask);
}


x86 assembly (clang, -O0):
<rng_u16_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <rng__u16_in@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_u16_in>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%esi
shr    $0x8,%esi
or     %eax,%esi
jmp    1030 <rng__u16_in@plt>

LLVM IR (-O0):
define i32 @rng_u16_in(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 1
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 2
%12 = or i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 4
%16 = or i32 %13, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = lshr i32 %18, 8
%20 = or i32 %17, %19
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @rng__u16_in(i32 %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @rng_u16_in(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = tail call i32 @rng__u16_in(i32 %0, i32 %9)
ret i32 %10
}
void unregister_handler_proc(unsigned int irq, struct irqaction *action) {}


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

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

LLVM IR (-O0):
%struct.irqaction = type opaque
define void @unregister_handler_proc(i32 %0, %struct.irqaction* %1) {
%3 = alloca i32
%4 = alloca %struct.irqaction*
store i32 %0, i32* %3
store %struct.irqaction* %1, %struct.irqaction** %4
ret void
}

LLVM IR (-O2):
%struct.irqaction = type opaque
define void @unregister_handler_proc(i32 %0, %struct.irqaction* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
uint64_t getTime(void) {
  struct timeval ptime;
  uint64_t t = 0;
  gettimeofday(&ptime, (struct timezone *)NULL);
  t = ((uint64_t)1000000) * (uint64_t)ptime.tv_sec + (uint64_t)ptime.tv_usec;
  return t;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i32 @getTime() {
%1 = alloca %struct.timeval
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 1000000, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i32 @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
void *dfn_rp(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @dfn_rp() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dfn_rp() {
ret i8* null
}
unsigned int rev_l(unsigned int r0) {
  unsigned int mask;
  unsigned int r1;
  mask = 0xffff00ffU;
  r1 = r0 ^ (((r0) >> (16)) | ((r0) << (32 - (16))));
  r1 = mask & (r1 >> 8);
  r0 = r1 ^ (((r0) >> (8)) | ((r0) << (32 - (8))));
  return r0;
}


x86 assembly (clang, -O0):
<rev_l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffff00ff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
mov    -0x4(%rbp),%edx
shl    $0x10,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
mov    -0x4(%rbp),%edx
shl    $0x18,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_l>:
mov    %edi,%eax
rol    $0x10,%eax
xor    %edi,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
rol    $0x18,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rev_l(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 -65281, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = load i32, i32* %2
%9 = shl i32 %8, 16
%10 = or i32 %7, %9
%11 = xor i32 %5, %10
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = lshr i32 %13, 8
%15 = and i32 %12, %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = shl i32 %19, 24
%21 = or i32 %18, %20
%22 = xor i32 %16, %21
store i32 %22, i32* %2
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @rev_l(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 16)
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = and i32 %4, 16711935
%6 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 24)
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rtems_configuration_set_stack_space_size(int /*<<< orphan*/);
int /*<<< orphan*/ rtems_configuration_set_work_space_size(int);
int /*<<< orphan*/ rtems_initialize_data_structures();
void force_error() {
  rtems_configuration_set_work_space_size(sizeof(void *));
  rtems_configuration_set_stack_space_size(0);
  rtems_initialize_data_structures();
}


x86 assembly (clang, -O0):
<force_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1050 <rtems_configuration_set_work_space_size@plt>
xor    %edi,%edi
call   1040 <rtems_configuration_set_stack_space_size@plt>
mov    $0x0,%al
call   1030 <rtems_initialize_data_structures@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_error>:
push   %rax
mov    $0x8,%edi
call   1050 <rtems_configuration_set_work_space_size@plt>
xor    %edi,%edi
call   1040 <rtems_configuration_set_stack_space_size@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rtems_initialize_data_structures@plt>

LLVM IR (-O0):
define void @force_error() {
%1 = call i32 @rtems_configuration_set_work_space_size(i32 8)
%2 = call i32 @rtems_configuration_set_stack_space_size(i32 0)
%3 = call i32 (...) @rtems_initialize_data_structures()
ret void
}

LLVM IR (-O2):
define void @force_error() {
%1 = tail call i32 @rtems_configuration_set_work_space_size(i32 8)
%2 = tail call i32 @rtems_configuration_set_stack_space_size(i32 0)
%3 = tail call i32 (...) @rtems_initialize_data_structures()
ret void
}
void strupr(s) char *s;
{
  int i = 0;
  while (s[i]) {
    if (islower(s[i]))
      s[i] -= 32;
    i++;
  }
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116f <strupr+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     1161 <strupr+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
sub    $0x20,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strupr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1153 <strupr+0x43>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    113c <strupr+0x2c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1153 <strupr+0x43>
movsbl %bpl,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1130 <strupr+0x20>
add    $0xe0,%bpl
mov    %bpl,-0x1(%rbx)
jmp    1130 <strupr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strupr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %13
%5 = phi i64 [ %14, %13 ], [ 0, %1 ]
%6 = phi i8 [ %16, %13 ], [ %2, %1 ]
%7 = phi i8* [ %15, %13 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 @islower(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = add i8 %6, -32
store i8 %12, i8* %7
br label %13
13: ; preds = %11, %4
%14 = add nuw i64 %5, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %13, %1
ret void
}