xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void FreeBMGMemory(unsigned char *mem) {
  if (mem != NULL)
    free(mem);
}


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

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

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

LLVM IR (-O2):
define void @FreeBMGMemory(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void g_source_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_source_remove() {
ret void
}
const char *dclass_get_version() { return "dClass 2.2.0"; }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"dClass 2.2.0\00"
define i8* @dclass_get_version() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int floatcomptest(double *X, double *Y, float *x, float *y) {
  return *X < *Y || *x < *y;
}


x86 assembly (clang, -O0):
<floatcomptest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
ja     114c <floatcomptest+0x4c>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatcomptest>:
movsd  (%rsi),%xmm0
mov    $0x1,%eax
ucomisd (%rdi),%xmm0
ja     111b <floatcomptest+0x1b>
movss  (%rcx),%xmm0
xor    %eax,%eax
ucomiss (%rdx),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @floatcomptest(double* %0, double* %1, float* %2, float* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca float*
%8 = alloca float*
store double* %0, double** %5
store double* %1, double** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = fcmp olt double %10, %12
br i1 %13, label %20, label %14
14: ; preds = %4
%15 = load float*, float** %7
%16 = load float, float* %15
%17 = load float*, float** %8
%18 = load float, float* %17
%19 = fcmp olt float %16, %18
br label %20
20: ; preds = %14, %4
%21 = phi i1 [ true, %4 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @floatcomptest(double* nocapture %0, double* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = fcmp olt double %5, %6
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fcmp olt float %9, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %4
%14 = phi i32 [ 1, %4 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int bit_test(unsigned int test, int n);
  unsigned int bit_set(unsigned int test, int n);
  unsigned int word1 = 0xffffff0fu;
  printf("%i\n", bit_test(word1, 23));
  printf("%x\n", bit_set(word1, 24));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff0f,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x17,%esi
call   1050 <bit_test@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x18,%esi
call   1040 <bit_set@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffff0f,%edi
mov    $0x17,%esi
call   1050 <bit_test@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffff0f,%edi
mov    $0x18,%esi
call   1040 <bit_set@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -241, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bit_test(i32 %3, i32 23)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @bit_set(i32 %6, i32 24)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @bit_test(i32 -241, i32 23)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @bit_set(i32 -241, i32 24)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
void gtk_toolbar_set_drop_highlight_item() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_set_drop_highlight_item() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CopyString(char const *, int, char *, int);
int /*<<< orphan*/ DymosimMessageSeverity(int, char *);
void dymosimmessageSev_(int severity, const char message[], int lstr) {
  char textline[200];
  CopyString(message, lstr, textline, 200);
  DymosimMessageSeverity(severity, textline);
}


x86 assembly (clang, -O0):
<dymosimmessageSev_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0xe0(%rbp),%rdx
mov    $0xc8,%ecx
call   1030 <CopyString@plt>
mov    -0x4(%rbp),%edi
lea    -0xe0(%rbp),%rsi
call   1040 <DymosimMessageSeverity@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dymosimmessageSev_>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %edx,%esi
mov    %r14,%rdx
mov    $0xc8,%ecx
call   1030 <CopyString@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <DymosimMessageSeverity@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @dymosimmessageSev_(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [200 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%11 = call i32 @CopyString(i8* %8, i32 %9, i8* %10, i32 200)
%12 = load i32, i32* %4
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%14 = call i32 @DymosimMessageSeverity(i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @dymosimmessageSev_(i32 %0, i8* %1, i32 %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @CopyString(i8* %1, i32 %2, i8* %5, i32 200)
%7 = call i32 @DymosimMessageSeverity(i32 %0, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int socket(int, int, int);
int sk_socket(int domain, int type, int protocol) {
  int sfd = socket(domain, type, protocol);
  if (sfd == -1) {
    perror("socket()");
    return -1;
  }
  return sfd;
}


x86 assembly (clang, -O0):
<sk_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1164 <sk_socket+0x44>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <sk_socket+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <sk_socket+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1030 <perror@plt>
jmp    112d <sk_socket+0xd>

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

LLVM IR (-O2):
@.str = [9 x i8] c"socket()\00"
define i32 @sk_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
ret i32 %4
}
int isPowerOfTwo(unsigned int x) { return (x && !(x & (x - 1))); }


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <isPowerOfTwo+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %edi,%edi
je     110f <isPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
long fread(unsigned char *, int, long, void *);
long dumb_stdfile_getnc(unsigned char *ptr, long n, void *f) {
  return fread(ptr, 1, n, f);
}


x86 assembly (clang, -O0):
<dumb_stdfile_getnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumb_stdfile_getnc>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @dumb_stdfile_getnc(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i64 @fread(i8* %0, i32 1, i64 %1, i8* %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
int file_exists(const char *fpath) {
  if (access(fpath, F_OK) != -1) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1143 <file_exists+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <file_exists+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int game_print_menu(int roomNumber) {
  if (roomNumber == 0) {
    printf("\nyou may now go forward or backward\n");
  } else {
    printf("\n You may now go forward, backward, left, or right\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<game_print_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <game_print_menu+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <game_print_menu+0x32>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_print_menu>:
push   %rax
test   %edi,%edi
lea    0xf19(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0Ayou may now go forward or backward\0A\00"
@.str.1 = [52 x i8] c"\0A You may now go forward, backward, left, or right\0A\00"
define i32 @game_print_menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [51 x i8] c"\0A You may now go forward, backward, left, or right\00"
@str.2 = [36 x i8] c"\0Ayou may now go forward or backward\00"
define i32 @game_print_menu(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
int test_imm_07int8_reg(signed char val) {
  return ((val) & (-0x07 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_07int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xfffffff9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_07int8_reg(i8 signext %0) {
%2 = and i8 %0, -7
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void show_exponential_vector(double *v, int h) {
  int k = 0;
  for (k = 0; k < h; k++) {
    printf("%.10e \n", v[k]);
  }
}


x86 assembly (clang, -O0):
<show_exponential_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <show_exponential_vector+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <show_exponential_vector+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%.10e \0A\00"
define void @show_exponential_vector(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void ff_hevc_put_hevc_qpel_v4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v4_12_sse4() {
ret void
}
int test_imm_5Fint16_reg(short val) {
  return ((val) & (0x5F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x5f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Fint16_reg(i16 signext %0) {
%2 = and i16 %0, 95
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int subtract_func(int, int /*<<< orphan*/, int, int, int /*<<< orphan*/);
int neg_func(int src, int dest, int is_word) {
  (void)src;
  return subtract_func(dest, 0, is_word, 1, 0);
}


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

x86 assembly (clang, -O2):
<neg_func>:
mov    %esi,%edi
xor    %esi,%esi
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <subtract_func@plt>

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

LLVM IR (-O2):
define i32 @neg_func(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @subtract_func(i32 %1, i32 0, i32 %2, i32 1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Stream1_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Stream1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Stream1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t raw_get_pos(void *id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raw_get_pos(i8* nocapture readnone %0) {
ret i32 0
}
char test_74_0(char *mem) { return __atomic_fetch_nand(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_74_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test_74_0+0x4f>
jmp    111f <test_74_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_74_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_74_0+0x10>
ret

LLVM IR (-O0):
define signext i8 @test_74_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw nand i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_74_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 -1 acq_rel
ret i8 %2
}
unsigned char writeBit(unsigned char data, int value, int positionBit) {
  if (value == 1)
    data |= 1 << positionBit;
  else
    data &= ~(1 << positionBit);
  return data;
}


x86 assembly (clang, -O0):
<writeBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1134 <writeBit+0x34>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x1(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    114c <writeBit+0x4c>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
movzbl -0x1(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBit>:
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
or     %dil,%cl
not    %al
and    %dil,%al
cmp    $0x1,%esi
movzbl %cl,%ecx
movzbl %al,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @writeBit(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = or i32 %13, %11
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
br label %24
16: ; preds = %3
%17 = load i32, i32* %6
%18 = shl i32 1, %17
%19 = xor i32 %18, -1
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = and i32 %21, %19
%23 = trunc i32 %22 to i8
store i8 %23, i8* %4
br label %24
24: ; preds = %16, %9
%25 = load i8, i8* %4
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @writeBit(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 1
%5 = shl nuw i32 1, %2
%6 = trunc i32 %5 to i8
%7 = or i8 %6, %0
%8 = xor i8 %6, -1
%9 = and i8 %8, %0
%10 = select i1 %4, i8 %7, i8 %9
ret i8 %10
}
/* Variables and functions */
int get_group_column_index(int, int);
int min(int, int);
int get_current_group_right_bound(int row_index, int column_index,
                                  int group_size, int sequence_length) {
  int group_column_index = get_group_column_index(column_index, group_size);
  int right_bound = (group_column_index * group_size) + (group_size - 1);
  return min(right_bound, sequence_length - 1);
}


x86 assembly (clang, -O0):
<get_current_group_right_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <get_group_column_index@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <min@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_group_right_bound>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1040 <get_group_column_index@plt>
imul   %ebx,%eax
lea    (%rbx,%rax,1),%edi
add    $0xffffffff,%edi
add    $0xffffffff,%ebp
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @get_current_group_right_bound(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @get_group_column_index(i32 %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 1
%19 = add nsw i32 %16, %18
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = load i32, i32* %8
%22 = sub nsw i32 %21, 1
%23 = call i32 @min(i32 %20, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_current_group_right_bound(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @get_group_column_index(i32 %1, i32 %2)
%6 = mul nsw i32 %5, %2
%7 = add nsw i32 %2, -1
%8 = add nsw i32 %7, %6
%9 = add nsw i32 %3, -1
%10 = tail call i32 @min(i32 %8, i32 %9)
ret i32 %10
}
/* Type definitions */
typedef unsigned int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
unsigned int fnv_64a_buf(char const *, int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ strlen(char const *);
uint32_t sd_hash_vdi(const char *name) {
  uint64_t hval =
      fnv_64a_buf(name, strlen(name), ((uint64_t)0xcbf29ce484222325ULL));
  return (uint32_t)(hval & ((1U << 24) - 1));
}


x86 assembly (clang, -O0):
<sd_hash_vdi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x84222325,%edx
call   1040 <fnv_64a_buf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_hash_vdi>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x84222325,%edx
call   1040 <fnv_64a_buf@plt>
and    $0xffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sd_hash_vdi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @fnv_64a_buf(i8* %4, i32 %6, i32 -2078137563)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 16777215
ret i32 %9
}

LLVM IR (-O2):
define i32 @sd_hash_vdi(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @fnv_64a_buf(i8* %0, i32 %2, i32 -2078137563)
%4 = and i32 %3, 16777215
ret i32 %4
}
void RTVfsObjToSymlink(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsObjToSymlink() {
ret void
}
int countcards(hand) const int *hand;
{
  int i, count;
  for (count = i = 0; i < 13; i++)
    count += *hand++;
  return (count);
}


x86 assembly (clang, -O0):
<countcards>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xd,-0xc(%rbp)
jge    1145 <countcards+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <countcards+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countcards>:
movdqu 0x4(%rdi),%xmm0
movdqu 0x14(%rdi),%xmm1
movdqu 0x24(%rdi),%xmm2
paddd  %xmm1,%xmm2
pshufd $0xee,%xmm2,%xmm1
paddd  %xmm2,%xmm1
pshufd $0x55,%xmm1,%xmm2
paddd  %xmm1,%xmm2
movd   %xmm2,%ecx
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    %ecx,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @countcards(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %0
%4 = bitcast i32* %2 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = bitcast i32* %6 to <8 x i32>*
%8 = load <8 x i32>, <8 x i32>* %7
%9 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %8)
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%11 = add nsw i32 %9, %10
%12 = add nsw i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ init_enable_usb();
int /*<<< orphan*/ init_ep0();
int /*<<< orphan*/ init_reset_usb();
int /*<<< orphan*/ init_usbctl0();
void init_usb() {
  init_reset_usb();
  init_ep0();
  init_usbctl0();
  init_enable_usb();
}


x86 assembly (clang, -O0):
<init_usb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_reset_usb@plt>
mov    $0x0,%al
call   1050 <init_ep0@plt>
mov    $0x0,%al
call   1060 <init_usbctl0@plt>
mov    $0x0,%al
call   1040 <init_enable_usb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_usb>:
push   %rax
xor    %eax,%eax
call   1030 <init_reset_usb@plt>
xor    %eax,%eax
call   1050 <init_ep0@plt>
xor    %eax,%eax
call   1060 <init_usbctl0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_enable_usb@plt>

LLVM IR (-O0):
define void @init_usb() {
%1 = call i32 (...) @init_reset_usb()
%2 = call i32 (...) @init_ep0()
%3 = call i32 (...) @init_usbctl0()
%4 = call i32 (...) @init_enable_usb()
ret void
}

LLVM IR (-O2):
define void @init_usb() {
%1 = tail call i32 (...) @init_reset_usb()
%2 = tail call i32 (...) @init_ep0()
%3 = tail call i32 (...) @init_usbctl0()
%4 = tail call i32 (...) @init_enable_usb()
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ add_loop(scalar_t__, scalar_t__);
int64_t sign_of_sum(int64_t x, int64_t y) {
  int64_t d = add_loop(x, y);
  if (d > 0) {
    return 1;
  } else if (d < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<sign_of_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add_loop@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    1149 <sign_of_sum+0x39>
movq   $0x1,-0x8(%rbp)
jmp    1169 <sign_of_sum+0x59>
cmpq   $0x0,-0x20(%rbp)
jge    1161 <sign_of_sum+0x51>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1169 <sign_of_sum+0x59>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_of_sum>:
push   %rax
call   1030 <add_loop@plt>
mov    %rax,%rcx
sar    $0x3f,%rcx
test   %rax,%rax
mov    $0x1,%eax
cmovle %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @sign_of_sum(i64 %0, i64 %1) {
%3 = tail call i64 @add_loop(i64 %0, i64 %1)
%4 = ashr i64 %3, 63
%5 = icmp slt i64 %3, 1
%6 = select i1 %5, i64 %4, i64 1
ret i64 %6
}
void glUnlockArraysEXT(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUnlockArraysEXT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CPU;
int /*<<< orphan*/ cdecl_func__RLIMIT_CPU(int /*<<< orphan*/);
void cdecl_expr__RLIMIT_CPU() { cdecl_func__RLIMIT_CPU(RLIMIT_CPU); }


x86 assembly (clang, -O0):
<cdecl_expr__RLIMIT_CPU>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <cdecl_func__RLIMIT_CPU@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdecl_expr__RLIMIT_CPU>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <cdecl_func__RLIMIT_CPU@plt>

LLVM IR (-O0):
@RLIMIT_CPU = global i32 0
define void @cdecl_expr__RLIMIT_CPU() {
%1 = load i32, i32* @RLIMIT_CPU
%2 = call i32 @cdecl_func__RLIMIT_CPU(i32 %1)
ret void
}

LLVM IR (-O2):
@RLIMIT_CPU = global i32 0
define void @cdecl_expr__RLIMIT_CPU() {
%1 = load i32, i32* @RLIMIT_CPU
%2 = tail call i32 @cdecl_func__RLIMIT_CPU(i32 %1)
ret void
}
void sigtrap_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigtrap_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void derror(int no_err) { printf("%d non-floats skipped ", no_err); }


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

x86 assembly (clang, -O2):
<derror>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%d non-floats skipped \00"
define void @derror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%d non-floats skipped \00"
define void @derror(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned long nextpow2(unsigned long n) {
  unsigned long nn = n;
  for (; n &= n - 1; nn = n)
    ;
  return nn * 2;
}


x86 assembly (clang, -O0):
<nextpow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     113c <nextpow2+0x3c>
jmp    112f <nextpow2+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <nextpow2+0x10>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextpow2>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rdi
and    %rax,%rdi
jne    1100 <nextpow2>
add    %rax,%rax
ret

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

LLVM IR (-O2):
define i64 @nextpow2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %5, %2 ]
%4 = add i64 %3, -1
%5 = and i64 %4, %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = shl i64 %3, 1
ret i64 %8
}
main() {
  switch (0) {}
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetErrorString() {
  printf("XESetErrorString called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"XESetErrorString called\00"
define i32 @XESetErrorString() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ds_set_boolean(int /*<<< orphan*/, int, int);
void snmp_set_quick_print(int x) { ds_set_boolean(0, 13, x); }


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

x86 assembly (clang, -O2):
<snmp_set_quick_print>:
mov    %edi,%edx
xor    %edi,%edi
mov    $0xd,%esi
jmp    1030 <ds_set_boolean@plt>

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

LLVM IR (-O2):
define void @snmp_set_quick_print(i32 %0) {
%2 = tail call i32 @ds_set_boolean(i32 0, i32 13, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
int *malloc(int);
int *create_empty_array(int n) {
  int *a;
  int i;
  a = malloc(sizeof(*a) * n);
  assert(a);
  for (i = 0; i < n; i++) {
    a[i] = (-1);
  }
  return a;
}


x86 assembly (clang, -O0):
<create_empty_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1177 <create_empty_array+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <create_empty_array+0x2e>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_empty_array>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1040 <assert@plt>
test   %ebx,%ebx
jle    1164 <create_empty_array+0x34>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @create_empty_array(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
%9 = call i32* @malloc(i32 %8)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call i32 @assert(i32* %10)
store i32 0, i32* %4
br label %12
12: ; preds = %21, %1
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 -1, i32* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %12
24: ; preds = %12
%25 = load i32*, i32** %3
ret i32* %25
}

LLVM IR (-O2):
define i32* @create_empty_array(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = tail call i32 @assert(i32* %3)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = bitcast i32* %3 to i8*
%8 = zext i32 %0 to i64
%9 = shl nuw nsw i64 %8, 2
br label %10
10: ; preds = %6, %1
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ blah();
void foo(int value) {
  switch (value) {
  case 42:
    if (value != 42)
      abort();
  case 50:
    blah();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x2a,%eax
je     1150 <foo+0x30>
jmp    113f <foo+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x32,%eax
je     1166 <foo+0x46>
jmp    116d <foo+0x4d>
cmpl   $0x2a,-0x4(%rbp)
je     1161 <foo+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1166 <foo+0x46>
mov    $0x0,%al
call   1040 <blah@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x32,%edi
je     111a <foo+0xa>
cmp    $0x2a,%edi
jne    1121 <foo+0x11>
xor    %eax,%eax
jmp    1030 <blah@plt>
ret

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 42, label %4
i32 50, label %10
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 42
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %4
br label %10
10: ; preds = %1, %9
%11 = call i32 (...) @blah()
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
switch i32 %0, label %4 [
i32 42, label %2
i32 50, label %2
]
2: ; preds = %1, %1
%3 = tail call i32 (...) @blah()
br label %4
4: ; preds = %2, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cio_seek(int);
int /*<<< orphan*/ cio_skip(int);
int cio_tell();
int /*<<< orphan*/ cio_write(int, int);
int /*<<< orphan*/ j2k_write_qcx(int /*<<< orphan*/);
void j2k_write_qcd() {
  int lenp, len;

  cio_write(0xff5c, 2);
  lenp = cio_tell();
  cio_skip(2);
  j2k_write_qcx(0);
  len = cio_tell() - lenp;
  cio_seek(lenp);
  cio_write(len, 2);
  cio_seek(lenp + len);
}


x86 assembly (clang, -O0):
<j2k_write_qcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff5c,%edi
mov    $0x2,%esi
call   1060 <cio_write@plt>
mov    $0x0,%al
call   1070 <cio_tell@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <cio_skip@plt>
xor    %edi,%edi
call   1050 <j2k_write_qcx@plt>
mov    $0x0,%al
call   1070 <cio_tell@plt>
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <cio_seek@plt>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1060 <cio_write@plt>
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
call   1040 <cio_seek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j2k_write_qcd>:
push   %rbp
push   %r14
push   %rbx
mov    $0xff5c,%edi
mov    $0x2,%esi
call   1060 <cio_write@plt>
xor    %eax,%eax
call   1070 <cio_tell@plt>
mov    %eax,%r14d
mov    $0x2,%edi
call   1030 <cio_skip@plt>
xor    %edi,%edi
call   1050 <j2k_write_qcx@plt>
xor    %eax,%eax
call   1070 <cio_tell@plt>
mov    %eax,%ebx
mov    %eax,%ebp
sub    %r14d,%ebp
mov    %r14d,%edi
call   1040 <cio_seek@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1060 <cio_write@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cio_seek@plt>

LLVM IR (-O0):
define void @j2k_write_qcd() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @cio_write(i32 65372, i32 2)
%4 = call i32 (...) @cio_tell()
store i32 %4, i32* %1
%5 = call i32 @cio_skip(i32 2)
%6 = call i32 @j2k_write_qcx(i32 0)
%7 = call i32 (...) @cio_tell()
%8 = load i32, i32* %1
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = call i32 @cio_seek(i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @cio_write(i32 %12, i32 2)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = add nsw i32 %14, %15
%17 = call i32 @cio_seek(i32 %16)
ret void
}

LLVM IR (-O2):
define void @j2k_write_qcd() {
%1 = tail call i32 @cio_write(i32 65372, i32 2)
%2 = tail call i32 (...) @cio_tell()
%3 = tail call i32 @cio_skip(i32 2)
%4 = tail call i32 @j2k_write_qcx(i32 0)
%5 = tail call i32 (...) @cio_tell()
%6 = sub nsw i32 %5, %2
%7 = tail call i32 @cio_seek(i32 %2)
%8 = tail call i32 @cio_write(i32 %6, i32 2)
%9 = tail call i32 @cio_seek(i32 %5)
ret void
}