xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIG_DFL;
scalar_t__ firstexit(int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sigrelse(int /*<<< orphan*/);
void __attribute__((noreturn)) umem_do_abort(void) {
  if (firstexit(1)) {
    (void)raise(SIGABRT);
  }
  for (;;) {
    (void)signal(SIGABRT, SIG_DFL);
    (void)sigrelse(SIGABRT);
    (void)raise(SIGABRT);
  }
}


x86 assembly (clang, -O0):
<umem_do_abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <firstexit@plt>
cmp    $0x0,%rax
je     1166 <umem_do_abort+0x26>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    116b <umem_do_abort+0x2b>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
call   1060 <signal@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1040 <sigrelse@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    116b <umem_do_abort+0x2b>

x86 assembly (clang, -O2):
<umem_do_abort>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
call   1050 <firstexit@plt>
test   %rax,%rax
je     1161 <umem_do_abort+0x21>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    0x2e70(%rip),%rbx
mov    0x2e71(%rip),%r14
nop
mov    (%rbx),%edi
mov    (%r14),%esi
call   1060 <signal@plt>
mov    (%rbx),%edi
call   1040 <sigrelse@plt>
mov    (%rbx),%edi
call   1030 <raise@plt>
jmp    1170 <umem_do_abort+0x30>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @umem_do_abort() {
%1 = call i64 @firstexit(i32 1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @SIGABRT
%5 = call i32 @raise(i32 %4)
br label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %7, %6
%8 = load i32, i32* @SIGABRT
%9 = load i32, i32* @SIG_DFL
%10 = call i32 @signal(i32 %8, i32 %9)
%11 = load i32, i32* @SIGABRT
%12 = call i32 @sigrelse(i32 %11)
%13 = load i32, i32* @SIGABRT
%14 = call i32 @raise(i32 %13)
br label %7
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @umem_do_abort() {
%1 = tail call i64 @firstexit(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @SIGABRT
%5 = tail call i32 @raise(i32 %4)
br label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %6, %7
%8 = load i32, i32* @SIGABRT
%9 = load i32, i32* @SIG_DFL
%10 = tail call i32 @signal(i32 %8, i32 %9)
%11 = load i32, i32* @SIGABRT
%12 = tail call i32 @sigrelse(i32 %11)
%13 = load i32, i32* @SIGABRT
%14 = tail call i32 @raise(i32 %13)
br label %7
}
/* Type definitions */
typedef int int8_t;
typedef int int32_t;

/* Variables and functions */
int cpu_byte_order_is_little_endian(void) {
  union {
    int32_t i;
    int8_t c[4];
  } u;
  u.i = 1;
  return (1 == u.c[0]);
}


x86 assembly (clang, -O0):
<cpu_byte_order_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x10(%rbp)
mov    $0x1,%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
define i32 @cpu_byte_order_is_little_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i32]*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 1, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @cpu_byte_order_is_little_endian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ signal_pidfile(int, char *);
int /*<<< orphan*/ uwsgi_exit(int /*<<< orphan*/);
void uwsgi_opt_pidfile_signal(char *opt, char *pidfile, void *sig) {
  long *signum_fake_ptr = (long *)sig;
  int signum = (long)signum_fake_ptr;
  signal_pidfile(signum, pidfile);
  uwsgi_exit(0);
}


x86 assembly (clang, -O0):
<uwsgi_opt_pidfile_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <signal_pidfile@plt>
xor    %edi,%edi
call   1040 <uwsgi_exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_pidfile_signal>:
push   %rax
mov    %rdx,%rdi
call   1030 <signal_pidfile@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <uwsgi_exit@plt>

LLVM IR (-O0):
define void @uwsgi_opt_pidfile_signal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %7
%11 = load i64*, i64** %7
%12 = ptrtoint i64* %11 to i64
%13 = trunc i64 %12 to i32
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = load i8*, i8** %5
%16 = call i32 @signal_pidfile(i32 %14, i8* %15)
%17 = call i32 @uwsgi_exit(i32 0)
ret void
}

LLVM IR (-O2):
define void @uwsgi_opt_pidfile_signal(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @signal_pidfile(i32 %5, i8* %1)
%7 = tail call i32 @uwsgi_exit(i32 0)
ret void
}
int main(void) {
  int a[5] = {1, 2, 3, 4, 5};
  *(&a[5]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 5
%4 = load i32, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ realloc(void *, int);
char *AddCharToBuffer(char *Dest, int DestLen, char Char) {
  char *actb_ptr;
  actb_ptr = (char *)realloc((void *)Dest, DestLen + 110);
  actb_ptr[DestLen] = Char;
  actb_ptr[DestLen + 1] = '\0';
  return (actb_ptr);
}


x86 assembly (clang, -O0):
<AddCharToBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x6e,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddCharToBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
lea    0x6e(%rbx),%esi
call   1030 <realloc@plt>
movslq %ebx,%rcx
mov    %bpl,(%rax,%rcx,1)
movb   $0x0,0x1(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @AddCharToBuffer(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 110
%11 = call i64 @realloc(i8* %8, i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8, i8* %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
%18 = load i8*, i8** %7
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
define i8* @AddCharToBuffer(i8* %0, i32 %1, i8 signext %2) {
%4 = add nsw i32 %1, 110
%5 = tail call i64 @realloc(i8* %0, i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8 %2, i8* %8
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
ret i8* %6
}
float Q_rsqrt(float number) {
  union {
    float f;
    int i;
  } t;
  float x2, y;
  const float threehalfs = 1.5F;
  x2 = number * 0.5F;
  t.f = number;
  t.i = 0x5f3759df - (t.i >> 1);
  y = t.f;
  y = y * (threehalfs - (x2 * y * y));
  return y;
}


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

x86 assembly (clang, -O2):
<Q_rsqrt>:
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):
%union.anon = type { float }
define float @Q_rsqrt(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
%10 = bitcast %union.anon* %3 to float*
store float %9, float* %10
%11 = bitcast %union.anon* %3 to i32*
%12 = load i32, i32* %11
%13 = ashr i32 %12, 1
%14 = sub nsw i32 1597463007, %13
%15 = bitcast %union.anon* %3 to i32*
store i32 %14, i32* %15
%16 = bitcast %union.anon* %3 to float*
%17 = load float, float* %16
store float %17, float* %5
%18 = load float, float* %5
%19 = load float, float* %4
%20 = load float, float* %5
%21 = fmul float %19, %20
%22 = load float, float* %5
%23 = fneg float %21
%24 = call float @llvm.fmuladd.f32(float %23, float %22, float 1.500000e+00)
%25 = fmul float %18, %24
store float %25, float* %5
%26 = load float, float* %5
ret float %26
}

LLVM IR (-O2):
define float @Q_rsqrt(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
}
int func10() {
#pragma critTer : 38 :../../ test / resources / functionNumber.c:
  return 0;
#pragma critTer : 39 :../../ test / resources / functionNumber.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func10() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: gpnetbenchServer -p PORT\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"usage: gpnetbenchServer -p PORT\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"usage: gpnetbenchServer -p PORT\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long sumOfPrimes(unsigned long const, unsigned long const);
int main(void) {
  const unsigned long int MIN = 2;
  const unsigned long int MAX = 10;
  unsigned long int sum = 0;
  sum = sumOfPrimes(MIN, MAX);
  printf("sum: %lu\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <sumOfPrimes@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <sumOfPrimes@plt>
lea    0xec9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"sum: %lu\0A\00"
define i32 @main() {
%1 = tail call i64 @sumOfPrimes(i64 2, i64 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
short __iiqnnt(long double);
short intr_wrap_400(long double p1) { return __iiqnnt(p1); }


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

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

LLVM IR (-O0):
define signext i16 @intr_wrap_400(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call signext i16 @__iiqnnt(x86_fp80 %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @intr_wrap_400(x86_fp80 %0) {
%2 = tail call signext i16 @__iiqnnt(x86_fp80 %0)
ret i16 %2
}
/* Variables and functions */
int send_core(int, char *, char *, int);
int send_once(int fd, char *message, char *arguments) {
  return (send_core(fd, message, arguments, 1));
}


x86 assembly (clang, -O0):
<send_once>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <send_core@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_once>:
mov    $0x1,%ecx
jmp    1030 <send_core@plt>

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

LLVM IR (-O2):
define i32 @send_once(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @send_core(i32 %0, i8* %1, i8* %2, i32 1)
ret i32 %4
}
int check_short() { return sizeof(short); }


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

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

LLVM IR (-O0):
define i32 @check_short() {
ret i32 2
}

LLVM IR (-O2):
define i32 @check_short() {
ret i32 2
}
void Cyc_XInfer_analyze_fd(struct Cyc_JumpAnalysis_Jump_Anal_Result *tables,
                           struct Cyc_Absyn_Fndecl *fd, unsigned loc) {
  ;
}


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

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

LLVM IR (-O0):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type opaque
%struct.Cyc_Absyn_Fndecl = type opaque
define void @Cyc_XInfer_analyze_fd(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_Absyn_Fndecl* %1, i32 %2) {
%4 = alloca %struct.Cyc_JumpAnalysis_Jump_Anal_Result*
%5 = alloca %struct.Cyc_Absyn_Fndecl*
%6 = alloca i32
store %struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %4
store %struct.Cyc_Absyn_Fndecl* %1, %struct.Cyc_Absyn_Fndecl** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type opaque
%struct.Cyc_Absyn_Fndecl = type opaque
define void @Cyc_XInfer_analyze_fd(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* nocapture %0, %struct.Cyc_Absyn_Fndecl* nocapture %1, i32 %2) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long pixel;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
void set_XColor_pixel(void *_p, unsigned long _v) {
  ((XColor *)_p)->pixel = (unsigned long)_v;
}


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

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

LLVM IR (-O2):
define void @set_XColor_pixel(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int get_adc(int resolution) {
  while (!((*(volatile unsigned int *)(0x7E00B000)) & (1 << 15)))
    ;
  if (resolution == 10) {
    return (*(volatile unsigned int *)(0x7E00B00C)) & 0x3FF;
  } else if (resolution == 12) {
    return (*(volatile unsigned int *)(0x7E00B00C)) & 0xFFF;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_adc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x7e00b000,%eax
mov    (%rax),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <get_adc+0x28>
jmp    112d <get_adc+0x2d>
jmp    1107 <get_adc+0x7>
cmpl   $0xa,-0x8(%rbp)
jne    114b <get_adc+0x4b>
mov    $0x7e00b00c,%eax
mov    (%rax),%eax
and    $0x3ff,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <get_adc+0x75>
cmpl   $0xc,-0x8(%rbp)
jne    1169 <get_adc+0x69>
mov    $0x7e00b00c,%eax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <get_adc+0x75>
jmp    116e <get_adc+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_adc>:
testl  $0x8000,0x7e00b000
je     1100 <get_adc>
cmp    $0xa,%edi
je     1120 <get_adc+0x20>
xor    %eax,%eax
cmp    $0xc,%edi
jne    112c <get_adc+0x2c>
mov    $0xfff,%eax
jmp    1125 <get_adc+0x25>
mov    $0x3ff,%eax
and    0x7e00b00c,%eax
ret

LLVM IR (-O0):
define i32 @get_adc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* inttoptr (i64 2113974272 to i32*)
%6 = and i32 %5, 32768
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
%15 = and i32 %14, 1023
store i32 %15, i32* %2
br label %24
16: ; preds = %10
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 12
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
%21 = and i32 %20, 4095
store i32 %21, i32* %2
br label %24
22: ; preds = %16
br label %23
23: ; preds = %22
store i32 0, i32* %2
br label %24
24: ; preds = %23, %19, %13
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @get_adc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 2113974272 to i32*)
%4 = and i32 %3, 32768
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
switch i32 %0, label %12 [
i32 10, label %8
i32 12, label %7
]
7: ; preds = %6
br label %8
8: ; preds = %6, %7
%9 = phi i32 [ 4095, %7 ], [ 1023, %6 ]
%10 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
%11 = and i32 %10, %9
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ 0, %6 ], [ %11, %8 ]
ret i32 %13
}
void fifoClose() {}


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

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

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

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

/* Variables and functions */
scalar_t__ binarySearch(int /*<<< orphan*/ const *, scalar_t__,
                        int /*<<< orphan*/);
int32_t count_less(const uint16_t *array, int32_t lenarray, uint16_t ikey) {
  if (lenarray == 0)
    return 0;
  int32_t pos = binarySearch(array, lenarray, ikey);
  return pos >= 0 ? pos : -(pos + 1);
}


x86 assembly (clang, -O0):
<count_less>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113b <count_less+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1180 <count_less+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <binarySearch@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jl     1167 <count_less+0x57>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1178 <count_less+0x68>
mov    -0x28(%rbp),%rcx
add    $0x1,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_less>:
test   %rsi,%rsi
je     112a <count_less+0x1a>
push   %rax
call   1030 <binarySearch@plt>
mov    %rax,%rcx
sar    $0x3f,%rax
xor    %rcx,%rax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @count_less(i32* %0, i64 %1, i32 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i64 @binarySearch(i32* %0, i64 %1, i32 %2)
%7 = ashr i64 %6, 63
%8 = xor i64 %7, %6
br label %9
9: ; preds = %3, %5
%10 = phi i64 [ %8, %5 ], [ 0, %3 ]
ret i64 %10
}
/* Variables and functions */
int rom_present(char *);
int dtc_5150x_available() { return rom_present("dtc_cxd21a.bin"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"dtc_cxd21a.bin\00"
define i32 @dtc_5150x_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ crc32c_init_sw();
void crc32c_global_init(void) { crc32c_init_sw(); }


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

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

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

LLVM IR (-O2):
define void @crc32c_global_init() {
%1 = tail call i32 (...) @crc32c_init_sw()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 4, 7);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x4,%ecx
mov    $0x7,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x4,%ecx
mov    $0x7,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 7)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 7)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
void ARGBToAR30() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ err(char *, int);
scalar_t__ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void myseek(FILE *f, int position) {
  if (fseek(f, position, SEEK_SET))
    err("Error seeking to %d.\n", position);
}


x86 assembly (clang, -O0):
<myseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     115d <myseek+0x3d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myseek>:
push   %rbx
mov    %esi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
test   %rax,%rax
je     1145 <myseek+0x25>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <err@plt>
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [22 x i8] c"Error seeking to %d.\0A\00"
define void @myseek(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i64 @fseek(i32* %5, i32 %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @err(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [22 x i8] c"Error seeking to %d.\0A\00"
define void @myseek(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @fseek(i32* %0, i32 %1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @err(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int /*<<< orphan*/ bubbleSort(int *, int);
int main() {
  int array_size = __VERIFIER_nondet_int();
  if (array_size < 1) {
    array_size = 1;
  }
  int *numbers = (int *)alloca(array_size * sizeof(int));
  bubbleSort(numbers, array_size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115a <main+0x2a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <bubbleSort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x1,%ebx
cmovg  %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <bubbleSort@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = call i32 @bubbleSort(i32* %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
%4 = shl i32 %3, 2
%5 = tail call i64 @alloca(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @bubbleSort(i32* %6, i32 %3)
ret i32 0
}
unsigned uDivTest10(unsigned X, unsigned Y) { return X / 4; }


x86 assembly (clang, -O0):
<uDivTest10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDivTest10>:
mov    %edi,%eax
shr    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @uDivTest10(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 = udiv i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @uDivTest10(i32 %0, i32 %1) {
%3 = lshr i32 %0, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LLL_Algorithm();
int main() {
  LLL_Algorithm();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <LLL_Algorithm@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @LLL_Algorithm()
ret i32 0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_reassoc_resp(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0000 | 0x0030);
}


x86 assembly (clang, -O0):
<ieee80211_is_reassoc_resp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x30,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_reassoc_resp>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x30,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_reassoc_resp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 48)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_reassoc_resp(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 48)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int plus1(int x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @plus1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int myfunc(char *str) {
  char *ptr = str;
  while (*ptr++)
    ;
  return ptr - str - 1;
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <myfunc+0x2d>
jmp    1110 <myfunc+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @myfunc(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ arraywrite(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  char *arr = (char *)malloc(1024 * 1024 * 1024);
  arraywrite(arr);
  printf("r = %d\n", arr[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <arraywrite@plt>
mov    -0x18(%rbp),%rax
lea    0xe98(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <arraywrite@plt>
movsbl (%rbx),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"r = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 1073741824)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @arraywrite(i8* %9)
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"r = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1073741824)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @arraywrite(i8* %4)
%6 = load i8, i8* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void help(char *progname) {
  fprintf(stderr, "%s: bootloader image\n", progname);
  fprintf(stderr, "bootloader should have the correct size for the image\n");
}


x86 assembly (clang, -O0):
<help>:
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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"%s: bootloader image\0A\00"
@.str.1 = [55 x i8] c"bootloader should have the correct size for the image\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"%s: bootloader image\0A\00"
@.str.1 = [55 x i8] c"bootloader should have the correct size for the image\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t regread32(uint32_t addr) {
  uint32_t value = *(volatile uint32_t *)addr;
  return value;
}


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

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

LLVM IR (-O0):
define i64 @regread32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @regread32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ checkdir(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc <= 1) {
    fprintf(stderr, "usage: %s dir\n", argv[0]);
    return 1;
  }
  checkdir(argv[1], NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1168 <main+0x48>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <checkdir@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1145 <main+0x25>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%ebx
jmp    1152 <main+0x32>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <checkdir@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"usage: %s dir\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @checkdir(i8* %17, i32* null)
store i32 0, i32* %3
br label %19
19: ; preds = %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"usage: %s dir\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @checkdir(i8* %10, i32* null)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ logger(int /*<<< orphan*/, char *, char const);
int read_mysql_tiny(const char *buf) {
  logger(0, "TINY INT: %d\n", *buf);
  return *buf;
}


x86 assembly (clang, -O0):
<read_mysql_tiny>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    %edi,%edi
lea    0xed7(%rip),%rsi
movsbl (%rax),%edx
call   1030 <logger@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mysql_tiny>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edx
lea    0xee2(%rip),%rsi
xor    %edi,%edi
call   1030 <logger@plt>
movsbl (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"TINY INT: %d\0A\00"
define i32 @read_mysql_tiny(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @logger(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"TINY INT: %d\0A\00"
define i32 @read_mysql_tiny(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @logger(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
const char *get_rx_queue_name(unsigned id) {
  static char buffer[sizeof("MProc_Client_%u_RX") + 2];
  snprintf(buffer, sizeof(buffer) - 1, "MProc_Client_%u_RX", id);
  return buffer;
}


x86 assembly (clang, -O0):
<get_rx_queue_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x14,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rx_queue_name>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_rx_queue_name.buffer = internal global [21 x i8] zeroinitializer
@.str = [19 x i8] c"MProc_Client_%u_RX\00"
define i8* @get_rx_queue_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@get_rx_queue_name.buffer = internal global [21 x i8] zeroinitializer
@.str = [19 x i8] c"MProc_Client_%u_RX\00"
define i8* @get_rx_queue_name(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0)
}
void rotr(int *a, int *b, int *c) {
  int help;
  help = *c;
  *c = *b;
  *b = *a;
  *a = help;
}


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

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

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

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret void
}