xunge/DecIR huggingface dataset:
/* Variables and functions */
int max(int, int);
int calc_coeffs_len(int in_dim, int out_dim) {
  return 4 * max(in_dim, out_dim) * sizeof(float);
}


x86 assembly (clang, -O0):
<calc_coeffs_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <max@plt>
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_coeffs_len>:
push   %rax
call   1030 <max@plt>
shl    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calc_coeffs_len(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @max(i32 %5, i32 %6)
%8 = mul nsw i32 4, %7
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @calc_coeffs_len(i32 %0, i32 %1) {
%3 = tail call i32 @max(i32 %0, i32 %1)
%4 = shl i32 %3, 4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cat0();
int /*<<< orphan*/ cat2();
void rot64_sem() {
  cat0();
  cat2();
}


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

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

LLVM IR (-O0):
define void @rot64_sem() {
%1 = call i32 (...) @cat0()
%2 = call i32 (...) @cat2()
ret void
}

LLVM IR (-O2):
define void @rot64_sem() {
%1 = tail call i32 (...) @cat0()
%2 = tail call i32 (...) @cat2()
ret void
}
/* Variables and functions */
scalar_t__ leap_year(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  scanf("%d", &n);
  if (leap_year(n))
    printf("L");
  else
    printf("N");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <leap_year@plt>
cmp    $0x0,%rax
je     1179 <main+0x49>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    1185 <main+0x55>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <leap_year@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,1),%edi
add    $0x4c,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i64 @leap_year(i32 %6)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 78, i32 76
%10 = call i32 @putchar(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ putchar(char);
void show_array(const int ar[], int n) {
  int i;
  for (i = 0; i < n; ++i) {
    printf("%d ", ar[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<show_array>:
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    1167 <show_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <show_array+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <show_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <show_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @show_array(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
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 i32*, i32** %3
%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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%21 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @show_array(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_ais_21(void) {
  fprintf(stderr, "test_ais_21() failed: Not Written\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_ais_21>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ais_21>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_21() failed: Not Written\0A\00"
define i32 @test_ais_21() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_21() failed: Not Written\0A\00"
define i32 @test_ais_21() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
void clear_buffer() {
  int c = 0;
  while (c != '\n' && c != EOF)
    c = getchar();
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1140 <clear_buffer+0x30>
mov    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1150 <clear_buffer+0x40>
jmp    115f <clear_buffer+0x4f>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    111f <clear_buffer+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
cmpl   $0x0,(%rbx)
je     1130 <clear_buffer+0x20>
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clear_buffer+0x20>
cmp    (%rbx),%eax
jne    1120 <clear_buffer+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @clear_buffer() {
%1 = load i32, i32* @EOF
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @getchar()
%5 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret void
}
void rl_push_macro_input(macro) char *macro;
{ _rl_with_macro_input(macro); }


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

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

LLVM IR (-O0):
define void @rl_push_macro_input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @_rl_with_macro_input to i32 (i8*, ...)*)(i8* %3)
ret void
}

LLVM IR (-O2):
define void @rl_push_macro_input(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_rl_with_macro_input to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void _usleep(int micro) {
  struct timespec req = {0};
  req.tv_sec = 0;
  req.tv_nsec = micro * 1000L;
  nanosleep(&req, (struct timespec *)NULL);
}


x86 assembly (clang, -O0):
<_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
movq   $0x0,-0x18(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x3e8,%rax,%rax
mov    %eax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usleep>:
sub    $0x18,%rsp
imul   $0x3e8,%edi,%eax
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %eax,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32, i64, i32 }
define void @_usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = mul i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%6 = bitcast %struct.timespec* %2 to i8*
store i32 %4, i32* %5
%7 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* null)
ret void
}
char *bda_get_keyboard_buffer(void) { return (char *)0x41E; }


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

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

LLVM IR (-O0):
define i8* @bda_get_keyboard_buffer() {
ret i8* inttoptr (i64 1054 to i8*)
}

LLVM IR (-O2):
define i8* @bda_get_keyboard_buffer() {
ret i8* inttoptr (i64 1054 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ putc(char const);
void puts(const char *s) {
  while (*s != '\0') {
    putc(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <puts+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
char *getString(unsigned int i) {
  char *str = (char *)malloc(sizeof(char) * 50);
  sprintf(str, "schluessel%u", i);
  return str;
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x32,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getString>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x32,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"schluessel%u\00"
define i8* @getString(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 50)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"schluessel%u\00"
define i8* @getString(i32 %0) {
%2 = tail call i64 @malloc(i32 50)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
int test_imm_96int64_lowword_reg(long long val) {
  return ((val) & (0x96 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_96int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 150
%5 = icmp ne i64 %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_96int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 150
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int roll;
  srand(time(NULL));
  roll = rand() % 6 + 1;
  printf("\n\tCongratulations, you rolled a %d\n", roll);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0A\09Congratulations, you rolled a %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A\09Congratulations, you rolled a %d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test81_ArrayReturn_foo__E();
void test81_TestProg_pollen__run__E() {
  test81_ArrayReturn_foo__E();
  exit(0);
}


x86 assembly (clang, -O0):
<test81_TestProg_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test81_ArrayReturn_foo__E@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test81_TestProg_pollen__run__E>:
push   %rax
xor    %eax,%eax
call   1030 <test81_ArrayReturn_foo__E@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @test81_TestProg_pollen__run__E() {
%1 = call i32 (...) @test81_ArrayReturn_foo__E()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test81_TestProg_pollen__run__E() {
%1 = tail call i32 (...) @test81_ArrayReturn_foo__E()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int syscall(int, int, char const *, int /*<<< orphan*/);
int inotify_add_watch(int fd, const char *pathname, uint32_t mask) {
  return syscall(317, fd, pathname, mask);
}


x86 assembly (clang, -O0):
<inotify_add_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x13d,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotify_add_watch>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x13d,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @inotify_add_watch(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 317, i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @inotify_add_watch(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 317, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void oom_die(void) {
  fprintf(stderr, "Out of memory!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<oom_die>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oom_die>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define void @oom_die() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define void @oom_die() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
umatch(s, p) char *s, *p;
{
  if (*p == 0)
    return (1);
  while (*s)
    if (glbmtch(s++, p))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<umatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <umatch+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1189 <umatch+0x79>
jmp    1141 <umatch+0x31>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1182 <umatch+0x72>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <glbmtch@plt>
cmp    $0x0,%eax
je     117d <umatch+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1189 <umatch+0x79>
jmp    1141 <umatch+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umatch>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%r14d
cmpb   $0x0,(%rsi)
je     114f <umatch+0x3f>
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi)
je     114c <umatch+0x3c>
lea    0x1(%rdi),%rbp
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <glbmtch@plt>
mov    %rbp,%rdi
test   %eax,%eax
je     1130 <umatch+0x20>
jmp    114f <umatch+0x3f>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @umatch(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** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %25
11: ; preds = %2
br label %12
12: ; preds = %23, %11
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
%19 = load i8*, i8** %5
%20 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @glbmtch to i32 (i8*, i8*, ...)*)(i8* %17, i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %3
br label %25
23: ; preds = %16
br label %12
24: ; preds = %12
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @umatch(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @glbmtch to i32 (i8*, i8*, ...)*)(i8* %6, i8* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %2
%14 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %14
}
/* Variables and functions */
int green_issat(char *);
int /*<<< orphan*/ printf(char *, char *, int);
void issat(char *query) {
  int answer = green_issat(query);
  printf("QUERY: \"%s\"\nANSWER: %d\n\n", query, answer);
}


x86 assembly (clang, -O0):
<issat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <green_issat@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issat>:
push   %rbx
mov    %rdi,%rbx
call   1040 <green_issat@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"QUERY: \22%s\22\0AANSWER: %d\0A\0A\00"
define void @issat(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @green_issat(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"QUERY: \22%s\22\0AANSWER: %d\0A\0A\00"
define void @issat(i8* %0) {
%2 = tail call i32 @green_issat(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cube(float);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float num;
  scanf("%f", &num);
  printf("%Lf\n", cube(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <cube@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <cube@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [5 x i8] c"%Lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = call i32 @cube(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [5 x i8] c"%Lf\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @cube(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct path_link_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct path_link_list *);
void path_link_list_free(struct path_link_list *list) {
  if (list)
    free(list);
}


x86 assembly (clang, -O0):
<path_link_list_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <path_link_list_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_link_list_free>:
test   %rdi,%rdi
je     111a <path_link_list_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.path_link_list = type { i32 }
define void @path_link_list_free(%struct.path_link_list* %0) {
%2 = alloca %struct.path_link_list*
store %struct.path_link_list* %0, %struct.path_link_list** %2
%3 = load %struct.path_link_list*, %struct.path_link_list** %2
%4 = icmp ne %struct.path_link_list* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.path_link_list*, %struct.path_link_list** %2
%7 = call i32 @free(%struct.path_link_list* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.path_link_list = type { i32 }
define void @path_link_list_free(%struct.path_link_list* %0) {
%2 = icmp eq %struct.path_link_list* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.path_link_list* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
double fabs(double);
double err_abs(double x, double y) { return fabs(x - y); }


x86 assembly (clang, -O0):
<err_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_abs>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @err_abs(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
ret double %8
}

LLVM IR (-O2):
define double @err_abs(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
/* Type definitions */
struct RuleSelector {
  int dummy;
};

/* Variables and functions */
int _match(struct RuleSelector *, struct RuleSelector *);
int _match_parent(struct RuleSelector *parent_query,
                  struct RuleSelector *parent_iter_query) {
  if (!parent_iter_query)
    return 1;
  if (!parent_query)
    return 0;
  return _match(parent_query, parent_iter_query);
}


x86 assembly (clang, -O0):
<_match_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <_match_parent+0x27>
movl   $0x1,-0x4(%rbp)
jmp    115e <_match_parent+0x4e>
cmpq   $0x0,-0x10(%rbp)
jne    114e <_match_parent+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    115e <_match_parent+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_match@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_match_parent>:
test   %rsi,%rsi
je     111f <_match_parent+0xf>
test   %rdi,%rdi
je     1125 <_match_parent+0x15>
jmp    1030 <_match@plt>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.RuleSelector = type { i32 }
define i32 @_match_parent(%struct.RuleSelector* %0, %struct.RuleSelector* %1) {
%3 = alloca i32
%4 = alloca %struct.RuleSelector*
%5 = alloca %struct.RuleSelector*
store %struct.RuleSelector* %0, %struct.RuleSelector** %4
store %struct.RuleSelector* %1, %struct.RuleSelector** %5
%6 = load %struct.RuleSelector*, %struct.RuleSelector** %5
%7 = icmp ne %struct.RuleSelector* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 1, i32* %3
br label %17
9: ; preds = %2
%10 = load %struct.RuleSelector*, %struct.RuleSelector** %4
%11 = icmp ne %struct.RuleSelector* %10, null
br i1 %11, label %13, label %12
12: ; preds = %9
store i32 0, i32* %3
br label %17
13: ; preds = %9
%14 = load %struct.RuleSelector*, %struct.RuleSelector** %4
%15 = load %struct.RuleSelector*, %struct.RuleSelector** %5
%16 = call i32 @_match(%struct.RuleSelector* %14, %struct.RuleSelector* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %12, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.RuleSelector = type { i32 }
define i32 @_match_parent(%struct.RuleSelector* %0, %struct.RuleSelector* %1) {
%3 = icmp eq %struct.RuleSelector* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp eq %struct.RuleSelector* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @_match(%struct.RuleSelector* %0, %struct.RuleSelector* %1)
br label %8
8: ; preds = %4, %2, %6
%9 = phi i32 [ %7, %6 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %9
}
/* Variables and functions */
int inportb(int);
int fd_getbyte() {
  for (int tmo = 0; tmo < 128; tmo++) {
    int msr = inportb((0x3f4));
    if ((msr & 0xd0) == 0xd0)
      return inportb((0x3f5));
    inportb(0x80);
  }
  return -1;
}


x86 assembly (clang, -O0):
<fd_getbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1176 <fd_getbyte+0x66>
mov    $0x3f4,%edi
call   1030 <inportb@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xd0,%eax
cmp    $0xd0,%eax
jne    115e <fd_getbyte+0x4e>
mov    $0x3f5,%edi
call   1030 <inportb@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <fd_getbyte+0x6d>
mov    $0x80,%edi
call   1030 <inportb@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <fd_getbyte+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_getbyte>:
push   %rbx
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x3f4,%edi
call   1030 <inportb@plt>
not    %eax
test   $0xd0,%al
je     1146 <fd_getbyte+0x36>
mov    $0x80,%edi
call   1030 <inportb@plt>
add    $0xffffffff,%ebx
jne    1120 <fd_getbyte+0x10>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    $0x3f5,%edi
pop    %rbx
jmp    1030 <inportb@plt>

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

LLVM IR (-O2):
define i32 @fd_getbyte() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %10, %8 ]
%3 = tail call i32 @inportb(i32 1012)
%4 = and i32 %3, 208
%5 = icmp eq i32 %4, 208
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @inportb(i32 1013)
br label %12
8: ; preds = %1
%9 = tail call i32 @inportb(i32 128)
%10 = add nuw nsw i32 %2, 1
%11 = icmp eq i32 %10, 128
br i1 %11, label %12, label %1
12: ; preds = %8, %6
%13 = phi i32 [ %7, %6 ], [ -1, %8 ]
ret i32 %13
}
int cpufreq_thermal_limit(int cluster, int limit_freq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpufreq_thermal_limit(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_8_le(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_int64_le(const uint8_t *src, uint32_t offs,
                                     int64_t *dst) {
  uint64_t tmp = ivory_serialize_unpack_prim_8_le(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_int64_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_8_le@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_int64_le>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_8_le@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_int64_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_8_le(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_int64_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_8_le(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
/* Type definitions */
struct libdeflate_compressor {
  int dummy;
};

/* Variables and functions */
struct libdeflate_compressor *libdeflate_alloc_compressor(int);
int /*<<< orphan*/ msg_errno(char *, int);
struct libdeflate_compressor *alloc_compressor(int level) {
  struct libdeflate_compressor *c;
  c = libdeflate_alloc_compressor(level);
  if (c == NULL) {
    msg_errno("Unable to allocate compressor with "
              "compression level %d",
              level);
  }
  return c;
}


x86 assembly (clang, -O0):
<alloc_compressor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <libdeflate_alloc_compressor@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <alloc_compressor+0x31>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <msg_errno@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_compressor>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <libdeflate_alloc_compressor@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <alloc_compressor+0x20>
lea    0xec7(%rip),%rdi
mov    %ebp,%esi
call   1030 <msg_errno@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.libdeflate_compressor = type { i32 }
@.str = [56 x i8] c"Unable to allocate compressor with compression level %d\00"
define %struct.libdeflate_compressor* @alloc_compressor(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.libdeflate_compressor*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.libdeflate_compressor* @libdeflate_alloc_compressor(i32 %4)
store %struct.libdeflate_compressor* %5, %struct.libdeflate_compressor** %3
%6 = load %struct.libdeflate_compressor*, %struct.libdeflate_compressor** %3
%7 = icmp eq %struct.libdeflate_compressor* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @msg_errno(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %1
%12 = load %struct.libdeflate_compressor*, %struct.libdeflate_compressor** %3
ret %struct.libdeflate_compressor* %12
}

LLVM IR (-O2):
%struct.libdeflate_compressor = type { i32 }
@.str = [56 x i8] c"Unable to allocate compressor with compression level %d\00"
define %struct.libdeflate_compressor* @alloc_compressor(i32 %0) {
%2 = tail call %struct.libdeflate_compressor* @libdeflate_alloc_compressor(i32 %0)
%3 = icmp eq %struct.libdeflate_compressor* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @msg_errno(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret %struct.libdeflate_compressor* %2
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main() {
  char str[20] = "abcdefgh\n";
  print(str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [20 x i8] c"abcdefgh\0A\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @print(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [20 x i8] c"abcdefgh\0A\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @print(i8* %2)
ret i32 0
}
void GB_LAND_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (((*x) != 0) && ((*y) != 0));
}


x86 assembly (clang, -O0):
<GB_LAND_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jne    1135 <GB_LAND_f_FP64+0x35>
jp     1135 <GB_LAND_f_FP64+0x35>
jmp    114f <GB_LAND_f_FP64+0x4f>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_LAND_f_FP64>:
movsd  (%rsi),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1110 <GB_LAND_f_FP64+0x10>
jnp    1125 <GB_LAND_f_FP64+0x25>
xorpd  %xmm1,%xmm1
cmpneqsd (%rdx),%xmm1
movsd  0xedf(%rip),%xmm0
andpd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_LAND_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = fcmp une double %8, 0.000000e+00
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = fcmp une double %12, 0.000000e+00
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = sitofp i32 %16 to double
%18 = load double*, double** %4
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @GB_LAND_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = fcmp une double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load double, double* %2
%8 = fcmp une double %7, 0.000000e+00
%9 = uitofp i1 %8 to double
br label %10
10: ; preds = %6, %3
%11 = phi double [ 0.000000e+00, %3 ], [ %9, %6 ]
store double %11, double* %0
ret void
}
void libb() {
  printf("\n%s: \n", __func__);
  common2();
}


x86 assembly (clang, -O0):
<libb>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <common2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<libb>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <common2@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.libb = [5 x i8] c"libb\00"
define void @libb() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.libb, i64 0, i64 0))
%2 = call i32 (...) @common2()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.libb = [5 x i8] c"libb\00"
define void @libb() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.libb, i64 0, i64 0))
%2 = tail call i32 (...) @common2()
ret void
}
int test_imm_58uint8_mem(unsigned char *val) {
  return ((*val) & (-0x58 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_58uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -88
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int print_queue(int idx, void *data) {
  printf("%d: %c,", idx, (char *)data);
  return (1);
}


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

x86 assembly (clang, -O2):
<print_queue>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %c,\00"
define i32 @print_queue(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret i32 1
}