xunge/DecIR huggingface dataset:
/* Variables and functions */
double f(double);
double area(double a, double b) { return (((f(a) + f(b)) / 2.0) * (b - a)); }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <f@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <f@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
sub    $0x18,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <f@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0xebe(%rip),%xmm0
movsd  (%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @area(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @f(double %5)
%7 = load double, double* %4
%8 = call double @f(double %7)
%9 = fadd double %6, %8
%10 = fdiv double %9, 2.000000e+00
%11 = load double, double* %4
%12 = load double, double* %3
%13 = fsub double %11, %12
%14 = fmul double %10, %13
ret double %14
}

LLVM IR (-O2):
define double @area(double %0, double %1) {
%3 = tail call double @f(double %0)
%4 = tail call double @f(double %1)
%5 = fadd double %3, %4
%6 = fmul double %5, 5.000000e-01
%7 = fsub double %1, %0
%8 = fmul double %7, %6
ret double %8
}
int main() {
  int n = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double poly6(double x, double c1, double c2, double c3) {
  return x * (1 - x * (0.5 - x * (c1 - x * (0.25 - x * (c2 - x * c3)))));
}


x86 assembly (clang, -O0):
<poly6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm4
movsd  -0x8(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm5
movsd  -0x18(%rbp),%xmm7
movsd  -0x8(%rbp),%xmm6
movsd  -0x20(%rbp),%xmm8
movq   %xmm6,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm6
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
mulsd  %xmm6,%xmm5
movsd  0xe87(%rip),%xmm6
addsd  %xmm6,%xmm5
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xe39(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe0a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly6>:
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xedc(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xed4(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @poly6(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %5
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %5
%14 = load double, double* %5
%15 = load double, double* %7
%16 = load double, double* %5
%17 = load double, double* %8
%18 = fneg double %16
%19 = call double @llvm.fmuladd.f64(double %18, double %17, double %15)
%20 = fneg double %14
%21 = call double @llvm.fmuladd.f64(double %20, double %19, double 2.500000e-01)
%22 = fneg double %13
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double %12)
%24 = fneg double %11
%25 = call double @llvm.fmuladd.f64(double %24, double %23, double 5.000000e-01)
%26 = fneg double %10
%27 = call double @llvm.fmuladd.f64(double %26, double %25, double 1.000000e+00)
%28 = fmul double %9, %27
ret double %28
}

LLVM IR (-O2):
define double @poly6(double %0, double %1, double %2, double %3) {
%5 = fneg double %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double %3, double %2)
%7 = tail call double @llvm.fmuladd.f64(double %5, double %6, double 2.500000e-01)
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %1)
%9 = tail call double @llvm.fmuladd.f64(double %5, double %8, double 5.000000e-01)
%10 = tail call double @llvm.fmuladd.f64(double %5, double %9, double 1.000000e+00)
%11 = fmul double %10, %0
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ defmac(char *);
void SetDefine(char *arg) { defmac(arg + 1); }


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

x86 assembly (clang, -O2):
<SetDefine>:
add    $0x1,%rdi
jmp    1030 <defmac@plt>

LLVM IR (-O0):
define void @SetDefine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = call i32 @defmac(i8* %4)
ret void
}

LLVM IR (-O2):
define void @SetDefine(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @defmac(i8* %2)
ret void
}
void testcase_assertion_teardown_test() {}


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

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

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

LLVM IR (-O2):
define void @testcase_assertion_teardown_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _tail_error(char const *message, int ret) {
  fputs("tail"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_tail_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tail_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"tail: \00"
@stderr = global i32 0
define i32 @_tail_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"tail: \00"
@stderr = global i32 0
define i32 @_tail_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFREG;
scalar_t__ os_stat(char *, struct stat *);
int scan_xml_is_file(char *path) {
  struct stat sb;
  if (os_stat(path, &sb))
    return 0;
  if (sb.st_mode & S_IFREG)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<scan_xml_is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <os_stat@plt>
cmp    $0x0,%rax
je     113f <scan_xml_is_file+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1167 <scan_xml_is_file+0x57>
mov    -0x18(%rbp),%eax
mov    0x2e9f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1160 <scan_xml_is_file+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <scan_xml_is_file+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_xml_is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <os_stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <scan_xml_is_file+0x15>
pop    %rcx
ret
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFREG = global i32 0
define i32 @scan_xml_is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @os_stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %17
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFREG
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %2
br label %17
16: ; preds = %9
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFREG = global i32 0
define i32 @scan_xml_is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @os_stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFREG
%10 = and i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %12, %6 ]
ret i32 %14
}
int test_imm_1Duint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Duint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x1d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Duint64_midword_reg>:
test   $0x1d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Duint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 29
%6 = icmp ne i64 %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_1Duint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1900544
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ seed;

/* Variables and functions */
int /*<<< orphan*/ random_init_by_array(int /*<<< orphan*/ *, int);
void random_init(uint32_t seed) {
  random_init_by_array((uint32_t *)&seed, sizeof(seed));
}


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

x86 assembly (clang, -O2):
<random_init>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <random_init_by_array@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @random_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @random_init_by_array(i32* %2, i32 4)
ret void
}
long math___Int_band___impl(long self, long i) { return self & i; }


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

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

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

LLVM IR (-O2):
define i64 @math___Int_band___impl(i64 %0, i64 %1) {
%3 = and i64 %1, %0
ret i64 %3
}
void FastRecoverAFCANChannel(unsigned char channel) {
  unsigned long sttp_MsgRegTypeBuf;
  sttp_MsgRegTypeBuf = ((0x03FEC100) + (channel * 0x600));
  *((unsigned short *)(sttp_MsgRegTypeBuf + 0x12e)) = 0x001F;
  *((unsigned short *)(sttp_MsgRegTypeBuf + 0x50)) = 0x001F;
  *((unsigned short *)(sttp_MsgRegTypeBuf + 0x50)) = 0x8000;
  *((unsigned short *)(sttp_MsgRegTypeBuf + 0x58)) = 0x003f;
  *((unsigned short *)(sttp_MsgRegTypeBuf + 0x50)) = 0x0100;
}


x86 assembly (clang, -O0):
<FastRecoverAFCANChannel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x600,%eax,%eax
add    $0x3fec100,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movw   $0x1f,0x12e(%rax)
mov    -0x10(%rbp),%rax
movw   $0x1f,0x50(%rax)
mov    -0x10(%rbp),%rax
movw   $0x8000,0x50(%rax)
mov    -0x10(%rbp),%rax
movw   $0x3f,0x58(%rax)
mov    -0x10(%rbp),%rax
movw   $0x100,0x50(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastRecoverAFCANChannel>:
mov    %edi,%eax
shl    $0x9,%rax
movw   $0x1f,0x3fec22e(%rax,%rax,2)
movw   $0x3f,0x3fec158(%rax,%rax,2)
movw   $0x100,0x3fec150(%rax,%rax,2)
ret

LLVM IR (-O0):
define void @FastRecoverAFCANChannel(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = mul nsw i32 %5, 1536
%7 = add nsw i32 67027200, %6
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = add i64 %9, 302
%11 = inttoptr i64 %10 to i16*
store i16 31, i16* %11
%12 = load i64, i64* %3
%13 = add i64 %12, 80
%14 = inttoptr i64 %13 to i16*
store i16 31, i16* %14
%15 = load i64, i64* %3
%16 = add i64 %15, 80
%17 = inttoptr i64 %16 to i16*
store i16 -32768, i16* %17
%18 = load i64, i64* %3
%19 = add i64 %18, 88
%20 = inttoptr i64 %19 to i16*
store i16 63, i16* %20
%21 = load i64, i64* %3
%22 = add i64 %21, 80
%23 = inttoptr i64 %22 to i16*
store i16 256, i16* %23
ret void
}

LLVM IR (-O2):
define void @FastRecoverAFCANChannel(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = mul nuw nsw i64 %2, 1536
%4 = add nuw nsw i64 %3, 67027502
%5 = inttoptr i64 %4 to i16*
store i16 31, i16* %5
%6 = add nuw nsw i64 %3, 67027280
%7 = inttoptr i64 %6 to i16*
%8 = add nuw nsw i64 %3, 67027288
%9 = inttoptr i64 %8 to i16*
store i16 63, i16* %9
store i16 256, i16* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x34_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x34_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x34_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x34_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x34_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ puts(char *);
void usageQuit() {
  puts("Usage: raru <program> [arguments]\n\n"
       "Runs <program> as a random UID and GID (31337-96872).\n"
       "Recommended: alias raru='env -i PATH=$PATH raru'\n"
       "Version: "
       "Unknown version");
  _exit(2);
}


x86 assembly (clang, -O0):
<usageQuit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<usageQuit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [163 x i8] c"Usage: raru <program> [arguments]\0A\0ARuns <program> as a random UID and GID (31337-96872).\0ARecommended: alias raru='env -i PATH=$PATH raru'\0AVersion: Unknown version\00"
define void @usageQuit() {
%1 = call i32 @puts(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [163 x i8] c"Usage: raru <program> [arguments]\0A\0ARuns <program> as a random UID and GID (31337-96872).\0ARecommended: alias raru='env -i PATH=$PATH raru'\0AVersion: Unknown version\00"
define void @usageQuit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, char *, int, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void printCharArray(char *arr, int length) { int80(4, 1, arr, length, 0, 0); }


x86 assembly (clang, -O0):
<printCharArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x4,%edi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <int80@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharArray>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <int80@plt>

LLVM IR (-O0):
define void @printCharArray(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @int80(i32 4, i32 1, i8* %5, i32 %6, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @printCharArray(i8* %0, i32 %1) {
%3 = tail call i32 @int80(i32 4, i32 1, i8* %0, i32 %1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void trs_print_line(char *line) { fprintf(stdout, "%s\n", line); }


x86 assembly (clang, -O0):
<trs_print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trs_print_line>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @trs_print_line(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a;
  int b;
  scanf("%d %d", &a, &b);
  printf("%d + %d = %d\n", a, b, (2 * a + b) / 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    (%rdx,%rsi,2),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = mul nsw i32 2, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = sdiv i32 %10, 2
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = shl nsw i32 %6, 1
%9 = add nsw i32 %8, %7
%10 = sdiv i32 %9, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCDigitLeft() {
  long int stat = 99;
  BNCIO(44);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCDigitLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x2c,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCDigitLeft>:
push   %rax
mov    $0x2c,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCDigitLeft() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 44)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCDigitLeft() {
%1 = tail call i32 @BNCIO(i32 44)
ret i64 99
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *properties;
};
typedef TYPE_1__ XFontStruct;
typedef int /*<<< orphan*/ XFontProp;

/* Variables and functions */
void set_XFontStruct_properties(void *_p, void *_v) {
  ((XFontStruct *)_p)->properties = (XFontProp *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XFontStruct_properties(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XFontStruct_properties(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
double diff(double *args) { return args[1] - args[0]; }


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
movsd  0x8(%rdi),%xmm0
subsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @diff(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fsub double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @diff(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = load double, double* %0
%5 = fsub double %3, %4
ret double %5
}
void ff_hevc_put_hevc_uni_epel_h8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h8_10_sse4() {
ret void
}
int security_file_llseek(struct file *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_llseek(%struct.file* nocapture readnone %0) {
ret i32 0
}
int test_imm_E2uint16_mem(unsigned short *val) {
  return ((*val) & (-0xE2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E2uint16_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, -226
%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_E2uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -226
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int GPIORawIntStatus(unsigned int baseAdd, unsigned int intLine,
                              unsigned int readMask) {
  unsigned int intStatus = 0;
  if ((0x0) == intLine) {
    intStatus =
        (*((volatile unsigned int *)(baseAdd + (0x24 + (0 * 4))))) & readMask;
  } else {
    intStatus =
        (*((volatile unsigned int *)(baseAdd + (0x24 + (1 * 4))))) & readMask;
  }
  return intStatus;
}


x86 assembly (clang, -O0):
<GPIORawIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1134 <GPIORawIntStatus+0x34>
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <GPIORawIntStatus+0x44>
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIORawIntStatus>:
mov    %edx,%eax
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
lea    (%rdi,%rcx,4),%ecx
add    $0x24,%ecx
and    (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @GPIORawIntStatus(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = icmp eq i32 0, %8
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %4
%12 = add i32 %11, 36
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = load i32, i32* %6
%17 = and i32 %15, %16
store i32 %17, i32* %7
br label %26
18: ; preds = %3
%19 = load i32, i32* %4
%20 = add i32 %19, 40
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %7
br label %26
26: ; preds = %18, %10
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @GPIORawIntStatus(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 36, i32 40
%6 = add i32 %5, %0
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, %2
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ do_i();
void do_app1(void) { do_i(); }


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

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

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

LLVM IR (-O2):
define void @do_app1() {
%1 = tail call i32 (...) @do_i()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *p, size_t s) {
  p = realloc(p, s);
  if (!p) {
    fprintf(stderr, "Out of memory\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <xrealloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 9;
  printf("Fib(9) : %d \n", fib(9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    $0x9,%edi
call   1040 <fib@plt>
mov    %eax,%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
mov    $0x9,%edi
call   1040 <fib@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Fib(9) : %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
%3 = call i32 @fib(i32 9)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Fib(9) : %d \0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_4Duint8_reg(unsigned char val) {
  return ((val) & (-0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffb3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Duint8_reg>:
test   $0xb3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Duint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -77
%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_4Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -77
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int unknown_function();
void deduplicate_issues_2_Bad(int y) {
  int a[10];
  int x = 10;
  a[x] = 0;
  x = unknown_function();
  if (x >= 10 && y >= 0) {
    a[x] = 0;
  }
}


x86 assembly (clang, -O0):
<deduplicate_issues_2_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x34(%rbp)
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    $0x0,%al
call   1030 <unknown_function@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jl     1158 <deduplicate_issues_2_Bad+0x48>
cmpl   $0x0,-0x4(%rbp)
jl     1158 <deduplicate_issues_2_Bad+0x48>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @deduplicate_issues_2_Bad(i32 %0) {
%2 = tail call i32 (...) @unknown_function()
ret void
}
__typeof__(vfscanf(1, "")) test_vfscanf_230(void) { return vfscanf(1, ""); }


x86 assembly (clang, -O0):
<test_vfscanf_230>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <vfscanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfscanf_230>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <vfscanf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_vfscanf_230() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfscanf to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_vfscanf_230() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfscanf to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int _logname_error(char *, int);
char *getlogin();
int /*<<< orphan*/ puts(char const *);
int _logname(void) {
  char const *lgnm;
  if ((lgnm = getlogin()) == NULL)
    return _logname_error("getlogin", 1);
  puts(lgnm);
  return 0;
}


x86 assembly (clang, -O0):
<_logname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getlogin@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1166 <_logname+0x36>
lea    0xeac(%rip),%rdi
mov    $0x1,%esi
call   1040 <_logname_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <_logname+0x46>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_logname>:
push   %rax
xor    %eax,%eax
call   1050 <getlogin@plt>
test   %rax,%rax
je     1149 <_logname+0x19>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb0(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1040 <_logname_error@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"getlogin\00"
define i32 @_logname() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @getlogin()
store i8* %3, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @_logname_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %6, i32* %1
br label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @puts(i8* %8)
store i32 0, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"getlogin\00"
define i32 @_logname() {
%1 = tail call i8* (...) @getlogin()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @_logname_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
br label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* %1)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ 0, %5 ]
ret i32 %8
}
void XLocaleOfFontSet() {}


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

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

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

LLVM IR (-O2):
define void @XLocaleOfFontSet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ export_pic_gpio();
int /*<<< orphan*/ pic_gpio_is_exported();
int /*<<< orphan*/ set_pic_gpio_direction();
void setup_pic_gpio(void) {
  if (!pic_gpio_is_exported())
    export_pic_gpio();
  set_pic_gpio_direction();
}


x86 assembly (clang, -O0):
<setup_pic_gpio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pic_gpio_is_exported@plt>
cmp    $0x0,%eax
jne    114b <setup_pic_gpio+0x1b>
mov    $0x0,%al
call   1050 <export_pic_gpio@plt>
mov    $0x0,%al
call   1040 <set_pic_gpio_direction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_pic_gpio>:
push   %rax
xor    %eax,%eax
call   1030 <pic_gpio_is_exported@plt>
test   %eax,%eax
jne    1143 <setup_pic_gpio+0x13>
xor    %eax,%eax
call   1050 <export_pic_gpio@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <set_pic_gpio_direction@plt>

LLVM IR (-O0):
define void @setup_pic_gpio() {
%1 = call i32 (...) @pic_gpio_is_exported()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @export_pic_gpio()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @set_pic_gpio_direction()
ret void
}

LLVM IR (-O2):
define void @setup_pic_gpio() {
%1 = tail call i32 (...) @pic_gpio_is_exported()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @export_pic_gpio()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @set_pic_gpio_direction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void fatalSys(char const *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<fatalSys>:
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):
<fatalSys>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatalSys(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 @fatalSys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *calloc(int, size_t);
void *memalloc(size_t n) { return calloc(1, n); }


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

x86 assembly (clang, -O2):
<memalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @memalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int *, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int getPID() {
  int pid;
  int80(32, &pid, 0, 0, 0, 0);
  return pid;
}


x86 assembly (clang, -O0):
<getPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
lea    -0x4(%rbp),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPID>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x20,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getPID() {
%1 = alloca i32
%2 = call i32 @int80(i32 32, i32* %1, i32 0, i32 0, i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @getPID() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @int80(i32 32, i32* %1, i32 0, i32 0, i32 0, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ hwI2CReadReg(int, int);
unsigned short sii164GetDeviceID(void) {
  unsigned short deviceID;
  deviceID = ((unsigned short)hwI2CReadReg(0x70, 0x03) << 8) |
             (unsigned short)hwI2CReadReg(0x70, 0x02);
  return deviceID;
}


x86 assembly (clang, -O0):
<sii164GetDeviceID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x70,%edi
mov    $0x3,%esi
call   1030 <hwI2CReadReg@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x70,%edi
mov    $0x2,%esi
call   1030 <hwI2CReadReg@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
movzwl %cx,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sii164GetDeviceID>:
push   %rbx
mov    $0x70,%edi
mov    $0x3,%esi
call   1030 <hwI2CReadReg@plt>
mov    %rax,%rbx
shl    $0x8,%ebx
mov    $0x70,%edi
mov    $0x2,%esi
call   1030 <hwI2CReadReg@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @sii164GetDeviceID() {
%1 = alloca i16
%2 = call i64 @hwI2CReadReg(i32 112, i32 3)
%3 = trunc i64 %2 to i16
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = call i64 @hwI2CReadReg(i32 112, i32 2)
%7 = trunc i64 %6 to i16
%8 = zext i16 %7 to i32
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %1
%11 = load i16, i16* %1
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @sii164GetDeviceID() {
%1 = tail call i64 @hwI2CReadReg(i32 112, i32 3)
%2 = trunc i64 %1 to i16
%3 = shl i16 %2, 8
%4 = tail call i64 @hwI2CReadReg(i32 112, i32 2)
%5 = trunc i64 %4 to i16
%6 = or i16 %3, %5
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ a7(int);
void a6(int n) { a7(n); }


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

x86 assembly (clang, -O2):
<a6>:
jmp    1030 <a7@plt>

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

LLVM IR (-O2):
define void @a6(i32 %0) {
%2 = tail call i32 @a7(i32 %0)
ret void
}
int usl_timer_cmp(void *t1, void *t2, int cmp_len) {
  unsigned int expire1, expire2;
  expire1 = *((unsigned int *)t1);
  expire2 = *((unsigned int *)t2);
  if (expire1 > expire2) {
    return 1;
  } else if (expire1 < expire2) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usl_timer_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jbe    1139 <usl_timer_cmp+0x39>
movl   $0x1,-0x4(%rbp)
jmp    115d <usl_timer_cmp+0x5d>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jae    1151 <usl_timer_cmp+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <usl_timer_cmp+0x5d>
jmp    1156 <usl_timer_cmp+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usl_timer_cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
sbb    %edx,%edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @usl_timer_cmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp ugt i32 %5, %7
%9 = icmp ult i32 %5, %7
%10 = sext i1 %9 to i32
%11 = select i1 %8, i32 1, i32 %10
ret i32 %11
}