xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exitWrapper() { exit(0); }


x86 assembly (clang, -O0):
<exitWrapper>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exitWrapper>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exitWrapper() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exitWrapper() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
long double _Complex sub_long_double_cc(long double _Complex a,
                                        long double _Complex b) {
  return a - b;
}


x86 assembly (clang, -O0):
<sub_long_double_cc>:
push   %rbp
mov    %rsp,%rbp
lea    0x30(%rbp),%rax
lea    0x10(%rbp),%rcx
fldt   (%rcx)
fldt   0x10(%rcx)
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(3)
fsubp  %st,%st(1)
fxch   %st(1)
fsubp  %st,%st(2)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_long_double_cc>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fldt   0x28(%rsp)
fsubrp %st,%st(2)
fldt   0x38(%rsp)
fsubrp %st,%st(1)
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @sub_long_double_cc({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0, { x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 0
%9 = load x86_fp80, x86_fp80* %8
%10 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 1
%11 = load x86_fp80, x86_fp80* %10
%12 = fsub x86_fp80 %5, %9
%13 = fsub x86_fp80 %7, %11
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%15 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %12, x86_fp80* %14
store x86_fp80 %13, x86_fp80* %15
%16 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %16
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @sub_long_double_cc({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0, { x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 0
%8 = load x86_fp80, x86_fp80* %7
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 1
%10 = load x86_fp80, x86_fp80* %9
%11 = fsub x86_fp80 %4, %8
%12 = fsub x86_fp80 %6, %10
%13 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %11, 0
%14 = insertvalue { x86_fp80, x86_fp80 } %13, x86_fp80 %12, 1
ret { x86_fp80, x86_fp80 } %14
}
/* Variables and functions */
int foo(int);
int fn_42_a(int locked) {
  int i;
  if (locked)
    i = foo(0);
  else
    i = foo(1);

  if (i > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fn_42_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <fn_42_a+0x24>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
jmp    1141 <fn_42_a+0x31>
mov    $0x1,%edi
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1157 <fn_42_a+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <fn_42_a+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_42_a>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fn_42_a(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @foo(i32 %3)
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pushDown(int, int *, int);
void montaHeap(int *heap, int n) {
  int i;
  for (i = n / 2; i >= 1; i--) {
    pushDown(i, heap, n);
  }
}


x86 assembly (clang, -O0):
<montaHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1154 <montaHeap+0x44>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <pushDown@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <montaHeap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<montaHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <montaHeap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <pushDown@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <montaHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @montaHeap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @pushDown(i32 %7, i32* %0, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
void write_utmp() { struct passwd *pw; }


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

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

LLVM IR (-O0):
%struct.passwd = type opaque
define void @write_utmp() {
%1 = alloca %struct.passwd*
ret void
}

LLVM IR (-O2):
%struct.passwd = type opaque
define void @write_utmp() {
ret void
}
void _M2_PolyMatrix3D_finish(__attribute__((unused)) int argc,
                             __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_PolyMatrix3D_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ system(char *);
int remove_folder(char *folder) {
  char cmd[512];
  sprintf(cmd, "rm -rf %s", folder);
  if (system(cmd))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<remove_folder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1168 <remove_folder+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <remove_folder+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_folder>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
neg    %rax
sbb    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"rm -rf %s\00"
define i32 @remove_folder(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef double suseconds_t;

/* Variables and functions */
double toSeconds(suseconds_t micros) { return (micros / 1000000.0); }


x86 assembly (clang, -O0):
<toSeconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toSeconds>:
divsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @toSeconds(double %0) {
%2 = fdiv double %0, 1.000000e+06
ret double %2
}
/* Type definitions */
struct PMC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void never_ever(int *interp, struct PMC *pmc) { abort(); }


x86 assembly (clang, -O0):
<never_ever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<never_ever>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.PMC = type { i32 }
define void @never_ever(i32* %0, %struct.PMC* %1) {
%3 = alloca i32*
%4 = alloca %struct.PMC*
store i32* %0, i32** %3
store %struct.PMC* %1, %struct.PMC** %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.PMC = type { i32 }
define void @never_ever(i32* nocapture readnone %0, %struct.PMC* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct shl_htable {
  int dummy;
};

/* Variables and functions */
int shl_htable_remove(struct shl_htable *, void const *, size_t, void **);
bool shl_htable_remove_ulong(struct shl_htable *htable, unsigned long key,
                             unsigned long **out) {
  return shl_htable_remove(htable, (const void *)&key, (size_t)key,
                           (void **)out);
}


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

x86 assembly (clang, -O2):
<shl_htable_remove_ulong>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <shl_htable_remove@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.shl_htable = type { i32 }
define i32 @shl_htable_remove_ulong(%struct.shl_htable* %0, i64 %1, i64** %2) {
%4 = alloca %struct.shl_htable*
%5 = alloca i64
%6 = alloca i64**
store %struct.shl_htable* %0, %struct.shl_htable** %4
store i64 %1, i64* %5
store i64** %2, i64*** %6
%7 = load %struct.shl_htable*, %struct.shl_htable** %4
%8 = bitcast i64* %5 to i8*
%9 = load i64, i64* %5
%10 = load i64**, i64*** %6
%11 = bitcast i64** %10 to i8**
%12 = call i32 @shl_htable_remove(%struct.shl_htable* %7, i8* %8, i64 %9, i8** %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.shl_htable = type { i32 }
define i32 @shl_htable_remove_ulong(%struct.shl_htable* %0, i64 %1, i64** %2) {
%4 = alloca i64
store i64 %1, i64* %4
%5 = bitcast i64* %4 to i8*
%6 = bitcast i64** %2 to i8**
%7 = call i32 @shl_htable_remove(%struct.shl_htable* %0, i8* %5, i64 %1, i8** %6)
ret i32 %7
}
void playlist_invert_selection() {}


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

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

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

LLVM IR (-O2):
define void @playlist_invert_selection() {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int gladiator_chooses_the_door(void) { return rand() / (RAND_MAX / 3); }


x86 assembly (clang, -O0):
<gladiator_chooses_the_door>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gladiator_chooses_the_door>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x55555556,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
cltd
idiv   %ecx
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @gladiator_chooses_the_door() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 3
%4 = sdiv i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @gladiator_chooses_the_door() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 3
%4 = sdiv i32 %1, %3
ret i32 %4
}
/* Variables and functions */
double log(double);
double Entropy_h(double p) { return p > 0 ? (p * log(p)) : 0; }


x86 assembly (clang, -O0):
<Entropy_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1159 <Entropy_h+0x49>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1166 <Entropy_h+0x56>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1166 <Entropy_h+0x56>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Entropy_h>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    1136 <Entropy_h+0x26>
push   %rax
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @Entropy_h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @log(double %7)
%9 = fmul double %6, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi double [ %9, %5 ], [ 0.000000e+00, %10 ]
ret double %12
}

LLVM IR (-O2):
define double @Entropy_h(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @log(double %0)
%5 = fmul double %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
ret double %7
}
void wlan_init_ap(void) {}


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

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

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

LLVM IR (-O2):
define void @wlan_init_ap() {
ret void
}
void check_negative_sized_VLA_4() {
  unsigned int x = -1;
  int vla[x];
}


x86 assembly (clang, -O0):
<check_negative_sized_VLA_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_negative_sized_VLA_4() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 -1, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @check_negative_sized_VLA_4() {
ret void
}
int test_imm_0Cuint32_mem(unsigned int *val) {
  return ((*val) & (0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 12
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void reverse(char on) { printf("%c[%dm", 0x1B, on != 0 ? 7 : 27); }


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1b,%edx
mov    $0x7,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xec7(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
test   %dil,%dil
mov    $0x1b,%eax
mov    $0x7,%edx
cmove  %eax,%edx
lea    0xed9(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dm\00"
define void @reverse(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 7, i32 27
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dm\00"
define void @reverse(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 27, i32 7
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3)
ret void
}
void XtKeysymToKeycodeList() {}


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

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

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

LLVM IR (-O2):
define void @XtKeysymToKeycodeList() {
ret void
}
int x16_setup() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @x16_setup() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ tcflush(int /*<<< orphan*/, int /*<<< orphan*/);
void flushin(FILE *fp) { (void)tcflush(fileno(fp), TCIFLUSH); }


x86 assembly (clang, -O0):
<flushin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushin>:
push   %rax
call   1040 <fileno@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIFLUSH = global i32 0
define void @flushin(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = load i32, i32* @TCIFLUSH
%6 = call i32 @tcflush(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@TCIFLUSH = global i32 0
define void @flushin(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = load i32, i32* @TCIFLUSH
%4 = tail call i32 @tcflush(i32 %2, i32 %3)
ret void
}
void Android420ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @Android420ToABGR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ttsetup();
setup() { ttsetup(); }


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

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

LLVM IR (-O0):
define i32 @setup() {
%1 = alloca i32
%2 = call i32 (...) @ttsetup()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @setup() {
%1 = tail call i32 (...) @ttsetup()
ret i32 undef
}
int cpy_asc(unsigned long value, void *arg) {
  unsigned char **p, *q;
  p = arg;
  q = *p;
  *q = (unsigned char)value;
  (*p)++;
  return 1;
}


x86 assembly (clang, -O0):
<cpy_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy_asc>:
mov    (%rsi),%rax
mov    %dil,(%rax)
addq   $0x1,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cpy_asc(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = trunc i64 %0 to i8
store i8 %5, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ resetty();
void uninitgame() {
  clear();
  (void)refresh();
  (void)resetty();
  (void)echo();
  (void)endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<uninitgame>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1040 <resetty@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<uninitgame>:
push   %rax
xor    %eax,%eax
call   1080 <clear@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1040 <resetty@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define void @uninitgame() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @resetty()
%4 = call i32 (...) @echo()
%5 = call i32 (...) @endwin()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @uninitgame() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @resetty()
%4 = tail call i32 (...) @echo()
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @exit(i32 0)
unreachable
}
int minstrel_ewma(int old, int new, int weight) {
  int diff, incr;
  diff = new - old;
  incr = (128 - weight) * diff / 128;
  return old + incr;
}


x86 assembly (clang, -O0):
<minstrel_ewma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x80,%eax
sub    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minstrel_ewma>:
sub    %edi,%esi
mov    $0x80,%ecx
sub    %edx,%ecx
imul   %esi,%ecx
lea    0x7f(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x7,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @minstrel_ewma(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = sub nsw i32 128, %12
%14 = load i32, i32* %7
%15 = mul nsw i32 %13, %14
%16 = sdiv i32 %15, 128
store i32 %16, i32* %8
%17 = load i32, i32* %4
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @minstrel_ewma(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %0
%5 = sub nsw i32 128, %2
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %6, 128
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
scalar_t__ setjmp(int /*<<< orphan*/);
void time_setjmp(int count) {
  int i;
  jmp_buf buf;
  for (i = 0; i < count; i++) {
    if (setjmp(buf))
      continue;
    longjmp(buf, 1);
  }
}


x86 assembly (clang, -O0):
<time_setjmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1170 <time_setjmp+0x50>
mov    -0xc(%rbp),%edi
call   1030 <setjmp@plt>
cmp    $0x0,%rax
je     1155 <time_setjmp+0x35>
jmp    1162 <time_setjmp+0x42>
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1040 <longjmp@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <time_setjmp+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_setjmp>:
push   %rbx
test   %edi,%edi
jle    113f <time_setjmp+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
call   1030 <setjmp@plt>
test   %rax,%rax
je     1141 <time_setjmp+0x21>
add    $0xffffffff,%ebx
jne    1130 <time_setjmp+0x10>
pop    %rbx
ret
mov    $0x1,%esi
call   1040 <longjmp@plt>

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

LLVM IR (-O2):
define void @time_setjmp(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %12
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %12, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 0, %1 ]
%7 = tail call i64 @setjmp(i32 undef)
%8 = icmp eq i64 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5
%11 = tail call i32 @longjmp(i32 undef, i32 1)
unreachable
12: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int pfq_fetchb_common();
int /*<<< orphan*/ wait(int, int /*<<< orphan*/);
uint16_t pfq_fetchw(void) {
  uint16_t temp;
  temp = pfq_fetchb_common();
  wait(1, 0);
  temp |= (pfq_fetchb_common() << 8);
  return temp;
}


x86 assembly (clang, -O0):
<pfq_fetchw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pfq_fetchb_common@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <wait@plt>
mov    $0x0,%al
call   1030 <pfq_fetchb_common@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfq_fetchw>:
push   %rbx
xor    %eax,%eax
call   1030 <pfq_fetchb_common@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <wait@plt>
xor    %eax,%eax
call   1030 <pfq_fetchb_common@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pfq_fetchw() {
%1 = alloca i32
%2 = call i32 (...) @pfq_fetchb_common()
store i32 %2, i32* %1
%3 = call i32 @wait(i32 1, i32 0)
%4 = call i32 (...) @pfq_fetchb_common()
%5 = shl i32 %4, 8
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @pfq_fetchw() {
%1 = tail call i32 (...) @pfq_fetchb_common()
%2 = tail call i32 @wait(i32 1, i32 0)
%3 = tail call i32 (...) @pfq_fetchb_common()
%4 = shl i32 %3, 8
%5 = or i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
p(char *p) { printf("hello %s %s\n", p, "n/a"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello %s %s\0A\00"
@.str.1 = [4 x i8] c"n/a\00"
define i32 @p(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello %s %s\0A\00"
@.str.1 = [4 x i8] c"n/a\00"
define i32 @p(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
unsigned int test_11(unsigned int a, int b) { return (a >> 1) | (b << 31); }


x86 assembly (clang, -O0):
<test_11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_11>:
mov    %edi,%eax
shrd   $0x1,%esi,%eax
ret

LLVM IR (-O0):
define i32 @test_11(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 = lshr i32 %5, 1
%7 = load i32, i32* %4
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_11(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %1, i32 %0, i32 31)
ret i32 %3
}
/* Variables and functions */
long mod_inv(long, long);
int /*<<< orphan*/ printf(char *, long, long, long, long);
long mod_inv_test(long num, long mod, long inv) {
  long invEval = mod_inv(num, mod);
  if (inv != invEval) {
    printf("Incorrect evaluation of %d^-1 mod %d: %d instead of %d.\n", num,
           mod, invEval, inv);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mod_inv_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <mod_inv@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     117c <mod_inv_test+0x5c>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movq   $0x1,-0x8(%rbp)
jmp    1184 <mod_inv_test+0x64>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_inv_test>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <mod_inv@plt>
cmp    %r14,%rax
jne    113c <mod_inv_test+0x1c>
xor    %eax,%eax
jmp    1159 <mod_inv_test+0x39>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %rax,%rcx
mov    %r14,%r8
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Incorrect evaluation of %d^-1 mod %d: %d instead of %d.\0A\00"
define i64 @mod_inv_test(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 @mod_inv(i64 %9, i64 %10)
store i64 %11, i64* %8
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = load i64, i64* %8
%19 = load i64, i64* %7
%20 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i64 %16, i64 %17, i64 %18, i64 %19)
store i64 1, i64* %4
br label %22
21: ; preds = %3
store i64 0, i64* %4
br label %22
22: ; preds = %21, %15
%23 = load i64, i64* %4
ret i64 %23
}

LLVM IR (-O2):
@.str = [57 x i8] c"Incorrect evaluation of %d^-1 mod %d: %d instead of %d.\0A\00"
define i64 @mod_inv_test(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @mod_inv(i64 %0, i64 %1)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %4, i64 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ 1, %6 ], [ 0, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ _bad_return_address(int);
void bad_return_zero(void) { _bad_return_address(0x0); }


x86 assembly (clang, -O0):
<bad_return_zero>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_bad_return_address@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_return_zero>:
xor    %edi,%edi
jmp    1030 <_bad_return_address@plt>

LLVM IR (-O0):
define void @bad_return_zero() {
%1 = call i32 @_bad_return_address(i32 0)
ret void
}

LLVM IR (-O2):
define void @bad_return_zero() {
%1 = tail call i32 @_bad_return_address(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int rand();
int main(void) {
  char *p;
  int k;
  for (;;) {
    p = (char *)malloc(1024);
    for (k = 0; k < 1024; k++)
      p[k] = rand() % 256;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1179 <main+0x59>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1040 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1140 <main+0x20>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %21, %0
%5 = call i64 @malloc(i32 1024)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
store i32 0, i32* %3
br label %7
7: ; preds = %18, %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 1024
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 256
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %7
21: ; preds = %7
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %4, %0
%2 = tail call i64 @malloc(i32 1024)
%3 = inttoptr i64 %2 to i8*
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %9, %4 ]
%6 = tail call i32 (...) @rand()
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 %7, i8* %8
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 1024
br i1 %10, label %1, label %4
}
long test_long(long v) { return v + 1; }


x86 assembly (clang, -O0):
<test_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long>:
lea    0x1(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @test_long(i64 %0) {
%2 = add nsw i64 %0, 1
ret i64 %2
}
void SwapMax(unsigned long *ul1, unsigned long *ul2) {
  if (*ul1 > *ul2) {
    unsigned long ulTmp = *ul1;
    *ul1 = *ul2;
    *ul2 = ulTmp;
  }
}


x86 assembly (clang, -O0):
<SwapMax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jbe    1144 <SwapMax+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapMax>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rcx,%rax
jbe    1111 <SwapMax+0x11>
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @SwapMax(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp ugt i64 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i64 %4, i64* %0
store i64 %3, i64* %1
br label %7
7: ; preds = %6, %2
ret void
}
int es_vocal(char ch) {
  return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}


x86 assembly (clang, -O0):
<es_vocal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
je     115f <es_vocal+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     115f <es_vocal+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x69,%ecx
mov    %al,-0x2(%rbp)
je     115f <es_vocal+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6f,%ecx
mov    %al,-0x2(%rbp)
je     115f <es_vocal+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x75,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_vocal>:
lea    -0x61(%rdi),%eax
ror    %al
cmp    $0x8,%al
jae    111b <es_vocal+0x1b>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x95,%edx
bt     %ecx,%edx
jb     1124 <es_vocal+0x24>
xor    %eax,%eax
cmp    $0x75,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @es_vocal(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 97
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 101
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 105
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 111
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 117
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @es_vocal(i8 signext %0) {
%2 = add i8 %0, -97
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 8
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i8 %0, 117
%7 = zext i1 %6 to i32
br label %12
8: ; preds = %1
%9 = lshr i8 -107, %3
%10 = and i8 %9, 1
%11 = icmp eq i8 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %13
}
int real_module(int v) {
  if (v == 1 || v == 2)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<real_module>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     111b <real_module+0x1b>
cmpl   $0x2,-0x8(%rbp)
jne    1127 <real_module+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <real_module+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_module>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @real_module(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
float inv_sqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<inv_sqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_sqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @inv_sqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @inv_sqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ EscreveFraseRamLCD(char *);
int /*<<< orphan*/ itoa(int, char *);
void EscreveInteiroLCD(int valor) {
  char texto[7] = " ";
  itoa(valor, texto);
  EscreveFraseRamLCD(texto);
}


x86 assembly (clang, -O0):
<EscreveInteiroLCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xb(%rbp),%rsi
call   1030 <itoa@plt>
lea    -0xb(%rbp),%rdi
call   1040 <EscreveFraseRamLCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EscreveInteiroLCD>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xb(%rsp)
movl   $0x20,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <itoa@plt>
mov    %rbx,%rdi
call   1040 <EscreveFraseRamLCD@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.EscreveInteiroLCD.texto = [7 x i8] c" \00\00\00\00\00\00"
define void @EscreveInteiroLCD(i32 %0) {
%2 = alloca i32
%3 = alloca [7 x i8]
store i32 %0, i32* %2
%4 = bitcast [7 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%7 = call i32 @itoa(i32 %5, i8* %6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%9 = call i32 @EscreveFraseRamLCD(i8* %8)
ret void
}

LLVM IR (-O2):
@__const.EscreveInteiroLCD.texto = [7 x i8] c" \00\00\00\00\00\00"
define void @EscreveInteiroLCD(i32 %0) {
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i32 %0, i8* %3)
%5 = call i32 @EscreveFraseRamLCD(i8* %3)
ret void
}
double aa_stat_z2x(double z, double mu, double sigma) {
  return (z * sigma) + mu;
}


x86 assembly (clang, -O0):
<aa_stat_z2x>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_stat_z2x>:
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @aa_stat_z2x(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @aa_stat_z2x(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %1)
ret double %4
}