xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void unique_print_simple_header() {
  printf(" ____________________________________________________________________"
         "_________\n");
  printf("   IP            At MAC Address     Count     Len  MAC Vendor / "
         "Hostname      \n");
  printf(" --------------------------------------------------------------------"
         "---------\n");
}


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

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

LLVM IR (-O0):
@.str = [80 x i8] c" _____________________________________________________________________________\0A\00"
@.str.1 = [80 x i8] c" IP At MAC Address Count Len MAC Vendor / Hostname \0A\00"
@.str.2 = [80 x i8] c" -----------------------------------------------------------------------------\0A\00"
define void @unique_print_simple_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c" _____________________________________________________________________________\00"
@str.3 = [79 x i8] c" IP At MAC Address Count Len MAC Vendor / Hostname \00"
@str.4 = [79 x i8] c" -----------------------------------------------------------------------------\00"
define void @unique_print_simple_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sqrt(double);
double btic1g_ssqrt(double f) { return ((f >= 0) ? sqrt(f) : (-sqrt(-f))); }


x86 assembly (clang, -O0):
<btic1g_ssqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <btic1g_ssqrt+0x33>
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1180 <btic1g_ssqrt+0x70>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btic1g_ssqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    113e <btic1g_ssqrt+0x2e>
push   %rax
movapd 0xedd(%rip),%xmm1
xorpd  %xmm0,%xmm1
movsd  0xee1(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     1145 <btic1g_ssqrt+0x35>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    114e <btic1g_ssqrt+0x3e>
jb     115b <btic1g_ssqrt+0x4b>
sqrtsd %xmm0,%xmm0
ret
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
xorpd  0xeaa(%rip),%xmm0
add    $0x8,%rsp
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @btic1g_ssqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @sqrt(double %6)
br label %13
8: ; preds = %1
%9 = load double, double* %2
%10 = fneg double %9
%11 = call double @sqrt(double %10)
%12 = fneg double %11
br label %13
13: ; preds = %8, %5
%14 = phi double [ %7, %5 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @btic1g_ssqrt(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call double @sqrt(double %6)
%8 = fneg double %7
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ factorial_thread(void *);
int main() {
  int x = 5;
  factorial_thread((void *)x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <factorial_thread@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @factorial_thread(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factorial_thread(i8* inttoptr (i64 5 to i8*))
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void msleep(int ms) {
  struct timespec tm;
  tm.tv_sec = ms / 1000;
  tm.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&tm, NULL);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, unsigned int);
void *MALLOC(size_t size) {
  void *addr;
  if (!(addr = malloc(size))) {
    printf("malloc %u Bytes failed.\n", (unsigned int)size);
    exit(-1);
  }
  return addr;
}


x86 assembly (clang, -O0):
<MALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116f <MALLOC+0x3f>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MALLOC>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <MALLOC+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"malloc %u Bytes failed.\0A\00"
define i8* @MALLOC(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"malloc %u Bytes failed.\0A\00"
define noalias i8* @MALLOC(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = trunc i64 %0 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadnum) {
  printf("Hello from thread no. %d!\n", *(int *)threadnum);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Hello from thread no. %d!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @pthread_exit(i32* null)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [27 x i8] c"Hello from thread no. %d!\0A\00"
define noalias i8* @PrintHello(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
unsigned int bar(unsigned int x) {
  unsigned long r;
  asm("" : "=r"(r) : "0"(x));
  return r >> 31;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
shr    $0x1f,%rax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i64 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = lshr i64 %7, 31
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %2)
%4 = lshr i64 %3, 31
%5 = trunc i64 %4 to i32
ret i32 %5
}
char *strcpy(char *dest, const char *src) {
  char *p = dest;
  while ((*p++ = *src++) != '\0')
    continue;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
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,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Type definitions */
struct B {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ B_read(void *, struct B *, int, unsigned long);
int read_raw_varint32(unsigned long *, void *, int);
int B_read_delimited_from(void *_buffer, struct B *_B, int offset) {
  unsigned long size;
  offset = read_raw_varint32(&size, _buffer, offset);
  B_read(_buffer, _B, offset, size + offset);
  return offset + size;
}


x86 assembly (clang, -O0):
<B_read_delimited_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1030 <read_raw_varint32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rax,%rcx
call   1040 <B_read@plt>
movslq -0x14(%rbp),%rax
add    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B_read_delimited_from>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1030 <read_raw_varint32@plt>
movslq %eax,%rbx
mov    0x8(%rsp),%rcx
add    %rbx,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <B_read@plt>
add    0x8(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.B = type { i32 }
define i32 @B_read_delimited_from(i8* %0, %struct.B* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.B*
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store %struct.B* %1, %struct.B** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @read_raw_varint32(i64* %7, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %4
%12 = load %struct.B*, %struct.B** %5
%13 = load i32, i32* %6
%14 = load i64, i64* %7
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add i64 %14, %16
%18 = call i32 @B_read(i8* %11, %struct.B* %12, i32 %13, i64 %17)
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = load i64, i64* %7
%22 = add i64 %20, %21
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
%struct.B = type { i32 }
define i32 @B_read_delimited_from(i8* %0, %struct.B* %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @read_raw_varint32(i64* %4, i8* %0, i32 %2)
%7 = load i64, i64* %4
%8 = sext i32 %6 to i64
%9 = add i64 %7, %8
%10 = call i32 @B_read(i8* %0, %struct.B* %1, i32 %6, i64 %9)
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = add i32 %6, %12
ret i32 %13
}
unsigned long read_cr3() {
  unsigned long cr3;
  asm volatile("mov %%cr3, %0" : "=r"(cr3));
  return cr3;
}


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

x86 assembly (clang, -O2):
<read_cr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i64 @read_cr3() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_cr3() {
%1 = tail call i64 asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void buttons_check() {
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<buttons_check>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <buttons_check+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <buttons_check+0x9>

x86 assembly (clang, -O2):
<buttons_check>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <buttons_check+0x10>

LLVM IR (-O0):
define void @buttons_check() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @buttons_check() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x2f() {
  Assert_real((islower(47) == 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_islower.c",
              240, ("islower should be 0 for /"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf0,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for /\00"
define void @t_islower_0x2f() {
%1 = call i64 @islower(i32 47)
%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 240, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for /\00"
define void @t_islower_0x2f() {
%1 = tail call i64 @islower(i32 47)
%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 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test_todo() {}


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

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

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

LLVM IR (-O2):
define void @test_todo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void align_handler(void) { printf("Misaligned access.\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Misaligned access.\00"
define void @align_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
int book_tmult_ok(int x, int y) {
  long long pll = (long long)x * y;
  return pll == (int)pll;
}


x86 assembly (clang, -O0):
<book_tmult_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq %ecx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<book_tmult_ok>:
movslq %edi,%rax
movslq %esi,%rcx
imul   %rax,%rcx
movslq %ecx,%rdx
xor    %eax,%eax
cmp    %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
define i32 @book_tmult_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
%14 = sext i32 %13 to i64
%15 = icmp eq i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @book_tmult_ok(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = add nsw i64 %5, 2147483648
%7 = icmp ult i64 %6, 4294967296
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned xrop3_96_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_96_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_96_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    $0xff,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_96_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_96_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = and i32 %6, %7
ret i32 %8
}
void hal_io_int_enable() {
  __asm__ __volatile__("sti\n");
  return;
}


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

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

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

LLVM IR (-O2):
define void @hal_io_int_enable() {
tail call void asm sideeffect "sti\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_standard_input_line();
int getchar();
int /*<<< orphan*/ printf(char *);
char get_valid_menu_selection(void) {
  int input = 0;
  do {
    printf("Please enter a number from 1 to 6 (0 to exit): ");
    input = getchar();
    clear_standard_input_line();
  } while (input >= '6' && input <= '0');
  return input;
}


x86 assembly (clang, -O0):
<get_valid_menu_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <clear_standard_input_line@plt>
xor    %eax,%eax
cmpl   $0x36,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1175 <get_valid_menu_selection+0x45>
cmpl   $0x30,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    113f <get_valid_menu_selection+0xf>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_valid_menu_selection>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <clear_standard_input_line@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Please enter a number from 1 to 6 (0 to exit): \00"
define signext i8 @get_valid_menu_selection() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getchar()
store i32 %4, i32* %1
%5 = call i32 (...) @clear_standard_input_line()
br label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp sge i32 %7, 54
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %1
%11 = icmp sle i32 %10, 48
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %2, label %14
14: ; preds = %12
%15 = load i32, i32* %1
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
@.str = [48 x i8] c"Please enter a number from 1 to 6 (0 to exit): \00"
define signext i8 @get_valid_menu_selection() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @clear_standard_input_line()
%4 = trunc i32 %2 to i8
ret i8 %4
}
/* Variables and functions */
int strverscmp(char *, char *);
int compare_string_version(char *str1, char *str2) {
  return strverscmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<compare_string_version>:
jmp    1030 <strverscmp@plt>

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

LLVM IR (-O2):
define i32 @compare_string_version(i8* %0, i8* %1) {
%3 = tail call i32 @strverscmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
void rules() {
  clear();
  printw("> Rules\n\n");
  printw("Delete numbers on the table by moving the pointer.\n");
  printw("That's all you need to know\n");
  refresh();
  getch();
}


x86 assembly (clang, -O0):
<rules>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <clear@plt>
lea    0xeae(%rip),%rdi
call   1030 <printw@plt>
lea    0xeac(%rip),%rdi
call   1030 <printw@plt>
lea    0xed4(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rules>:
push   %rax
xor    %eax,%eax
call   1060 <clear@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printw@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printw@plt>
lea    0xed7(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getch@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"> Rules\0A\0A\00"
@.str.1 = [52 x i8] c"Delete numbers on the table by moving the pointer.\0A\00"
@.str.2 = [29 x i8] c"That's all you need to know\0A\00"
define void @rules() {
%1 = call i32 (...) @clear()
%2 = call i32 @printw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printw(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"> Rules\0A\0A\00"
@.str.1 = [52 x i8] c"Delete numbers on the table by moving the pointer.\0A\00"
@.str.2 = [29 x i8] c"That's all you need to know\0A\00"
define void @rules() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printw(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @getch()
ret void
}
XRefreshKeyboardMapping() {}


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

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

LLVM IR (-O0):
define i32 @XRefreshKeyboardMapping() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XRefreshKeyboardMapping() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printStrFunc(void *p) { printf("%s", (char *)p); }


x86 assembly (clang, -O0):
<printStrFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStrFunc>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @printStrFunc(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)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printStrFunc(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v12_8_sse4() {
ret void
}
int util_chdir(const char *path) {}


x86 assembly (clang, -O0):
<util_chdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @util_chdir(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
char *getenv(char *);
char *defaultDrive(void) {
  char *s;
  return ((s = getenv("SystemDrive")) && *s) ? s : "C:";
}


x86 assembly (clang, -O0):
<defaultDrive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     114f <defaultDrive+0x3f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <defaultDrive+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115f <defaultDrive+0x4f>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115f <defaultDrive+0x4f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaultDrive>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1135 <defaultDrive+0x25>
mov    %rax,%rcx
cmpb   $0x0,(%rax)
lea    0xedd(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret
lea    0xed0(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"SystemDrive\00"
@.str.1 = [3 x i8] c"C:\00"
define i8* @defaultDrive() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = icmp ne i8* %2, null
br i1 %3, label %4, label %11
4: ; preds = %0
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = load i8*, i8** %1
br label %12
11: ; preds = %4, %0
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %11 ]
ret i8* %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"SystemDrive\00"
@.str.1 = [3 x i8] c"C:\00"
define i8* @defaultDrive() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printBar(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numPts;
  int value;
  int j;
  scanf("%d", &numPts);
  for (j = 1; j <= numPts; j++) {
    scanf("%d", &value);
    printBar(value);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1178 <main+0x58>
lea    0xea7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1030 <printBar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    116d <main+0x4d>
xor    %ebp,%ebp
lea    0xeb7(%rip),%r14
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <printBar@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %13, %8 ], [ 1, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = call i32 @printBar(i32 %11)
%13 = add nuw nsw i32 %9, 1
%14 = load i32, i32* %1
%15 = icmp slt i32 %9, %14
br i1 %15, label %8, label %16
16: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ numReales();
int main() {
  numReales();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <numReales@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @numReales()
ret i32 0
}
double MTU2_ch3_unit_in_sec(void) { return (256.0 / 20e6); }


x86 assembly (clang, -O0):
<MTU2_ch3_unit_in_sec>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MTU2_ch3_unit_in_sec>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MTU2_ch3_unit_in_sec() {
ret double 1.280000e-05
}

LLVM IR (-O2):
define double @MTU2_ch3_unit_in_sec() {
ret double 1.280000e-05
}
/* Variables and functions */
unsigned long RGB2HSN96(unsigned long);
unsigned long rgb2hsn(unsigned long rgb) { return RGB2HSN96(rgb); }


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

x86 assembly (clang, -O2):
<rgb2hsn>:
jmp    1030 <RGB2HSN96@plt>

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

LLVM IR (-O2):
define i64 @rgb2hsn(i64 %0) {
%2 = tail call i64 @RGB2HSN96(i64 %0)
ret i64 %2
}
/* Variables and functions */
void *halloc(int /*<<< orphan*/, size_t);
void *h_malloc(size_t len) { return halloc(0, len); }


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

x86 assembly (clang, -O2):
<h_malloc>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <halloc@plt>

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

LLVM IR (-O2):
define i8* @h_malloc(i64 %0) {
%2 = tail call i8* @halloc(i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int INT_MAX;
int test_tmax(void) { return INT_MAX; }


x86 assembly (clang, -O0):
<test_tmax>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tmax>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @test_tmax() {
%1 = load i32, i32* @INT_MAX
ret i32 %1
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @test_tmax() {
%1 = load i32, i32* @INT_MAX
ret i32 %1
}
int bionet_get_network_error(void) {}


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

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

LLVM IR (-O0):
define i32 @bionet_get_network_error() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bionet_get_network_error() {
ret i32 undef
}
void ff_hevc_put_hevc_uni_w_qpel_h16_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h16_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printstr(const char *s) {
  if (s)
    printf("\"%s\"", s);
  else
    printf("NULL");
}


x86 assembly (clang, -O0):
<printstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <printstr+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <printstr+0x3c>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printstr>:
test   %rdi,%rdi
je     1126 <printstr+0x16>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
@.str.1 = [5 x i8] c"NULL\00"
define void @printstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};
struct katcp_acquire {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ propagate_acquire_katcp(struct katcp_dispatch *,
                                           struct katcp_acquire *);
int set_value_intbool_katcp(struct katcp_acquire *, int);
int set_integer_acquire_katcp(struct katcp_dispatch *d, struct katcp_acquire *a,
                              int value) {
  int result;
  result = set_value_intbool_katcp(a, value);
  propagate_acquire_katcp(d, a);
  return result;
}


x86 assembly (clang, -O0):
<set_integer_acquire_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <set_value_intbool_katcp@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <propagate_acquire_katcp@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_integer_acquire_katcp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <set_value_intbool_katcp@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <propagate_acquire_katcp@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
%struct.katcp_acquire = type { i32 }
define i32 @set_integer_acquire_katcp(%struct.katcp_dispatch* %0, %struct.katcp_acquire* %1, i32 %2) {
%4 = alloca %struct.katcp_dispatch*
%5 = alloca %struct.katcp_acquire*
%6 = alloca i32
%7 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %4
store %struct.katcp_acquire* %1, %struct.katcp_acquire** %5
store i32 %2, i32* %6
%8 = load %struct.katcp_acquire*, %struct.katcp_acquire** %5
%9 = load i32, i32* %6
%10 = call i32 @set_value_intbool_katcp(%struct.katcp_acquire* %8, i32 %9)
store i32 %10, i32* %7
%11 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %4
%12 = load %struct.katcp_acquire*, %struct.katcp_acquire** %5
%13 = call i32 @propagate_acquire_katcp(%struct.katcp_dispatch* %11, %struct.katcp_acquire* %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
%struct.katcp_acquire = type { i32 }
define i32 @set_integer_acquire_katcp(%struct.katcp_dispatch* %0, %struct.katcp_acquire* %1, i32 %2) {
%4 = tail call i32 @set_value_intbool_katcp(%struct.katcp_acquire* %1, i32 %2)
%5 = tail call i32 @propagate_acquire_katcp(%struct.katcp_dispatch* %0, %struct.katcp_acquire* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
main() {
  char s1[10] = "testtest";
  char s2[10] = "se";
  printf("%s\n", s1);
  squeeze(s1, s2);
  printf("%s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <squeeze@plt>
lea    -0xe(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movabs $0x7473657474736574,%rax
65 73 74
mov    %rax,0x18(%rsp)
movw   $0x0,0x20(%rsp)
movw   $0x0,0x10(%rsp)
movq   $0x6573,0x8(%rsp)
lea    0xec0(%rip),%r14
lea    0x18(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <squeeze@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"testtest\00\00"
@__const.main.s2 = [10 x i8] c"se\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = bitcast [10 x i8]* %3 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @squeeze(i8* %8, i8* %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"testtest\00\00"
@__const.main.s2 = [10 x i8] c"se\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @squeeze(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void pthread_attr_setschedparam() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_setschedparam() {
ret void
}
extern void printRegexFlags(void) {}


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

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

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

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