xunge/DecIR huggingface dataset:
unsigned int DJBHash(char *str) {
  unsigned int hash = 5381;
  while (*str)
    hash += (hash << 5) + (*str++);
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<DJBHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <DJBHash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <DJBHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DJBHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <DJBHash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <DJBHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @DJBHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 33
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
void g_closure_invoke() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_invoke() {
ret void
}
/* Variables and functions */
int is_alphanumeric(char);
int my_word_size(char *str) {
  int i;
  i = 0;
  while (is_alphanumeric(str[i]) == 1)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<my_word_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <is_alphanumeric@plt>
cmp    $0x1,%eax
jne    114b <my_word_size+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <my_word_size+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_word_size>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <is_alphanumeric@plt>
add    $0x1,%ebp
add    $0x1,%rbx
cmp    $0x1,%eax
je     1120 <my_word_size+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_word_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = call i32 @is_alphanumeric(i8 signext %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @my_word_size(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @is_alphanumeric(i8 signext %5)
%7 = icmp eq i32 %6, 1
%8 = add nuw i64 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
%10 = trunc i64 %3 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void arg_parser_print_version(void) {
  printf("%s %s\n", (strlen("Athena") ? "Athena" : "Athena"), "0.1");
}


x86 assembly (clang, -O0):
<arg_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xec1(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [7 x i8] c"Athena\00"
@.str.2 = [4 x i8] c"0.1\00"
define void @arg_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [7 x i8] c"Athena\00"
@.str.2 = [4 x i8] c"0.1\00"
define void @arg_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Time2Frame(int, int, int);
unsigned Time2HSG(int min, int sec, int frame) {
  return Time2Frame(min, sec, frame) - 150;
}


x86 assembly (clang, -O0):
<Time2HSG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <Time2Frame@plt>
sub    $0x96,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Time2HSG>:
push   %rax
call   1030 <Time2Frame@plt>
add    $0xffffff6a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Time2HSG(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 @Time2Frame(i32 %7, i32 %8, i32 %9)
%11 = sub nsw i32 %10, 150
ret i32 %11
}

LLVM IR (-O2):
define i32 @Time2HSG(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Time2Frame(i32 %0, i32 %1, i32 %2)
%5 = add nsw i32 %4, -150
ret i32 %5
}
/* Variables and functions */
int mt_rand_32(int);
int rint(double);
int mt_rand_int(int n, int my_rank) {
  double full_value = mt_rand_32(my_rank) * (n / 4294967295.0);
  return rint(full_value);
}


x86 assembly (clang, -O0):
<mt_rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <mt_rand_32@plt>
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeb9(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <rint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_int>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <mt_rand_32@plt>
cvtsi2sd %eax,%xmm1
cvtsi2sd %ebx,%xmm0
divsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbx
jmp    1030 <rint@plt>

LLVM IR (-O0):
define i32 @mt_rand_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @mt_rand_32(i32 %6)
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 0x41EFFFFFFFE00000
%12 = fmul double %8, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = call i32 @rint(double %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mt_rand_int(i32 %0, i32 %1) {
%3 = tail call i32 @mt_rand_32(i32 %1)
%4 = sitofp i32 %3 to double
%5 = sitofp i32 %0 to double
%6 = fdiv double %5, 0x41EFFFFFFFE00000
%7 = fmul double %6, %4
%8 = tail call i32 @rint(double %7)
ret i32 %8
}
void clear(void) {}


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

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

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

LLVM IR (-O2):
define void @clear() {
ret void
}
__attribute__((always_)) void swiotlb_free(void) {}


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

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

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

LLVM IR (-O2):
define void @swiotlb_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sumar_referencia(int *);
int main(void) {
  int numero = 57;
  sumar_referencia(&numero);
  printf("\nValor de numero dentro de main() es: %d ", numero);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x39,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <sumar_referencia@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0AValor de numero dentro de main() es: %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 57, i32* %2
%3 = call i32 @sumar_referencia(i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0AValor de numero dentro de main() es: %d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 57, i32* %1
%3 = call i32 @sumar_referencia(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned int state;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void set_XKeyEvent_state(void *_p, unsigned _v) {
  ((XKeyEvent *)_p)->state = (unsigned)_v;
}


x86 assembly (clang, -O0):
<set_XKeyEvent_state>:
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_XKeyEvent_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyEvent_state(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_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyEvent_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
char *dnsquery(const char *domain, int qtype, unsigned int *ttl) {
  if (ttl)
    *ttl = 1;
  return NULL;
}


x86 assembly (clang, -O0):
<dnsquery>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1124 <dnsquery+0x24>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnsquery>:
test   %rdx,%rdx
je     110b <dnsquery+0xb>
movl   $0x1,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @dnsquery(i8* nocapture readnone %0, i32 %1, i32* writeonly %2) {
%4 = icmp eq i32* %2, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 1, i32* %2
br label %6
6: ; preds = %5, %3
ret i8* null
}
void rotr(int *a, int *b, int *c) {
  int swap;
  swap = *a;
  *a = *c;
  *c = *b;
  *b = swap;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @rotr(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** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int convert(int, int, char *, int /*<<< orphan*/);
int itoa(int n, int b, char str[]) {
  int i = convert(n, b, str, 0);
  str[i] = '\0';
  return i;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <convert@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %rdx,%rbx
xor    %ecx,%ecx
call   1030 <convert@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @itoa(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @convert(i32 %8, i32 %9, i8* %10, i32 0)
store i32 %11, i32* %7
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @itoa(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @convert(i32 %0, i32 %1, i8* %2, i32 0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
store i8 0, i8* %6
ret i32 %4
}
void handle_key_mem_win(int ch) {}


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

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

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

LLVM IR (-O2):
define void @handle_key_mem_win(i32 %0) {
ret void
}
int compare_entiers(const void *elem_1, const void *elem_2) {
  return (*((int *)elem_1) - *((int *)elem_2));
}


x86 assembly (clang, -O0):
<compare_entiers>:
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):
<compare_entiers>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_entiers(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 @compare_entiers(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
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen();
int /*<<< orphan*/ pauseMessage(char *);
void pauseMessageAndClearScreen(char *message) {
  pauseMessage(message);
  clearScreen();
}


x86 assembly (clang, -O0):
<pauseMessageAndClearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pauseMessage@plt>
mov    $0x0,%al
call   1040 <clearScreen@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pauseMessageAndClearScreen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pauseMessage(i8* %3)
%5 = call i32 (...) @clearScreen()
ret void
}

LLVM IR (-O2):
define void @pauseMessageAndClearScreen(i8* %0) {
%2 = tail call i32 @pauseMessage(i8* %0)
%3 = tail call i32 (...) @clearScreen()
ret void
}
int adjust_dbm_level(int dbm_val) {
  if (dbm_val >= 64)
    dbm_val -= 0x100;
  return dbm_val;
}


x86 assembly (clang, -O0):
<adjust_dbm_level>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jl     111c <adjust_dbm_level+0x1c>
mov    -0x4(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_dbm_level>:
lea    -0x100(%rdi),%eax
cmp    $0x40,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @adjust_dbm_level(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 64
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 256
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @adjust_dbm_level(i32 %0) {
%2 = icmp sgt i32 %0, 63
%3 = add nsw i32 %0, -256
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
/* Variables and functions */
int rom_present(char *);
int et4000_available() { return rom_present("et4000.bin"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"et4000.bin\00"
define i32 @et4000_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"et4000.bin\00"
define i32 @et4000_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
bool nrf_drv_usbd_errata_171(void) { return (1 && true); }


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

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

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_171() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_171() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t encode_float(float val) { return *(uint32_t *)&val; }


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

x86 assembly (clang, -O2):
<encode_float>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @encode_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @encode_float(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
void gtk_list_store_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *needLargeMem(size_t);
void *needLargeZeroedMem(size_t size) {
  void *v;
  v = needLargeMem(size);
  memset(v, 0, size);
  return v;
}


x86 assembly (clang, -O0):
<needLargeZeroedMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <needLargeMem@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<needLargeZeroedMem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <needLargeMem@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @needLargeZeroedMem(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @needLargeMem(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @needLargeZeroedMem(i64 %0) {
%2 = tail call i8* @needLargeMem(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void perror_exit(char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perror_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *threadEntry(void *data) {
  printf("Hello from thread(id=0x%lx)!\n", pthread_self());
  return NULL;
}


x86 assembly (clang, -O0):
<threadEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadEntry>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello from thread(id=0x%lx)!\0A\00"
define i8* @threadEntry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello from thread(id=0x%lx)!\0A\00"
define noalias i8* @threadEntry(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* null
}
char *ob_strtlc(char *str) {
  char *c = str;
  while ((*c) != 0) {
    if (((*c) >= 'A') && ((*c) <= 'Z')) {
      (*c) -= ('A' - 'a');
    }
    c++;
  }
  return str;
}


x86 assembly (clang, -O0):
<ob_strtlc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <ob_strtlc+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <ob_strtlc+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <ob_strtlc+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0xffffffe0,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ob_strtlc+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ob_strtlc>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ob_strtlc+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <ob_strtlc+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <ob_strtlc+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <ob_strtlc+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <ob_strtlc+0x10>
ret

LLVM IR (-O0):
define i8* @ob_strtlc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, -32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @ob_strtlc(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
void test_signed_long() {
  unsigned long a;
  long b;
  signed long c;
  int *p = 1 ? &b : &c;
}


x86 assembly (clang, -O0):
<test_signed_long>:
push   %rbp
mov    %rsp,%rbp
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_signed_long() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32*
%5 = bitcast i64* %2 to i32*
store i32* %5, i32** %4
ret void
}

LLVM IR (-O2):
define void @test_signed_long() {
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long _dtlsIdCallback(void) { return (unsigned long)pthread_self(); }


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

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

LLVM IR (-O0):
define i64 @_dtlsIdCallback() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @_dtlsIdCallback() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int posix_memalign(void **, size_t, size_t);
void *aligned_alloc(size_t alignment, size_t size) {
  void *p;
  int error;
  error = posix_memalign(&p, alignment, size);
  return (error == 0 ? p : NULL);
}


x86 assembly (clang, -O0):
<aligned_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114b <aligned_alloc+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1156 <aligned_alloc+0x46>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1156 <aligned_alloc+0x46>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_alloc>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %eax,%eax
jne    1129 <aligned_alloc+0x19>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %0, i64 %1)
%6 = icmp eq i32 %5, 0
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* %7, i8* null
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ le32_lget(int /*<<< orphan*/ const *);
uint32_t le_iget(const uint8_t *addr) { return (uint32_t)le32_lget(addr); }


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

x86 assembly (clang, -O2):
<le_iget>:
jmp    1030 <le32_lget@plt>

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

LLVM IR (-O2):
define i32 @le_iget(i32* %0) {
%2 = tail call i32 @le32_lget(i32* %0)
ret i32 %2
}
XFreeFont() {}


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

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

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

LLVM IR (-O2):
define i32 @XFreeFont() {
ret i32 undef
}
void gdk_screen_get_monitor_at_point() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_monitor_at_point() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mem_Dump();
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  Mem_Dump();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1040 <Mem_Dump@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1040 <Mem_Dump@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @Mem_Init(i32 4096)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 (...) @Mem_Dump()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @Mem_Dump()
%6 = tail call i32 @exit(i32 0)
unreachable
}
int if_bad_loop_constant() {
  int p = 10;
  for (int j = 0; j < 5; j++) {
    if (j < 2) {
      p++;
    } else {
      p = 3;
      for (int k = 0; k < 10; k++) {
        int m = 0;
      }
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<if_bad_loop_constant>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1179 <if_bad_loop_constant+0x79>
cmpl   $0x2,-0x8(%rbp)
jge    1134 <if_bad_loop_constant+0x34>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <if_bad_loop_constant+0x66>
movl   $0x3,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1161 <if_bad_loop_constant+0x61>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <if_bad_loop_constant+0x42>
jmp    1166 <if_bad_loop_constant+0x66>
jmp    116b <if_bad_loop_constant+0x6b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <if_bad_loop_constant+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @if_bad_loop_constant() {
ret i32 3
}
int simple_loop(int arg1, int arg2) {
  int i = 0, ret = 0;
  goto H;
H:
  if (i < arg2) {
  B:
    ret += arg1;
    ++i;
    goto H;
  } else {
  T:
    return ret;
  }
}


x86 assembly (clang, -O0):
<simple_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1140 <simple_loop+0x40>
jmp    1129 <simple_loop+0x29>
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <simple_loop+0x18>
jmp    1145 <simple_loop+0x45>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_loop>:
imul   %esi,%edi
xor    %eax,%eax
test   %esi,%esi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @simple_loop(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = mul i32 %1, %0
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
main() {
  int i = 3;
  f(&i);
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%3 = call i32 @f(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
unsigned int htonl(unsigned int);
unsigned int network_htonl(unsigned int s) { return htonl(s); }


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

x86 assembly (clang, -O2):
<network_htonl>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i32 @network_htonl(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
ret i32 %2
}
float f2(__attribute__((vector_size(16))) float t) { return ((float *)&t)[2]; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movhlps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f2(<4 x float> %0) {
%2 = alloca <4 x float>
store <4 x float> %0, <4 x float>* %2
%3 = bitcast <4 x float>* %2 to float*
%4 = getelementptr inbounds float, float* %3, i64 2
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @f2(<4 x float> %0) {
%2 = extractelement <4 x float> %0, i64 2
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ RC4(unsigned char const *, int const, unsigned char const *,
                       int const, unsigned char *);
void decode_rc4(const unsigned char *ciphertext, const int ciphertext_length,
                const unsigned char *key, const int key_length,
                unsigned char *plaintext) {
  0;
  RC4(ciphertext, ciphertext_length, key, key_length, plaintext);
}


x86 assembly (clang, -O0):
<decode_rc4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <RC4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_rc4>:
jmp    1030 <RC4@plt>

LLVM IR (-O0):
define void @decode_rc4(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @RC4(i8* %11, i32 %12, i8* %13, i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @decode_rc4(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @RC4(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4)
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __get_FPSCR(void) { return (0U); }


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

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

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

LLVM IR (-O2):
define i32 @__get_FPSCR() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decode_dna(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  decode_dna("ACATGGTGCACCTGACTCTCATTTGAGATATAAAAAAACCATGAGAGCGATGGCGCTACGCATAA"
             "TATAAAAA");
  printf("Press any key to exit...");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <decode_dna@plt>
lea    0xef8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <decode_dna@plt>
lea    0xf06(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"ACATGGTGCACCTGACTCTCATTTGAGATATAAAAAAACCATGAGAGCGATGGCGCTACGCATAATATAAAAA\00"
@.str.1 = [25 x i8] c"Press any key to exit...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @decode_dna(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [74 x i8] c"ACATGGTGCACCTGACTCTCATTTGAGATATAAAAAAACCATGAGAGCGATGGCGCTACGCATAATATAAAAA\00"
@.str.1 = [25 x i8] c"Press any key to exit...\00"
define i32 @main() {
%1 = tail call i32 @decode_dna(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
scalar_t__ mpz_get_str(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char *gmpint2str(mpz_t *op, int base) {
  return (char *)mpz_get_str(NULL, base, *op);
}


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

x86 assembly (clang, -O2):
<gmpint2str>:
mov    (%rdi),%edx
xor    %edi,%edi
jmp    1030 <mpz_get_str@plt>

LLVM IR (-O0):
define i8* @gmpint2str(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i64 @mpz_get_str(i32* null, i32 %5, i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @gmpint2str(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i64 @mpz_get_str(i32* null, i32 %1, i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
time_t osGetTickCount(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @osGetTickCount() {
ret i32 0
}
/* Variables and functions */
char *normalize_path(char const *);
char *libio_realpath(const char *src) {
  char *rpath = normalize_path(src);
  if (rpath)
    return rpath;
  return NULL;
}


x86 assembly (clang, -O0):
<libio_realpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <normalize_path@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <libio_realpath+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <libio_realpath+0x39>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libio_realpath>:
jmp    1030 <normalize_path@plt>

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

LLVM IR (-O2):
define i8* @libio_realpath(i8* %0) {
%2 = tail call i8* @normalize_path(i8* %0)
ret i8* %2
}
int test_imm_92uint16_mem(unsigned short *val) {
  return ((*val) & (-0x92 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_92uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -146
%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_92uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -146
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ turnLeftC(unsigned int, unsigned int);
void turnLeft_degree(unsigned int speed, unsigned int angle) {
  turnLeftC(speed, angle * 546 / 90);
}


x86 assembly (clang, -O0):
<turnLeft_degree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   $0x222,-0x8(%rbp),%eax
mov    $0x5a,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
call   1030 <turnLeftC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnLeft_degree>:
imul   $0x222,%esi,%eax
shr    %eax
mov    $0xb60b60b7,%esi
imul   %rax,%rsi
shr    $0x25,%rsi
jmp    1030 <turnLeftC@plt>

LLVM IR (-O0):
define void @turnLeft_degree(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul i32 %6, 546
%8 = udiv i32 %7, 90
%9 = call i32 @turnLeftC(i32 %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @turnLeft_degree(i32 %0, i32 %1) {
%3 = mul i32 %1, 546
%4 = udiv i32 %3, 90
%5 = tail call i32 @turnLeftC(i32 %0, i32 %4)
ret void
}