xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ floats_mat44_to_xyt(float *, float *);
int /*<<< orphan*/ floats_quat_xyz_to_mat44(float const *, float const *,
                                            float *);
void floats_quat_xyz_to_xyt(const float q[4], const float xyz[3],
                            float xyt[3]) {
  float M[16];
  floats_quat_xyz_to_mat44(q, xyz, M);
  floats_mat44_to_xyt(M, xyt);
}


x86 assembly (clang, -O0):
<floats_quat_xyz_to_xyt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1030 <floats_quat_xyz_to_mat44@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <floats_mat44_to_xyt@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_quat_xyz_to_xyt>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1030 <floats_quat_xyz_to_mat44@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <floats_mat44_to_xyt@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @floats_quat_xyz_to_xyt(float* %0, float* %1, float* %2) {
%4 = alloca [16 x float]
%5 = bitcast [16 x float]* %4 to i8*
%6 = getelementptr inbounds [16 x float], [16 x float]* %4, i64 0, i64 0
%7 = call i32 @floats_quat_xyz_to_mat44(float* %0, float* %1, float* %6)
%8 = call i32 @floats_mat44_to_xyt(float* %6, float* %2)
ret void
}
/* Variables and functions */
int eg_indirect_table_set(unsigned int, int /*<<< orphan*/, unsigned int, int,
                          unsigned int *);
int eg_ctl_filt_table_set(unsigned int dev_id, unsigned int index,
                          unsigned int *pentry) {
  if ((index < 0) || (index > 23)) {
    return -1;
  }
  return eg_indirect_table_set(dev_id, 0, index, 3, pentry);
}


x86 assembly (clang, -O0):
<eg_ctl_filt_table_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <eg_ctl_filt_table_set+0x26>
cmpl   $0x17,-0xc(%rbp)
jbe    1142 <eg_ctl_filt_table_set+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <eg_ctl_filt_table_set+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
xor    %esi,%esi
mov    $0x3,%ecx
call   1030 <eg_indirect_table_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_ctl_filt_table_set>:
cmp    $0x17,%esi
jbe    111b <eg_ctl_filt_table_set+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
xor    %esi,%esi
mov    $0x3,%ecx
jmp    1030 <eg_indirect_table_set@plt>

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

