xunge/DecIR huggingface dataset:
char *strcpy(char *dst, const char *src) {
  char *q = dst;
  const char *p = src;
  char ch;
  do {
    *q++ = ch = *p++;
  } while (ch);
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    %cl,-0x21(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
cmpb   $0x0,-0x21(%rbp)
jne    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
char get_file_name(void) {
  char file_name[30];
  printf("Enter name of file to read from: ");
  scanf(" %s", &file_name);
  return file_name;
}


x86 assembly (clang, -O0):
<get_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_name>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter name of file to read from: \00"
@.str.1 = [4 x i8] c" %s\00"
define signext i8 @get_file_name() {
%1 = alloca [30 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), [30 x i8]* %1)
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%5 = ptrtoint i8* %4 to i8
ret i8 %5
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter name of file to read from: \00"
@.str.1 = [4 x i8] c" %s\00"
define signext i8 @get_file_name() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), [30 x i8]* %1)
%5 = ptrtoint [30 x i8]* %1 to i64
%6 = trunc i64 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void parse_comment(FILE *in) {
  fgetc(in);
  while (fgetc(in) != '~')
    ;
}


x86 assembly (clang, -O0):
<parse_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0x7e,%eax
je     113f <parse_comment+0x2f>
jmp    1125 <parse_comment+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_comment>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgetc@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0x7e,%al
jne    1120 <parse_comment+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @parse_comment(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
br label %3
3: ; preds = %3, %1
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = icmp eq i8 %4, 126
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int bar();
int foo(void) { return bar(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @bar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
int main(int argc, char **argv) {
  int x;
  double r = argc;
  if (!(0 <= r)) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    113a <main+0x3a>
movl   $0x7,-0x14(%rbp)
jmp    1141 <main+0x41>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x2a,%ecx
mov    $0x7,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %7
%10 = load double, double* %7
%11 = fcmp ole double 0.000000e+00, %10
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 42, i32 7
ret i32 %4
}
/* Variables and functions */
int foo(int);
int main() { return foo(5); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stderr;
void die(int rc, char *msg) {
  clear();
  refresh();
  endwin();
  if (msg != NULL) {
    fprintf(stderr, "%s\n", msg);
  }
  exit(rc);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
cmpq   $0x0,-0x10(%rbp)
je     1198 <die+0x48>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe6d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
test   %rbx,%rbx
je     118a <die+0x3a>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %ebp,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @clear()
%6 = call i32 (...) @refresh()
%7 = call i32 (...) @endwin()
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %3
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i32 %0, i8* %1) {
%3 = tail call i32 (...) @clear()
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 (...) @endwin()
%6 = icmp eq i8* %1, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %7, %2
%11 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
float sine_out(float, float, float);
float sine_f_out(float step, float max_steps, float max_val) {
  return sine_out(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<sine_f_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <sine_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_f_out>:
jmp    1030 <sine_out@plt>

LLVM IR (-O0):
define float @sine_f_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @sine_out(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @sine_f_out(float %0, float %1, float %2) {
%4 = tail call float @sine_out(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ init_hashing_engine_memory_hash();
void HASHENG_init_hashing_engine(void) { init_hashing_engine_memory_hash(); }


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

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

LLVM IR (-O0):
define void @HASHENG_init_hashing_engine() {
%1 = call i32 (...) @init_hashing_engine_memory_hash()
ret void
}

LLVM IR (-O2):
define void @HASHENG_init_hashing_engine() {
%1 = tail call i32 (...) @init_hashing_engine_memory_hash()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char buf1[55];
  char buf0[300];
  volatile int (*var1)();
  var1 = 0;
  gets(buf0);
  if (var1) {
    printf("Wait, you aren't supposed to be here\n");
    var1();
  } else {
    printf("O look you didn't solve this. How very predictable\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x178(%rbp)
lea    -0x170(%rbp),%rdi
call   1040 <gets@plt>
cmpq   $0x0,-0x178(%rbp)
je     1170 <main+0x50>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   *-0x178(%rbp)
jmp    117c <main+0x5c>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x138,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x138,%rsp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Wait, you aren't supposed to be here\0A\00"
@.str.1 = [52 x i8] c"O look you didn't solve this. How very predictable\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [55 x i8]
%3 = alloca [300 x i8]
%4 = alloca i32 (...)*
store i32 0, i32* %1
store i32 (...)* null, i32 (...)** %4
%5 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = load i32 (...)*, i32 (...)** %4
%8 = icmp ne i32 (...)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%11 = load i32 (...)*, i32 (...)** %4
%12 = call i32 (...) %11()
br label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [51 x i8] c"O look you didn't solve this. How very predictable\00"
define i32 @main() {
%1 = alloca [300 x i8]
%2 = getelementptr inbounds [300 x i8], [300 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int validate(char *buffer, int i) {
  int j;
  int k;
  j = i % 8;
  k = (i - j) / 8;
  return buffer[k] & 0x1 << j;
}


x86 assembly (clang, -O0):
<validate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @validate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = srem i32 %7, 8
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = sdiv i32 %11, 8
store i32 %12, i32* %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %5
%20 = shl i32 1, %19
%21 = and i32 %18, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @validate(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
ret i32 %10
}
unsigned char e3(unsigned char a) {
  return ((a >> 5) & 0x07) | ((a << 3) & 0xf8);
}


x86 assembly (clang, -O0):
<e3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x5,%eax
and    $0x7,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x3,%ecx
and    $0xf8,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e3>:
mov    %edi,%eax
rol    $0x3,%al
ret

LLVM IR (-O0):
define zeroext i8 @e3(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 5
%6 = and i32 %5, 7
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 3
%10 = and i32 %9, 248
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @e3(i8 zeroext %0) {
%2 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 3)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0;
  i = ++i + i++;
  printf("First Example, i on your Machine/compiler/architecture = %d \n", i);
  int a[10];
  int y = 0;
  a[y] = y++;
  printf("Second Example, a[y] on your Machine/compiler/architecture = %d \n",
         a[y]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [62 x i8] c"First Example, i on your Machine/compiler/architecture = %d \0A\00"
@.str.1 = [66 x i8] c"Second Example, a[y] on your Machine/compiler/architecture = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = add nsw i32 %5, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 0, i32* %3
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
store i32 %11, i32* %15
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"First Example, i on your Machine/compiler/architecture = %d \0A\00"
@.str.1 = [66 x i8] c"Second Example, a[y] on your Machine/compiler/architecture = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutex_destroy(int /*<<< orphan*/ *);
void Pthread_mutex_destroy(pthread_mutex_t *mutex) {
  int retval;
  assert(mutex != NULL);
  retval = pthread_mutex_destroy(mutex);
  if (retval != 0)
    Sys_failure("pthread_mutex_destroy");
}


x86 assembly (clang, -O0):
<Pthread_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1170 <Pthread_mutex_destroy+0x40>
lea    0xe95(%rip),%rdi
call   1050 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_mutex_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <pthread_mutex_destroy@plt>
test   %eax,%eax
je     115b <Pthread_mutex_destroy+0x2b>
lea    0xeab(%rip),%rdi
pop    %rbx
jmp    1050 <Sys_failure@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"pthread_mutex_destroy\00"
define void @Pthread_mutex_destroy(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @pthread_mutex_destroy(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_buffer_attr_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_buffer_attr_callback"
         "\n");
}


x86 assembly (clang, -O0):
<pa_stream_set_buffer_attr_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"NOT IMPLEMENTED:pa_stream_set_buffer_attr_callback\0A\00"
define i32 @pa_stream_set_buffer_attr_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_stream_set_buffer_attr_callback\00"
define i32 @pa_stream_set_buffer_attr_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_A8int16_mem(short *val) {
  return ((*val) & (-0xA8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A8int16_mem>:
movzwl (%rdi),%eax
test   $0xff58,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A8int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -168
%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_A8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -168
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ gfx_test_timing_active();
scalar_t__ gfx_test_vertical_active();
int gu1_wait_vertical_blank(void) {
  if (gfx_test_timing_active()) {
    while (!gfx_test_vertical_active())
      ;
    while (gfx_test_vertical_active())
      ;
  }
  return (0);
}


x86 assembly (clang, -O0):
<gu1_wait_vertical_blank>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gfx_test_timing_active@plt>
cmp    $0x0,%rax
je     117c <gu1_wait_vertical_blank+0x5c>
jmp    113a <gu1_wait_vertical_blank+0x1a>
mov    $0x0,%al
call   1040 <gfx_test_vertical_active@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1157 <gu1_wait_vertical_blank+0x37>
jmp    115c <gu1_wait_vertical_blank+0x3c>
jmp    113a <gu1_wait_vertical_blank+0x1a>
jmp    1161 <gu1_wait_vertical_blank+0x41>
mov    $0x0,%al
call   1040 <gfx_test_vertical_active@plt>
cmp    $0x0,%rax
je     1177 <gu1_wait_vertical_blank+0x57>
jmp    1161 <gu1_wait_vertical_blank+0x41>
jmp    117c <gu1_wait_vertical_blank+0x5c>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu1_wait_vertical_blank>:
push   %rax
xor    %eax,%eax
call   1030 <gfx_test_timing_active@plt>
test   %rax,%rax
je     114c <gu1_wait_vertical_blank+0x2c>
nopl   (%rax)
xor    %eax,%eax
call   1040 <gfx_test_vertical_active@plt>
test   %rax,%rax
je     1130 <gu1_wait_vertical_blank+0x10>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <gfx_test_vertical_active@plt>
test   %rax,%rax
jne    1140 <gu1_wait_vertical_blank+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gu1_wait_vertical_blank() {
%1 = call i64 (...) @gfx_test_timing_active()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %15
3: ; preds = %0
br label %4
4: ; preds = %8, %3
%5 = call i64 (...) @gfx_test_vertical_active()
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
br label %10
10: ; preds = %13, %9
%11 = call i64 (...) @gfx_test_vertical_active()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
br label %15
15: ; preds = %14, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @gu1_wait_vertical_blank() {
%1 = tail call i64 (...) @gfx_test_timing_active()
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @gfx_test_vertical_active()
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3, %6
%7 = tail call i64 (...) @gfx_test_vertical_active()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %6
9: ; preds = %6, %0
ret i32 0
}
__attribute__((always_)) void init_rcu_head_on_stack(struct rcu_head *head) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_head = type opaque
define void @init_rcu_head_on_stack(%struct.rcu_head* nocapture %0) {
ret void
}
void disconnect() {
  for (unsigned char i = 0; i < 3; i++)
    disconnect(i);
}


x86 assembly (clang, -O0):
<disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x3,%eax
jge    1141 <disconnect+0x31>
movzbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <disconnect@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <disconnect+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @disconnect() {
tail call void @disconnect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fwd_decl_avx();
int /*<<< orphan*/ fwd_decl_default();
void bar5() {
  fwd_decl_default();
  fwd_decl_avx();
}


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

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

LLVM IR (-O0):
define void @bar5() {
%1 = call i32 (...) @fwd_decl_default()
%2 = call i32 (...) @fwd_decl_avx()
ret void
}

LLVM IR (-O2):
define void @bar5() {
%1 = tail call i32 (...) @fwd_decl_default()
%2 = tail call i32 (...) @fwd_decl_avx()
ret void
}
/* Variables and functions */
int bar();
int foo2(int x, int y) {
  if (y < 10)
    return bar();
  if (x > 9)
    return bar();
  return x > y ? x : y;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1137 <foo2+0x27>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <foo2+0x63>
cmpl   $0x9,-0x8(%rbp)
jle    1150 <foo2+0x40>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <foo2+0x63>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1167 <foo2+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116d <foo2+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
cmp    $0xa,%esi
jl     111d <foo2+0xd>
cmp    $0xa,%edi
jge    111d <foo2+0xd>
mov    %esi,%eax
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @bar()
store i32 %9, i32* %3
br label %25
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 9
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @bar()
store i32 %14, i32* %3
br label %25
15: ; preds = %10
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* %4
br label %23
21: ; preds = %15
%22 = load i32, i32* %5
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %13, %8
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @foo2(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 10
%4 = icmp sgt i32 %0, 9
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @bar()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ findtarget(int, char *);
void xltoplevel(void) { findtarget(64, "no top level"); }


x86 assembly (clang, -O0):
<xltoplevel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
lea    0xee0(%rip),%rsi
call   1030 <findtarget@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xltoplevel>:
lea    0xee9(%rip),%rsi
mov    $0x40,%edi
jmp    1030 <findtarget@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"no top level\00"
define void @xltoplevel() {
%1 = call i32 @findtarget(i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"no top level\00"
define void @xltoplevel() {
%1 = tail call i32 @findtarget(i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long ___copy_in_user(void *, void *, unsigned long);
unsigned long copy_in_user_fixup(void *, void *, unsigned long);
unsigned long copy_in_user(void *to, void *from, unsigned long size) {
  unsigned long ret = ___copy_in_user(to, from, size);
  if (ret)
    ret = copy_in_user_fixup(to, from, size);
  return ret;
}


x86 assembly (clang, -O0):
<copy_in_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <___copy_in_user@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1169 <copy_in_user+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <copy_in_user_fixup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_in_user>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <___copy_in_user@plt>
test   %rax,%rax
je     114b <copy_in_user+0x2b>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <copy_in_user_fixup@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @copy_in_user(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @___copy_in_user(i8* %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i64 @copy_in_user_fixup(i8* %15, i8* %16, i64 %17)
store i64 %18, i64* %7
br label %19
19: ; preds = %14, %3
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @copy_in_user(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @___copy_in_user(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @copy_in_user_fixup(i8* %0, i8* %1, i64 %2)
br label %8
8: ; preds = %6, %3
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
int test30(int a, int b) {
  return ((a & 0x7F) == 1) | ((a & 0xFF00) == 0x0200) |
         ((a & 0xFF0000) == 0x030000);
}


x86 assembly (clang, -O0):
<test30>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
cmp    $0x200,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
cmp    $0x30000,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test30>:
mov    %edi,%eax
and    $0x7f,%eax
cmp    $0x1,%eax
sete   %al
mov    %edi,%ecx
and    $0xff00,%ecx
cmp    $0x200,%ecx
sete   %cl
or     %al,%cl
and    $0xff0000,%edi
cmp    $0x30000,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @test30(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 = and i32 %5, 127
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = load i32, i32* %3
%10 = and i32 %9, 65280
%11 = icmp eq i32 %10, 512
%12 = zext i1 %11 to i32
%13 = or i32 %8, %12
%14 = load i32, i32* %3
%15 = and i32 %14, 16711680
%16 = icmp eq i32 %15, 196608
%17 = zext i1 %16 to i32
%18 = or i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @test30(i32 %0, i32 %1) {
%3 = and i32 %0, 127
%4 = icmp eq i32 %3, 1
%5 = and i32 %0, 65280
%6 = icmp eq i32 %5, 512
%7 = or i1 %4, %6
%8 = and i32 %0, 16711680
%9 = icmp eq i32 %8, 196608
%10 = or i1 %9, %7
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef unsigned long __u32;

/* Variables and functions */
unsigned int tipc_cluster(__u32 addr) {
  return (addr & (((1UL << 12) - 1) << 12)) >> 12;
}


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

x86 assembly (clang, -O2):
<tipc_cluster>:
mov    %rdi,%rax
shr    $0xc,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @tipc_cluster(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 16773120
%5 = lshr i64 %4, 12
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @tipc_cluster(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 12
%4 = and i32 %3, 4095
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ swapbuffers();
void swapbuffers_() { swapbuffers(); }


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

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

LLVM IR (-O0):
define void @swapbuffers_() {
%1 = call i32 (...) @swapbuffers()
ret void
}

LLVM IR (-O2):
define void @swapbuffers_() {
%1 = tail call i32 (...) @swapbuffers()
ret void
}
void f_c(void) {
  char x;
  asm("" : "=@ccc"(x));
}


x86 assembly (clang, -O0):
<f_c>:
push   %rbp
mov    %rsp,%rbp
setb   %al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_c() {
%1 = alloca i8
%2 = call i8 asm "", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
ret void
}

LLVM IR (-O2):
define void @f_c() {
%1 = tail call i8 asm "", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int no_stack_frame();
int main(int argc, char **argv) { return no_stack_frame(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @no_stack_frame()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Multiply matrix by vector via 3 processors with common memory\n");
  printf("using posix threads\n");
  printf("\E[1;11mUsage:\E[0;11m main --seed seed --count count of sequence "
         "member\n");
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"Multiply matrix by vector via 3 processors with common memory\0A\00"
@.str.1 = [21 x i8] c"using posix threads\0A\00"
@.str.2 = [72 x i8] c"\1B[1;11mUsage:\1B[0;11m main --seed seed --count count of sequence member\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"Multiply matrix by vector via 3 processors with common memory\00"
@str.3 = [20 x i8] c"using posix threads\00"
@str.4 = [71 x i8] c"\1B[1;11mUsage:\1B[0;11m main --seed seed --count count of sequence member\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msec_to_usec(unsigned long);
int /*<<< orphan*/ tv_add_usec(struct timeval *, int /*<<< orphan*/);
void tv_add_msec(struct timeval *tv, unsigned long msec) {
  tv_add_usec(tv, msec_to_usec(msec));
}


x86 assembly (clang, -O0):
<tv_add_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <msec_to_usec@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <tv_add_usec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_add_msec>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <msec_to_usec@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <tv_add_usec@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @tv_add_msec(%struct.timeval* %0, i64 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store i64 %1, i64* %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load i64, i64* %4
%7 = call i32 @msec_to_usec(i64 %6)
%8 = call i32 @tv_add_usec(%struct.timeval* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @tv_add_msec(%struct.timeval* %0, i64 %1) {
%3 = tail call i32 @msec_to_usec(i64 %1)
%4 = tail call i32 @tv_add_usec(%struct.timeval* %0, i32 %3)
ret void
}
void kolibri_destroy_bitmap(void *bitmap) {}


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

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

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

LLVM IR (-O2):
define void @kolibri_destroy_bitmap(i8* nocapture %0) {
ret void
}
long getoutputcirclesize(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @getoutputcirclesize() {
ret i64 0
}

LLVM IR (-O2):
define i64 @getoutputcirclesize() {
ret i64 0
}
int *hop(int *elem) {
  elem = elem + *elem;
  return (elem);
}


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hop>:
movslq (%rdi),%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i32* @hop(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %3, i64 %6
store i32* %7, i32** %2
%8 = load i32*, i32** %2
ret i32* %8
}

LLVM IR (-O2):
define i32* @hop(i32* %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, size_t);
void *vn_alloc(size_t);
void *vn_calloc(size_t size) {
  void *p;
  p = vn_alloc(size);
  if (p) {
    memset(p, '\0', size);
  }
  return p;
}


x86 assembly (clang, -O0):
<vn_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vn_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <vn_calloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <vn_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <vn_calloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @vn_calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @vn_alloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i8 signext 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @vn_calloc(i64 %0) {
%2 = tail call i8* @vn_alloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i8 signext 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ smpc_issue_command(unsigned char);
int /*<<< orphan*/ smpc_wait_till_ready();
void smpc_command(unsigned char cmd) {
  smpc_wait_till_ready();
  smpc_issue_command(cmd);
}


x86 assembly (clang, -O0):
<smpc_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <smpc_wait_till_ready@plt>
movzbl -0x1(%rbp),%edi
call   1040 <smpc_issue_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpc_command>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <smpc_wait_till_ready@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <smpc_issue_command@plt>

LLVM IR (-O0):
define void @smpc_command(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @smpc_wait_till_ready()
%4 = load i8, i8* %2
%5 = call i32 @smpc_issue_command(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @smpc_command(i8 zeroext %0) {
%2 = tail call i32 (...) @smpc_wait_till_ready()
%3 = tail call i32 @smpc_issue_command(i8 zeroext %0)
ret void
}
int check_amount(float amount) {
  if (amount > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_amount>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1126 <check_amount+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <check_amount+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_amount>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @check_amount(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @check_amount(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
int sign(int x) { return (x >> 31) | (((~x + 1) >> 31) & 1); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%eax
sar    $0x1f,%eax
neg    %edi
shr    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = add nsw i32 %6, 1
%8 = ashr i32 %7, 31
%9 = and i32 %8, 1
%10 = or i32 %4, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = sub i32 0, %0
%4 = lshr i32 %3, 31
%5 = or i32 %2, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *p;
  printf("%d\n", 8 * sizeof(p));
  return (0);
}


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

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

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

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