xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M540_f(char *s) {
  debug("M540_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M540_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M540_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M540_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M540_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M540_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M540_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int in_byte(int);
int serial_received() { return in_byte((0x3F8 + 5)) & 1; }


x86 assembly (clang, -O0):
<serial_received>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fd,%edi
call   1030 <in_byte@plt>
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_received>:
push   %rax
mov    $0x3fd,%edi
call   1030 <in_byte@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_received() {
%1 = call i32 @in_byte(i32 1021)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @serial_received() {
%1 = tail call i32 @in_byte(i32 1021)
%2 = and i32 %1, 1
ret i32 %2
}
void destroy_mcs(struct mcs *l) {}


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

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

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

LLVM IR (-O2):
%struct.mcs = type opaque
define void @destroy_mcs(%struct.mcs* nocapture %0) {
ret void
}
const char *COM_SkipPath(const char *pathname) {
  const char *last;
  last = pathname;
  while (*pathname) {
    if (*pathname == '/' || *pathname == '\\')
      last = pathname + 1;
    pathname++;
  }
  return last;
}


x86 assembly (clang, -O0):
<COM_SkipPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <COM_SkipPath+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113d <COM_SkipPath+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1149 <COM_SkipPath+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <COM_SkipPath+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_SkipPath>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <COM_SkipPath+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <COM_SkipPath+0x10>
cmp    $0x5c,%dl
je     1110 <COM_SkipPath+0x10>
test   %dl,%dl
jne    1113 <COM_SkipPath+0x13>
ret

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

LLVM IR (-O2):
define i8* @COM_SkipPath(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
void g_DUMMY_menu_destroy_menubar2_children(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_menu_destroy_menubar2_children(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PCA9685Sleep();
int /*<<< orphan*/ usleep(int);
void pwmSleep() {
  PCA9685Sleep();
  usleep(1000);
}


x86 assembly (clang, -O0):
<pwmSleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PCA9685Sleep@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmSleep>:
push   %rax
xor    %eax,%eax
call   1030 <PCA9685Sleep@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @pwmSleep() {
%1 = call i32 (...) @PCA9685Sleep()
%2 = call i32 @usleep(i32 1000)
ret void
}

LLVM IR (-O2):
define void @pwmSleep() {
%1 = tail call i32 (...) @PCA9685Sleep()
%2 = tail call i32 @usleep(i32 1000)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
count2() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%d\n", nl);
}


x86 assembly (clang, -O0):
<count2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <count2+0x40>
cmpl   $0xa,-0x8(%rbp)
jne    115b <count2+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <count2+0xf>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count2>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <count2+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <count2+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @count2() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 undef
}
int pipe(int fd[2]) { return __syscall(22, fd); }


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

x86 assembly (clang, -O2):
<pipe>:
mov    %rdi,%rsi
mov    $0x16,%edi
xor    %eax,%eax
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @pipe(i32* %0) {
%2 = tail call i32 (i32, i32*, ...) bitcast (i32 (...)* @__syscall to i32 (i32, i32*, ...)*)(i32 22, i32* %0)
ret i32 %2
}
void ASN1_UNIVERSALSTRING_to_string(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_UNIVERSALSTRING_to_string() {
ret void
}
AX0AX1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (((char *)10000000)[x0]) = (((char *)11111111)[x1]); }


x86 assembly (clang, -O0):
<AX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,1),%dl
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AX1>:
movslq %ecx,%rax
mov    0xa98ac7(%rax),%al
movslq %edx,%rcx
mov    %al,0x989680(%rcx)
ret

LLVM IR (-O0):
define i32 @AX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %17
%19 = load i8, i8* %18
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %21
store i8 %19, i8* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @AX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %10
store i8 %9, i8* %11
ret i32 undef
}
/* Variables and functions */
char *my_strcat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str1[16] = "hello";
  char str2[16] = "123456789012345";
  printf("strings combined: %s\n", my_strcat(str1, str2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <my_strcat@plt>
mov    %rax,%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <my_strcat@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [16 x i8] c"hello\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.str2 = [16 x i8] c"123456789012345\00"
@.str = [22 x i8] c"strings combined: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %2 to i8*
%5 = bitcast [16 x i8]* %3 to i8*
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i8* @my_strcat(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [16 x i8] c"hello\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.str2 = [16 x i8] c"123456789012345\00"
@.str = [22 x i8] c"strings combined: %s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i8* @my_strcat(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello, Little Endian !\n");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [24 x i8] c"Hello, Little Endian !\0A\00"
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 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Hello, Little Endian !\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_set_pi8(char, char, char, char, char, char, char, char);
__m64 test_mm_set_pi8(char a, char b, char c, char d, char e, char f, char g,
                      char h) {
  return _mm_set_pi8(a, b, c, d, e, f, g, h);
}


x86 assembly (clang, -O0):
<test_mm_set_pi8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x18(%rbp)
mov    %ecx,%eax
mov    -0x18(%rbp),%ecx
mov    %eax,-0x14(%rbp)
mov    %edx,%eax
mov    -0x14(%rbp),%edx
mov    %eax,-0x10(%rbp)
mov    %esi,%eax
mov    -0x10(%rbp),%esi
mov    %eax,-0xc(%rbp)
mov    %edi,%r8d
mov    -0xc(%rbp),%edi
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8b,-0x1(%rbp)
mov    %dil,-0x2(%rbp)
mov    %sil,-0x3(%rbp)
mov    %dl,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x1(%rbp),%dil
mov    -0x2(%rbp),%sil
mov    -0x3(%rbp),%dl
mov    -0x4(%rbp),%cl
mov    -0x5(%rbp),%r8b
mov    -0x6(%rbp),%r9b
mov    0x10(%rbp),%al
movsbl %dil,%edi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <_mm_set_pi8@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_mm_set_pi8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
store i8 %0, i8* %9
store i8 %1, i8* %10
store i8 %2, i8* %11
store i8 %3, i8* %12
store i8 %4, i8* %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
%17 = load i8, i8* %9
%18 = load i8, i8* %10
%19 = load i8, i8* %11
%20 = load i8, i8* %12
%21 = load i8, i8* %13
%22 = load i8, i8* %14
%23 = load i8, i8* %15
%24 = load i8, i8* %16
%25 = call i32 @_mm_set_pi8(i8 signext %17, i8 signext %18, i8 signext %19, i8 signext %20, i8 signext %21, i8 signext %22, i8 signext %23, i8 signext %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_mm_set_pi8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = tail call i32 @_mm_set_pi8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7)
ret i32 %9
}
int getch(void) {}


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

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

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

LLVM IR (-O2):
define i32 @getch() {
ret i32 undef
}
void Cmd_Video() {}


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

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

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

LLVM IR (-O2):
define void @Cmd_Video() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_inc(char *str) { sprintf(str, "INC   A                         "); }


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

x86 assembly (clang, -O2):
<sprint_inc>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"INC A \00"
define void @sprint_inc(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
int omap_dsp_request_mem(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_dsp_request_mem() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int test(void const *ptr) {
  if (!ptr) {
    assert(ptr == 0);
    int f = 7;
  } else {
    assert(ptr == 1);
    assert(ptr != 0);
    int f = 38;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <test+0x35>
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x7,-0x14(%rbp)
jmp    1174 <test+0x64>
mov    $0x1,%eax
cmp    %rax,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x26,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %rdi,%rdi
je     112a <test+0x1a>
push   %rax
xor    %eax,%eax
cmp    $0x1,%rdi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
mov    $0x1,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @test(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = icmp eq i8* %0, inttoptr (i64 1 to i8*)
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
br label %7
7: ; preds = %1, %3
%8 = tail call i32 @assert(i32 1)
ret i32 undef
}
/* Variables and functions */
int os_setenv(const char *name, const char *value, int overwrite) { return -1; }


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

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

LLVM IR (-O0):
define i32 @os_setenv(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @os_setenv(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
int test_imm_5Fint16_mem(short *val) {
  return ((*val) & (-0x5F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Fint16_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, -95
%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_5Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -95
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strchr(char *, char);
void split(char c, char *string, char **resto) {
  char *pos = strchr(string, c);
  if (pos == NULL) {
    *resto = strchr(string, '\0');
  } else {
    *pos++ = '\0';
    *resto = pos;
  }
}


x86 assembly (clang, -O0):
<split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115c <split+0x4c>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1179 <split+0x69>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rbx,%rdi
call   1040 <strchr@plt>
test   %rax,%rax
je     1145 <split+0x25>
mov    %rax,%rcx
add    $0x1,%rax
movb   $0x0,(%rcx)
jmp    1150 <split+0x30>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @split(i8 signext %0, i8* %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %1, i8 signext %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = getelementptr i8, i8* %1, i64 %7
br label %11
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %4
br label %11
11: ; preds = %9, %6
%12 = phi i8* [ %10, %9 ], [ %8, %6 ]
store i8* %12, i8** %2
ret void
}
int execute_setrlimit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setrlimit() {
ret i32 0
}
void RTLinuxSysFsReadIntFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxSysFsReadIntFile() {
ret void
}
int getbit(unsigned char *data, int n) {
  return (data[n / 8] & (1 << (7 - n % 8))) ? 1 : 0;
}


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x10(%rbp),%edx
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %ecx,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0xfffffff8,%ecx
sub    %ecx,%esi
mov    $0x7,%cl
sub    %sil,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getbit(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 = srem i32 %1, 8
%9 = sub nsw i32 7, %8
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int object_init(void *self) {
  assert(self);
  return 1;
}


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

x86 assembly (clang, -O2):
<object_init>:
push   %rax
call   1030 <assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @object_init(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
ret i32 1
}
void NCONF_load_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_load_fp() {
ret void
}
int is_lt(long a, long b) { return a < b; }


x86 assembly (clang, -O0):
<is_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lt>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @is_lt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_lt(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int f4() {
  static const int g4 = 12;
  return g4;
}


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

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

LLVM IR (-O0):
@f4.g4 = internal constant i32 12
define i32 @f4() {
ret i32 12
}

LLVM IR (-O2):
define i32 @f4() {
ret i32 12
}
/* Variables and functions */
int partition(char *, int, int);
void quickSort(char A[], int si, int ei) {
  int pi;
  if (si < ei) {
    pi = partition(A, si, ei);
    quickSort(A, si, pi - 1);
    quickSort(A, pi + 1, ei);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i8* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i8* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i8* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ rand_word();
double rand_uniform(void) {
  return (double)rand_word() / (1.0 + (double)0x7fffffff);
}


x86 assembly (clang, -O0):
<rand_uniform>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand_word@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniform>:
push   %rax
xor    %eax,%eax
call   1030 <rand_word@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_uniform() {
%1 = call i64 (...) @rand_word()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41E0000000000000
ret double %3
}

LLVM IR (-O2):
define double @rand_uniform() {
%1 = tail call i64 (...) @rand_word()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3E00000000000000
ret double %3
}
void foo(unsigned long a, unsigned long b) { *((int **)a) = (int *)b; }


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

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

LLVM IR (-O0):
define void @foo(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 = inttoptr i64 %5 to i32*
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i32**
store i32* %6, i32** %8
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0, i64 %1) {
%3 = inttoptr i64 %1 to i32*
%4 = inttoptr i64 %0 to i32**
store i32* %3, i32** %4
ret void
}
/* Variables and functions */
int find_file_size(char *);
double compute_bitrate_for_video(char *video_filename, int nr_frames,
                                 double fps) {
  double time_duration = (double)nr_frames / fps;
  double file_size = 8 * find_file_size(video_filename);
  double bit_rate = file_size / time_duration / (double)1000000;
  return bit_rate;
}


x86 assembly (clang, -O0):
<compute_bitrate_for_video>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_file_size@plt>
shl    $0x3,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_bitrate_for_video>:
push   %rax
cvtsi2sd %esi,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <find_file_size@plt>
shl    $0x3,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  (%rsp),%xmm0
divsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @compute_bitrate_for_video(i8* %0, i32 %1, double %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i8* %0, i8** %4
store i32 %1, i32* %5
store double %2, double* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fdiv double %11, %12
store double %13, double* %7
%14 = load i8*, i8** %4
%15 = call i32 @find_file_size(i8* %14)
%16 = mul nsw i32 8, %15
%17 = sitofp i32 %16 to double
store double %17, double* %8
%18 = load double, double* %8
%19 = load double, double* %7
%20 = fdiv double %18, %19
%21 = fdiv double %20, 1.000000e+06
store double %21, double* %9
%22 = load double, double* %9
ret double %22
}

LLVM IR (-O2):
define double @compute_bitrate_for_video(i8* %0, i32 %1, double %2) {
%4 = sitofp i32 %1 to double
%5 = fdiv double %4, %2
%6 = tail call i32 @find_file_size(i8* %0)
%7 = shl nsw i32 %6, 3
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, %5
%10 = fdiv double %9, 1.000000e+06
ret double %10
}
int test_imm_E2uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E2uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -226
%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_E2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 30
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float convert_adc_current(float adc_volts) { return adc_volts * 10.; }


x86 assembly (clang, -O0):
<convert_adc_current>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @convert_adc_current(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 1.000000e+01
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @convert_adc_current(float %0) {
%2 = fmul float %0, 1.000000e+01
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "simple_d [inputfile [outputfile]]\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 = [35 x i8] c"simple_d [inputfile [outputfile]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"simple_d [inputfile [outputfile]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_bi_w_pel_pixels24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels24_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned long);
void mov_m32_reg32(void *_m32, unsigned long reg32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x89);
  put8((reg32 << 3) | 5);
  put32((unsigned long)(m32));
}


x86 assembly (clang, -O0):
<mov_m32_reg32>:
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    $0x89,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
shl    $0x3,%rdi
or     $0x5,%rdi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_m32_reg32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x89,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%rdi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_m32_reg32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i64 137)
%9 = load i64, i64* %4
%10 = shl i64 %9, 3
%11 = or i64 %10, 5
%12 = call i32 @put8(i64 %11)
%13 = load i64*, i64** %5
%14 = ptrtoint i64* %13 to i64
%15 = call i32 @put32(i64 %14)
ret void
}

LLVM IR (-O2):
define void @mov_m32_reg32(i8* %0, i64 %1) {
%3 = tail call i32 @put8(i64 137)
%4 = shl i64 %1, 3
%5 = or i64 %4, 5
%6 = tail call i32 @put8(i64 %5)
%7 = ptrtoint i8* %0 to i64
%8 = tail call i32 @put32(i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printstr(void *handle, const char str[]) { printf("%s", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printstr(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int main() {
  union {
    unsigned char ch;
    struct {
      unsigned char bf1 : 4, bf2 : 4;
    } bf;
  } u;
  u.ch = 0x12;
  return (u.bf.bf1 == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x12,-0x8(%rbp)
mov    -0x8(%rbp),%al
and    $0xf,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i8 }
%struct.anon = type { i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to i8*
store i8 18, i8* %3
%4 = bitcast %union.anon* %2 to %struct.anon*
%5 = bitcast %struct.anon* %4 to i8*
%6 = load i8, i8* %5
%7 = and i8 %6, 15
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
ret i32 %10
}

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

/* Variables and functions */
int fwrite(unsigned long *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void store_fucks(FILE *fp, unsigned long *fucks) {
  rewind(fp);
  if (fwrite(fucks, sizeof(*fucks), 1, fp) != 1) {
    printf("writing error\n");
    return;
  }
}


x86 assembly (clang, -O0):
<store_fucks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
je     1175 <store_fucks+0x45>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_fucks>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <rewind@plt>
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
jne    1161 <store_fucks+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe98(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [14 x i8] c"writing error\00"
define void @store_fucks(i32* nocapture %0, i64* nocapture %1) {
%3 = tail call i32 @rewind(i32* %0)
%4 = tail call i32 @fwrite(i64* %1, i32 8, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_deleteLatestElement(struct List *);
void lifo_pop(struct List *list) { list_deleteLatestElement(list); }


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

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

LLVM IR (-O0):
%struct.List = type { i32 }
define void @lifo_pop(%struct.List* %0) {
%2 = alloca %struct.List*
store %struct.List* %0, %struct.List** %2
%3 = load %struct.List*, %struct.List** %2
%4 = call i32 @list_deleteLatestElement(%struct.List* %3)
ret void
}

LLVM IR (-O2):
%struct.List = type { i32 }
define void @lifo_pop(%struct.List* %0) {
%2 = tail call i32 @list_deleteLatestElement(%struct.List* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *abac_xmalloc(size_t size) {
  void *ret;
  ret = malloc(size);
  if (ret == NULL)
    err(1, "malloc");
  return ret;
}


x86 assembly (clang, -O0):
<abac_xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <abac_xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abac_xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <abac_xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @abac_xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}