xunge/DecIR huggingface dataset:
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_dir;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *getHomeDir(char *home) {
  struct passwd *usr_info = getpwuid(getuid());
  strcpy(home, usr_info->pw_dir);
  return home;
}


x86 assembly (clang, -O0):
<getHomeDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHomeDir>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i8* @getHomeDir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.passwd*
store i8* %0, i8** %2
%4 = call i32 (...) @getuid()
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load i8*, i8** %2
%7 = load %struct.passwd*, %struct.passwd** %3
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @strcpy(i8* %6, i32 %9)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i8* @getHomeDir(i8* returned %0) {
%2 = tail call i32 (...) @getuid()
%3 = tail call %struct.passwd* @getpwuid(i32 %2)
%4 = getelementptr inbounds %struct.passwd, %struct.passwd* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @strcpy(i8* %0, i32 %5)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_size_y() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_size_y>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_size_y>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_size_y() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_size_y() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *str_alloc_ncpy(const char *s, size_t len, void *(alloc_f)(size_t size)) {
  char *tmp = (char *)alloc_f(len + 1);
  strncpy(tmp, s, len + 1);
  return tmp;
}


x86 assembly (clang, -O0):
<str_alloc_ncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   *%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_alloc_ncpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x1(%rsi),%r15
mov    %r15,%rdi
call   *%rdx
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @str_alloc_ncpy(i8* %0, i64 %1, i8* (i64)* nocapture %2) {
%4 = add i64 %1, 1
%5 = tail call i8* %2(i64 %4)
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
int /*<<< orphan*/ set_cursor(int /*<<< orphan*/, int /*<<< orphan*/);
void video_init() {
  clrscr();
  set_cursor(0, 0);
}


x86 assembly (clang, -O0):
<video_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clrscr@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <set_cursor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_init>:
push   %rax
xor    %eax,%eax
call   1030 <clrscr@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <set_cursor@plt>

LLVM IR (-O0):
define void @video_init() {
%1 = call i32 (...) @clrscr()
%2 = call i32 @set_cursor(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @video_init() {
%1 = tail call i32 (...) @clrscr()
%2 = tail call i32 @set_cursor(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
int main() {
  printf("%*.*f", 10, 2, 12.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0xa,%esi
mov    $0x2,%edx
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0xa,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%*.*f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10, i32 2, double 1.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%*.*f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10, i32 2, double 1.200000e+01)
ret i32 0
}
unsigned int swap32(unsigned int x) {
  return (((x >> 24) & 0xff) << 0) | (((x >> 16) & 0xff) << 8) |
         (((x >> 8) & 0xff) << 16) | (((x >> 0) & 0xff) << 24);
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
shl    $0x0,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int judgeCircle(char *);
char *whenUD_ShouldReturnTrue() {
  int result = judgeCircle("UD");
  do {
    if (!(1 == result))
      return "When moves are UP-DOWN, the result should be 1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<whenUD_ShouldReturnTrue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <judgeCircle@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
je     1145 <whenUD_ShouldReturnTrue+0x35>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <whenUD_ShouldReturnTrue+0x42>
jmp    114a <whenUD_ShouldReturnTrue+0x3a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whenUD_ShouldReturnTrue>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <judgeCircle@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
lea    0xeda(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"UD\00"
@.str.1 = [47 x i8] c"When moves are UP-DOWN, the result should be 1\00"
define i8* @whenUD_ShouldReturnTrue() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @judgeCircle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 1, %5
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"UD\00"
@.str.1 = [47 x i8] c"When moves are UP-DOWN, the result should be 1\00"
define i8* @whenUD_ShouldReturnTrue() {
%1 = tail call i32 @judgeCircle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
void f2() {
  int *p = NULL;
  int a;
  *p = 12;
  a = *p;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @f2() {
%1 = alloca i32*
%2 = alloca i32
store i32* null, i32** %1
%3 = load i32*, i32** %1
store i32 12, i32* %3
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ ds2770_writeByte(int);
void ds2770_skipROM() { ds2770_writeByte(0xcc); }


x86 assembly (clang, -O0):
<ds2770_skipROM>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcc,%edi
call   1030 <ds2770_writeByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2770_skipROM>:
mov    $0xcc,%edi
jmp    1030 <ds2770_writeByte@plt>

LLVM IR (-O0):
define void @ds2770_skipROM() {
%1 = call i32 @ds2770_writeByte(i32 204)
ret void
}

LLVM IR (-O2):
define void @ds2770_skipROM() {
%1 = tail call i32 @ds2770_writeByte(i32 204)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_sethostname;
int syscall(int /*<<< orphan*/, char const *, size_t);
int sethostname(const char *name, size_t len) {
  return syscall(__NR_sethostname, name, len);
}


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

x86 assembly (clang, -O2):
<sethostname>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_sethostname = global i32 0
define i32 @sethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @__NR_sethostname
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @syscall(i32 %5, i8* %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@__NR_sethostname = global i32 0
define i32 @sethostname(i8* %0, i64 %1) {
%3 = load i32, i32* @__NR_sethostname
%4 = tail call i32 @syscall(i32 %3, i8* %0, i64 %1)
ret i32 %4
}
/* Variables and functions */
int rand();
__attribute__((__weak__, __always___)) int softboundcets_rand() {
  return rand();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundcets_rand() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundcets_rand() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int **permuteUnique(int *, int, int *);
int main(void) {
  int **res, ret;
  int x[] = {1, 1, 2};
  res = permuteUnique(x, 3, &ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
lea    -0x14(%rbp),%rdx
call   1030 <permuteUnique@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rdx
mov    $0x3,%esi
call   1030 <permuteUnique@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [3 x i32] [i32 1, i32 1, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32** @permuteUnique(i32* %5, i32 3, i32* %1)
ret i32 0
}
void *test_anti_range_111(signed char n) {
  extern void *alloc_anti_range_111(signed char) __attribute__((alloc_size(1)));
  if ((-0x7f - 1) + 2 <= n && n <= -1)
    n = (-0x7f - 1) + 2 - 1;
  return alloc_anti_range_111(n);
}


x86 assembly (clang, -O0):
<test_anti_range_111>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xffffff82,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_111+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0xffffffff,%eax
jg     1140 <test_anti_range_111+0x30>
movb   $0x81,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_111@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_111>:
cmp    $0x81,%dil
mov    $0x81,%eax
cmovb  %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_111@plt>

LLVM IR (-O0):
define i8* @test_anti_range_111(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 -126, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -127, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_111(i8 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_111(i8 signext %0) {
%2 = icmp ult i8 %0, -127
%3 = select i1 %2, i8 %0, i8 -127
%4 = tail call i8* @alloc_anti_range_111(i8 signext %3)
ret i8* %4
}
__attribute__((always_)) void set_kernel_text_ro(void) {}


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

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

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

LLVM IR (-O2):
define void @set_kernel_text_ro() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SSIStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x0000000C))) & 0x0000000F);
}


x86 assembly (clang, -O0):
<SSIStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIStatus>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0xc(%rax),%rax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i64 @SSIStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 15
ret i64 %7
}

LLVM IR (-O2):
define i64 @SSIStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 15
ret i64 %7
}
int pdf_rc4_flush(void *_ctx, char *out) {
  int tmplen = 0;
  return tmplen;
}


x86 assembly (clang, -O0):
<pdf_rc4_flush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pdf_rc4_flush(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void glutInitWindowSize(int x, int y) {}


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

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

LLVM IR (-O0):
define void @glutInitWindowSize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @glutInitWindowSize(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dp_disklock();
int send_orig(int, void const *, size_t, int);
int send(int s, const void *msg, size_t len, int flags) {
  dp_disklock();
  return (send_orig(s, msg, len, flags));
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <dp_disklock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <send_orig@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <dp_disklock@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <send_orig@plt>

LLVM IR (-O0):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 (...) @dp_disklock()
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @send_orig(i32 %10, i8* %11, i64 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 (...) @dp_disklock()
%6 = tail call i32 @send_orig(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ comm_printer_writeFFFx(char);
void ejectAndReset(void) { comm_printer_writeFFFx('I'); }


x86 assembly (clang, -O0):
<ejectAndReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49,%edi
call   1030 <comm_printer_writeFFFx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ejectAndReset>:
mov    $0x49,%edi
jmp    1030 <comm_printer_writeFFFx@plt>

LLVM IR (-O0):
define void @ejectAndReset() {
%1 = call i32 @comm_printer_writeFFFx(i8 signext 73)
ret void
}

LLVM IR (-O2):
define void @ejectAndReset() {
%1 = tail call i32 @comm_printer_writeFFFx(i8 signext 73)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strxfrm(char *, char const *, int);
void bufferAccessOutOfBounds_strxfrm(void) {
  const char src[3] = "abc";
  char dest[1] = "a";
  (void)strxfrm(dest, src, 1);
  (void)strxfrm(dest, src, 2);
  (void)strxfrm(dest, src, 3);
}


x86 assembly (clang, -O0):
<bufferAccessOutOfBounds_strxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x1,%edx
call   1030 <strxfrm@plt>
lea    -0x4(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x2,%edx
call   1030 <strxfrm@plt>
lea    -0x4(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strxfrm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferAccessOutOfBounds_strxfrm>:
push   %r14
push   %rbx
push   %rax
movb   $0x63,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
movb   $0x61,0x3(%rsp)
lea    0x3(%rsp),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <strxfrm@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <strxfrm@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <strxfrm@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.bufferAccessOutOfBounds_strxfrm.src = [3 x i8] c"abc"
@__const.bufferAccessOutOfBounds_strxfrm.dest = [1 x i8] c"a"
define void @bufferAccessOutOfBounds_strxfrm() {
%1 = alloca [3 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [3 x i8]* %1 to i8*
%4 = bitcast [1 x i8]* %2 to i8*
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = call i32 @strxfrm(i8* %5, i8* %6, i32 1)
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%10 = call i32 @strxfrm(i8* %8, i8* %9, i32 2)
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%13 = call i32 @strxfrm(i8* %11, i8* %12, i32 3)
ret void
}

LLVM IR (-O2):
@__const.bufferAccessOutOfBounds_strxfrm.src = [3 x i8] c"abc"
define void @bufferAccessOutOfBounds_strxfrm() {
%1 = alloca [3 x i8]
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 97, i8* %4
%5 = call i32 @strxfrm(i8* %4, i8* %3, i32 1)
%6 = call i32 @strxfrm(i8* %4, i8* %3, i32 2)
%7 = call i32 @strxfrm(i8* %4, i8* %3, i32 3)
ret void
}
void gtk_combo_box_entry_set_text_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_entry_set_text_column() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t I2CFIFODataGetNonBlocking(uint32_t ui32Base, uint8_t *pui8Data) {
  ;
  if ((*((volatile uint32_t *)(ui32Base + 0x00000F08))) & 0x00010000) {
    return (0);
  } else {
    *pui8Data = (*((volatile uint32_t *)(ui32Base + 0x00000F00)));
    return (1);
  }
}


x86 assembly (clang, -O0):
<I2CFIFODataGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xf08,%eax
cltq
mov    (%rax),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1131 <I2CFIFODataGetNonBlocking+0x31>
movl   $0x0,-0x4(%rbp)
jmp    114a <I2CFIFODataGetNonBlocking+0x4a>
mov    -0x8(%rbp),%eax
add    $0xf00,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CFIFODataGetNonBlocking>:
movslq %edi,%rcx
xor    %eax,%eax
testl  $0x10000,0xf08(%rcx)
jne    111e <I2CFIFODataGetNonBlocking+0x1e>
mov    0xf00(%rcx),%eax
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @I2CFIFODataGetNonBlocking(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 3848
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 65536
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 3840
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = load i32*, i32** %5
store i32 %19, i32* %20
store i32 1, i32* %3
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @I2CFIFODataGetNonBlocking(i32 %0, i32* nocapture writeonly %1) {
%3 = add nsw i32 %0, 3848
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 65536
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = add nsw i32 %0, 3840
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
store i32 %13, i32* %1
br label %14
14: ; preds = %2, %9
%15 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ B38400;
int /*<<< orphan*/ init_serial(int, int /*<<< orphan*/);
int open_serial(char *);
int openGPS(char *dev) {
  int fd;
  fd = open_serial(dev);
  init_serial(fd, B38400);
  return fd;
}


x86 assembly (clang, -O0):
<openGPS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <open_serial@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1040 <init_serial@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openGPS>:
push   %rbx
call   1030 <open_serial@plt>
mov    %eax,%ebx
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <init_serial@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@B38400 = global i32 0
define i32 @openGPS(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @open_serial(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @B38400
%8 = call i32 @init_serial(i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@B38400 = global i32 0
define i32 @openGPS(i8* %0) {
%2 = tail call i32 @open_serial(i8* %0)
%3 = load i32, i32* @B38400
%4 = tail call i32 @init_serial(i32 %2, i32 %3)
ret i32 %2
}
int test_imm_12uint32_mem(unsigned int *val) {
  return ((*val) & (0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x12,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_12uint32_mem>:
testb  $0x12,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_12uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 18
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_12uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 18
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void handle_URG(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_URG(i32 %0) {
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double tan(double n) {
  if (cos(n) == 0) {
    return 0. / 0.;
  }
  return sin(n) / cos(n);
}


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115c <tan+0x3c>
jp     115c <tan+0x3c>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <tan+0x66>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1148 <tan+0x28>
jp     1148 <tan+0x28>
movsd  0xebd(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call double @cos(double %4)
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0x7FF8000000000000, double* %2
br label %14
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @sin(double %9)
%11 = load double, double* %3
%12 = call double @cos(double %11)
%13 = fdiv double %10, %12
store double %13, double* %2
br label %14
14: ; preds = %8, %7
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @cos(double %0)
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call double @sin(double %0)
%6 = tail call double @cos(double %0)
%7 = fdiv double %5, %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 0x7FF8000000000000, %1 ]
ret double %9
}
/* Variables and functions */
int ascii_to_integer(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) { printf("%d", ascii_to_integer("233")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <ascii_to_integer@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"233\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 @ascii_to_integer(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"233\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ascii_to_integer(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned char *memchr(unsigned char *, int /*<<< orphan*/, int);
int channels_len(unsigned char *channels) {
  unsigned char *p = memchr(channels, 0, 8);
  return p ? (p - channels) : 8;
}


x86 assembly (clang, -O0):
<channels_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114f <channels_len+0x3f>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    115d <channels_len+0x4d>
mov    $0x8,%eax
mov    %rax,-0x18(%rbp)
jmp    115d <channels_len+0x4d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<channels_len>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x8,%ebp
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @channels_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @memchr(i8* %4, i32 0, i32 8)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
br label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %8
%16 = phi i64 [ %13, %8 ], [ 8, %14 ]
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @channels_len(i8* %0) {
%2 = tail call i8* @memchr(i8* %0, i32 0, i32 8)
%3 = icmp eq i8* %2, null
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = select i1 %3, i32 8, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strStr(char *, char *);
int main() {
  printf("%d\n", strStr("hello", "llo"));
  printf("%d\n", strStr("hello", "llo"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <strStr@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <strStr@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed8(%rip),%r15
lea    0xed3(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strStr@plt>
lea    0xebb(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strStr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [4 x i8] c"llo\00"
define i32 @main() {
%1 = tail call i32 @strStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @strStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void pthread_cleanup_pop(int execute) { (void)execute; }


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

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

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

LLVM IR (-O2):
define void @pthread_cleanup_pop(i32 %0) {
ret void
}
void RTAvloHCPhysDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloHCPhysDestroy() {
ret void
}
void X509_EXTENSION_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_EXTENSION_dup() {
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
int mutex_wait(int semid, int sem_num) {
  struct sembuf op;
  op.sem_num = sem_num;
  op.sem_op = -1;
  op.sem_flg = 0;
  semop(semid, &op, 1);
}


x86 assembly (clang, -O0):
<mutex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_wait>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @mutex_wait(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 1
store i32 -1, i32* %9
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 2
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = call i32 @semop(i32 %11, %struct.sembuf* %6, i32 1)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @mutex_wait(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret i32 undef
}
int prime(int x) {
  int num;
  for (int i = 2; i <= x - 1; i++) {
    if (x % i == 0)
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1142 <prime+0x42>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    113b <prime+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <prime+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t ntoh32(uint32_t n) { return ntohl(n); }


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

x86 assembly (clang, -O2):
<ntoh32>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @ntoh32(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Variables and functions */
double acos(double);
__attribute__((__weak__, __always___)) double softboundmpx_acos(double x) {
  return acos(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_acos>:
jmp    1030 <acos@plt>

LLVM IR (-O0):
define weak double @softboundmpx_acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @acos(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundmpx_acos(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
int compar(const void *x, const void *y, void *context) {
  (void)context;
  return *(int *)x - *(int *)y;
}


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

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

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

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = sub nsw i32 %5, %7
ret i32 %8
}
void RTS3SetProgressCallback(void) {}


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

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

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

LLVM IR (-O2):
define void @RTS3SetProgressCallback() {
ret void
}
void RTR3InitEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTR3InitEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Swap(unsigned char *, unsigned char *);
void EndianSwap_2bytes(unsigned char *data) { Swap(data, data + 1); }


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

x86 assembly (clang, -O2):
<EndianSwap_2bytes>:
lea    0x1(%rdi),%rsi
jmp    1030 <Swap@plt>

LLVM IR (-O0):
define void @EndianSwap_2bytes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i32 @Swap(i8* %3, i8* %5)
ret void
}

LLVM IR (-O2):
define void @EndianSwap_2bytes(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @Swap(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x03() {
  Assert_real((isprint(3) == 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_isprint.c",
              20, ("isprint should be 0 for 0x03"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x03>:
push   %rax
mov    $0x3,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x03\00"
define void @t_isprint_0x03() {
%1 = call i64 @isprint(i32 3)
%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 20, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x03\00"
define void @t_isprint_0x03() {
%1 = tail call i64 @isprint(i32 3)
%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 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void XDefaultDepthOfScreen() {}


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

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

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

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