xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() { printf("char: %c\n", 'A'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"char: %c\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 65)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"char: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 65)
ret i32 0
}
/* Variables and functions */
scalar_t__ omb_utils_file_exists(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int omb_utils_check_lock_menu() {
  char tmp[255];
  sprintf(tmp, "%s/%s/.bootmenu.lock", "/omb", "open-multiboot");
  if (omb_utils_file_exists(tmp))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<omb_utils_check_lock_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x110(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xed5(%rip),%rdx
lea    0xed3(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <omb_utils_file_exists@plt>
cmp    $0x0,%rax
je     116e <omb_utils_check_lock_menu+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <omb_utils_check_lock_menu+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omb_utils_check_lock_menu>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
lea    0xedf(%rip),%rdx
lea    0xedd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <omb_utils_file_exists@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s/%s/.bootmenu.lock\00"
@.str.1 = [5 x i8] c"/omb\00"
@.str.2 = [15 x i8] c"open-multiboot\00"
define i32 @omb_utils_check_lock_menu() {
%1 = alloca i32
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%6 = call i64 @omb_utils_file_exists(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s/%s/.bootmenu.lock\00"
@.str.1 = [5 x i8] c"/omb\00"
@.str.2 = [15 x i8] c"open-multiboot\00"
define i32 @omb_utils_check_lock_menu() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = call i64 @omb_utils_file_exists(i8* %2)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ MapRom(int, int, int);
void camerica(int addr, int val) {
  val &= 0xFF;
  if (addr > 0xC000) {
    MapRom(0x8, val * 16384, 16384);
  }
}


x86 assembly (clang, -O0):
<camerica>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xc000,-0x4(%rbp)
jle    114b <camerica+0x3b>
mov    -0x8(%rbp),%esi
shl    $0xe,%esi
mov    $0x8,%edi
mov    $0x4000,%edx
call   1030 <MapRom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camerica>:
cmp    $0xc001,%edi
jl     112e <camerica+0x1e>
movzbl %sil,%esi
shl    $0xe,%esi
mov    $0x8,%edi
mov    $0x4000,%edx
jmp    1030 <MapRom@plt>
ret

LLVM IR (-O0):
define void @camerica(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 49152
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 16384
%12 = call i32 @MapRom(i32 8, i32 %11, i32 16384)
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @camerica(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 49152
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = shl i32 %1, 14
%6 = and i32 %5, 4177920
%7 = tail call i32 @MapRom(i32 8, i32 %6, i32 16384)
br label %8
8: ; preds = %4, %2
ret void
}
void INT_Excep_PERIB_INTB130(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB130() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void die(char *s) {
  printf("%s", s);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ converttofixed(int);
int fadd(int, int /*<<< orphan*/);
int faddm(int x, int n) { return fadd(x, converttofixed(n)); }


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

x86 assembly (clang, -O2):
<faddm>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <converttofixed@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <fadd@plt>

LLVM IR (-O0):
define i32 @faddm(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 @converttofixed(i32 %6)
%8 = call i32 @fadd(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @faddm(i32 %0, i32 %1) {
%3 = tail call i32 @converttofixed(i32 %1)
%4 = tail call i32 @fadd(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int signo) { printf("interrupt%%\n"); }


x86 assembly (clang, -O0):
<sig_int>:
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):
<sig_int>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"interrupt%%\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"interrupt%%\0A\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int fsop_path_islnk(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return S_ISLNK(st.st_mode);
}


x86 assembly (clang, -O0):
<fsop_path_islnk>:
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    $0x0,%rax
jge    114f <fsop_path_islnk+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <fsop_path_islnk+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_islnk>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1138 <fsop_path_islnk+0x18>
mov    (%rsp),%edi
call   1030 <S_ISLNK@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsop_path_islnk(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISLNK(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
short min(short a, short b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    112e <min+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <min+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %ax,%di
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @min(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @min(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *pro) {
  fprintf(stderr, "Usage: %s <string>\n", pro);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <string>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <string>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int bones_main();
int main(void) {
  int bones_return = bones_main();
  return bones_return;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bones_main()
ret i32 %1
}
int path_component(const char *path, int pos) {
  return path[pos] == 0 || pos == 0 || path[pos - 1] == '/';
}


x86 assembly (clang, -O0):
<path_component>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     114e <path_component+0x4e>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     114e <path_component+0x4e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_component>:
mov    $0x1,%eax
test   %esi,%esi
je     111c <path_component+0x1c>
movslq %esi,%rcx
cmpb   $0x0,(%rdi,%rcx,1)
je     111c <path_component+0x1c>
xor    %eax,%eax
cmpb   $0x2f,-0x1(%rcx,%rdi,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @path_component(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %24, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 47
br label %24
24: ; preds = %15, %12, %2
%25 = phi i1 [ true, %12 ], [ true, %2 ], [ %23, %15 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @path_component(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i32 %1, 0
%8 = or i1 %7, %6
br i1 %8, label %16, label %9
9: ; preds = %2
%10 = add nsw i32 %1, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 47
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %2
%17 = phi i32 [ 1, %2 ], [ %15, %9 ]
ret i32 %17
}
void ufshpb_suspend(struct ufs_hba *hba) {}


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

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

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

LLVM IR (-O2):
%struct.ufs_hba = type opaque
define void @ufshpb_suspend(%struct.ufs_hba* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int bps_is_valid(uint16_t bps) {
  int i;
  for (i = 0; i <= 8; i++) {
    if (bps == (128 << i))
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<bps_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     114e <bps_is_valid+0x4e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x80,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jne    113b <bps_is_valid+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1155 <bps_is_valid+0x55>
jmp    1140 <bps_is_valid+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <bps_is_valid+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bps_is_valid>:
mov    $0x1,%eax
cmp    $0x7ff,%edi
jle    112e <bps_is_valid+0x2e>
cmp    $0x1fff,%edi
jle    1148 <bps_is_valid+0x48>
cmp    $0x2000,%edi
je     112d <bps_is_valid+0x2d>
cmp    $0x4000,%edi
je     112d <bps_is_valid+0x2d>
cmp    $0x8000,%edi
jne    116a <bps_is_valid+0x6a>
ret
cmp    $0x1ff,%edi
jg     115a <bps_is_valid+0x5a>
cmp    $0x80,%edi
je     112d <bps_is_valid+0x2d>
cmp    $0x100,%edi
je     112d <bps_is_valid+0x2d>
jmp    116a <bps_is_valid+0x6a>
cmp    $0x800,%edi
je     112d <bps_is_valid+0x2d>
cmp    $0x1000,%edi
je     112d <bps_is_valid+0x2d>
jmp    116a <bps_is_valid+0x6a>
cmp    $0x200,%edi
je     112d <bps_is_valid+0x2d>
cmp    $0x400,%edi
je     112d <bps_is_valid+0x2d>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bps_is_valid(i32 %0) {
switch i32 %0, label %2 [
i32 128, label %3
i32 256, label %3
i32 512, label %3
i32 1024, label %3
i32 2048, label %3
i32 4096, label %3
i32 8192, label %3
i32 16384, label %3
i32 32768, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ugl_AddBytecode(int);
int ugl_GetLabel(char const *);
int /*<<< orphan*/ ugl_plog(char *, int);
void ugl_bytecode_jmp_no_zero(const char *s) {
  int idx;
  idx = ugl_GetLabel(s);
  ugl_plog("BC jump on not zero, label idx=%d", idx);
  ugl_AddBytecode((0x4f));
  ugl_AddBytecode(idx >> 8);
  ugl_AddBytecode(idx & 0x0ff);
}


x86 assembly (clang, -O0):
<ugl_bytecode_jmp_no_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ugl_GetLabel@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <ugl_plog@plt>
mov    $0x4f,%edi
call   1030 <ugl_AddBytecode@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
call   1030 <ugl_AddBytecode@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
call   1030 <ugl_AddBytecode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ugl_bytecode_jmp_no_zero>:
push   %rbx
call   1050 <ugl_GetLabel@plt>
mov    %eax,%ebx
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <ugl_plog@plt>
mov    $0x4f,%edi
call   1030 <ugl_AddBytecode@plt>
mov    %ebx,%edi
sar    $0x8,%edi
call   1030 <ugl_AddBytecode@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <ugl_AddBytecode@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"BC jump on not zero, label idx=%d\00"
define void @ugl_bytecode_jmp_no_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ugl_GetLabel(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @ugl_plog(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @ugl_AddBytecode(i32 79)
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = call i32 @ugl_AddBytecode(i32 %10)
%12 = load i32, i32* %3
%13 = and i32 %12, 255
%14 = call i32 @ugl_AddBytecode(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"BC jump on not zero, label idx=%d\00"
define void @ugl_bytecode_jmp_no_zero(i8* %0) {
%2 = tail call i32 @ugl_GetLabel(i8* %0)
%3 = tail call i32 @ugl_plog(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @ugl_AddBytecode(i32 79)
%5 = ashr i32 %2, 8
%6 = tail call i32 @ugl_AddBytecode(i32 %5)
%7 = and i32 %2, 255
%8 = tail call i32 @ugl_AddBytecode(i32 %7)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int compare_int32(const void *_i1, const void *_i2) {
  int32_t *i1 = (int32_t *)_i1;
  int32_t *i2 = (int32_t *)_i2;
  return *i1 - *i2;
}


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

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

LLVM IR (-O0):
define i32 @compare_int32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_int32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ size();
int is_empty() { return size() == 0; }


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <size@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rax
xor    %eax,%eax
call   1030 <size@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_empty() {
%1 = call i64 (...) @size()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @is_empty() {
%1 = tail call i64 (...) @size()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  setuid(0);
  setgid(0);
  execv("whoami", argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
xor    %edi,%edi
call   1030 <setgid@plt>
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <execv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %edi,%edi
call   1040 <setuid@plt>
xor    %edi,%edi
call   1030 <setgid@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
call   1050 <execv@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"whoami\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @setuid(i32 0)
%6 = call i32 @setgid(i32 0)
%7 = load i8**, i8*** %4
%8 = call i32 @execv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"whoami\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setuid(i32 0)
%4 = tail call i32 @setgid(i32 0)
%5 = tail call i32 @execv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
long lmax(a, b)
long a, b;
{ return (a > b ? a : b); }


x86 assembly (clang, -O0):
<lmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <lmax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lmax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @lmax(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @lmax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int stackEmpty() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stackEmpty() {
ret i32 0
}
void b43_leds_stop(struct b43_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43_wldev = type opaque
define void @b43_leds_stop(%struct.b43_wldev* nocapture %0) {
ret void
}
void generic_file_open(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<generic_file_open>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_file_open>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.generic_file_open = [18 x i8] c"generic_file_open\00"
define void @generic_file_open() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.generic_file_open, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.generic_file_open = [18 x i8] c"generic_file_open\00"
define void @generic_file_open() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.generic_file_open, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_f(char *, int, int);
void err(int n) {
  e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
      "master/minix-master/minix/tests/test52.c",
      30, (n));
}


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

x86 assembly (clang, -O2):
<err>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    $0x1e,%esi
jmp    1030 <e_f@plt>

LLVM IR (-O0):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/master/minix-master/minix/tests/test52.c\00"
define void @err(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 30, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/master/minix-master/minix/tests/test52.c\00"
define void @err(i32 %0) {
%2 = tail call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 30, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *);
void ns_reset() { cprintf("normal world reset\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"normal world reset\0A\00"
define void @ns_reset() {
%1 = call i32 @cprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"normal world reset\0A\00"
define void @ns_reset() {
%1 = tail call i32 @cprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int svz_file_check(char *file) {
  struct stat buf;
  return file ? stat(file, &buf) : -1;
}


x86 assembly (clang, -O0):
<svz_file_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <svz_file_check+0x2c>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
jmp    1149 <svz_file_check+0x39>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <svz_file_check+0x39>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_file_check>:
test   %rdi,%rdi
je     1123 <svz_file_check+0x13>
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @svz_file_check(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @stat(i8* %7, %struct.stat* %3)
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i32 [ %8, %6 ], [ -1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @svz_file_check(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @stat(i8* %0, %struct.stat* %2)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t strlen(char const *);
char *w_addmem(char *, size_t *, size_t *, char const *, size_t);
char *w_addstr(char *buffer, size_t *actlen, size_t *maxlen, const char *str) {
  size_t len;
  assert(str != NULL);
  len = strlen(str);
  return w_addmem(buffer, actlen, maxlen, str, len);
}


x86 assembly (clang, -O0):
<w_addstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <w_addmem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_addstr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %edi,%edi
test   %rcx,%rcx
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <w_addmem@plt>

LLVM IR (-O0):
define i8* @w_addstr(i8* %0, i64* %1, i64* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %8
%15 = call i64 @strlen(i8* %14)
store i64 %15, i64* %9
%16 = load i8*, i8** %5
%17 = load i64*, i64** %6
%18 = load i64*, i64** %7
%19 = load i8*, i8** %8
%20 = load i64, i64* %9
%21 = call i8* @w_addmem(i8* %16, i64* %17, i64* %18, i8* %19, i64 %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @w_addstr(i8* %0, i64* %1, i64* %2, i8* %3) {
%5 = icmp ne i8* %3, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%9 = tail call i8* @w_addmem(i8* %0, i64* %1, i64* %2, i8* %3, i64 %8)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void zero_ivector(int *v, int n) { memset(v, 0, sizeof(int) * n); }


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

x86 assembly (clang, -O2):
<zero_ivector>:
lea    0x0(,%rsi,4),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zero_ivector(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 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i32* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @zero_ivector(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32 @memset(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hg_enable(int /*<<< orphan*/);
int /*<<< orphan*/ lt_timer_reset();
int /*<<< orphan*/ mpu_enable(int /*<<< orphan*/);
int /*<<< orphan*/ remote_fuse_enable(int /*<<< orphan*/);
int /*<<< orphan*/ thermo_hi_enable(int /*<<< orphan*/);
int /*<<< orphan*/ thermo_lo_enable(int /*<<< orphan*/);
void roll_back(void) {
  thermo_hi_enable(0);
  thermo_lo_enable(0);
  mpu_enable(0);
  hg_enable(0);
  remote_fuse_enable(0);
  lt_timer_reset();
}


x86 assembly (clang, -O0):
<roll_back>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <thermo_hi_enable@plt>
xor    %edi,%edi
call   1030 <thermo_lo_enable@plt>
xor    %edi,%edi
call   1080 <mpu_enable@plt>
xor    %edi,%edi
call   1040 <hg_enable@plt>
xor    %edi,%edi
call   1070 <remote_fuse_enable@plt>
mov    $0x0,%al
call   1060 <lt_timer_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_back>:
push   %rax
xor    %edi,%edi
call   1050 <thermo_hi_enable@plt>
xor    %edi,%edi
call   1030 <thermo_lo_enable@plt>
xor    %edi,%edi
call   1080 <mpu_enable@plt>
xor    %edi,%edi
call   1040 <hg_enable@plt>
xor    %edi,%edi
call   1070 <remote_fuse_enable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <lt_timer_reset@plt>

LLVM IR (-O0):
define void @roll_back() {
%1 = call i32 @thermo_hi_enable(i32 0)
%2 = call i32 @thermo_lo_enable(i32 0)
%3 = call i32 @mpu_enable(i32 0)
%4 = call i32 @hg_enable(i32 0)
%5 = call i32 @remote_fuse_enable(i32 0)
%6 = call i32 (...) @lt_timer_reset()
ret void
}

LLVM IR (-O2):
define void @roll_back() {
%1 = tail call i32 @thermo_hi_enable(i32 0)
%2 = tail call i32 @thermo_lo_enable(i32 0)
%3 = tail call i32 @mpu_enable(i32 0)
%4 = tail call i32 @hg_enable(i32 0)
%5 = tail call i32 @remote_fuse_enable(i32 0)
%6 = tail call i32 (...) @lt_timer_reset()
ret void
}
void caller_2_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_2_2_1_1() {
ret void
}
int main(void) {
  int a[5] = {1, 2, 3, 4, 5};
  *(&a[4]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee9(%rip),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%5 = load i32, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ __builtin_scalbl(long double, long double);
int /*<<< orphan*/ link_failure_builtin_scalbl();
void test_builtin_scalbl(long double ld1, long double ld2) {
  if (__builtin_scalbl(ld1, ld2) != __builtin_scalbl(ld1, ld2))
    link_failure_builtin_scalbl();
}


x86 assembly (clang, -O0):
<test_builtin_scalbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <__builtin_scalbl@plt>
mov    %rax,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <__builtin_scalbl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1175 <test_builtin_scalbl+0x55>
mov    $0x0,%al
call   1030 <link_failure_builtin_scalbl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_scalbl>:
push   %rbx
sub    $0x40,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_scalbl@plt>
mov    %rax,%rbx
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_scalbl@plt>
cmp    %rax,%rbx
jne    1167 <test_builtin_scalbl+0x47>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_scalbl@plt>

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

LLVM IR (-O2):
define void @test_builtin_scalbl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @__builtin_scalbl(x86_fp80 %0, x86_fp80 %1)
%4 = tail call i64 @__builtin_scalbl(x86_fp80 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_scalbl()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int sdeco_zeige_esc(int);
int sdeco_process_esc(int esc) {
  int res;
  res = sdeco_zeige_esc(esc);
  return res;
}


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

x86 assembly (clang, -O2):
<sdeco_process_esc>:
jmp    1030 <sdeco_zeige_esc@plt>

LLVM IR (-O0):
define i32 @sdeco_process_esc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sdeco_zeige_esc(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @sdeco_process_esc(i32 %0) {
%2 = tail call i32 @sdeco_zeige_esc(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "Usage: tie -[mc] outfile master changefile(s)");
  fputc('\n', stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [46 x i8] c"Usage: tie -[mc] outfile master changefile(s)\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fputc(i8 signext 10, i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [46 x i8] c"Usage: tie -[mc] outfile master changefile(s)\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputc(i8 signext 10, i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __io_putchar(int /*<<< orphan*/);
__attribute__((weak)) int _write(int file, char *ptr, int len) {
  (void)(file);
  int DataIdx;
  for (DataIdx = 0; DataIdx < len; DataIdx++) {
    __io_putchar(*ptr++);
  }
  return len;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <_write+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <__io_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <_write+0x19>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edx,%edx
jle    1142 <_write+0x32>
mov    %rsi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <__io_putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <_write+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define weak i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ 0, %3 ]
%7 = phi i8* [ %8, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @__io_putchar(i32 %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret i32 %2
}
void modp_callback(int special) {}


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

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

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

LLVM IR (-O2):
define void @modp_callback(i32 %0) {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void test_vorrimm_s32x2(int32_t *__restrict__ dest, int32_t *a) {
  int i;
  for (i = 0; i < 2; i++) {
    dest[i] = a[i] | 1;
  }
}


x86 assembly (clang, -O0):
<test_vorrimm_s32x2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1144 <test_vorrimm_s32x2+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vorrimm_s32x2+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorrimm_s32x2>:
mov    (%rsi),%eax
or     $0x1,%eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
or     $0x1,%eax
mov    %eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorrimm_s32x2(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = or i32 %3, 1
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = or i32 %6, 1
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %7, i32* %8
ret void
}