xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test5(void) {
  const char a[] = {'m', 'a', 'd', 'a', 'm', 'I', 'm', 'a', 'd', 'a', 'm'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xb(%rbp),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0xb(%rbp),%rdi
mov    $0xb,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rbx
sub    $0x10,%rsp
movabs $0x616d496d6164616d,%rax
49 6d 61
mov    %rax,(%rsp)
movl   $0x6d616461,0x7(%rsp)
6d
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test5.a = [11 x i8] c"madamImadam"
@.str = [2 x i8] c"\0A\00"
define void @test5() {
%1 = alloca [11 x i8]
%2 = bitcast [11 x i8]* %1 to i8*
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 11, i32 1)
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 11, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test5.a = [11 x i8] c"madamImadam"
define void @test5() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @test_palindrome(i8* %2, i32 11, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 11, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDD;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double sqrt(double);
double sqrt_lo(double x) {
  if (x == 0)
    return (0.0);
  mpfr_set_default_rounding_mode(GMP_RNDD);
  ;
  return (sqrt(x));
}


x86 assembly (clang, -O0):
<sqrt_lo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <sqrt_lo+0x32>
jp     1152 <sqrt_lo+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <sqrt_lo+0x4f>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_lo>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1131 <sqrt_lo+0x11>
jp     1131 <sqrt_lo+0x11>
ret
push   %rax
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
movsd  %xmm1,(%rsp)
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
lea    0x8(%rsp),%rsp
jb     115e <sqrt_lo+0x3e>
sqrtsd %xmm0,%xmm0
ret
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
@GMP_RNDD = global i32 0
define double @sqrt_lo(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* @GMP_RNDD
%9 = call i32 @mpfr_set_default_rounding_mode(i32 %8)
%10 = load double, double* %3
%11 = call double @sqrt(double %10)
store double %11, double* %2
br label %12
12: ; preds = %7, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
@GMP_RNDD = global i32 0
define double @sqrt_lo(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @GMP_RNDD
%5 = tail call i32 @mpfr_set_default_rounding_mode(i32 %4)
%6 = tail call double @sqrt(double %0)
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ Qt_setColor(char *, int, int, int, int);
void Qt_setColorForeground(char *widget, int r, int g, int b, int alpha) {
  (void)(widget);
  Qt_setColor("foreground", r, g, b, alpha);
}


x86 assembly (clang, -O0):
<Qt_setColorForeground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xec3(%rip),%rdi
call   1030 <Qt_setColor@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"foreground\00"
define void @Qt_setColorForeground(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @Qt_setColor(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"foreground\00"
define void @Qt_setColorForeground(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @Qt_setColor(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void close_serving_thread(int sockfd) {
  close(sockfd);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<close_serving_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_serving_thread>:
push   %rax
call   1030 <close@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define void @close_serving_thread(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
define void @close_serving_thread(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = tail call i32 @pthread_exit(i32* null)
ret void
}
/* Variables and functions */
double tan(double);
double cot(double x) { return 1.0 / tan(x); }


x86 assembly (clang, -O0):
<cot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cot>:
push   %rax
call   1030 <tan@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @tan(double %3)
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @cot(double %0) {
%2 = tail call double @tan(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigure_type(void *_p, int _v) {
  ((XEvent *)_p)->xconfigure.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xconfigure_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xconfigure_type(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xconfigure_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void AK_print_active_functions() {}


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

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

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

LLVM IR (-O2):
define void @AK_print_active_functions() {
ret void
}
void ceph_fscache_inode_init(struct ceph_inode_info *ci) {}


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

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

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

LLVM IR (-O2):
%struct.ceph_inode_info = type opaque
define void @ceph_fscache_inode_init(%struct.ceph_inode_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main() {
  int comparison;
  char string1[] = "alpha";
  char string2[] = "beta";
  comparison = strcmp(string1, string2);
  printf("%d\n", comparison);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x13(%rbp)
mov    0xeb8(%rip),%al
mov    %al,-0xf(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.string1 = [6 x i8] c"alpha\00"
@__const.main.string2 = [5 x i8] c"beta\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i8]
%4 = alloca [5 x i8]
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %3 to i8*
%6 = bitcast [5 x i8]* %4 to i8*
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%9 = call i32 @strcmp(i8* %7, i8* %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
long roundl(long double);
long int lroundl(long double x) { return roundl(x); }


x86 assembly (clang, -O0):
<lroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <roundl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lroundl>:
jmp    1030 <roundl@plt>

LLVM IR (-O0):
define i64 @lroundl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @roundl(x86_fp80 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lroundl(x86_fp80 %0) {
%2 = tail call i64 @roundl(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int x64ApiCallBySysNo(int, int, int /*<<< orphan*/);
int main() { return x64ApiCallBySysNo(0x29, 0xFFFFFFFFFFFFFFFF, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x29,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1030 <x64ApiCallBySysNo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x29,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
jmp    1030 <x64ApiCallBySysNo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @x64ApiCallBySysNo(i32 41, i32 -1, i32 0)
ret i32 %1
}
void free_array_of_charptr_incl(char ***arr, const int len) {
  int i;
  char **tmp = (*arr);
  for (i = 0; i < len; i++) {
    free(tmp[i]);
  }
  free(tmp);
  (*arr) = 0;
}


x86 assembly (clang, -O0):
<free_array_of_charptr_incl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <free_array_of_charptr_incl+0x4c>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <free_array_of_charptr_incl+0x21>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_array_of_charptr_incl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%r15
test   %esi,%esi
jle    1142 <free_array_of_charptr_incl+0x32>
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <free_array_of_charptr_incl+0x20>
mov    %r15,%rdi
call   1030 <free@plt>
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @free_array_of_charptr_incl(i8*** nocapture %0, i32 %1) {
%3 = load i8**, i8*** %0
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i8*, i8** %3, i64 %8
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
%14 = bitcast i8** %3 to i8*
tail call void @free(i8* %14)
store i8** null, i8*** %0
ret void
}
void glGetLightfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetLightfv() {
ret void
}
void func_2(const unsigned long pc) {}


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

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

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

LLVM IR (-O2):
define void @func_2(i64 %0) {
ret void
}
/* Type definitions */
struct bitset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __assert_true(char *, int, int);
struct bitset *alloc_bitset(int);
scalar_t__ bitset_ffs(struct bitset *);
int /*<<< orphan*/ free(struct bitset *);
void test_bitset_ffs_all_zeros(void) {
  struct bitset *bitset;
  bitset = alloc_bitset(8);
  __assert_true("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/"
                "master/test/unit/vm/bitset-test.c",
                173, (bitset_ffs(bitset) < 0));
  free(bitset);
}


x86 assembly (clang, -O0):
<test_bitset_ffs_all_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <alloc_bitset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <bitset_ffs@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xe8e(%rip),%rdi
mov    $0xad,%esi
call   1050 <__assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bitset_ffs_all_zeros>:
push   %rbx
mov    $0x8,%edi
call   1040 <alloc_bitset@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <bitset_ffs@plt>
shr    $0x3f,%rax
lea    0xe9f(%rip),%rdi
mov    $0xad,%esi
mov    %eax,%edx
call   1050 <__assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.bitset = type { i32 }
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/bitset-test.c\00"
define void @test_bitset_ffs_all_zeros() {
%1 = alloca %struct.bitset*
%2 = call %struct.bitset* @alloc_bitset(i32 8)
store %struct.bitset* %2, %struct.bitset** %1
%3 = load %struct.bitset*, %struct.bitset** %1
%4 = call i64 @bitset_ffs(%struct.bitset* %3)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @__assert_true(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 173, i32 %6)
%8 = load %struct.bitset*, %struct.bitset** %1
%9 = call i32 @free(%struct.bitset* %8)
ret void
}

LLVM IR (-O2):
%struct.bitset = type { i32 }
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/bitset-test.c\00"
define void @test_bitset_ffs_all_zeros() {
%1 = tail call %struct.bitset* @alloc_bitset(i32 8)
%2 = tail call i64 @bitset_ffs(%struct.bitset* %1)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
%5 = tail call i32 @__assert_true(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 173, i32 %4)
%6 = tail call i32 @free(%struct.bitset* %1)
ret void
}
void problemUsage() {}


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

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

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

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

/* Variables and functions */
int _atomic_compare_and_swap_u32(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int _atomic_compare_and_swap_s32(int32_t *ptr, int32_t old, int32_t new) {
  return _atomic_compare_and_swap_u32((uint32_t *)ptr, old, new);
}


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

x86 assembly (clang, -O2):
<_atomic_compare_and_swap_s32>:
jmp    1030 <_atomic_compare_and_swap_u32@plt>

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

LLVM IR (-O2):
define i32 @_atomic_compare_and_swap_s32(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_atomic_compare_and_swap_u32(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
signed long long int
signedlonglongint_ignoring_longlongint(signed long long int x,
                                       long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlonglongint_ignoring_longlongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_longlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
unsigned long unsignedlong_ignoring_signedshortint(unsigned long x,
                                                   signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlong_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlong_ignoring_signedshortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Type definitions */
struct jit_state {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ emit_alu64_imm32(struct jit_state *, int, int, int,
                                    int /*<<< orphan*/);
void emit_cmp_imm32(struct jit_state *state, int dst, int32_t imm) {
  emit_alu64_imm32(state, 0x81, 7, dst, imm);
}


x86 assembly (clang, -O0):
<emit_cmp_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0x81,%esi
mov    $0x7,%edx
call   1030 <emit_alu64_imm32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmp_imm32>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    $0x81,%esi
mov    $0x7,%edx
jmp    1030 <emit_alu64_imm32@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_cmp_imm32(%struct.jit_state* %0, i32 %1, i32 %2) {
%4 = alloca %struct.jit_state*
%5 = alloca i32
%6 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.jit_state*, %struct.jit_state** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @emit_alu64_imm32(%struct.jit_state* %7, i32 129, i32 7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_cmp_imm32(%struct.jit_state* %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_alu64_imm32(%struct.jit_state* %0, i32 129, i32 7, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
double pow(double, double);
double sRGB_to_linear(double x) {
  if (x < 0.04045)
    return x / 12.92;
  return pow((x + 0.055) / 1.055, 2.4);
}


x86 assembly (clang, -O0):
<sRGB_to_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114b <sRGB_to_linear+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <sRGB_to_linear+0x66>
movsd  0xec5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sRGB_to_linear>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1127 <sRGB_to_linear+0x17>
divsd  0xefa(%rip),%xmm0
ret
addsd  0xed9(%rip),%xmm0
divsd  0xed9(%rip),%xmm0
movsd  0xed9(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @sRGB_to_linear(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 4.045000e-02
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fdiv double %7, 1.292000e+01
store double %8, double* %2
br label %14
9: ; preds = %1
%10 = load double, double* %3
%11 = fadd double %10, 5.500000e-02
%12 = fdiv double %11, 1.055000e+00
%13 = call double @pow(double %12, double 2.400000e+00)
store double %13, double* %2
br label %14
14: ; preds = %9, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @sRGB_to_linear(double %0) {
%2 = fcmp olt double %0, 4.045000e-02
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fdiv double %0, 1.292000e+01
br label %9
5: ; preds = %1
%6 = fadd double %0, 5.500000e-02
%7 = fdiv double %6, 1.055000e+00
%8 = tail call double @pow(double %7, double 2.400000e+00)
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void merge_sort(int *a, int p, int r) {
  int q;
  if (p < r) {
    q = (p + r) / 2;
    merge_sort(a, p, q);
    merge_sort(a, q + 1, r);
    merge(a, p, q, r);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <merge_sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %edx,%esi
jge    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void kb_wait_4(void) {
  unsigned long timeout = 2;
  do {
    (1 ? printf("timeout=%ld\n", timeout) : ({
      switch (timeout) {
      case 2:
        printf("timeout is 2");
        break;
      case 1:
        printf("timeout is 1");
        break;
      default:
        printf("timeout is 0?");
        break;
      };
    }));
    timeout--;
  } while (timeout);
}


x86 assembly (clang, -O0):
<kb_wait_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1120 <kb_wait_4+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_wait_4>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"timeout=%ld\0A\00"
define void @kb_wait_4() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 2)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 1)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t QEIIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000028))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000024))));
  }
}


x86 assembly (clang, -O0):
<QEIIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1126 <QEIIntStatus+0x26>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <QEIIntStatus+0x32>
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x24(%rcx,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @QEIIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 36, i64 40
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
double P(int degree) { return 0.62 / (double)(degree * degree); }


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @P(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to double
%7 = fdiv double 6.200000e-01, %6
ret double %7
}

LLVM IR (-O2):
define double @P(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sitofp i32 %2 to double
%4 = fdiv double 6.200000e-01, %3
ret double %4
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
char *upper_set(char *data) {
  int ctr = 0;
  int len = strlen(data);
  for (ctr = 0; ctr < len; ctr++)
    data[ctr] = toupper(data[ctr]);
  return (data);
}


x86 assembly (clang, -O0):
<upper_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117e <upper_set+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <upper_set+0x26>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper_set>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <upper_set+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <upper_set+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @upper_set(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGFontRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGFontRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGFontRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ wpa_key_mgmt_wpa(int);
int wpa_key_mgmt_wpa_any(int akm) {
  return wpa_key_mgmt_wpa(akm) || (akm & (1 << (4)));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <wpa_key_mgmt_wpa@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1144 <wpa_key_mgmt_wpa_any+0x34>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa_any>:
push   %rbx
mov    %edi,%ebx
call   1030 <wpa_key_mgmt_wpa@plt>
test   %rax,%rax
setne  %al
and    $0x10,%ebx
shr    $0x4,%ebx
or     %al,%bl
movzbl %bl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa_any(i32 %0) {
%2 = tail call i64 @wpa_key_mgmt_wpa(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, 16
%5 = icmp ne i32 %4, 0
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ inc1(int);
int /*<<< orphan*/ inc2(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  int b = 0;
  inc1(a);
  inc2(&b);
  printf("a= %d\n", a);
  printf("b= %d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <inc1@plt>
lea    -0xc(%rbp),%rdi
call   1050 <inc2@plt>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
xor    %edi,%edi
call   1040 <inc1@plt>
lea    0x4(%rsp),%rdi
call   1050 <inc2@plt>
lea    0xeaf(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"a= %d\0A\00"
@.str.1 = [7 x i8] c"b= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @inc1(i32 %4)
%6 = call i32 @inc2(i32* %3)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"a= %d\0A\00"
@.str.1 = [7 x i8] c"b= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @inc1(i32 0)
%4 = call i32 @inc2(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int say_bye(void *m) {
  printf("Bye, free mem at %p \n", m);
  return 0;
}


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

x86 assembly (clang, -O2):
<say_bye>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Bye, free mem at %p \0A\00"
define i32 @say_bye(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Bye, free mem at %p \0A\00"
define i32 @say_bye(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef int option;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetCommBps(unsigned char option) {
  SendChar((0XEE) & 0xFF);
  SendChar((0xA0) & 0xFF);
  SendChar((option)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetCommBps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xa0,%edi
call   1030 <SendChar@plt>
movzbl -0x1(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetCommBps>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xa0,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetCommBps(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 160)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = call i32 @SendChar(i32 %7)
%9 = call i32 @SendChar(i32 255)
%10 = call i32 @SendChar(i32 252)
%11 = call i32 @SendChar(i32 255)
%12 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetCommBps(i8 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 160)
%4 = zext i8 %0 to i32
%5 = tail call i32 @SendChar(i32 %4)
%6 = tail call i32 @SendChar(i32 255)
%7 = tail call i32 @SendChar(i32 252)
%8 = tail call i32 @SendChar(i32 255)
%9 = tail call i32 @SendChar(i32 255)
ret void
}
void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_add_netdev(%struct.ieee80211_sub_if_data* nocapture %0) {
ret void
}
int CompareInt(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

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

LLVM IR (-O0):
define i32 @CompareInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @CompareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void native_irq_disable(void) { asm volatile("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @native_irq_disable() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_D3uint8_mem(unsigned char *val) {
  return ((*val) & (0xD3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -45
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int Partition(int *, int, int);
void QuickSort(int array[], int low, int high) {
  int pivot = 0;
  if (low < high) {
    pivot = Partition(array, low, high);
    QuickSort(array, low, pivot - 1);
    QuickSort(array, pivot + 1, high);
  }
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <QuickSort+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QuickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}