xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
main() {
  printf("ERROR: No locking available. Running Samba would be unsafe\n");
  exit(1);
  printf("WARNING: no shared memory. Running with slow locking code\n");
  printf("WARNING: No automated network interface determination\n");
  printf("ERROR: no seteuid method available\n");
  exit(1);
  printf("ERROR: No disk free routine!\n");
  exit(1);
  printf("ERROR: No random or srandom routine!\n");
  exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [60 x i8] c"ERROR: No locking available. Running Samba would be unsafe\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [59 x i8] c"ERROR: No locking available. Running Samba would be unsafe\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void *does_too(void *a) {
  int i = 0;
  for (i = 0; i < 5; i++) {
    sleep(1);
    puts("Does too");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<does_too>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1168 <does_too+0x48>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <does_too+0x1a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<does_too>:
push   %rbx
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Does too\00"
define noalias i8* @does_too(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @sleep(i32 1)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ drawCharacter(int /*<<< orphan*/, int, int, unsigned int);
void drawString(unsigned char *s, int x, int y, unsigned int color) {
  while (*s) {
    drawCharacter(*s++, x, y, color);
    x += 8;
  }
}


x86 assembly (clang, -O0):
<drawString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <drawString+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <drawCharacter@plt>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <drawString+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114f <drawString+0x3f>
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
add    $0x1,%rbp
nopl   0x0(%rax)
movzbl %al,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <drawCharacter@plt>
add    $0x8,%ebx
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    1130 <drawString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @drawString(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %15, %7 ], [ %5, %4 ]
%9 = phi i8* [ %11, %7 ], [ %0, %4 ]
%10 = phi i32 [ %14, %7 ], [ %1, %4 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = zext i8 %8 to i32
%13 = tail call i32 @drawCharacter(i32 %12, i32 %10, i32 %2, i32 %3)
%14 = add nsw i32 %10, 8
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %4
ret void
}
int leap(int year) {
  return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
}


x86 assembly (clang, -O0):
<leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <leap+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <leap+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <leap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <leap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void KSTK_EIP(void) { panic("KSTK_EIP"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"KSTK_EIP\00"
define void @KSTK_EIP() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct redfish_file {
  int dummy;
};

/* Variables and functions */
int redfish_close(struct redfish_file *);
int /*<<< orphan*/ redfish_free_file(struct redfish_file *);
int redfish_close_and_free(struct redfish_file *ofe) {
  int ret;
  ret = redfish_close(ofe);
  redfish_free_file(ofe);
  return ret;
}


x86 assembly (clang, -O0):
<redfish_close_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <redfish_close@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <redfish_free_file@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redfish_close_and_free>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <redfish_close@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <redfish_free_file@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.redfish_file = type { i32 }
define i32 @redfish_close_and_free(%struct.redfish_file* %0) {
%2 = alloca %struct.redfish_file*
%3 = alloca i32
store %struct.redfish_file* %0, %struct.redfish_file** %2
%4 = load %struct.redfish_file*, %struct.redfish_file** %2
%5 = call i32 @redfish_close(%struct.redfish_file* %4)
store i32 %5, i32* %3
%6 = load %struct.redfish_file*, %struct.redfish_file** %2
%7 = call i32 @redfish_free_file(%struct.redfish_file* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.redfish_file = type { i32 }
define i32 @redfish_close_and_free(%struct.redfish_file* %0) {
%2 = tail call i32 @redfish_close(%struct.redfish_file* %0)
%3 = tail call i32 @redfish_free_file(%struct.redfish_file* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isWRITE(const char *tok) { return strcmp(tok, "write") == 0; }


x86 assembly (clang, -O0):
<isWRITE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWRITE>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"write\00"
define i32 @isWRITE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define i32 @isWRITE(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
const unsigned long long clock_tic() {
  unsigned int a, d;
  asm volatile("rdtsc" : "=a"(a), "=d"(d));
  return ((unsigned long long)a) | (((unsigned long long)d) << 32);
}


x86 assembly (clang, -O0):
<clock_tic>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_tic>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @clock_tic() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @clock_tic() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
void genc_le_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_le_d() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ abortWithReadError(int /*<<< orphan*/ *const);
int getc(int /*<<< orphan*/ *const);
unsigned char getcNofail(FILE *const ifP) {
  int c;
  c = getc(ifP);
  if (c == EOF)
    abortWithReadError(ifP);
  return (unsigned char)c;
}


x86 assembly (clang, -O0):
<getcNofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
jne    1153 <getcNofail+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <abortWithReadError@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcNofail>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <getc@plt>
mov    %eax,%ebx
mov    0x2eb3(%rip),%rax
cmp    (%rax),%ebx
jne    1141 <getcNofail+0x21>
mov    %r14,%rdi
call   1030 <abortWithReadError@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define zeroext i8 @getcNofail(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = call i32 @abortWithReadError(i32* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define zeroext i8 @getcNofail(i32* %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @abortWithReadError(i32* %0)
br label %7
7: ; preds = %5, %1
%8 = trunc i32 %2 to i8
ret i8 %8
}
/* Type definitions */
typedef int int_least64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_int_least64_t(int_least64_t *const dest,
                                          int_least64_t const src) {
  return (((*dest) = src), true);
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_int_least64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_int_least64_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
void SPIFIFOEnable(unsigned long ulBase, unsigned long ulFlags) {
  (*((volatile unsigned long *)(ulBase + 0x0000012C))) |= ulFlags;
}


x86 assembly (clang, -O0):
<SPIFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x12c(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x12c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIFIFOEnable>:
or     %rsi,0x12c(%rdi)
ret

LLVM IR (-O0):
define void @SPIFIFOEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 300
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SPIFIFOEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 300
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
int test_imm_CCint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xCC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CCint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 204
%7 = icmp ne i64 %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_CCint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 876173328384
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("...hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"...hello world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"...hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void function_empty_desc() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_desc() {
ret void
}
void n_null_receivebuf(struct tty_struct *tty, const unsigned char *cp,
                       const char *fp, int cnt) {}


x86 assembly (clang, -O0):
<n_null_receivebuf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tty_struct = type opaque
define void @n_null_receivebuf(%struct.tty_struct* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.tty_struct*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.tty_struct* %0, %struct.tty_struct** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.tty_struct = type opaque
define void @n_null_receivebuf(%struct.tty_struct* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
void XCreateRegion() {}


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

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

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

LLVM IR (-O2):
define void @XCreateRegion() {
ret void
}
double f6(double x) { return (x + (-0.0)) - (-0.0); }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, -0.000000e+00
%5 = fsub double %4, -0.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f6(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
R0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (r0 <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     1139 <R0AX1+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <R0AX1+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0AX1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmp    %edi,0xa98ac7(,%rcx,4)
setge  %al
ret

LLVM IR (-O0):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %8
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %16
%18 = load i32, i32* %17
%19 = icmp sle i32 %14, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
double milliseconds_to_nanoseconds(double milliseconds) {
  return milliseconds * 1000000;
}


x86 assembly (clang, -O0):
<milliseconds_to_nanoseconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @milliseconds_to_nanoseconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @milliseconds_to_nanoseconds(double %0) {
%2 = fmul double %0, 1.000000e+06
ret double %2
}
void __svgalib_laguna_outgra(int index, int val) {}


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

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

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

LLVM IR (-O2):
define void @__svgalib_laguna_outgra(i32 %0, i32 %1) {
ret void
}
void test3(unsigned a) {
  while (1)
    ;
  if (a > 5) {
    return;
  }
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <test3+0x7>

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

LLVM IR (-O0):
define void @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @test3(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void main() {
  int a1 = 10;
  int a2 = 010;
  int a3 = 0x10;
  int a4 = 101u;
  int a5 = 102l;
  int a6 = 103ll;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
movl   $0x65,-0x10(%rbp)
movl   $0x66,-0x14(%rbp)
movl   $0x67,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 10, i32* %1
store i32 8, i32* %2
store i32 16, i32* %3
store i32 101, i32* %4
store i32 102, i32* %5
store i32 103, i32* %6
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int passivesock(char const *, char *, int /*<<< orphan*/);
int passiveUDP(const char *service) { return passivesock(service, "udp", 0); }


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

x86 assembly (clang, -O2):
<passiveUDP>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <passivesock@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"udp\00"
define i32 @passiveUDP(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @passivesock(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"udp\00"
define i32 @passiveUDP(i8* %0) {
%2 = tail call i32 @passivesock(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %2
}
int countingNumberofOneswithTogglingApproach(unsigned int n) {
  int count = 0;
  while (n) {
    n = n & (n - 1);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countingNumberofOneswithTogglingApproach>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <countingNumberofOneswithTogglingApproach+0x34>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <countingNumberofOneswithTogglingApproach+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countingNumberofOneswithTogglingApproach>:
xor    %eax,%eax
test   %edi,%edi
je     111c <countingNumberofOneswithTogglingApproach+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <countingNumberofOneswithTogglingApproach+0x10>
ret

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

LLVM IR (-O2):
define i32 @countingNumberofOneswithTogglingApproach(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int putchar(int);
int alt_putchar(int c) { return putchar(c); }


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

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

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

LLVM IR (-O2):
define i32 @alt_putchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
__attribute__((no, noclone)) signed __int128 t104_2sub(signed __int128 y) {
  signed __int128 x = (0);
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t104_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t104_2sub+0x5e>
jmp    1175 <t104_2sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t104_2sub>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
neg    %rbx
sbb    %rsi,%r14
jno    1129 <t104_2sub+0x19>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t104_2sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t104_2sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 0, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
double FPS_TO_MS(int fps) { return (double)1000 / fps; }


x86 assembly (clang, -O0):
<FPS_TO_MS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPS_TO_MS>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @FPS_TO_MS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double 1.000000e+03, %4
ret double %5
}

LLVM IR (-O2):
define double @FPS_TO_MS(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double 1.000000e+03, %2
ret double %3
}
int dot_offset(int x, int y, int width) { return y * width + x; }


x86 assembly (clang, -O0):
<dot_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_offset>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @dot_offset(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bench_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @bench_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double pair_tailcorr_cut_eislater1sp1spcorr(void *pair_data, long center_index,
                                            long other_index, double rcut) {
  double t1 = 0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_cut_eislater1sp1spcorr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_cut_eislater1sp1spcorr>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_cut_eislater1sp1spcorr(i8* %0, i64 %1, i64 %2, double %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
%9 = alloca double
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @pair_tailcorr_cut_eislater1sp1spcorr(i8* nocapture readnone %0, i64 %1, i64 %2, double %3) {
ret double 0.000000e+00
}
long goodm(long n, long h, long l) {
  return ((h - l) * n) / (h * h - l * n) + 1;
}


x86 assembly (clang, -O0):
<goodm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
imul   -0x8(%rbp),%rdx
sub    %rdx,%rcx
cqto
idiv   %rcx
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<goodm>:
mov    %rsi,%rax
sub    %rdx,%rax
imul   %rdi,%rax
imul   %rsi,%rsi
imul   %rdi,%rdx
sub    %rdx,%rsi
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     112b <goodm+0x2b>
cqto
idiv   %rsi
add    $0x1,%rax
ret
xor    %edx,%edx
div    %esi
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @goodm(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = sub nsw i64 %7, %8
%10 = load i64, i64* %4
%11 = mul nsw i64 %9, %10
%12 = load i64, i64* %5
%13 = load i64, i64* %5
%14 = mul nsw i64 %12, %13
%15 = load i64, i64* %6
%16 = load i64, i64* %4
%17 = mul nsw i64 %15, %16
%18 = sub nsw i64 %14, %17
%19 = sdiv i64 %11, %18
%20 = add nsw i64 %19, 1
ret i64 %20
}

LLVM IR (-O2):
define i64 @goodm(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %1, %2
%5 = mul nsw i64 %4, %0
%6 = mul nsw i64 %1, %1
%7 = mul nsw i64 %2, %0
%8 = sub nsw i64 %6, %7
%9 = sdiv i64 %5, %8
%10 = add nsw i64 %9, 1
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cnt_deque_freemem(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cnt_deque_freemem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
long smileMath_roundToNextPowOf2(long);
long smileMath_ceilToNextPowOf2(long x) {
  long y = smileMath_roundToNextPowOf2(x);
  if (y < x)
    y *= 2;
  return y;
}


x86 assembly (clang, -O0):
<smileMath_ceilToNextPowOf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <smileMath_roundToNextPowOf2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1143 <smileMath_ceilToNextPowOf2+0x33>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smileMath_ceilToNextPowOf2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <smileMath_roundToNextPowOf2@plt>
cmp    %rbx,%rax
setl   %cl
shl    %cl,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @smileMath_ceilToNextPowOf2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @smileMath_roundToNextPowOf2(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, 2
store i64 %11, i64* %3
br label %12
12: ; preds = %9, %1
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @smileMath_ceilToNextPowOf2(i64 %0) {
%2 = tail call i64 @smileMath_roundToNextPowOf2(i64 %0)
%3 = icmp slt i64 %2, %0
%4 = zext i1 %3 to i64
%5 = shl nsw i64 %2, %4
ret i64 %5
}
const char *skip_spaces(const char *buffer) {
  const char *ret = buffer;
  while (*ret == ' ' || *ret == '\t')
    ++ret;
  return ret;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1135 <skip_spaces+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <skip_spaces+0x45>
jmp    1156 <skip_spaces+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <skip_spaces+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
mov    %rdi,%rax
jmp    1114 <skip_spaces+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_spaces+0x10>
cmp    $0x9,%cl
je     1110 <skip_spaces+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void test_teardown() {}


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

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

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

LLVM IR (-O2):
define void @test_teardown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: mt [-f device] command [count]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [39 x i8] c"usage: mt [-f device] command [count]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: mt [-f device] command [count]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void _pre_call_callback_default(const char *name, void *funcptr, int len_args,
                                ...) {
  (void)name;
  (void)funcptr;
  (void)len_args;
}


x86 assembly (clang, -O0):
<_pre_call_callback_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_pre_call_callback_default(i8* %0, i8* %1, i32 %2, ...) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @_pre_call_callback_default(i8* nocapture %0, i8* nocapture %1, i32 %2, ...) {
ret void
}
BOOST_AUTO_TEST_CASE(coth) {}


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

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

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

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int generic_proc_open(char *, char *);
int net_netstat_open(void) {
  return generic_proc_open("PROC_NET_NETSTAT", "net/netstat");
}


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

x86 assembly (clang, -O2):
<net_netstat_open>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <generic_proc_open@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"PROC_NET_NETSTAT\00"
@.str.1 = [12 x i8] c"net/netstat\00"
define i32 @net_netstat_open() {
%1 = call i32 @generic_proc_open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [17 x i8] c"PROC_NET_NETSTAT\00"
@.str.1 = [12 x i8] c"net/netstat\00"
define i32 @net_netstat_open() {
%1 = tail call i32 @generic_proc_open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
double df(double x) { return 2 * x - 7; }


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

x86 assembly (clang, -O2):
<df>:
addsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @df(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %3, double -7.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @df(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -7.000000e+00)
ret double %2
}
/* Variables and functions */
void *Cyc_BansheeIf_internal_equality_constraint(void *, void *,
                                                 int /*<<< orphan*/);
void *Cyc_BansheeIf_equality_constraint(void *t1, void *t2) {
  void *_T0;
  _T0 = Cyc_BansheeIf_internal_equality_constraint(t1, t2, 0);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_BansheeIf_equality_constraint>:
xor    %edx,%edx
jmp    1030 <Cyc_BansheeIf_internal_equality_constraint@plt>

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

LLVM IR (-O2):
define i8* @Cyc_BansheeIf_equality_constraint(i8* %0, i8* %1) {
%3 = tail call i8* @Cyc_BansheeIf_internal_equality_constraint(i8* %0, i8* %1, i32 0)
ret i8* %3
}
main() {
  static void *p = &&L;
  goto *p;
L:
  return f();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2f02(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    113c <main+0x2c>
mov    $0x0,%al
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
@main.p = internal global i8* blockaddress(@main, %3)
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8*, i8** @main.p
br label %5
3: ; preds = %5
%4 = call i32 (...) @f()
ret i32 %4
5: ; preds = %0
%6 = phi i8* [ %2, %0 ]
indirectbr i8* %6, [label %3]
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
int ol_backend_kelvin_neilb_init(struct ol_backend_kelvin_s *self) {
  (void)(self);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ol_backend_kelvin_s = type opaque
define i32 @ol_backend_kelvin_neilb_init(%struct.ol_backend_kelvin_s* %0) {
%2 = alloca %struct.ol_backend_kelvin_s*
store %struct.ol_backend_kelvin_s* %0, %struct.ol_backend_kelvin_s** %2
%3 = load %struct.ol_backend_kelvin_s*, %struct.ol_backend_kelvin_s** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ol_backend_kelvin_s = type opaque
define i32 @ol_backend_kelvin_neilb_init(%struct.ol_backend_kelvin_s* nocapture readnone %0) {
ret i32 0
}