xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char extractBitRange(char byte, int startingPos, int offset) {
  assert(((startingPos + offset) >= 0) && ((startingPos + offset) < 8));
  return (byte >> startingPos) & ~(0xff << (offset + 1));
}


x86 assembly (clang, -O0):
<extractBitRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jl     1147 <extractBitRange+0x37>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x8,%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    $0xff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractBitRange>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
lea    (%rbx,%r14,1),%eax
xor    %edi,%edi
cmp    $0x8,%eax
setb   %dil
call   1030 <assert@plt>
mov    %r14d,%ecx
sar    %cl,%ebp
add    $0x1,%bl
mov    $0xff,%eax
mov    %ebx,%ecx
shl    %cl,%eax
not    %eax
and    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @extractBitRange(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = add nsw i32 %7, %8
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = icmp slt i32 %14, 8
br label %16
16: ; preds = %11, %3
%17 = phi i1 [ false, %3 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = load i32, i32* %5
%23 = ashr i32 %21, %22
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = shl i32 255, %25
%27 = xor i32 %26, -1
%28 = and i32 %23, %27
%29 = trunc i32 %28 to i8
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @extractBitRange(i8 signext %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = icmp ult i32 %4, 8
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = sext i8 %0 to i32
%9 = ashr i32 %8, %1
%10 = add nsw i32 %2, 1
%11 = shl i32 255, %10
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = trunc i32 %13 to i8
ret i8 %14
}
/* Variables and functions */
int UnRandomUniform();
unsigned int unRand24(void) {
  return (unsigned int)(UnRandomUniform() * 4096 * 4096);
}


x86 assembly (clang, -O0):
<unRand24>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <UnRandomUniform@plt>
shl    $0xc,%eax
shl    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unRand24>:
push   %rax
xor    %eax,%eax
call   1030 <UnRandomUniform@plt>
shl    $0x18,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unRand24() {
%1 = call i32 (...) @UnRandomUniform()
%2 = mul nsw i32 %1, 4096
%3 = mul nsw i32 %2, 4096
ret i32 %3
}

LLVM IR (-O2):
define i32 @unRand24() {
%1 = tail call i32 (...) @UnRandomUniform()
%2 = shl nsw i32 %1, 24
ret i32 %2
}
void mr97311_setcontrast(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @mr97311_setcontrast(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char input[16];
  int a;
  printf("Type an integer: ");
  fgets(input, 16, stdin);
  a = atoi(input);
  printf("Double %d is %d\n", a, a + a);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   1040 <fgets@plt>
lea    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x24(%rbp),%edx
add    -0x24(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
lea    (%rax,%rax,1),%edx
lea    0xea4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Type an integer: \00"
@stdin = global i32 0
@.str.1 = [17 x i8] c"Double %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 16, i32 %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Type an integer: \00"
@stdin = global i32 0
@.str.1 = [17 x i8] c"Double %d is %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 16, i32 %4)
%6 = call i32 @atoi(i8* %2)
%7 = shl nsw i32 %6, 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
void enic_busy_poll_init_lock(struct vnic_rq *rq) {}


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

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

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

LLVM IR (-O2):
%struct.vnic_rq = type opaque
define void @enic_busy_poll_init_lock(%struct.vnic_rq* nocapture %0) {
ret void
}
void do_nothing() { return; }


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

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

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

LLVM IR (-O2):
define void @do_nothing() {
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *ns;
  ns = malloc(strlen(s) + 1);
  if (ns)
    strcpy(ns, s);
  return ns;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
char *config_to_path(char *);
char *stringf(char *, char const *, char const *);
char *build_path(const char *name) {
  const char *directory = config_to_path("cache-dir");
  return stringf("%s/%s", directory, name);
}


x86 assembly (clang, -O0):
<build_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <config_to_path@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1040 <stringf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_path>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <config_to_path@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <stringf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"cache-dir\00"
@.str.1 = [6 x i8] c"%s/%s\00"
define i8* @build_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @config_to_path(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i8* @stringf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"cache-dir\00"
@.str.1 = [6 x i8] c"%s/%s\00"
define i8* @build_path(i8* %0) {
%2 = tail call i8* @config_to_path(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @stringf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %0)
ret i8* %3
}
void post_sem(void) {}


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

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

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

LLVM IR (-O2):
define void @post_sem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a[3] = {'A', 'B', 'C'};
  char(*p)[3] = &a;
  printf("%c", *(*p));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xec4(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i8] c"ABC"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]*
%3 = bitcast [3 x i8]* %1 to i8*
store [3 x i8]* %1, [3 x i8]** %2
%4 = load [3 x i8]*, [3 x i8]** %2
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%6 = load i8, i8* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 65)
ret i32 0
}
int fun627() { return 627; }


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

x86 assembly (clang, -O2):
<fun627>:
mov    $0x273,%eax
ret

LLVM IR (-O0):
define i32 @fun627() {
ret i32 627
}

LLVM IR (-O2):
define i32 @fun627() {
ret i32 627
}
double fmod(double x, double y) { return 4; }


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void map_to_str(char *s, int *map) {
  int i;
  for (i = 0; i < 15 * 13; i++) {
    sprintf(s, "%d ", map[i]);
    s += 2;
  }
}


x86 assembly (clang, -O0):
<map_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xc3,-0x14(%rbp)
jge    1169 <map_to_str+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb6(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <map_to_str+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_to_str>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebx,%ebx
lea    0xed9(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%rdi
mov    (%r14,%rbx,2),%edx
mov    %r15,%rsi
call   1030 <sprintf@plt>
add    $0x2,%rbx
cmp    $0x186,%rbx
jne    1130 <map_to_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @map_to_str(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 195
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8* %18, i8** %3
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @map_to_str(i8* nocapture writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = phi i8* [ %0, %2 ], [ %9, %3 ]
%6 = getelementptr inbounds i32, i32* %1, i64 %4
%7 = load i32, i32* %6
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i8, i8* %5, i64 2
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 195
br i1 %11, label %12, label %3
12: ; preds = %3
ret void
}
void _lpcInit(void) {}


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

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

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

LLVM IR (-O2):
define void @_lpcInit() {
ret void
}
void sysfs_remove_dir(struct kobject *k) { ; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define void @sysfs_remove_dir(%struct.kobject* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ bad_eof();
int getchar_update_lineno();
int getchar_no_eof(void) {
  int c;
  c = getchar_update_lineno();
  if (c == EOF)
    bad_eof();
  return c;
}


x86 assembly (clang, -O0):
<getchar_no_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar_update_lineno@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
jne    114b <getchar_no_eof+0x2b>
mov    $0x0,%al
call   1030 <bad_eof@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar_no_eof>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar_update_lineno@plt>
mov    %eax,%ebx
mov    0x2eb7(%rip),%rax
cmp    (%rax),%ebx
jne    113c <getchar_no_eof+0x1c>
xor    %eax,%eax
call   1030 <bad_eof@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getchar_no_eof() {
%1 = alloca i32
%2 = call i32 (...) @getchar_update_lineno()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @bad_eof()
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getchar_no_eof() {
%1 = tail call i32 (...) @getchar_update_lineno()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @bad_eof()
br label %6
6: ; preds = %4, %0
ret i32 %1
}
long kernel__Float__object_id(double self) {
  long var;
  long var1;
  var1 = (double)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Float__object_id>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Float__object_id>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @kernel__Float__object_id(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @kernel__Float__object_id(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
void ScalePlaneVertical_16() {}


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

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

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

LLVM IR (-O2):
define void @ScalePlaneVertical_16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: hyt-read [ -b I2C bus name | -d device file ] [ -a I2C slave "
         "address ]\n"
         "                [ -i seconds ] [ -T ] [ -H ]\n"
         "Options:\n"
         "\t-b X\tOpen the I2C bus named X (e.g. bcm2708_i2c.1)\n"
         "\t-d X\tOpen the I2C device named X (e.g. /dev/i2c-0)\n"
         "\t-a X\tTarget I2C slave address X (default 0x28)\n"
         "\t-i X\tRead data every X seconds\n"
         "\t-T\tPrint only temperature\n"
         "\t-H\tPrint only humidity\n"
         "\t-h\tShow this message\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [391 x i8] c"Usage: hyt-read [ -b I2C bus name | -d device file ] [ -a I2C slave address ]\0A [ -i seconds ] [ -T ] [ -H ]\0AOptions:\0A\09-b X\09Open the I2C bus named X (e.g. bcm2708_i2c.1)\0A\09-d X\09Open the I2C device named X (e.g. /dev/i2c-0)\0A\09-a X\09Target I2C slave address X (default 0x28)\0A\09-i X\09Read data every X seconds\0A\09-T\09Print only temperature\0A\09-H\09Print only humidity\0A\09-h\09Show this message\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [390 x i8] c"Usage: hyt-read [ -b I2C bus name | -d device file ] [ -a I2C slave address ]\0A [ -i seconds ] [ -T ] [ -H ]\0AOptions:\0A\09-b X\09Open the I2C bus named X (e.g. bcm2708_i2c.1)\0A\09-d X\09Open the I2C device named X (e.g. /dev/i2c-0)\0A\09-a X\09Target I2C slave address X (default 0x28)\0A\09-i X\09Read data every X seconds\0A\09-T\09Print only temperature\0A\09-H\09Print only humidity\0A\09-h\09Show this message\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([390 x i8], [390 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int inpselect_dev(int tm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inpselect_dev(i32 %0) {
ret i32 0
}
int subtract(int x, int y) { return x - y; }


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

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

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct md5_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ md5_write(struct md5_s *, void const *, size_t);
void DVDAddMD5(struct md5_s *h, const void *data, size_t len) {
  md5_write(h, data, len);
}


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

x86 assembly (clang, -O2):
<DVDAddMD5>:
jmp    1030 <md5_write@plt>

LLVM IR (-O0):
%struct.md5_s = type { i32 }
define void @DVDAddMD5(%struct.md5_s* %0, i8* %1, i64 %2) {
%4 = alloca %struct.md5_s*
%5 = alloca i8*
%6 = alloca i64
store %struct.md5_s* %0, %struct.md5_s** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.md5_s*, %struct.md5_s** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @md5_write(%struct.md5_s* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
%struct.md5_s = type { i32 }
define void @DVDAddMD5(%struct.md5_s* %0, i8* %1, i64 %2) {
%4 = tail call i32 @md5_write(%struct.md5_s* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_35() {
  Assert_real((isqrt(35) == 5),
              "/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/stdlib/isqrt.c",
              180, ("Integer square root of 35 should be 5"));
}


x86 assembly (clang, -O0):
<t_sqrt_35>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1030 <isqrt@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xb4,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_35>:
push   %rax
mov    $0x23,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xb4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 35 should be 5\00"
define void @t_sqrt_35() {
%1 = call i32 @isqrt(i32 35)
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 35 should be 5\00"
define void @t_sqrt_35() {
%1 = tail call i32 @isqrt(i32 35)
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int func2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func2() {
ret i32 0
}
long *check_ptr_ATTRlong(long *v) { return v; }


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

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

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

LLVM IR (-O2):
define i64* @check_ptr_ATTRlong(i64* readnone returned %0) {
ret i64* %0
}
void sonix_setquality(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @sonix_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
int is_whitespace(char blah) { return (blah == ' ' || blah == '\t'); }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_whitespace+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void sandbox_post(void) {}


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

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

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

LLVM IR (-O2):
define void @sandbox_post() {
ret void
}
int pai(int N) { return ((N - 1) / 2); }


x86 assembly (clang, -O0):
<pai>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pai>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @pai(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @pai(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ parse(int, char **);
int main(int argc, char **argv) {
  parse(argc, argv);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse(i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ strtoull(char const *, int /*<<< orphan*/ *, int);
int main(int argc, const char *argv[]) {
  const char *hex = argv[1];
  uint64_t *addr = (uint64_t *)strtoull(hex, NULL, 16);
  uint64_t x = *addr;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtoull@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtoull@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = call i64 @strtoull(i8* %12, i32* null, i32 16)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %7
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
store i32 %16, i32* %8
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtoull(i8* nocapture %4, i32* null, i32 16)
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ print_byte(unsigned char);
print_hword(unsigned short s) {
  print_byte((unsigned char)(s >> 8));
  print_byte((unsigned char)(s & 0xff));
}


x86 assembly (clang, -O0):
<print_hword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%edi
call   1030 <print_byte@plt>
movzwl -0x6(%rbp),%eax
and    $0xff,%eax
movzbl %al,%edi
call   1030 <print_byte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hword>:
push   %rbx
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <print_byte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <print_byte@plt>

LLVM IR (-O0):
define i32 @print_hword(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = ashr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = call i32 @print_byte(i8 zeroext %7)
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = call i32 @print_byte(i8 zeroext %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @print_hword(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = trunc i16 %2 to i8
%4 = tail call i32 @print_byte(i8 zeroext %3)
%5 = trunc i16 %0 to i8
%6 = tail call i32 @print_byte(i8 zeroext %5)
ret i32 undef
}
void websils_pkix_abi_0() {}


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

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

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

LLVM IR (-O2):
define void @websils_pkix_abi_0() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool str_equal(const char *first, const char *second) {
  if (first == NULL) {
    return (second == NULL);
  }
  if (second == NULL) {
    return false;
  }
  return (strcmp(first, second) == 0);
}


x86 assembly (clang, -O0):
<str_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <str_equal+0x30>
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <str_equal+0x63>
cmpq   $0x0,-0x18(%rbp)
jne    1157 <str_equal+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1173 <str_equal+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_equal>:
mov    %rdi,%rax
or     %rsi,%rax
sete   %al
test   %rdi,%rdi
je     1133 <str_equal+0x23>
test   %rsi,%rsi
je     1133 <str_equal+0x23>
push   %rax
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
add    $0x8,%rsp
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @str_equal(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
%6 = and i1 %3, %4
br i1 %5, label %10, label %7
7: ; preds = %2
%8 = tail call i64 @strcmp(i8* %0, i8* %1)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %2, %7
%11 = phi i1 [ %9, %7 ], [ %6, %2 ]
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ printIntArray(int *, int);
int main(int argc, char **argv) {
  int array[] = {23, 54, 6, 12, 76, 3, 5, 8};
  bubble_sort(array, 8);
  printIntArray(array, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <bubble_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <printIntArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <bubble_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printIntArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 23, i32 54, i32 6, i32 12, i32 76, i32 3, i32 5, i32 8]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i32]* %6 to i8*
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%9 = call i32 @bubble_sort(i32* %8, i32 8)
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%11 = call i32 @printIntArray(i32* %10, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 23, i32 54, i32 6, i32 12, i32 76, i32 3, i32 5, i32 8]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @bubble_sort(i32* %5, i32 8)
%7 = call i32 @printIntArray(i32* %5, i32 8)
ret i32 0
}
void primPointerCheck(void) {}


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

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

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

LLVM IR (-O2):
define void @primPointerCheck() {
ret void
}
void swap(char *m, char *n) {
  char temp = *m;
  *m = *n;
  *n = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(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
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __svgalib_memcpy4to3(void *dest, void *src, int n) {
  printf("libgl: __svgalib_memcpy4to3 not done yet\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"libgl: __svgalib_memcpy4to3 not done yet\0A\00"
define void @__svgalib_memcpy4to3(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"libgl: __svgalib_memcpy4to3 not done yet\00"
define void @__svgalib_memcpy4to3(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void LZ77UnCompWram(void *source, void *dest) { SystemCall(17); }


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

x86 assembly (clang, -O2):
<LZ77UnCompWram>:
mov    $0x11,%edi
jmp    1030 <SystemCall@plt>

LLVM IR (-O0):
define void @LZ77UnCompWram(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @SystemCall(i32 17)
ret void
}

LLVM IR (-O2):
define void @LZ77UnCompWram(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @SystemCall(i32 17)
ret void
}
emit2(arg) int arg;
{
  emit1(arg);
  emit1((arg >> 8));
}


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

x86 assembly (clang, -O2):
<emit2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <emit1@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <emit1@plt>

LLVM IR (-O0):
define i32 @emit2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %3
%7 = ashr i32 %6, 8
%8 = call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @emit2(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %0)
%3 = ashr i32 %0, 8
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
unsigned ixp2000_has_broken_slowport(void) {
  unsigned long id =
      *(volatile unsigned long *)((0xfef04000 + 0x0a00) | (0x00));
  unsigned long id_prod = id & (0x001F0000 | 0x0000FF00);
  return (
      ((id_prod == (0x00000000 | 0x00000200)) && ((id & 0x000000F0) == 0)) ||
      ((id_prod == (0x00000000 | 0x00000000)) && ((id & 0x000000F0) == 0)) ||
      ((id_prod == (0x00000000 | 0x00000100)) && ((id & 0x000000F0) == 0)));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0xfef04a00,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1fff00,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x200,-0x10(%rbp)
jne    1146 <ixp2000_has_broken_slowport+0x46>
mov    -0x8(%rbp),%rcx
and    $0xf0,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1198 <ixp2000_has_broken_slowport+0x98>
cmpq   $0x0,-0x10(%rbp)
jne    116b <ixp2000_has_broken_slowport+0x6b>
mov    -0x8(%rbp),%rcx
and    $0xf0,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1198 <ixp2000_has_broken_slowport+0x98>
xor    %eax,%eax
cmpq   $0x100,-0x10(%rbp)
mov    %al,-0x12(%rbp)
jne    1192 <ixp2000_has_broken_slowport+0x92>
mov    -0x8(%rbp),%rax
and    $0xf0,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xfef04a00,%eax
mov    (%rax),%rax
mov    %eax,%ecx
and    $0x1ffff0,%ecx
test   $0x1ffdf0,%eax
sete   %al
cmp    $0x100,%ecx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ixp2000_has_broken_slowport() {
%1 = alloca i64
%2 = alloca i64
%3 = load volatile i64, i64* inttoptr (i64 4277160448 to i64*)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = and i64 %4, 2096896
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 512
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i64, i64* %1
%10 = and i64 %9, 240
%11 = icmp eq i64 %10, 0
br i1 %11, label %28, label %12
12: ; preds = %8, %0
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i64, i64* %1
%17 = and i64 %16, 240
%18 = icmp eq i64 %17, 0
br i1 %18, label %28, label %19
19: ; preds = %15, %12
%20 = load i64, i64* %2
%21 = icmp eq i64 %20, 256
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i64, i64* %1
%24 = and i64 %23, 240
%25 = icmp eq i64 %24, 0
br label %26
26: ; preds = %22, %19
%27 = phi i1 [ false, %19 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %15, %8
%29 = phi i1 [ true, %15 ], [ true, %8 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @ixp2000_has_broken_slowport() {
%1 = load volatile i64, i64* inttoptr (i64 4277160448 to i64*)
%2 = and i64 %1, 2097136
%3 = and i64 %1, 2096624
%4 = icmp eq i64 %3, 0
%5 = icmp eq i64 %2, 256
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ animation();
int /*<<< orphan*/ display();
void idle(void) {
  animation();
  display();
}


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

x86 assembly (clang, -O2):
<idle>:
push   %rax
xor    %eax,%eax
call   1040 <animation@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <display@plt>

LLVM IR (-O0):
define void @idle() {
%1 = call i32 (...) @animation()
%2 = call i32 (...) @display()
ret void
}

LLVM IR (-O2):
define void @idle() {
%1 = tail call i32 (...) @animation()
%2 = tail call i32 (...) @display()
ret void
}
/* Variables and functions */
int EOF;
int fileGetc();
int skipToCharacter(const int c) {
  int d;
  do {
    d = fileGetc();
  } while (d != EOF && d != c);
  return d;
}


x86 assembly (clang, -O0):
<skipToCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fileGetc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
mov    0x2eb7(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x9(%rbp)
je     1148 <skipToCharacter+0x38>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    111b <skipToCharacter+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipToCharacter>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecb(%rip),%r14
nopl   (%rax)
xor    %eax,%eax
call   1030 <fileGetc@plt>
cmp    %ebx,%eax
je     1130 <skipToCharacter+0x20>
cmp    (%r14),%eax
jne    1120 <skipToCharacter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skipToCharacter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = call i32 (...) @fileGetc()
store i32 %5, i32* %3
br label %6
6: ; preds = %4
%7 = load i32, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp ne i32 %11, %12
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br i1 %15, label %4, label %16
16: ; preds = %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skipToCharacter(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @fileGetc()
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, %0
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %3
}