xunge/DecIR huggingface dataset:
void all_leds_on(void) {
  (*(volatile unsigned int *)(0x7F008824)) &= ~0xF;
  return;
}


x86 assembly (clang, -O0):
<all_leds_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_leds_on>:
andl   $0xfffffff0,0x7f008824
f0
ret

LLVM IR (-O0):
define void @all_leds_on() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, -16
store volatile i32 %2, i32* inttoptr (i64 2130741284 to i32*)
ret void
}

LLVM IR (-O2):
define void @all_leds_on() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, -16
store volatile i32 %2, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t rust_dbg_extern_identity_u64(uint64_t u) { return u; }


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

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

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

LLVM IR (-O2):
define i32 @rust_dbg_extern_identity_u64(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ writemem65816(int /*<<< orphan*/, int /*<<< orphan*/);
void stzAbs8(void) { writemem65816(absolute(), 0); }


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

x86 assembly (clang, -O2):
<stzAbs8>:
push   %rax
xor    %eax,%eax
call   1030 <absolute@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <writemem65816@plt>

LLVM IR (-O0):
define void @stzAbs8() {
%1 = call i32 (...) @absolute()
%2 = call i32 @writemem65816(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stzAbs8() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @writemem65816(i32 %1, i32 0)
ret void
}
void qnap_dt_ts219_init(void) {}


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

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

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

LLVM IR (-O2):
define void @qnap_dt_ts219_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int PrintVec(double *b, int size) {
  int i;
  for (i = 0; i < size; ++i) {
    printf("%f\n", b[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<PrintVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <PrintVec+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintVec+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintVec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <PrintVec+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <PrintVec+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @PrintVec(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *argv0) {
  fprintf(stderr, "usage: %s [--port=PORT] [--bind=IP] <filename>\n", argv0);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [--port=PORT] [--bind=IP] <filename>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
char *mote64_Name(void) { return "MOTE64"; }


x86 assembly (clang, -O0):
<mote64_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mote64_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"MOTE64\00"
define i8* @mote64_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"MOTE64\00"
define i8* @mote64_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ do_exit(int /*<<< orphan*/);
void die(int notused) { do_exit(0); }


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

x86 assembly (clang, -O2):
<die>:
xor    %edi,%edi
jmp    1030 <do_exit@plt>

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

LLVM IR (-O2):
define void @die(i32 %0) {
%2 = tail call i32 @do_exit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ equalizer_prev();
int /*<<< orphan*/ update_eq_name();
void req_equalizer_prev() {
  equalizer_prev();
  update_eq_name();
}


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

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

LLVM IR (-O0):
define void @req_equalizer_prev() {
%1 = call i32 (...) @equalizer_prev()
%2 = call i32 (...) @update_eq_name()
ret void
}

LLVM IR (-O2):
define void @req_equalizer_prev() {
%1 = tail call i32 (...) @equalizer_prev()
%2 = tail call i32 (...) @update_eq_name()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct unaligned_u64__ {
  int dummy;
};

/* Variables and functions */
struct unaligned_u64__ *unaligned_u64__(const uint64_t *p) {
  return (struct unaligned_u64__ *)p;
}


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

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

LLVM IR (-O0):
%struct.unaligned_u64__ = type { i32 }
define %struct.unaligned_u64__* @unaligned_u64__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to %struct.unaligned_u64__*
ret %struct.unaligned_u64__* %4
}

LLVM IR (-O2):
%struct.unaligned_u64__ = type { i32 }
define %struct.unaligned_u64__* @unaligned_u64__(i32* readnone %0) {
%2 = bitcast i32* %0 to %struct.unaligned_u64__*
ret %struct.unaligned_u64__* %2
}
/* Variables and functions */
int random();
char generate_printable_char(unsigned char malformed) {
  char rnd = 0;
  if (malformed) {
    rnd = random();
  } else {
    rnd = (random() % 94) + ' ';
  }
  return rnd;
}


x86 assembly (clang, -O0):
<generate_printable_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113b <generate_printable_char+0x2b>
mov    $0x0,%al
call   1030 <random@plt>
mov    %al,-0x2(%rbp)
jmp    1152 <generate_printable_char+0x42>
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x5e,%ecx
cltd
idiv   %ecx
add    $0x20,%edx
mov    %dl,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_printable_char>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
test   %ebx,%ebx
je     1120 <generate_printable_char+0x10>
pop    %rbx
ret
movslq %eax,%rcx
imul   $0xffffffffae4c415d,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x6,%ecx
add    %edx,%ecx
imul   $0x5e,%ecx,%ecx
sub    %ecx,%eax
add    $0x20,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @generate_printable_char(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @random()
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
br label %14
9: ; preds = %1
%10 = call i32 (...) @random()
%11 = srem i32 %10, 94
%12 = add nsw i32 %11, 32
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
br label %14
14: ; preds = %9, %6
%15 = load i8, i8* %3
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @generate_printable_char(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = tail call i32 (...) @random()
br i1 %2, label %6, label %4
4: ; preds = %1
%5 = trunc i32 %3 to i8
br label %10
6: ; preds = %1
%7 = srem i32 %3, 94
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 32
br label %10
10: ; preds = %6, %4
%11 = phi i8 [ %5, %4 ], [ %9, %6 ]
ret i8 %11
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
int test_line_length(char *line) {
  return (strlen(line) > 1 && strstr(line, "\n") == NULL) ? 1 : 0;
}


x86 assembly (clang, -O0):
<test_line_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jle    115f <test_line_length+0x3f>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_line_length>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jl     114a <test_line_length+0x2a>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @test_line_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32* @strstr(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_line_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printAns(int);
void doPeri(int a, int b, int c) { printAns(a + b + c); }


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

x86 assembly (clang, -O2):
<doPeri>:
add    %esi,%edi
add    %edx,%edi
jmp    1030 <printAns@plt>

LLVM IR (-O0):
define void @doPeri(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = call i32 @printAns(i32 %11)
ret void
}

LLVM IR (-O2):
define void @doPeri(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = tail call i32 @printAns(i32 %5)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct sysinfo {
  int /*<<< orphan*/ uptime;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
void util_getuptime(struct timeval *tv) {
  struct sysinfo si;
  sysinfo(&si);
  tv->tv_sec = si.uptime;
  tv->tv_usec = 0;
}


x86 assembly (clang, -O0):
<util_getuptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_getuptime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <sysinfo@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x8(%rbx)
movq   $0x0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
%struct.sysinfo = type { i32 }
define void @util_getuptime(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.sysinfo
store %struct.timeval* %0, %struct.timeval** %2
%4 = call i32 @sysinfo(%struct.sysinfo* %3)
%5 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %3, i32 0, i32 0
%6 = load i32, i32* %5
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = load %struct.timeval*, %struct.timeval** %2
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i64 0, i64* %10
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
%struct.sysinfo = type { i32 }
define void @util_getuptime(%struct.timeval* nocapture writeonly %0) {
%2 = alloca %struct.sysinfo
%3 = bitcast %struct.sysinfo* %2 to i8*
%4 = call i32 @sysinfo(%struct.sysinfo* %2)
%5 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i64 0, i64* %8
ret void
}
decimal_error(s1, s2) char *s1, *s2;
{ error(s1, s2); }


x86 assembly (clang, -O0):
<decimal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @decimal_error(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 = load i8*, i8** %5
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* %6, i8* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @decimal_error(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
ret i32 undef
}
int test_imm_EAint32_reg(int val) { return ((val) & (0xEA << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_EAint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xea,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EAint32_reg>:
test   $0xea,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EAint32_reg(i32 %0) {
%2 = and i32 %0, 234
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *s) {
  char *tmp = (char *)s;
  while (*tmp != '\0')
    tmp++;
  return (size_t)(tmp - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
char const *strstr(char const *, char *);
int is_mu_temp(const char *fname) {
  return ((fname) && (fname == strstr(fname, "/tmp/multicoresql-")));
}


x86 assembly (clang, -O0):
<is_mu_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1154 <is_mu_temp+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mu_temp>:
test   %rdi,%rdi
je     1135 <is_mu_temp+0x25>
push   %rax
lea    0xee3(%rip),%rsi
mov    $0x12,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"/tmp/multicoresql-\00"
define i32 @is_mu_temp(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 %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @strstr(i8* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %6, %8
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [19 x i8] c"/tmp/multicoresql-\00"
define i32 @is_mu_temp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(19) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 18)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;

/* Variables and functions */
extern int isShaped(Window w) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isShaped(i32 %0) {
ret i32 0
}
void label_free(const char *label) {}


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

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

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

LLVM IR (-O2):
define void @label_free(i8* nocapture %0) {
ret void
}
int ls_cost_nm7_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm7_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm7_n_in() {
ret i32 2
}
void gdk_x11_get_default_root_xwindow() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_get_default_root_xwindow() {
ret void
}
int is_ind_vowel(unsigned int i) { return (i >= 0x905 && i <= 0x914); }


x86 assembly (clang, -O0):
<is_ind_vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x905,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1126 <is_ind_vowel+0x26>
cmpl   $0x914,-0x4(%rbp)
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ind_vowel>:
add    $0xfffff6fb,%edi
xor    %eax,%eax
cmp    $0x10,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_ind_vowel(i32 %0) {
%2 = add i32 %0, -2309
%3 = icmp ult i32 %2, 16
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CLOEXEC;
int epoll_create1(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int ev_create() {
  int evfd;
  evfd = epoll_create1(EPOLL_CLOEXEC);
  if (evfd == -1) {
    perror("epoll_create1");
    return -1;
  }
  return evfd;
}


x86 assembly (clang, -O0):
<ev_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <epoll_create1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    115b <ev_create+0x3b>
lea    0xeb6(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <ev_create+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_create>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <epoll_create1@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     113a <ev_create+0x1a>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebf(%rip),%rdi
call   1030 <perror@plt>
jmp    1136 <ev_create+0x16>

LLVM IR (-O0):
@EPOLL_CLOEXEC = global i32 0
@.str = [14 x i8] c"epoll_create1\00"
define i32 @ev_create() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @EPOLL_CLOEXEC
%4 = call i32 @epoll_create1(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@EPOLL_CLOEXEC = global i32 0
@.str = [14 x i8] c"epoll_create1\00"
define i32 @ev_create() {
%1 = load i32, i32* @EPOLL_CLOEXEC
%2 = tail call i32 @epoll_create1(i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap_with_pointers(int *, int *);
int main(void) {
  int n1 = 3;
  int n2 = 7;
  printf("number1:%d , number2:%d\n", n1, n2);
  swap_with_pointers(&n1, &n2);
  printf("number1:%d , number2:%d\n", n1, n2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap_with_pointers@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x3,0xc(%rsp)
movl   $0x7,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap_with_pointers@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"number1:%d , number2:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 7, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap_with_pointers(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"number1:%d , number2:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 7, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3, i32 7)
%6 = call i32 @swap_with_pointers(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRE2_get(void) { return U_WMRCORENONE_get("U_WMRE2"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE2\00"
define i32 @U_WMRE2_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE2\00"
define i32 @U_WMRE2_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52e_get_substreamid(const uint8_t *p_a52) {
  return (p_a52[2] & 0x38) >> 3;
}


x86 assembly (clang, -O0):
<a52e_get_substreamid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x38,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_get_substreamid>:
mov    0x8(%rdi),%eax
shr    $0x3,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @a52e_get_substreamid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 56
%7 = ashr i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
define i32 @a52e_get_substreamid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 7
ret i32 %5
}
int hash32(str)
unsigned char *str;
{
  int xo, cc;
  xo = 1048583;
  while (cc = *str++) {
    xo = (xo << 5) - xo + cc;
  }
  return (xo & 0x7fffffff);
}


x86 assembly (clang, -O0):
<hash32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x100007,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash32+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash32+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash32>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <hash32+0x2f>
add    $0x1,%rdi
mov    $0x100007,%eax
nop
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash32+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x100007,%eax
ret

LLVM IR (-O0):
define i32 @hash32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 1048583, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = load i32, i32* %3
%13 = shl i32 %12, 5
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
%20 = and i32 %19, 2147483647
ret i32 %20
}

LLVM IR (-O2):
define i32 @hash32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 1048583, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 31
%11 = add nsw i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 1048583, %1 ], [ %15, %14 ]
ret i32 %17
}
void task_third() {
  int j = 1;
  while (1) {
    j += 2;
    kprint("3");
    for (int i = 0; i < 1000000; ++i) {
      __asm__("NOP");
    }
  }
}


x86 assembly (clang, -O0):
<task_third>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <kprint@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1159 <task_third+0x49>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <task_third+0x2d>
jmp    111f <task_third+0xf>

x86 assembly (clang, -O2):
<task_third>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <kprint@plt>
mov    $0xf4240,%eax
nop
nop
add    $0xffffffff,%eax
jne    1130 <task_third+0x20>
jmp    1120 <task_third+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"3\00"
define void @task_third() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
br label %3
3: ; preds = %0, %14
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 2
store i32 %5, i32* %1
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @kprint to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1000000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %7
14: ; preds = %7
br label %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"3\00"
define void @task_third() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprint to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %5, %3 ]
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nuw nsw i32 %4, 1
%6 = icmp eq i32 %5, 1000000
br i1 %6, label %1, label %3
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void WX_milliSleep(int milliseconds) {
  struct timespec t;
  t.tv_sec = 0;
  t.tv_nsec = 1000000 * milliseconds;
  nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<WX_milliSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @WX_milliSleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i32 %0, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *produtor(int *buffer) {
  int count = 0;
  while (count < 3) {
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<produtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1132 <produtor+0x22>
jmp    1123 <produtor+0x13>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<produtor>:
jmp    1100 <produtor>

LLVM IR (-O0):
define i8* @produtor(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %5
br label %5
9: ; preds = %5
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @produtor(i32* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int main() {
  int sum = 0;
  int i = 1;
  if (--i) {
    sum += 1;
  }
  if (i++ || i++) {
    sum += 2;
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1134 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jne    115c <main+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1165 <main+0x65>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void initQue(int list[], int max) {
  int i = 0;
  for (i = 0; i < max; i++) {
    list[i] = -1;
  }
}


x86 assembly (clang, -O0):
<initQue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1142 <initQue+0x42>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <initQue+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initQue>:
test   %esi,%esi
jle    1129 <initQue+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initQue(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int hasProgramPulse(int portnum) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @hasProgramPulse(i32 %0) {
ret i32 1
}
/* Variables and functions */
char const *_mac_status_str(int state) {
  switch (state) {
  default:
    return NULL;
  }
}


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

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

LLVM IR (-O0):
define i8* @_mac_status_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_mac_status_str(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ alloc(int);
void t1(int align) { alloc(7); }


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

x86 assembly (clang, -O2):
<t1>:
mov    $0x7,%edi
jmp    1030 <alloc@plt>

LLVM IR (-O0):
define void @t1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @alloc(i32 7)
ret void
}

LLVM IR (-O2):
define void @t1(i32 %0) {
%2 = tail call i32 @alloc(i32 7)
ret void
}
short bytereverse(short in) {
  short out;
  out = 0;
  out = out | ((in & (0x00FF)) << 8);
  out = out | ((in & (0xFF00)) >> 8);
  return out;
}


x86 assembly (clang, -O0):
<bytereverse>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movswl -0x4(%rbp),%eax
movswl -0x2(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
movswl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytereverse>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @bytereverse(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = load i16, i16* %2
%7 = sext i16 %6 to i32
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i16, i16* %3
%13 = sext i16 %12 to i32
%14 = load i16, i16* %2
%15 = sext i16 %14 to i32
%16 = and i32 %15, 65280
%17 = ashr i32 %16, 8
%18 = or i32 %13, %17
%19 = trunc i32 %18 to i16
store i16 %19, i16* %3
%20 = load i16, i16* %3
ret i16 %20
}

LLVM IR (-O2):
define signext i16 @bytereverse(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 1373777115UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      local1++;
    }
    output[0UL] = (state[0UL] + 255873917UL) << 1UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x51e22cdb,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1141 <RandomFunc+0x41>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
add    $0xf40537d,%rcx
shl    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
mov    $0xc24500b0,%ecx
lea    (%rcx,%rax,2),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 1373777115
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %6
%17 = add i64 %16, 1
store i64 %17, i64* %6
br label %12
18: ; preds = %12
%19 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%20 = load i64, i64* %19
%21 = add i64 %20, 255873917
%22 = shl i64 %21, 1
%23 = load i64*, i64** %4
%24 = getelementptr inbounds i64, i64* %23, i64 0
store i64 %22, i64* %24
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 3259302064
store i64 %5, i64* %1
ret void
}
int turn_off_right_most_bit_num(int num) { return (num & (num - 1)); }


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

x86 assembly (clang, -O2):
<turn_off_right_most_bit_num>:
lea    -0x1(%rdi),%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @turn_off_right_most_bit_num(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = and i32 %2, %0
ret i32 %3
}
void restore_screen(void) {}


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

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

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

LLVM IR (-O2):
define void @restore_screen() {
ret void
}
void pthread_cleanup_pop(int execute) {
  printf("%s() Not IMPLEMENTED\n", __FUNCTION__);
}


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

x86 assembly (clang, -O2):
<pthread_cleanup_pop>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%s() Not IMPLEMENTED\0A\00"
@__FUNCTION__.pthread_cleanup_pop = [20 x i8] c"pthread_cleanup_pop\00"
define void @pthread_cleanup_pop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.pthread_cleanup_pop, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s() Not IMPLEMENTED\0A\00"
@__FUNCTION__.pthread_cleanup_pop = [20 x i8] c"pthread_cleanup_pop\00"
define void @pthread_cleanup_pop(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.pthread_cleanup_pop, i64 0, i64 0))
ret void
}