LLVM IR (-O2):
define i32 @eg_ctl_filt_table_set(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 23
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @eg_indirect_table_set(i32 %0, i32 0, i32 %1, i32 3, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
void gtk_tree_view_get_cursor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_cursor() {
ret void
}
/* Variables and functions */
scalar_t__ log2(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  while (1) {
    scanf("%d", &n);
    if (n == 0)
      break;
    printf("%d\n", (int)log2(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    115e <main+0x2e>
jmp    1179 <main+0x49>
mov    -0x8(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1192 <main+0x62>
lea    0xeaa(%rip),%r14
lea    0xea0(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <log2@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %8
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %13
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i64 @log2(i32 %9)
%11 = trunc i64 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %3
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ %4, %0 ]
%8 = call i64 @log2(i32 %7)
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %0
ret i32 0
}
void ar2315_plat_time_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ar2315_plat_time_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void recStrRvrs(char *str, int num) {
  if (num >= 0) {
    printf("%c", str[num]);
    recStrRvrs(str, num - 1);
  }
}


x86 assembly (clang, -O0):
<recStrRvrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1160 <recStrRvrs+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb8(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <recStrRvrs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recStrRvrs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1143 <recStrRvrs+0x33>
mov    %rdi,%r15
mov    %esi,%ebx
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1130 <recStrRvrs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @recStrRvrs(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
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 [ %5, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nsw i64 %7, -1
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int cos(float);
float zone_plate(float r, float k) { return (1 + cos(k * r * r)) / 2; }


x86 assembly (clang, -O0):
<zone_plate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zone_plate>:
push   %rax
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @zone_plate(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = call i32 @cos(float %9)
%11 = add nsw i32 1, %10
%12 = sdiv i32 %11, 2
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @zone_plate(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fmul float %3, %0
%5 = tail call i32 @cos(float %4)
%6 = add nsw i32 %5, 1
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int, char *, char *);
char *strrchr(char const *, int);
int main(void) {
  const char *string1 = "A zoo has many animals including zebras";
  int c = 'z';
  printf("%s\n%s'%c'%s\"%s\"\n", "The remainder of string1 beginning with the",
         "last occurrence of character ", c, " is: ", strrchr(string1, c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x7a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strrchr@plt>
mov    -0x18(%rbp),%ecx
mov    %rax,%r9
lea    0xec8(%rip),%rdi
lea    0xed2(%rip),%rsi
lea    0xef7(%rip),%rdx
lea    0xf0e(%rip),%r8
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
lea    0xf1a(%rip),%rsi
lea    0xf3f(%rip),%rdx
lea    0xf56(%rip),%r8
lea    0xeed(%rip),%r9
mov    $0x7a,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"A zoo has many animals including zebras\00"
@.str.1 = [17 x i8] c"%s\0A%s'%c'%s\22%s\22\0A\00"
@.str.2 = [44 x i8] c"The remainder of string1 beginning with the\00"
@.str.3 = [30 x i8] c"last occurrence of character \00"
@.str.4 = [6 x i8] c" is: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 122, i32* %3
%4 = load i32, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i8* @strrchr(i8* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"A zoo has many animals including zebras\00"
@.str.1 = [17 x i8] c"%s\0A%s'%c'%s\22%s\22\0A\00"
@.str.2 = [44 x i8] c"The remainder of string1 beginning with the\00"
@.str.3 = [30 x i8] c"last occurrence of character \00"
@.str.4 = [6 x i8] c" is: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 33))
ret i32 0
}
const char *ajOboinTypeGetQlinks(void) { return "|"; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
define i8* @ajOboinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int pgup_handler(char **save) {
  write_instr(0x00);
  write_imm(0x4B);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<pgup_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4b,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgup_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4b,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pgup_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 75)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @pgup_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 75)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
int main() { return 1 != 1UL; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int foo(unsigned char x) { return __builtin_parity(x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %dil,%dil
setnp  %al
ret

LLVM IR (-O0):
define i32 @foo(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = call i32 @llvm.ctpop.i32(i32 %4)
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i8 zeroext %0) {
%2 = tail call i8 @llvm.ctpop.i8(i8 %0)
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
void clear_stream(FILE *in) {
  int ch;
  clearerr(in);
  do
    ch = getc(in);
  while (ch != '\n' && ch != EOF);
  clearerr(in);
}


x86 assembly (clang, -O0):
<clear_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1162 <clear_stream+0x42>
mov    -0xc(%rbp),%eax
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1135 <clear_stream+0x15>
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stream>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <clearerr@plt>
mov    0x2eb5(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    $0xa,%eax
je     1152 <clear_stream+0x32>
cmp    (%r14),%eax
jne    1140 <clear_stream+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
@EOF = global i32 0
define void @clear_stream(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @clearerr(i32* %4)
br label %6
6: ; preds = %16, %1
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %3
br label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i32*, i32** %2
%20 = call i32 @clearerr(i32* %19)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clear_stream(i32* nocapture %0) {
%2 = tail call i32 @clearerr(i32* %0)
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @getc(i32* %0)
%5 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = tail call i32 @clearerr(i32* %0)
ret void
}
zysdm() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @zysdm() {
ret i32 0
}
void mlx5_sf_dev_table_destroy(struct mlx5_core_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.mlx5_core_dev = type opaque
define void @mlx5_sf_dev_table_destroy(%struct.mlx5_core_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int *, int);
int original_fibo(int);
void original_process() {
  int i = 0;
  int vector[35];
  for (; i < 35; i++)
    vector[i] = original_fibo(i);
  binary_search(vector, 5702887);
}


x86 assembly (clang, -O0):
<original_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x23,-0x4(%rbp)
jge    115f <original_process+0x3f>
mov    -0x4(%rbp),%edi
call   1030 <original_fibo@plt>
mov    %eax,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <original_process+0x12>
lea    -0x90(%rbp),%rdi
mov    $0x5704e7,%esi
call   1040 <binary_search@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<original_process>:
push   %rbx
sub    $0x90,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <original_fibo@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x23,%rbx
jne    1130 <original_process+0x10>
mov    %rsp,%rdi
mov    $0x5704e7,%esi
call   1040 <binary_search@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @original_process() {
%1 = alloca i32
%2 = alloca [35 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 35
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @original_fibo(i32 %7)
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [35 x i32], [35 x i32]* %2, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %6
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
%16 = getelementptr inbounds [35 x i32], [35 x i32]* %2, i64 0, i64 0
%17 = call i32 @binary_search(i32* %16, i32 5702887)
ret void
}

LLVM IR (-O2):
define void @original_process() {
%1 = alloca [35 x i32]
%2 = bitcast [35 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %8, %3 ]
%5 = trunc i64 %4 to i32
%6 = tail call i32 @original_fibo(i32 %5)
%7 = getelementptr inbounds [35 x i32], [35 x i32]* %1, i64 0, i64 %4
store i32 %6, i32* %7
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 35
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = getelementptr inbounds [35 x i32], [35 x i32]* %1, i64 0, i64 0
%12 = call i32 @binary_search(i32* %11, i32 5702887)
ret void
}
void fsl_udc_clk_release(void) {}


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

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

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

LLVM IR (-O2):
define void @fsl_udc_clk_release() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strtok(char *, char *);
void uninitvar_strtok(void) {
  char *s;
  char *ct;
  (void)strtok(s, ct);
}


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

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

LLVM IR (-O0):
define void @uninitvar_strtok() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strtok(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strtok() {
%1 = tail call i32 @strtok(i8* undef, i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ascending2(int *, int *);
int /*<<< orphan*/ printf(char *);
void ascending3(int *a, int *b, int *c) {
  printf("\nAscending called\n");
  ascending2(a, b);
  ascending2(a, c);
  ascending2(b, c);
}


x86 assembly (clang, -O0):
<ascending3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ascending2@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ascending2@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ascending2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascending3>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <ascending2@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ascending2@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <ascending2@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0AAscending called\0A\00"
define void @ascending3(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 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = call i32 @ascending2(i32* %8, i32* %9)
%11 = load i32*, i32** %4
%12 = load i32*, i32** %6
%13 = call i32 @ascending2(i32* %11, i32* %12)
%14 = load i32*, i32** %5
%15 = load i32*, i32** %6
%16 = call i32 @ascending2(i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"\0AAscending called\00"
define void @ascending3(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @ascending2(i32* %0, i32* %1)
%6 = tail call i32 @ascending2(i32* %0, i32* %2)
%7 = tail call i32 @ascending2(i32* %1, i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void get_mem() {
  char *ptr;
  ptr = (char *)malloc(10);
}


x86 assembly (clang, -O0):
<get_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem>:
mov    $0xa,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @get_mem() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
ret void
}

LLVM IR (-O2):
define void @get_mem() {
%1 = tail call i64 @malloc(i32 10)
ret void
}
int sum(int a, float b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, float %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, unsigned int *);
int /*<<< orphan*/ stdin;
unsigned be_egesz() {
  unsigned ret;
  fscanf(stdin, "%u", &ret);
  return ret;
}


x86 assembly (clang, -O0):
<be_egesz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1030 <fscanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_egesz>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <fscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%u\00"
define i32 @be_egesz() {
%1 = alloca i32
%2 = load i32, i32* @stdin
%3 = call i32 @fscanf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%u\00"
define i32 @be_egesz() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stdin
%4 = call i32 @fscanf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_lib_function(void) { printf("library routine called\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"library routine called\00"
define void @my_lib_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
void zdie(int report) {
  if (report)
    perror(NULL);
  exit(1);
}


x86 assembly (clang, -O0):
<zdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <zdie+0x1e>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<zdie>:
push   %rax
test   %edi,%edi
je     112c <zdie+0xc>
xor    %edi,%edi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @zdie(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 %7
5: ; preds = %1
%6 = call i32 @perror(i32* null)
br label %7
7: ; preds = %5, %1
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @zdie(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @perror(i32* null)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @exit(i32 1)
unreachable
}
int track_pfn_vma_copy(struct vm_area_struct *vma) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define i32 @track_pfn_vma_copy(%struct.vm_area_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getsockopt(int, int, int, void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void std_getsockopt(int s, int level, int optname, void *optval,
                    socklen_t *optlen) {
  if (getsockopt(s, level, optname, optval, optlen) == -1) {
    perror("getsockopt");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_getsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0xffffffff,%eax
jne    117e <std_getsockopt+0x4e>
lea    0xe91(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_getsockopt>:
push   %rax
call   1030 <getsockopt@plt>
cmp    $0xffffffff,%eax
je     113d <std_getsockopt+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"getsockopt\00"
define void @std_getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret void
}
int str_len(char *f_str) {
  int count;
  for (count = 0; *(f_str + count) != '\0'; count++)
    ;
  return (count);
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <str_len+0x37>
jmp    1129 <str_len+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int ezThreeFourths(int x) {
  int xs1 = x >> 1;
  int xs2 = x >> 2;
  int bias = (x >> 31) & 0x3;
  int xl2 = x & 0x3;
  int xl1 = (x & 0x1) << 1;
  int incr = (xl2 + xl1 + bias) >> 2;
  return xs1 + xs2 + incr;
}


x86 assembly (clang, -O0):
<ezThreeFourths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezThreeFourths>:
mov    %edi,%eax
sar    %eax
mov    %edi,%ecx
sar    $0x2,%ecx
add    %eax,%ecx
mov    %edi,%edx
sar    $0x1f,%edx
and    $0x3,%edx
mov    %edi,%eax
and    $0x3,%eax
and    $0x1,%edi
lea    (%rax,%rdi,2),%eax
add    %edx,%eax
shr    $0x2,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ezThreeFourths(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = ashr i32 %11, 2
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = ashr i32 %13, 31
%15 = and i32 %14, 3
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = and i32 %16, 3
store i32 %17, i32* %6
%18 = load i32, i32* %2
%19 = and i32 %18, 1
%20 = shl i32 %19, 1
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
%26 = ashr i32 %25, 2
store i32 %26, i32* %8
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %8
%31 = add nsw i32 %29, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @ezThreeFourths(i32 %0) {
%2 = ashr i32 %0, 1
%3 = ashr i32 %0, 2
%4 = icmp slt i32 %0, 0
%5 = select i1 %4, i32 3, i32 0
%6 = and i32 %0, 3
%7 = shl i32 %0, 1
%8 = and i32 %7, 2
%9 = add nuw nsw i32 %8, %6
%10 = add nuw nsw i32 %9, %5
%11 = lshr i32 %10, 2
%12 = add nsw i32 %2, %3
%13 = add nsw i32 %12, %11
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SV_ResetPacketFiltersTimeouts();
int /*<<< orphan*/ trap_Cmd_ExecuteText(int, char *);
void SV_ReadIPList(void) {
  SV_ResetPacketFiltersTimeouts();
  trap_Cmd_ExecuteText(2, "exec listip.cfg silent\n");
}


x86 assembly (clang, -O0):
<SV_ReadIPList>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SV_ResetPacketFiltersTimeouts@plt>
mov    $0x2,%edi
lea    0xec9(%rip),%rsi
call   1030 <trap_Cmd_ExecuteText@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_ReadIPList>:
push   %rax
xor    %eax,%eax
call   1040 <SV_ResetPacketFiltersTimeouts@plt>
lea    0xed1(%rip),%rsi
mov    $0x2,%edi
pop    %rax
jmp    1030 <trap_Cmd_ExecuteText@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"exec listip.cfg silent\0A\00"
define void @SV_ReadIPList() {
%1 = call i32 (...) @SV_ResetPacketFiltersTimeouts()
%2 = call i32 @trap_Cmd_ExecuteText(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"exec listip.cfg silent\0A\00"
define void @SV_ReadIPList() {
%1 = tail call i32 (...) @SV_ResetPacketFiltersTimeouts()
%2 = tail call i32 @trap_Cmd_ExecuteText(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int recurse2(int, int, char *);
int recurse1(int x, int y, char *s) {
  char str[32];
  if (x < y) {
    return (recurse2(x + 1, y, str));
  }
  return (x);
}


x86 assembly (clang, -O0):
<recurse1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1148 <recurse1+0x38>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <recurse2@plt>
mov    %eax,-0x4(%rbp)
jmp    114e <recurse1+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse1>:
mov    %edi,%eax
cmp    %esi,%edi
jge    112b <recurse1+0x1b>
sub    $0x28,%rsp
add    $0x1,%eax
mov    %rsp,%rdx
mov    %eax,%edi
call   1030 <recurse2@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @recurse1(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [32 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %6
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%17 = call i32 @recurse2(i32 %14, i32 %15, i8* %16)
store i32 %17, i32* %4
br label %20
18: ; preds = %3
%19 = load i32, i32* %5
store i32 %19, i32* %4
br label %20
20: ; preds = %18, %12
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @recurse1(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = icmp slt i32 %0, %1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = add nsw i32 %0, 1
%9 = call i32 @recurse2(i32 %8, i32 %1, i8* %5)
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ %9, %7 ], [ %0, %3 ]
ret i32 %11
}
/* Variables and functions */
int second_smallest(int *, int);
int test_duplicate_numbers() {
  int input[] = {67, -33, 67, 70, -33};
  return second_smallest(input, 5) == 67;
}


x86 assembly (clang, -O0):
<test_duplicate_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <second_smallest@plt>
cmp    $0x43,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_duplicate_numbers>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <second_smallest@plt>
xor    %ecx,%ecx
cmp    $0x43,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_duplicate_numbers.input = [5 x i32] [i32 67, i32 -33, i32 67, i32 70, i32 -33]
define i32 @test_duplicate_numbers() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @second_smallest(i32* %3, i32 5)
%5 = icmp eq i32 %4, 67
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_duplicate_numbers.input = [5 x i32] [i32 67, i32 -33, i32 67, i32 70, i32 -33]
define i32 @test_duplicate_numbers() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @second_smallest(i32* %3, i32 5)
%5 = icmp eq i32 %4, 67
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int andysh_clear(char **args) { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define i32 @andysh_clear(i8** nocapture readnone %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void Display(char c[]) {
  printf("String output: ");
  puts(c);
}


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

x86 assembly (clang, -O2):
<Display>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"String output: \00"
define void @Display(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int read_c0_ebase();
unsigned int nlm_core_id(void) { return (read_c0_ebase() & 0x1c) >> 2; }


x86 assembly (clang, -O0):
<nlm_core_id>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <read_c0_ebase@plt>
and    $0x1c,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlm_core_id>:
push   %rax
xor    %eax,%eax
call   1030 <read_c0_ebase@plt>
shr    $0x2,%eax
and    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nlm_core_id() {
%1 = call i32 (...) @read_c0_ebase()
%2 = and i32 %1, 28
%3 = ashr i32 %2, 2
ret i32 %3
}

LLVM IR (-O2):
define i32 @nlm_core_id() {
%1 = tail call i32 (...) @read_c0_ebase()
%2 = lshr i32 %1, 2
%3 = and i32 %2, 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ apbuart_test(int);
int /*<<< orphan*/ gptimer_test(int, int);
int /*<<< orphan*/ irqtest(int);
int /*<<< orphan*/ leon3_test(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  leon3_test(1, 0x80000200, 0);
  irqtest(0x80000200);
  apbuart_test(0x80000100);
  apbuart_test(0x80000900);
  gptimer_test(0x80000300, 6);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <report_start@plt>
mov    $0x1,%edi
mov    $0x80000200,%esi
xor    %edx,%edx
call   1040 <leon3_test@plt>
mov    $0x80000200,%edi
call   1050 <irqtest@plt>
mov    $0x80000100,%edi
call   1070 <apbuart_test@plt>
mov    $0x80000900,%edi
call   1070 <apbuart_test@plt>
mov    $0x80000300,%edi
mov    $0x6,%esi
call   1030 <gptimer_test@plt>
mov    $0x0,%al
call   1060 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <report_start@plt>
mov    $0x1,%edi
mov    $0x80000200,%esi
xor    %edx,%edx
call   1040 <leon3_test@plt>
mov    $0x80000200,%edi
call   1050 <irqtest@plt>
mov    $0x80000100,%edi
call   1070 <apbuart_test@plt>
mov    $0x80000900,%edi
call   1070 <apbuart_test@plt>
mov    $0x80000300,%edi
mov    $0x6,%esi
call   1030 <gptimer_test@plt>
xor    %eax,%eax
call   1060 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 @leon3_test(i32 1, i32 -2147483136, i32 0)
%3 = call i32 @irqtest(i32 -2147483136)
%4 = call i32 @apbuart_test(i32 -2147483392)
%5 = call i32 @apbuart_test(i32 -2147481344)
%6 = call i32 @gptimer_test(i32 -2147482880, i32 6)
%7 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 @leon3_test(i32 1, i32 -2147483136, i32 0)
%3 = tail call i32 @irqtest(i32 -2147483136)
%4 = tail call i32 @apbuart_test(i32 -2147483392)
%5 = tail call i32 @apbuart_test(i32 -2147481344)
%6 = tail call i32 @gptimer_test(i32 -2147482880, i32 6)
%7 = tail call i32 (...) @report_end()
ret i32 0
}