xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void remove_store_item() { printf("Remove item\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Remove item\00"
define void @remove_store_item() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void test_float(float *data) {
#pragma omp simd
  for (int i = 0; i < 128 / sizeof(float); ++i)
    data[i] = 2.0f;
}


x86 assembly (clang, -O0):
<test_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    1140 <test_float+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  0xed3(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <test_float+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x70(%rdi)
ret

LLVM IR (-O0):
define void @test_float(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, 32
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load float*, float** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %9, i64 %11
store float 2.000000e+00, float* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test_float(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %2
%3 = getelementptr inbounds float, float* %0, i64 4
%4 = bitcast float* %3 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %4
%5 = getelementptr inbounds float, float* %0, i64 8
%6 = bitcast float* %5 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %6
%7 = getelementptr inbounds float, float* %0, i64 12
%8 = bitcast float* %7 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %8
%9 = getelementptr inbounds float, float* %0, i64 16
%10 = bitcast float* %9 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %10
%11 = getelementptr inbounds float, float* %0, i64 20
%12 = bitcast float* %11 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %12
%13 = getelementptr inbounds float, float* %0, i64 24
%14 = bitcast float* %13 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %14
%15 = getelementptr inbounds float, float* %0, i64 28
%16 = bitcast float* %15 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>, <4 x float>* %16
ret void
}
int last_one1(unsigned int u1) { return 53 - __builtin_ctz(u1); }


x86 assembly (clang, -O0):
<last_one1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsf    %eax,%ecx
mov    $0x35,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_one1>:
bsf    %edi,%ecx
mov    $0x35,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @last_one1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = sub nsw i32 53, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @last_one1(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = sub nuw nsw i32 53, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void vuln(char *name) {
  char buf[64];
  strcpy(buf, name);
}


x86 assembly (clang, -O0):
<vuln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuln>:
sub    $0x48,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @vuln(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @vuln(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ Getc();
int /*<<< orphan*/ printf(char *);
extern void revocable(int len) {
  printf("\t\tRevocable - ");
  if (Getc() == 0)
    printf("No");
  else
    printf("Yes");
  printf("\n");
}


x86 assembly (clang, -O0):
<revocable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <Getc@plt>
cmp    $0x0,%rax
jne    1159 <revocable+0x39>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1165 <revocable+0x45>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revocable>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <Getc@plt>
test   %rax,%rax
lea    0xec1(%rip),%rax
lea    0xebd(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\09\09Revocable - \00"
@.str.1 = [3 x i8] c"No\00"
@.str.2 = [4 x i8] c"Yes\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @revocable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i64 (...) @Getc()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\09\09Revocable - \00"
@.str.1 = [3 x i8] c"No\00"
@.str.2 = [4 x i8] c"Yes\00"
define void @revocable(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 (...) @Getc()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
%7 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_libco_opts();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_initial();
int /*<<< orphan*/ test_leaks();
int /*<<< orphan*/ test_preserved();
int main(void) {
  printf("Basic test\n");
  print_libco_opts();
  test_initial();
  test_leaks();
  test_preserved();
  printf("Passed\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <print_libco_opts@plt>
mov    $0x0,%al
call   1050 <test_initial@plt>
mov    $0x0,%al
call   1070 <test_leaks@plt>
mov    $0x0,%al
call   1060 <test_preserved@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <print_libco_opts@plt>
xor    %eax,%eax
call   1050 <test_initial@plt>
xor    %eax,%eax
call   1070 <test_leaks@plt>
xor    %eax,%eax
call   1060 <test_preserved@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Basic test\0A\00"
@.str.1 = [9 x i8] c"Passed\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @print_libco_opts()
%4 = call i32 (...) @test_initial()
%5 = call i32 (...) @test_leaks()
%6 = call i32 (...) @test_preserved()
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Basic test\00"
@str.2 = [8 x i8] c"Passed\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_libco_opts()
%3 = tail call i32 (...) @test_initial()
%4 = tail call i32 (...) @test_leaks()
%5 = tail call i32 (...) @test_preserved()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_unrealscript_comment_entities();
int /*<<< orphan*/ test_unrealscript_comments();
void all_unrealscript_tests() {
  test_unrealscript_comments();
  test_unrealscript_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_unrealscript_tests() {
%1 = call i32 (...) @test_unrealscript_comments()
%2 = call i32 (...) @test_unrealscript_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_unrealscript_tests() {
%1 = tail call i32 (...) @test_unrealscript_comments()
%2 = tail call i32 (...) @test_unrealscript_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printheader(char *);
void intitest(char *name) { printheader(name); }


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

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

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

LLVM IR (-O2):
define void @intitest(i8* %0) {
%2 = tail call i32 @printheader(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int utf8_encode(unsigned int, char *, int);
char *utf8_enc_tmp(unsigned int unicode_value) {
  static char tmp[8];
  if (unicode_value == 0xFFFFFFFF)
    tmp[0] = 0;
  else {
    int len = utf8_encode(unicode_value, tmp, sizeof(tmp));
    tmp[len] = 0;
  }
  return (char *)tmp;
}


x86 assembly (clang, -O0):
<utf8_enc_tmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1131 <utf8_enc_tmp+0x21>
movb   $0x0,0x2efd(%rip)
jmp    1157 <utf8_enc_tmp+0x47>
mov    -0x4(%rbp),%edi
lea    0x2eee(%rip),%rsi
mov    $0x8,%edx
call   1030 <utf8_encode@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
lea    0x2ed6(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ecb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_enc_tmp>:
push   %rbx
cmp    $0xffffffff,%edi
je     1131 <utf8_enc_tmp+0x21>
lea    0x2f0c(%rip),%rbx
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <utf8_encode@plt>
cltq
add    %rbx,%rax
jmp    1138 <utf8_enc_tmp+0x28>
lea    0x2ef1(%rip),%rax
movb   $0x0,(%rax)
lea    0x2ee7(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@utf8_enc_tmp.tmp = internal global [8 x i8] zeroinitializer
define i8* @utf8_enc_tmp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 0)
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @utf8_encode(i32 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 0), i32 8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %7, %6
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 0)
}

LLVM IR (-O2):
@utf8_enc_tmp.tmp = internal global [8 x i8] zeroinitializer
define i8* @utf8_enc_tmp(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @utf8_encode(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 0), i32 8)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 %5
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 0), %1 ]
store i8 0, i8* %8
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @utf8_enc_tmp.tmp, i64 0, i64 0)
}
int main(void) {
  short int si = -32767;
  unsigned short int usi = 65535U;
  int i = -42;
  unsigned int ui = 89U;
  long int li = -2147483648;
  unsigned long int uli = 4294967295U;
  long long int lli = -9223372036854775808;
  unsigned long long int ulli = 18446744073709551615U;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x8001,-0x6(%rbp)
movw   $0xffff,-0x8(%rbp)
movl   $0xffffffd6,-0xc(%rbp)
movl   $0x59,-0x10(%rbp)
movq   $0xffffffff80000000,-0x18(%rbp)
80
mov    $0xffffffff,%eax
mov    %rax,-0x20(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x28(%rbp)
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %1
store i16 -32767, i16* %2
store i16 -1, i16* %3
store i32 -42, i32* %4
store i32 89, i32* %5
store i64 -2147483648, i64* %6
store i64 4294967295, i64* %7
store i64 -9223372036854775808, i64* %8
store i64 -1, i64* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ process_execution_count_increment(char *);
void process_increment_execution_count(char *application_name,
                                       char *process_name,
                                       char *database_management_system) {
  if (application_name) {
  }
  if (database_management_system) {
  }
  process_execution_count_increment(process_name);
}


x86 assembly (clang, -O0):
<process_increment_execution_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <process_increment_execution_count+0x24>
jmp    1134 <process_increment_execution_count+0x24>
cmpq   $0x0,-0x18(%rbp)
je     1144 <process_increment_execution_count+0x34>
jmp    1144 <process_increment_execution_count+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <process_execution_count_increment@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_increment_execution_count>:
mov    %rsi,%rdi
jmp    1030 <process_execution_count_increment@plt>

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

LLVM IR (-O2):
define void @process_increment_execution_count(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @process_execution_count_increment(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ printf(char *);
int rightrot(unsigned x, int n) {
  int sz = sizeof(x) * CHAR_BIT;
  if (n > sz) {
    printf("illegal move\n");
    return 0;
  }
  return (x >> n) | (x << (sz - n));
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ebb(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1153 <rightrot+0x43>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116d <rightrot+0x5d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
push   %rax
mov    0x2ec8(%rip),%rcx
mov    (%rcx),%edx
shl    $0x2,%edx
sub    %esi,%edx
jge    1131 <rightrot+0x21>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    %edi,%eax
mov    %esi,%ecx
shr    %cl,%edi
mov    %edx,%ecx
shl    %cl,%eax
or     %edi,%eax
pop    %rcx
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
@.str = [14 x i8] c"illegal move\0A\00"
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* @CHAR_BIT
%8 = sext i32 %7 to i64
%9 = mul i64 4, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %26
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = lshr i32 %17, %18
%20 = load i32, i32* %4
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
%24 = shl i32 %20, %23
%25 = or i32 %19, %24
store i32 %25, i32* %3
br label %26
26: ; preds = %16, %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
@str = [13 x i8] c"illegal move\00"
define i32 @rightrot(i32 %0, i32 %1) {
%3 = load i32, i32* @CHAR_BIT
%4 = shl i32 %3, 2
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %13
8: ; preds = %2
%9 = lshr i32 %0, %1
%10 = sub nsw i32 %4, %1
%11 = shl i32 %0, %10
%12 = or i32 %11, %9
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ 0, %6 ], [ %12, %8 ]
ret i32 %14
}
void page_directory_uninit(struct page_directory *pd) { return; }


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

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

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

LLVM IR (-O2):
%struct.page_directory = type opaque
define void @page_directory_uninit(%struct.page_directory* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ towupper(int /*<<< orphan*/);
int casecmp(wchar_t a, wchar_t b) { return towupper(a) == towupper(b); }


x86 assembly (clang, -O0):
<casecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <towupper@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <towupper@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<casecmp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <towupper@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <towupper@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @casecmp(i32 %0, i32 %1) {
%3 = tail call i64 @towupper(i32 %0)
%4 = tail call i64 @towupper(i32 %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ do_concat_set();
int /*<<< orphan*/ do_cons_set();
int /*<<< orphan*/ do_swapd();
void do_enconcat_set(void) {
  do_swapd();
  do_cons_set();
  do_concat_set();
}


x86 assembly (clang, -O0):
<do_enconcat_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <do_swapd@plt>
mov    $0x0,%al
call   1030 <do_cons_set@plt>
mov    $0x0,%al
call   1040 <do_concat_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_enconcat_set>:
push   %rax
xor    %eax,%eax
call   1050 <do_swapd@plt>
xor    %eax,%eax
call   1030 <do_cons_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <do_concat_set@plt>

LLVM IR (-O0):
define void @do_enconcat_set() {
%1 = call i32 (...) @do_swapd()
%2 = call i32 (...) @do_cons_set()
%3 = call i32 (...) @do_concat_set()
ret void
}

LLVM IR (-O2):
define void @do_enconcat_set() {
%1 = tail call i32 (...) @do_swapd()
%2 = tail call i32 (...) @do_cons_set()
%3 = tail call i32 (...) @do_concat_set()
ret void
}
void tzdev_fini_migration(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_epi32(int);
__m128i test_mm_set1_epi32(int A) { return _mm_set1_epi32(A); }


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

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

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

LLVM IR (-O2):
define i32 @test_mm_set1_epi32(i32 %0) {
%2 = tail call i32 @_mm_set1_epi32(i32 %0)
ret i32 %2
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=20 REPO_URL= REVISION=0 CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Thu Nov  6 09:56:07 CET 2014 BUILD=release "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [315 x i8] c"malidrv: API_VERSION=20 REPO_URL= REVISION=0 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu Nov 6 09:56:07 CET 2014 BUILD=release TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([315 x i8], [315 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [315 x i8] c"malidrv: API_VERSION=20 REPO_URL= REVISION=0 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu Nov 6 09:56:07 CET 2014 BUILD=release TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([315 x i8], [315 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ datum;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char get_char(char *where) {
  char datum;
  memcpy(&datum, where, sizeof(datum));
  return datum;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rax
mov    %rdi,%rsi
lea    0x7(%rsp),%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @get_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 1)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @get_char(i8* %0) {
%2 = alloca i8
%3 = call i32 @memcpy(i8* %2, i8* %0, i32 1)
%4 = load i8, i8* %2
ret i8 %4
}
int main() {
  {
    123;
    {
      456;
      789;
    }
    0;
  }
  -10;
}


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
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isblank(int /*<<< orphan*/);
int iswblank(wint_t c) { return isblank(c); }


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

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

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

LLVM IR (-O2):
define i32 @iswblank(i32 %0) {
%2 = tail call i32 @isblank(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct gc_arena {
  int dummy;
};

/* Variables and functions */
char *format_hex_ex(int /*<<< orphan*/ const *, int, int, int, char *,
                    struct gc_arena *);
char *format_hex(const uint8_t *data, int size, int maxoutput,
                 struct gc_arena *gc) {
  return format_hex_ex(data, size, maxoutput, 4, " ", gc);
}


x86 assembly (clang, -O0):
<format_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r9
mov    $0x4,%ecx
lea    0xec0(%rip),%r8
call   1030 <format_hex_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_hex>:
mov    %rcx,%r9
lea    0xee6(%rip),%r8
mov    $0x4,%ecx
jmp    1030 <format_hex_ex@plt>

LLVM IR (-O0):
%struct.gc_arena = type { i32 }
@.str = [2 x i8] c" \00"
define i8* @format_hex(i32* %0, i32 %1, i32 %2, %struct.gc_arena* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.gc_arena*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.gc_arena* %3, %struct.gc_arena** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.gc_arena*, %struct.gc_arena** %8
%13 = call i8* @format_hex_ex(i32* %9, i32 %10, i32 %11, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.gc_arena* %12)
ret i8* %13
}

LLVM IR (-O2):
%struct.gc_arena = type { i32 }
@.str = [2 x i8] c" \00"
define i8* @format_hex(i32* %0, i32 %1, i32 %2, %struct.gc_arena* %3) {
%5 = tail call i8* @format_hex_ex(i32* %0, i32 %1, i32 %2, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.gc_arena* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void turnoff() { printf("Bye! \n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Bye! \00"
define void @turnoff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ata_exit();
void SLIC_driver_exit(void) {
  {
    ata_exit();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @SLIC_driver_exit() {
%1 = tail call i32 (...) @ata_exit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void indentN(int n, char *str) {
  int i;
  for (i = 0; i < n; i++) {
    strcat(str, " ");
  }
}


x86 assembly (clang, -O0):
<indentN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <indentN+0x40>
mov    -0x10(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <indentN+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indentN>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <indentN+0x30>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
add    $0xffffffff,%ebp
jne    1130 <indentN+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @indentN(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
int foo(int *a, int r, short *b) {
  int ret = 0;
  *a = 1;
  if (r == 3)
    *a = 5;
  else
    ret = r + 20;
  *b = 9;
  return ret;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x3,-0xc(%rbp)
jne    1139 <foo+0x39>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
jmp    1142 <foo+0x42>
mov    -0xc(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movw   $0x9,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,(%rdi)
cmp    $0x3,%esi
jne    1119 <foo+0x19>
movl   $0x5,(%rdi)
xor    %eax,%eax
movw   $0x9,(%rdx)
ret
mov    %esi,%eax
add    $0x14,%eax
movw   $0x9,(%rdx)
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0, i32 %1, i16* nocapture writeonly %2) {
store i32 1, i32* %0
%4 = icmp eq i32 %1, 3
br i1 %4, label %5, label %6
5: ; preds = %3
store i32 5, i32* %0
br label %8
6: ; preds = %3
%7 = add nsw i32 %1, 20
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 0, %5 ], [ %7, %6 ]
store i16 9, i16* %2
ret i32 %9
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int unified_sockets__recv(int _sd, char *_p, int _len) {
  int ret;
  ret = recv(_sd, _p, _len, 0);
  if (ret >= 0) {
    ;
  } else {
    ret = -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<unified_sockets__recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1145 <unified_sockets__recv+0x35>
jmp    114c <unified_sockets__recv+0x3c>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unified_sockets__recv>:
push   %rax
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unified_sockets__recv(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
void gg_search_request_free(struct gg_search_request *r) {}


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

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

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

LLVM IR (-O2):
%struct.gg_search_request = type opaque
define void @gg_search_request_free(%struct.gg_search_request* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void wserror(const char *p) { printf("WSERROR: %s\n", p); }


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

x86 assembly (clang, -O2):
<wserror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"WSERROR: %s\0A\00"
define void @wserror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cnfImpn(char *const, int, int, char *);
int /*<<< orphan*/ emsSetr(char *, float);
void ems_setr_(char *const token, float *const rvalue, int token_length) {
  char ctok[15 + 1];

  cnfImpn(token, token_length, 15, ctok);
  emsSetr(ctok, *rvalue);
  return;
}


x86 assembly (clang, -O0):
<ems_setr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0xf,%edx
call   1030 <cnfImpn@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <emsSetr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ems_setr_>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %edx,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   1030 <cnfImpn@plt>
movss  (%rbx),%xmm0
mov    %r14,%rdi
call   1040 <emsSetr@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ems_setr_(i8* %0, float* nocapture %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @cnfImpn(i8* %0, i32 %2, i32 15, i8* %5)
%7 = load float, float* %1
%8 = call i32 @emsSetr(i8* %5, float %7)
ret void
}
void USBEndpointDMAEnable(unsigned long ulBase, unsigned long ulEndpoint,
                          unsigned long ulFlags) {
  if (ulFlags & 0x00002000) {
    (*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) +
                                  0x00000113))) |= 0x00000010;
  } else {
    (*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) +
                                  0x00000117))) |= 0x00000020;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     114a <USBEndpointDMAEnable+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x113(%rax),%cl
movzbl %cl,%ecx
or     $0x10,%ecx
mov    %cl,0x113(%rax)
jmp    116b <USBEndpointDMAEnable+0x6b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x117(%rax),%cl
movzbl %cl,%ecx
or     $0x20,%ecx
mov    %cl,0x117(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDMAEnable>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
add    %rsi,%rdi
mov    %eax,%ecx
shl    $0x4,%cl
add    $0x10,%cl
or     %cl,0x103(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @USBEndpointDMAEnable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = and i64 %7, 8192
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = sub i64 %12, 16
%14 = add i64 %11, %13
%15 = add i64 %14, 275
%16 = inttoptr i64 %15 to i8*
%17 = load volatile i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, 16
%20 = trunc i32 %19 to i8
store volatile i8 %20, i8* %16
br label %32
21: ; preds = %3
%22 = load i64, i64* %4
%23 = load i64, i64* %5
%24 = sub i64 %23, 16
%25 = add i64 %22, %24
%26 = add i64 %25, 279
%27 = inttoptr i64 %26 to i8*
%28 = load volatile i8, i8* %27
%29 = zext i8 %28 to i32
%30 = or i32 %29, 32
%31 = trunc i32 %30 to i8
store volatile i8 %31, i8* %27
br label %32
32: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
define void @USBEndpointDMAEnable(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 8192
%5 = icmp eq i64 %4, 0
%6 = add i64 %1, %0
%7 = select i1 %5, i64 263, i64 259
%8 = select i1 %5, i8 32, i8 16
%9 = add i64 %6, %7
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = or i8 %11, %8
store volatile i8 %12, i8* %10
ret void
}
/* Variables and functions */
int sscanf(char const *, char *, int *);
int iupStrToInt(const char *str, int *i) {
  if (!str)
    return 0;
  if (sscanf(str, "%d", i) != 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iupStrToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <iupStrToInt+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1167 <iupStrToInt+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeba(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1160 <iupStrToInt+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1167 <iupStrToInt+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrToInt>:
test   %rdi,%rdi
je     1134 <iupStrToInt+0x24>
push   %rax
mov    %rsi,%rdx
lea    0xee0(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @iupStrToInt(i8* %0, i32* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__36__IO__set();
void Msp430GpioC__0__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__36__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__0__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__36__IO__set()
ret void
}
void EVP_CIPHER_CTX_init(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dummy(char *);
void test2(void) { dummy("0"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @test2() {
%1 = tail call i32 @dummy(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kml_extract();
int main(void) {
  kml_extract();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <kml_extract@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @kml_extract()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint8_t csr_readb(uint32_t addr) { return *(volatile uint8_t *)addr; }


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

x86 assembly (clang, -O2):
<csr_readb>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @csr_readb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @csr_readb(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ioline_printf() {
  printf("NOT IMPLEMENTED:"
         "pa_ioline_printf"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_ioline_printf\00"
define i32 @pa_ioline_printf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}